summaryrefslogtreecommitdiff
path: root/src/basic/efivars.h
Commit message (Collapse)AuthorAgeFilesLines
* efivars: define efi variable flags less weirdlyLennart Poettering2022-03-241-3/+4
| | | | | The flags are actually 32bit values, but aligned with zeroes befitting a 64bit value. Let's fix that.
* efivarfs: rename a couple of return params to ret_xyz/retLennart Poettering2022-03-241-5/+5
|
* sd-boot: Be more precise about secure boot modesJan Janssen2021-10-221-3/+4
| | | | Fixes: #11559
* bootctl: print SystemdOptions from efivarfs if newer than our cacheZbigniew Jędrzejewski-Szmek2021-06-151-0/+5
| | | | | | | | | | | | | | | 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.
* basic/efivars: replace dynanamic creation of efivar names with static stringsZbigniew Jędrzejewski-Szmek2021-06-151-17/+31
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* efi: create symbolic link to efi/loader-feature.hYu Watanabe2021-01-191-1/+0
| | | | To drop src/boot/efi from include directories for binaries later.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* efi: use stub for cache_efi_options_variable if !ENABLE_EFILuca Boccassi2020-06-161-0/+4
| | | | | | | | ../src/core/main.c: In function 'main': ../src/core/main.c:2637:32: error: implicit declaration of function 'cache_efi_options_variable'; did you mean 'systemd_efi_options_variable'? [-Werror=implicit-function-declaration] (void) cache_efi_options_variable(); ^~~~~~~~~~~~~~~~~~~~~~~~~~ systemd_efi_options_variable
* efi: Cache contents of EFI variable SystemdOptionsFilipe Brandenburger2020-06-131-0/+1
| | | | | | Cache it early in startup of the system manager, right after `/run/systemd` is created, so that further access to it can be done without accessing the EFI filesystem at all.
* Disable reading SystemdOptions EFI Var when in SecureBoot modeArian van Putten2020-01-161-0/+16
| | | | | | | | | In SecureBoot mode this is probably not what you want. As your cmdline is cryptographically signed like when using Type #2 EFI Unified Kernel Images (https://systemd.io/BOOT_LOADER_SPECIFICATION/) The user's intention is then that the cmdline should not be modified. You want to make sure that the system starts up as exactly specified in the signed artifact.
* Rename "system-options" to "systemd-efi-options"Zbigniew Jędrzejewski-Szmek2019-11-181-2/+2
| | | | | | | | | | | | | | | | This makes the naming more consistent: we now have bootctl systemd-efi-options, $SYSTEMD_EFI_OPTIONS and the SystemdOptions EFI variable. (SystemdEFIOptions would be redundant, because it is only used in the context of efivars, and users don't interact with that name directly.) bootctl is adjusted to use 2sp indentation, similarly to systemctl and other programs. Remove the prefix with the old name from 'bootctl systemd-efi-options' output, since it's redundant and we don't want the old name anyway.
* Add support for SystemdOptions EFI var to augment /proc/cmdlineZbigniew Jędrzejewski-Szmek2019-09-161-2/+9
| | | | | | | | | | | | In various circumstances, overriding the kernel commandline can be inconvenient. People have different bootloaders, and e.g. the grub config can be pretty scary. grubby helps, but it isn't always available. This option adds an alternative mechanism that can quite convenient on EFI systems. cmdline settings have higher priority, because they can be (usually) changed on the bootloader prompt. $SYSTEMD_EFI_OPTIONS can be used to override, same as $SYSTEMD_PROC_CMDLINE.
* util-lib: split shared/efivars into basic/efivars and shared/efi-loaderZbigniew Jędrzejewski-Szmek2019-09-161-0/+52
I want to use efivars.[ch] in proc-cmdline.c, but most of the efivars stuff is not needed in basic/. Move the file from shared/ to basic/, but then move back most of the higher-level functions to the new shared/efi-loader.c file.