From: Jan Janssen Date: Thu, 4 Nov 2021 09:37:25 +0000 (+0100) Subject: sd-boot: Add .osrel section X-Git-Tag: v250-rc1~347 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ad102dd09a22a55df99029d1df82eeed7d3f600f;p=thirdparty%2Fsystemd.git sd-boot: Add .osrel section This allows starting systemd-boot from \EFI\Linux for easier testing and bisection without risking an unbootable system as the user does not need to replace their working loader. --- diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index 296efdd4892..5992a28cdd0 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -31,6 +31,12 @@ /* magic string to find in the binary image */ _used_ _section_(".sdmagic") static const char magic[] = "#### LoaderInfo: systemd-boot " GIT_VERSION " ####"; +/* Makes systemd-boot available from \EFI\Linux\ for testing purposes. */ +_used_ _section_(".osrel") static const char osrel[] = + "ID=systemd-boot\n" + "VERSION=\"" GIT_VERSION "\"\n" + "NAME=\"systemd-boot " GIT_VERSION "\"\n"; + enum loader_type { LOADER_UNDEFINED, LOADER_EFI, diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index 40b0ab0dbd8..cdf31c7fd85 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -323,14 +323,15 @@ if have_gnu_efi input : so, output : tuple[1], command : [objcopy, - '-j', '.text', - '-j', '.sdata', - '-j', '.sbat', - '-j', '.sdmagic', '-j', '.data', '-j', '.dynamic', '-j', '.dynsym', + '-j', '.osrel', '-j', '.rel*', + '-j', '.sbat', + '-j', '.sdata', + '-j', '.sdmagic', + '-j', '.text', efi_format, '@INPUT@', '@OUTPUT@'], install : true,