1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00

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.
This commit is contained in:
Jan Janssen 2021-11-04 10:37:25 +01:00 committed by Lennart Poettering
parent 874cbf675d
commit ad102dd09a
2 changed files with 11 additions and 4 deletions

View File

@ -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,

View File

@ -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,