From: Daan De Meyer Date: Tue, 4 Feb 2025 13:52:02 +0000 (+0100) Subject: stub: Mention that VirtualSize should be <= SizeOfRawData X-Git-Tag: v258-rc1~1424 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2443b4d9a17787fd0a63d6591fbdb74650c43994;p=thirdparty%2Fsystemd.git stub: Mention that VirtualSize should be <= SizeOfRawData --- diff --git a/man/systemd-stub.xml b/man/systemd-stub.xml index 09de149d42d..9528d9fdb6c 100644 --- a/man/systemd-stub.xml +++ b/man/systemd-stub.xml @@ -385,6 +385,15 @@ core kernel, the embedded initrd and kernel command line (see above for a full list), including all UKI profiles. + Also note that when systemd-stub measures a PE section, it will measure the + amount of bytes that the section takes up in memory (VirtualSize) and not the amount + of bytes that the section takes up on disk (SizeOfRawData). This means that if the + size in memory is larger than the size on disk, systemd-stub will end up measuring + extra zeroes. To avoid this from happening, it is recommended to make sure that the size in memory of + each section that is measured by systemd-stub is always smaller than or equal to the + size on disk. ukify automatically makes sure this is the case when building UKIs or + addons. + Also note that the Linux kernel will measure all initrds it receives into TPM PCR 9. This means every type of initrd (of the selected UKI profile) will possibly be measured two or three times: the initrds embedded in the kernel image will be measured to PCR 4, PCR 9 and PCR 11; the initrd synthesized