summaryrefslogtreecommitdiff
path: root/src/boot/bootctl-install.c
Commit message (Collapse)AuthorAgeFilesLines
* bootctl: Gracefully handle missing bootloader directoryDaan De Meyer2023-04-071-0/+4
| | | | | When --graceful is specified, let's gracefully deal with a missing bootloader directory.
* bootctl: clean up handling of files with no version informationZbigniew Jędrzejewski-Szmek2023-03-301-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | | | 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'.
* chase-symlinks: Rename chase_symlinks() to chase()Daan De Meyer2023-03-241-9/+9
| | | | | | | | | Chasing symlinks is a core function that's used in a lot of places so it deservers a less verbose names so let's rename it to chase() and chaseat(). We also slightly change the pattern used for the chaseat() helpers so we get chase_and_openat() and similar.
* bootctl: 'graceful' should ignore EFI variable failuresKevin P. Fleming2023-03-221-9/+22
| | | | | | | Suppress errors when creating/writing EFI variables during 'bootctl update' if '--graceful' mode is active (as the documentation indicates). Closes #26773.
* bootctl: fix wrong type comparisonYu Watanabe2023-03-201-1/+1
|
* Merge pull request #26784 from DaanDeMeyer/chase-fixDaan De Meyer2023-03-151-1/+1
|\ | | | | Allow creating files and directories with chase_symlinks_open() and further improvements
| * chase-symlinks: Remove unused ret_fd argumentsDaan De Meyer2023-03-141-1/+1
| |
* | fs-util: Drop unlink_noerrno()Daan De Meyer2023-03-151-4/+5
|/
* tmpfile-util: teach link_tmpfile() to optionally replace filesLennart Poettering2023-03-031-4/+6
|
* bootctl: Fix debug messagesSamanta Navarro2023-02-161-2/+2
| | | | | | | Remove duplicate KERNEL_INSTALL_MACHINE_ID from message and also specify the correct origin of layout variable. Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
* boot: Make sure we take --root into account everywhere.Daan De Meyer2023-02-091-4/+8
|
* bootctl: Add missing %mDaan De Meyer2023-02-091-1/+1
|
* id128: introduce ERRNO_IS_MACHINE_ID_UNSET() helper macroLennart Poettering2023-02-011-6/+9
|
* bootctl: honor $KERNEL_INSTALL_CONF_ROOTLudwig Nussel2023-01-101-6/+14
| | | | | Honor $KERNEL_INSTALL_CONF_ROOT for reading config files, as kernel-install does.
* bootctl: print entry token as wellLudwig Nussel2023-01-051-92/+0
|
* tree-wide: use -EBADF for fd initializationZbigniew Jędrzejewski-Szmek2022-12-191-2/+2
| | | | | | | | | | | | | | | | -1 was used everywhere, but -EBADF or -EBADFD started being used in various places. Let's make things consistent in the new style. Note that there are two candidates: EBADF 9 Bad file descriptor EBADFD 77 File descriptor in bad state Since we're initializating the fd, we're just assigning a value that means "no fd yet", so it's just a bad file descriptor, and the first errno fits better. If instead we had a valid file descriptor that became invalid because of some operation or state change, the other errno would fit better. In some places, initialization is dropped if unnecessary.
* bootctl: split out "install" verb tooLennart Poettering2022-12-191-0/+1157