summaryrefslogtreecommitdiffstats
path: root/src/boot (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Disable non-explicit sbatvars autodetection for cross builds.James Hilliard2021-07-111-1/+1
| | | | | | | Since autodetection is unlikely to work reliably for cross builds disable it unless explicitly enabled. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
* docs: improve wording when mentioning the acronym "ESP"nl67202021-07-091-1/+1
| | | | "ESP" is "EFI system partition", so "ESP partition" is redundant.
* bootctl: print SystemdOptions from efivarfs if newer than our cacheZbigniew Jędrzejewski-Szmek2021-06-151-6/+17
| | | | | | | | | | | | | | | The logic is that if the options are updated after boot, we *don't* use the new value. But we still want to print out the changed contents in bootctl as to not confuse people. Fixes #19597. Also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988450. $ build/bootctl systemd-efi-options quiet Note: SystemdOptions EFI variable has been modified since boot. New value: debug The hint is printed to stderr, so scripts should not be confused.
* Inline some inerator variablesZbigniew Jędrzejewski-Szmek2021-06-151-15/+10
|
* basic/efivars: replace dynanamic creation of efivar names with static stringsZbigniew Jędrzejewski-Szmek2021-06-153-36/+40
| | | | | | | | | | | | | | | | | | | | | | | | Creating those string dynamically at runtime is slow and unnecessary. Let's use static strings with a bit of macro magic and the let the compiler coalesce as much as possible. $ size build/src/shared/libsystemd-shared-248.so{.old,} text data bss dec hex filename 2813453 94572 4584 2912609 2c7161 build/src/shared/libsystemd-shared-248.so.old 2812309 94564 4584 2911457 2c6ce1 build/src/shared/libsystemd-shared-248.so A nice side-effect is that the same form is used everywhere, so it's easier to figure out all variables that are used, and where each specific variable is used. C.f. 2b0445262ad9be2a9bf49956ab8e886ea2e48a0a. Note: 'const char *foo = alloca(…);' seems OK. Our coding style document and alloca(3) only warn against using alloca() in function invocations. Declaring both stack variable and alloca at the same time should be fine: no matter in which order they happen, i.e. if the pointer variable is above the contents, or the contents are above the pointer, or even if the pointer is elided by the compiler, everything should be fine.
* meson: do not share compiler flags except for emitting warningsYu Watanabe2021-06-081-0/+1
| | | | | | Follow-up for 65267363978dbb298eb4ba9b628d028c969fa616. Prompted by https://github.com/systemd/systemd/issues/19191#issuecomment-856312107.
* efi: drop glibc header and use pre-defined macrosYu Watanabe2021-06-032-3/+1
| | | | | This reverts 72dc626b3d6905b105ae61ca2c60f51a6f74070e and replace glibc specific macros with compiler's pre-defined macros.
* meson: enable more warnings when building efi binaryYu Watanabe2021-06-021-14/+18
|
* efi: constify several arguments of functions which handle loader entriesYu Watanabe2021-06-021-21/+20
|
* efi: drop const qualifiers from arguments in uefi_call_wrapper()Yu Watanabe2021-06-022-7/+7
|
* efi: add const qualifier to EFI variable handling functionsYu Watanabe2021-06-022-8/+8
|
* efi: add const qualifier to string utilsYu Watanabe2021-06-022-8/+8
|
* efi: include endian.h to handle endian correctlyYu Watanabe2021-06-021-0/+2
| | | | The macro __BYTE_ORDER__ is defined in endian.h.
* efi: do not use _STRING_ARCH_unaligned macroYu Watanabe2021-06-021-3/+6
| | | | | | It is already removed from glibc. See, https://sourceware.org/git/?p=glibc.git;a=commit;h=16396c41deab45f715ffd813280d9d685b3b281e https://sourceware.org/git/?p=glibc.git;a=commit;h=09a596cc2cf4e0f9f8e9f3bba4b1a97efcb13bcb
* efi: use meson object directly instead of going through 'substs'Zbigniew Jędrzejewski-Szmek2021-05-191-2/+2
|
* meson: use jinja2 for rpm templatesZbigniew Jędrzejewski-Szmek2021-05-191-1/+1
| | | | | | | The naming of variables is very inconsistent. I tried to use more modern style naming (UNDERSCORED_TITLE_CASE), but I didn't change existing names too much. Only SYSTEM_DATA_UNIT_PATH is renamed to SYSTEM_DATA_UNIT_DIR to match SYSTEM_CONFIG_UNIT_DIR.
* meson: print autodetected sbat fieldsZbigniew Jędrzejewski-Szmek2021-05-141-0/+1
| | | | | | | | ... Message: sbat-distro (from ID): fedora Message: sbat-distro-summary (from NAME): Fedora Message: sbat-distro-url (from BUG_REPORT_URL): https://bugzilla.redhat.com/ ...
* meson: call find_program() once and reuse the variable everywhereZbigniew Jędrzejewski-Szmek2021-05-141-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson 0.58 has gotten quite bad with emitting a message every time a quoted command is used: Program /home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh found: YES (/home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program xsltproc found: YES (/usr/bin/xsltproc) Configuring custom-entities.ent using configuration Message: Skipping bootctl.1 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping journal-remote.conf.5 because HAVE_MICROHTTPD is false Message: Skipping journal-upload.conf.5 because HAVE_MICROHTTPD is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping loader.conf.5 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) ... Let's suffer one message only for each command. Hopefully we can silence even this when https://github.com/mesonbuild/meson/issues/8642 is resolved.
* Merge pull request #19506 from xnox/ship-stub-elfZbigniew Jędrzejewski-Szmek2021-05-121-19/+22
|\ | | | | boot/efi: install ELF linux.elf.stub in addition to PE linux.efi.stub
| * meson: rework test-efi-disk.img creation to not require variablesZbigniew Jędrzejewski-Szmek2021-05-101-21/+20
| | | | | | | | | | The primary goal is to make the name of the custom_target() rule match the output file again. Having them different is confusing.
| * boot/efi: add --build-id=sha1 to ELF efi objectsDimitri John Ledkov2021-05-101-0/+1
| | | | | | | | As it is not nice to ship ELF binary without a note.gnu.build-id set.
| * boot/efi: install ELF linux.elf.stub in addition to PE linux.efi.stubDimitri John Ledkov2021-05-101-4/+7
| | | | | | | | | | | | | | | | Binutils for non-x86 architectures currently does not support PE binaries. Thus linux.efi.stub is useless on those, as one cannot use any tooling to add linux/cmdline/splash sections to it. In addition to PE linux.efi.stub also install ELF linux.elf.stub, such that one can use objcopy ELF target to copy in linux/cmdline/splash sections and then convert the result to a PE binary.
* | bootctl: same entry path check case-insensitivezsien2021-05-111-1/+5
|/ | | | | Some motherboards convert the path to uppercase under certain circumstances (e.g. after booting into the Boot Menu in the ASUS ROG STRIX B350-F GAMING).
* boot: add optional EFI SBAT supportDimitri John Ledkov2021-05-072-0/+44
| | | | | | | | | | Add SBAT support, when -Dsbat-distro value is specified. One can use -Dsbat-distro=auto for autodetection of all sbat options. Many meson configure options added to customize SBAT CSV values, but sensible defaults are auto detected by default. SBAT support is required if shim v15+ is used to load systemd-boot binary or kernel.efi (Type II BootLoaderSpec). Fixes #19247
* boot/efi: add ARM (THUMB) and RISCV64 machine typesDimitri John Ledkov2021-05-061-1/+5
| | | | Also drop defines from shared/pe-header.h, appear to be unused.
* Merge pull request #19507 from nabijaczleweli/bootctlpsko-liteYu Watanabe2021-05-061-11/+105
|\ | | | | bootctl: take --make-machine-id-directory=yes|no|auto and make/remove \$MACHINE_ID accordingly
| * bootctl: take --make-machine-id-directory=yes|no|auto and make/remove ↵наб2021-05-051-11/+105
| | | | | | | | | | | | | | | | \$MACHINE_ID accordingly auto resolves to yes if /etc/machine-id resides on non-tmpfs This effectively reverts commit 31e57550b552e113bd3d44355b237c41e42beb58
* | meson: make one check shorterZbigniew Jędrzejewski-Szmek2021-05-041-1/+1
|/
* boot/efi: compile on riscv64Emil Renner Berthing2021-04-221-3/+3
| | | | | This makes systemd-boot compile against the latest gnu-efi which just added support for riscv64.
* src: shellcheck-ify shell scriptsFrantisek Sumsal2021-04-201-2/+3
|
* tree-wide: avoid uninitialized warning on _cleanup_ variablesLuca Boccassi2021-04-145-7/+7
| | | | | | | With some versions of the compiler, the _cleanup_ attr makes it think the variable might be freed/closed when uninitialized, even though it cannot happen. The added cost is small enough to be worth the benefit, and optimized builds will help reduce it even further.
* meson: fix warning about comparison between different typesYu Watanabe2021-03-221-7/+5
| | | | Follow-up for e39288193fcdf3a36dbc49b78e6c9bf86a764e31.
* systemd-boot: LLVM/lld does not support PE/COFF relocations. Bail out with ↵tpgxyz2021-03-191-1/+8
| | | | an error message
* boot: Move console declarations to missing_efi.hDaan De Meyer2021-03-133-61/+69
| | | | | | These were added to eficonex.h in gnu-efi 3.0.13. Let's move them to missing_efi.h behind an appropriate guard to fix the build with recent versions of gnu-efi.
* efi: introduce UINT32_MAX and UINT64_MAXYu Watanabe2021-03-042-24/+30
|
* tree-wide: use UINT64_MAX or friendsYu Watanabe2021-03-041-1/+1
|
* util: add helpers for generating colored check mark glyphs from boolsLennart Poettering2021-03-021-2/+2
|
* efi stub: accept it if our loaded image has no FilePath field setLennart Poettering2021-02-231-2/+8
| | | | | | | | | | | The firmware spec doesn't really say whether FilePath of the LoadedImage protocol may be NULL or not. So far we assumed it to be non-NULL, but apparently the FreeBSD UEFI chainloader sets it to NULL. Handle this gracefully. (Noticed and tracked down by Alexander Schreiber) Fixes: #18733
* bootctl: show whether the firmware has TPM2 supportLennart Poettering2021-02-111-0/+1
|
* tree-wide: use -EINVAL for enum invalid valuesZbigniew Jędrzejewski-Szmek2021-02-101-1/+2
| | | | | | | | | As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617. This does not touch anything exposed in src/systemd. Changing the defines there would be a compatibility break. Note that tests are broken after this commit. They will be fixed in the next one.
* tree-wide: replace strverscmp() and str_verscmp() with strverscmp_improved()Yu Watanabe2021-02-092-59/+2
|
* fundamental: move several macros and functions into src/fundamental/Yu Watanabe2021-02-095-96/+11
| | | | | | | | | | sd-boot has a copy of a subset of codes from libbasic. This makes sd-boot share the code with libbasic, and dedup the code. Note, startswith_no_case() is dropped from sd-boot, as - it is not used, - the previous implementation is not correct, - gnu-efi does not have StrniCmp() or so.
* boot: Replace efivar_set() persistent argument with flags argumentDaan De Meyer2021-02-045-45/+47
| | | | | | To add secure-boot enrolling support, we need to be able to specify the EFI_VARIABLE_APPEND_WRITE flag so let's make the efivar_set() methods more generic so we can set that flag.
* boot: Add startswith() and endswith() functions with no_case variantsDaan De Meyer2021-02-023-12/+66
| | | | Adapted from string-util
* boot: Drop unnecessary bracesDaan De Meyer2021-02-021-2/+1
|
* boot: Fix void pointer arithmetic warningDaan De Meyer2021-02-021-1/+1
|
* boot: Replace raw efivar gets with typed variantsDaan De Meyer2021-02-021-21/+15
|
* boot: Add efivar_get/set_uint64_le() functionsDaan De Meyer2021-02-022-0/+65
| | | | | | These are implemented as bit-shifting functions that allow reading and writing UEFI variables stored as little endian 64-bit unsigned values.
* boot: Rename efivar_get/set_int() to efivar_get/set_uint_string()Daan De Meyer2021-02-023-9/+9
| | | | | Let's clearly indicate that these are used to set/get uints that are stored as strings.
* boot: Tighten scope of variables used in loopsDaan De Meyer2021-02-029-101/+70
|