summaryrefslogtreecommitdiff
path: root/src/boot/bootctl-util.c
Commit message (Collapse)AuthorAgeFilesLines
* boot-entry: prioritize machine ID only when it is not randomly generatedYu Watanabe2023-04-121-0/+1
| | | | | Preparation for later commits. The parameter will be used in kernel-install later.
* bootctl: clean up handling of files with no version informationZbigniew Jędrzejewski-Szmek2023-03-301-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | get_file_version() would return: - various negative errors if the file could not be accessed or if it was not a regular file - 0/NULL if the file was too small - -ESRCH or -EINVAL if the file did not contain the marker - -ENOMEM or permissions errors - 1 if the marker was found bootctl status iterates over /EFI/{systemd,BOOT}/*.efi and checks if the files contain a systemd-boot version tag. Resource or permission errors should be fatal, but lack of version information should be silently ignored. OTOH, when updating or installing bootloader files, the version is expected to be present. get_file_version() is changed to return -ESRCH if the version is unavailable, and other errnos for permission or resource errors. The logging is reworked to always display an error if encountered, but also to log the status at debug level what the result of the version inquiry is. This makes it figure out what is going on: /efi/EFI/systemd/systemd-bootx64.efi: EFI binary LoaderInfo marker: "systemd-boot 253-6.fc38" /efi/EFI/BOOT/BOOTfbx64.efi: EFI binary has no LoaderInfo marker. /efi/EFI/BOOT/BOOTIA32.EFI: EFI binary has no LoaderInfo marker. /efi/EFI/BOOT/BOOTX64.EFI: EFI binary LoaderInfo marker: "systemd-boot 253-6.fc38" Replaces #27034. Fixes https://github.com/NixOS/nixpkgs/issues/223579.
* bootctl: split-out entry token related definitions into boot-entry.[ch]Yu Watanabe2023-03-271-90/+8
| | | | | | | | | | No functional change, just preparation for later commits. These can be used in kernel-install later. Note, unlike the our usual coding style, the arguments for boot_entry_token_ensure() and parse_boot_entry_token_type() are referenced, updated, and may freed, hence, always pass initialized values. That's why they are not named as 'ret_xyz'.
* bootctl: avoid using __WORDSIZE macroMike Gilbert2023-02-151-3/+5
| | | | | | | | | | | | __WORDSIZE does not seem to be documented anywhere, and is probably meant to be used internally by glibc headers. In systemd, it was only being used in warning messages. We can avoid using it by rewording the messages slightly. Fixes a build error with musl libc. Bug: https://bugs.gentoo.org/894430
* boot: Make sure we take --root into account everywhere.Daan De Meyer2023-02-091-4/+4
|
* bootctl: honor $KERNEL_INSTALL_CONF_ROOTLudwig Nussel2023-01-101-3/+7
| | | | | Honor $KERNEL_INSTALL_CONF_ROOT for reading config files, as kernel-install does.
* bootctl: print entry token as wellLudwig Nussel2023-01-051-0/+94
|
* bootctl: split out "status" verb tooLennart Poettering2022-12-191-0/+88
|
* bootctl: split out random seed verb, tooLennart Poettering2022-12-191-0/+23