summaryrefslogtreecommitdiffstats
path: root/src/boot (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move the Commands section above Options sectionZbigniew Jędrzejewski-Szmek2019-10-081-9/+9
| | | | | | | For executables which take a verb, we should list the verbs first, and then options which modify those verbs second. The general layout of the man page is from general description to specific details, usually Overview, Commands, Options, Return Value, Examples, References.
* bootctl: add "system-options" verbZbigniew Jędrzejewski-Szmek2019-09-161-11/+34
|
* util-lib: split shared/efivars into basic/efivars and shared/efi-loaderZbigniew Jędrzejewski-Szmek2019-09-163-1/+3
| | | | | | 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.
* src/boot/efi/meson.build: if meson --werror is true, set gcc -WerrorDan Streetman2019-08-151-0/+3
| | | | | | This part of the build does not use the normal meson parameters, so we need to explicitly check for the meson --werror parameter, and if it's true, set the gcc -Werror parameter for this subdir's build.
* src/boot/efi/linux: elide __attribute__((regparm(0))) on non-i386Dan Streetman2019-08-151-12/+12
| | | | | | This attribute is x86_32-only, so when building on non-intel archs it generates a compiler warning. When building with -Werror this turns into an error, so only include the attribute on i386 arch builds.
* src/boot/efi/shim: elide __attribute__((sysv_abi)) on non-intel archsDan Streetman2019-08-151-3/+9
| | | | | | This attribute is x86-only, so when building on non-intel archs it generates a compiler warning. When building with -Werror this turns into an error, so only include the attribute on intel archs.
* bootctl: arg_dolloar_boot_path() may return NULLYu Watanabe2019-08-121-1/+5
|
* bootctl: clear arg_xbootldr_path when acquire_xbootldr() succeedsYu Watanabe2019-08-111-0/+1
|
* boot: fix build with gnu-efi older than 3.0.5v243-rc1Yu Watanabe2019-07-303-0/+57
|
* bootctl: log message tweaksZbigniew Jędrzejewski-Szmek2019-07-261-2/+2
| | | | Follow-up for e44c3229f22459b189c1e79cb01fdb156672eb93.
* Merge pull request #13137 from poettering/efi-randomZbigniew Jędrzejewski-Szmek2019-07-2610-81/+1063
|\ | | | | beef up random seed logic, add boot loader entropy privisioning, improve docs about it
| * bootctl: add is-installed verbLennart Poettering2019-07-251-9/+49
| | | | | | | | Fixes: #9428
| * bootctl: show random seed stateLennart Poettering2019-07-251-0/+16
| |
| * bootctl: add new verb for initializing a random seed in the ESPLennart Poettering2019-07-251-50/+253
| |
| * sd-boot: read random seed from ESP and pass it to OSLennart Poettering2019-07-254-2/+397
| |
| * efi: steal glibc sha256 implementationLennart Poettering2019-07-253-1/+306
| |
| * bootctl: add new feature flag for indicating random seed management supportLennart Poettering2019-07-252-6/+8
| |
| * bootctl: shortcut configuration file parsingLennart Poettering2019-07-251-0/+6
| |
| * bootctl: drop const from non-pointer function argumentLennart Poettering2019-07-251-1/+1
| |
| * bootctl: use the fact that startswith() returns the suffixLennart Poettering2019-07-251-3/+4
| |
| * efi: add log_oom() helperLennart Poettering2019-07-252-0/+8
| |
| * efi: modernize file_read() a bitLennart Poettering2019-07-251-10/+16
| |
* | sd-boot: silence one warning about pointer castZbigniew Jędrzejewski-Szmek2019-07-261-1/+1
|/ | | | It doesn't matter either way. Fixes #13174.
* bootctl: show correct error codeLennart Poettering2019-07-241-1/+1
|
* efi: drop unused defineLennart Poettering2019-07-241-3/+0
|
* efi: remove trailing whitespace in stringLennart Poettering2019-07-241-1/+1
|
* tree-wide: drop duplicated blank linesYu Watanabe2019-07-151-2/+0
| | | | | | | ``` $ for i in */*.[ch] */*/*.[ch]; do sed -e '/^$/ {N; s/\n$//g}' -i $i; done $ git checkout HEAD -- basic/linux shared/linux ```
* bootctl,sd-boot: define EFI_LOADER_FEATURE_XBOOTLDRZbigniew Jędrzejewski-Szmek2019-07-102-5/+7
| | | | | It was added back in fa2a3bbdd8bfcc3402c2ad9e941eb3911971e09a, but we forgot to add the feature define.
* boot,shared: share the definitions of EFI_LOADER_FEATURE macrosZbigniew Jędrzejewski-Szmek2019-07-102-5/+19
| | | | | | | | | This means the the code needs to be kept compatible in the shared header, but I think that still nicer than having two places to declare the same things. I added src/boot to -I, so that efi/foo.h needs to be used. This reduces the potential for accidentally including the wrong header.
* Merge pull request #12870 from yuwata/tree-wide-further-path-join-cleanupsLennart Poettering2019-06-251-12/+12
|\ | | | | tree-wide: further path_join() and path_joina() cleanups
| * tree-wide: replace strjoina() with prefix_roota()Yu Watanabe2019-06-241-12/+12
| |
* | bootctl: fix display of options with embedeed newlinesZbigniew Jędrzejewski-Szmek2019-06-251-2/+14
|/ | | | | | | | | I have an .efi image with embedded newlinews. Now I don't even remember if it was created for testing or by accident, but it doesn't really matter. We should display such files correctly. (This isn't a problem with normal BLS entries, because input is split into lines so newlines are consumed.)
* Merge pull request #12508 from keszybz/no-root-checksYu Watanabe2019-06-062-15/+13
|\ | | | | Drop many root checks
| * bootctl: drop must_be_root() checksZbigniew Jędrzejewski-Szmek2019-05-081-9/+8
| | | | | | | | | | | | The reasoning is the same as in previous cases. We get an error like "Failed to update EFI variable: Operation not permitted" anyway, so the check is not very useful.
| * bless-boot: drop must_be_root() checksZbigniew Jędrzejewski-Szmek2019-05-081-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we lack permissions, we will fail anyway. But by not doing the artifial check, we get more information. For example, on my machine, I see $ build/systemd-bless-boot good Not booted with boot counting in effect. while "Need to be root" is actually untrue, because being root doesn't change the outcome in any way. Letting the operation fail on the actual error makes it easier to do test runs: we *know* the command will fail, but we want to see what the first step would be. Not doing the articial check makes it also easier to do create alternative security arrangements, for example where the directories are mounted with special ownership mode and an otherwise unprivileged user can perform certain operations.
* | sd-boot: Remove unnecessary call to GetEventLogJoe Richey2019-06-031-54/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR reverts #4302 and part of #7568, as the call to GetEventLog isn't necessary to get the logs from the OS runtime. This has already been reverted in shim, see: https://github.com/rhboot/shim/commit/fd7c3bd920ba39082cb7c619afb7203d150a4cd3 The reasoning for the change that added this is wrong, explained below: > According to TCG EFI Protocol Specification for TPM 2.0 family, > all events generated after the invocation of EFI_TCG2_GET_EVENT_LOG > shall be stored in an instance of an EFI_CONFIGURATION_TABLE aka > EFI TCG 2.0 final events table. This is correct and a valid reading of the TCG spec. > Hence, it is necessary to trigger the internal switch through calling > get_event_log() in order to allow to retrieve the logs from OS runtime. However, this reasoning is incorrect. The "EFI TCG 2.0 final events table" exists to allow the OS Runtime to get TCG events created during or after the call to ExitBootServices. If systemd-boot didn't call trigger_tcg2_final_events_table(), the call to HashLogExtendEvent will write the event to the normal events table (i.e. the same place the PCR 0 - 7 related events are written). Then the OS can obtain these systemd-boot events in the same way it obtains normal events, via a call to GetEventLog(). Tested on amd64 w/ TPM2 using the newest Linux kernel patches that get the TPM2 formatted log: https://www.lkml.org/lkml/2019/5/20/1590 I confirmed that this change still lets the OS runtime obtain the log entries created by systemd-boot. Signed-off-by: Joe Richey <joerichey@google.com>
* | bootctl: do not allow -x and -p to be used togetherZbigniew Jędrzejewski-Szmek2019-05-191-0/+6
| | | | | | | | | | -x already prints the path to ESP in some circumstances, and allowing both to be printed seems confusing.
* | bootctl: add -x shortcut for --print-boot-pathZbigniew Jędrzejewski-Szmek2019-05-191-5/+4
| | | | | | | | It's a quite useful option, let's match -p.
* | bootclt: add missing columnZbigniew Jędrzejewski-Szmek2019-05-191-1/+1
|/ | | | This got broken somehow in 44e6a5ef825.
* codespell: fix spelling errorsBen Boeckel2019-04-292-2/+2
|
* scripts: use 4 space indentationZbigniew Jędrzejewski-Szmek2019-04-121-2/+2
| | | | | | | | | | | | | | | | | | We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed. 4 sp was the most common, in particular the majority of scripts under test/ used that. Let's standarize on 4 sp, because many commandlines are long and there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp also seems to be the default indentation, so this will make it less likely that people will mess up if they don't load the editor config. (I think people often use vi, and vi has no support to load project-wide configuration automatically. We distribute a .vimrc file, but it is not loaded by default, and even the instructions in it seem to discourage its use for security reasons.) Also remove the few vim config lines that were left. We should either have them on all files, or none. Also remove some strange stuff like '#!/bin/env bash', yikes.
* bootctl: urlify .conf filesZbigniew Jędrzejewski-Szmek2019-04-051-2/+10
| | | | Just because we can ;)
* bootctl: emit extra warning if the default boot entry is brokenZbigniew Jędrzejewski-Szmek2019-04-051-6/+19
| | | | | Let's make it more obvious for the user if something is badly borked. It does the job, but I'm not too happy with this.
* bootctl: check if files specified by boot entry exist, and warn if notZbigniew Jędrzejewski-Szmek2019-04-051-10/+31
| | | | | | | | | | | | | Example output: title: Fedora 30 (Workstation Edition) (5.0.5-300.fc30.x86_64) id: 08a5690a2eed47cf92ac0a5d2e3cf6b0-5.0.5-bad-300.fc30.x86_64 source: /boot/efi/loader/entries/08a5690a2eed47cf92ac0a5d2e3cf6b0-5.0.5-bad-300.fc30.x86_64.conf version: 5.0.5-300.fc30.x86_64 machine-id: 08a5690a2eed47cf92ac0a5d2e3cf6b0 linux: /08a5690a2eed47cf92ac0a/5.0.5-300.fc30.x86_64/linux (No such file or directory) initrd: /08a5690a2eed47cf92ac0a/5.0.5-300.fc30.x86_64/initrd (No such file or directory) /08a5690a2eed47cf92ac0a/5.0.5-300.fc30.x86_64/initrd2 (No such file or directory) options: ...
* bootctl: replace "type" with "source" in outputZbigniew Jędrzejewski-Szmek2019-04-051-9/+5
| | | | | | | | | | | | | | | | | | | | | | I think this is more useful (because it's easy to stick the path into an editor command when one wants to change the options or inspect the files), and more self-explanatory. Example output: title: Fedora 30 (Workstation Edition) (4.20.16-200.fc29.x86_64) id: 08a5690a2eed47cf92ac0a5d2e3cf6b0-4.20.16-200.fc29.x86_64 source: /boot/efi/loader/entries/08a5690a2eed47cf92ac0a5d2e3cf6b0-4.20.16-200.fc29.x86_64.conf version: 4.20.16-200.fc29.x86_64 ... title: Fedora 30 (Workstation Edition) id: fedora-30 source: /boot/efi/EFI/Linux/linux-5.0.5-300.fc30.x86_64-08a5690a2eed47cf92ac0a5d2e3cf6b0.efi linux: EFI/Linux/linux-5.0.5-300.fc30.x86_64-08a5690a2eed47cf92ac0a5d2e3cf6b0.efi ... title: Reboot Into Firmware Interface id: auto-reboot-to-firmware-setup source: /sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
* tree-wide: use SD_ID128_UUID_FORMAT_STR as appropriateZbigniew Jędrzejewski-Szmek2019-04-051-4/+6
|
* boot: use TAKE_PTR() where appropriateLennart Poettering2019-04-022-16/+8
|
* tree-wide: use reallocarray() where appropriateLennart Poettering2019-04-021-1/+1
|
* Merge pull request #11971 from keszybz/kernel-install-directoryLennart Poettering2019-03-141-13/+25
|\ | | | | Make kernel-install create entry directory
| * bootctl: use path_join() to join pathsZbigniew Jędrzejewski-Szmek2019-03-141-3/+3
| | | | | | | | We would say "/boot/efi//loader/entries"...