1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-04 21:47:31 +03:00

boot: Use objcopy to align sections

Not aligning these can create gaps in the section table. Some
firmware does not handle this nicely resulting in secure boot
signature fails.
Using objcopy ensures that any new sections in the future will be
properly aligned.

Fixes: #21956
This commit is contained in:
Jan Janssen 2022-01-01 16:37:27 +01:00
parent 3c80c7bacf
commit 75747c8a39
2 changed files with 2 additions and 1 deletions

View File

@ -405,6 +405,7 @@ foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects
'-j', '.sdata',
'-j', '.sdmagic',
'-j', '.text',
'--section-alignment=512',
efi_format,
'@INPUT@', '@OUTPUT@'],
install : true,

View File

@ -30,7 +30,7 @@ SecureBootMode secure_boot_mode(void) {
}
#ifdef SBAT_DISTRO
static const char sbat[] _used_ _section_ (".sbat") _align_ (512) =
static const char sbat[] _used_ _section_(".sbat") =
"sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md\n"
SBAT_PROJECT ",1,The systemd Developers," SBAT_PROJECT "," PROJECT_VERSION "," PROJECT_URL "\n"
SBAT_PROJECT "." SBAT_DISTRO "," STRINGIFY(SBAT_DISTRO_GENERATION) "," SBAT_DISTRO_SUMMARY "," SBAT_DISTRO_PKGNAME "," SBAT_DISTRO_VERSION "," SBAT_DISTRO_URL "\n";