summaryrefslogtreecommitdiff
path: root/src/boot
Commit message (Collapse)AuthorAgeFilesLines
...
* bootctl: add @current/@oneshot/@default targets to set-default/set-oneshotДамјан Георгиевски2020-10-201-8/+33
| | | | | | | | | | | | Using `bootctl set-default @current` will set the default loader entry to the currently booted entry as read from the `LoaderEntrySelected` EFI variable. Also `bootctl set-oneshot @current` will set the oneshot loader entry to the current booted entry. Correspondingly `@default` and `@oneshot` can be used to read from the LoaderEntryDefault and LoaderEntryOneshot EFI variables.
* bootctl: separate boot loader specific commands in man and --helpLennart Poettering2020-10-141-17/+19
| | | | | | | | | | | | | bootctl implements three types of operation: those that work with an EFI boot loader, those which work with any EFI boot loader that implements the boot loader spec + interface, and finally those specific to sd-boot. Previously the --help text and the man page mixed them all up. Let's put them clearly in three separate sections however, to communicate clearly what is supposed to work everywhere, and what is specific to systemd-boot or boot loaders implementing the two specs. This adjusts wording here and there, but is mostly just about re-ordering existing docs, and putting them under new sections.
* boot/efi: Explicitly specify void in parameter listMarco Wang2020-10-061-1/+1
| | | | | | | Functions that accept no arguments should be explicitly declared a void parameter in their parameter list. Signed-off-by: Marco Wang <m.aesophor@gmail.com>
* bootctl: handle if LoaderSystemToken is invalid for some reasonLennart Poettering2020-09-141-1/+3
| | | | | | | This points to some firmware issue, but we should still be able to correct things if this happens. Hence log about this and fix it. Fixes: #17041
* bootctl: don't accidentally propagate errors in "bootctl status"Lennart Poettering2020-09-101-5/+5
| | | | Fixes: #16989
* tree-wide: drop pointless zero initialization (#16884)fangxiuning2020-08-281-2/+2
| | | tree-wide: drop pointless zero initialization
* Merge pull request #16687 from DaanDeMeyer/bootloader-machine-idZbigniew Jędrzejewski-Szmek2020-08-181-43/+4
|\ | | | | Allow bootctl and kernel-install to be called without /etc/machine-id present
| * bootctl: Remove dependency on machine-id.Daan De Meyer2020-08-101-43/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The machine-id is used to create a few directories and setup a default loader entry in loader.conf. Having bootctl create the directories itself is not particularly useful as it does not put anything in them and bootctl install is not guaranteed to be called before an initramfs tool like kernel-install so other programs will always need to have logic to create the directories themselves if they happen to be called before bootctl install is called. On top of this, when using unified kernel images, these are installed to $BOOT/EFI/Linux which removes the need to have the directories created by bootctl at all. This further indicates that these directories should be created by the program that puts something in them rather than by bootctl. Removing the machine-id dependency allows bootctl install to be called even when there's no machine-id in the image. This is useful for image builders such as mkosi which don't have a machine-id when installing systemd-boot (via bootctl) because it should only be generated by systemd when the final image is booted. The default entry in loader.conf based on the machine-id in loader.conf is also removed which shouldn't be a massive loss in usability overall. This commit reverts commit 341890d.
* | bless-boot: add missing verb to --helpZbigniew Jędrzejewski-Szmek2020-08-051-0/+1
|/ | | | | There is also "help" verb which duplicates the --help option. I don't think we should advertise it.
* sd-boot: Add small comments after device-specific key macrosPaul Cercueil2020-06-181-4/+4
| | | | | | | | | The key macros added in commit 6fe95d3020 look strange at first sight. Add a comment with just the tablet name after each line, so that it's obvious that these lines address device-specific issues of the EFI firmware, and not broken/old code. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
* sd-boot: Work around malformed CR key codePaul Cercueil2020-06-151-0/+4
| | | | | | | | | | | | | | | | | | | | | When a key is pressed, the EFI firmware gives us a 64-bit word that contains the modifier key code in the upper 32 bits, the scan code in the middle 16 bits, and a unicode character in the low 16 bits. Some bogus EFI firmwares will put the unicode character in the scan code area, for instance on the EZpad mini 4s tablet. Others will even put the unicode character in both the scan code and unicode areas. This is the case for instance on the Teclast X98+ II tablet. Add workarounds for these corner cases, only for the carriage return key right now. Some more workarounds may be needed, e.g. for volume keys, but I cannot test it. Partially fixes #8466. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
* bootctl: add simple, low-level reboot-to-firmware verb for controlling the flagLennart Poettering2020-05-291-2/+39
|
* bootctl: show reboot-to-firmware info, tooLennart Poettering2020-05-291-0/+12
|
* efi: cache LoaderEntries EFI variableLennart Poettering2020-05-291-1/+8
| | | | | | Based-on: https://github.com/systemd/systemd/issues/14828#issuecomment-634202054
* sd-boot: fix menu ordering with boot countingDaniel Fullmer2020-05-261-8/+8
| | | | | | systemd-boot selects the last valid entry by default, not the first. Fixes: #15256
* tree-wide: fix bad errno checksZbigniew Jędrzejewski-Szmek2020-05-201-1/+1
|
* tree-wide: fix spelling errorsFrantisek Sumsal2020-04-211-1/+1
| | | | | | Based on a report from Fossies.org using Codespell. Followup to #15436
* tree-wide: spellcheck using codespellZbigniew Jędrzejewski-Szmek2020-04-161-1/+1
| | | | Fixes #15436.
* sd-boot: Add → as alternative to boot selected entryJan Janssen2020-04-151-0/+1
| | | | | This is sometimes slightly more convenient to use and is also what GRUB supports.
* Remove unneded {}sZbigniew Jędrzejewski-Szmek2020-04-131-2/+1
| | | | | | $ perl -i -0pe 's|\s+{\n([^\n]*;)\n\s+}\n|\n\1\n|gms' **/*.c Inspired by ea7cbf5bdd68d7861ebf1570c439e8bbabd83f6c.
* bootctl: fix assert issueLennart Poettering2020-04-091-1/+1
| | | | Follow-up for b46c3e4913f7f234039ebd8104446450917cab8d
* *: use _cleanup_close_ with fdopen() where trivialVito Caputo2020-03-311-5/+4
| | | | Also convert these to use take_fdopen().
* boot: Ensure ARM UEFI binary does not contain FP/SIMD instructionsJames T. Lee2020-03-081-0/+2
| | | | | | | | | | | | | | | | | | ARM toolchains will sometimes optimize otherwise floating-point-free code with floating point and SIMD instructions. This was happening with systemd-bootarm.efi and it was causing U-Boot to crash and reset the CPU. U-Boot does not support the ARM VFP floating point coprocessor, which is an optional piece of hardware anyway [1]. Ensure the compiler does not generate FP/SIMD instructions by supplying the `-mgeneral-regs-only` option when building for ARM [2]. The other option you often see to solve these problems is `-msoft-float`, but that changes the ABI and prevents linking with libgnuefi. [1] https://lists.denx.de/pipermail/u-boot/2011-February/087736.html [2] https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#index-mgeneral-regs-only-1
* meson: update efi path detection to gnu-efi-3.0.11Zbigniew Jędrzejewski-Szmek2020-02-041-22/+41
| | | | | | | | | | | | | | | | | | | | | | | | Fixes systemd build in Fedora rawhide. The old ldsdir option is not useful, because both the directory and the file name changed. Let's remove the option and try to autodetect the file name. If this turns out to be not enough, a new option to simply specify the full path to the file can be added. F31: efi arch: x86_64 EFI machine type: x64 EFI CC ccache cc EFI lds: /usr/lib64/gnuefi/elf_x64_efi.lds EFI crt0: /usr/lib64/gnuefi/crt0-efi-x64.o EFI include directory: /usr/include/efi F32: efi arch: x86_64 EFI machine type: x64 EFI CC ccache cc EFI lds: /usr/lib/gnuefi/x64/efi.lds EFI crt0: /usr/lib/gnuefi/x64/crt0.o EFI include directory: /usr/include/efi
* sd-boot: fix -Wpointer-sign warningYu Watanabe2020-01-312-6/+6
|
* sd-boot: fix warning about comparison is always trueYu Watanabe2020-01-311-1/+1
|
* Merge pull request #14667 from yuwata/boot-random-seed-modeLennart Poettering2020-01-281-2/+2
|\ | | | | boot: parse random-seed-mode
| * sd-boot: fix typoYu Watanabe2020-01-261-2/+2
| | | | | | | | Fixes #14657.
* | efi: fix build.Susant Sahani2020-01-271-1/+1
|/ | | | | | | | | | | | | | | | | | | | | ``` ninja -C build ninja: Entering directory `build' [29/101] Generating systemd_boot.so with a custom command. FAILED: src/boot/efi/systemd_boot.so /usr/bin/ld -o src/boot/efi/systemd_boot.so -T /usr/lib64/gnuefi/elf_x64_efi.lds -shared -Bsymbolic -nostdlib -znocombreloc -L /usr/lib64 /usr/lib64/gnuefi/crt0-efi-x64.o src/boot/efi/disk.c.o src/boot/efi/graphics.c.o src/boot/efi/measure.c.o src/boot/efi/pe.c.o src/boot/efi/util.c.o src/boot/efi/boot.c.o src/boot/efi/console.c.o src/boot/efi/crc32.c.o src/boot/efi/random-seed.c.o src/boot/efi/sha256.c.o src/boot/efi/shim.c.o -lefi -lgnuefi /usr/lib/gcc/x86_64-redhat-linux/10/libgcc.a /usr/bin/ld: src/boot/efi/graphics.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here /usr/bin/ld: src/boot/efi/pe.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here /usr/bin/ld: src/boot/efi/util.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here /usr/bin/ld: src/boot/efi/boot.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here /usr/bin/ld: src/boot/efi/console.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here /usr/bin/ld: src/boot/efi/random-seed.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here /usr/bin/ld: src/boot/efi/shim.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here [31/101] Generating stub.c.o with a custom command. ninja: build stopped: subcommand failed. make: *** [Makefile:2: all] Error 1 ```
* boot: fix osrel parserLennart Poettering2020-01-071-1/+1
| | | | | | let's check VERSION instead of VERSION_ID where appropriate. Fixes: #14493
* Merge pull request #14196 from keszybz/gpt-auto-generator-debuggingLennart Poettering2019-12-161-10/+16
|\ | | | | gpt-auto-generator debugging
| * bootlctl: show LoaderDevicePartUUID information in statusZbigniew Jędrzejewski-Szmek2019-11-301-10/+16
| |
* | Merge pull request #13953 from SpencerMichaels/systemd-boot-efistub-id-fixZbigniew Jędrzejewski-Szmek2019-12-041-16/+32
|\ \ | | | | | | boot: Fix default/oneshot selection for EFISTUB entries
| * | boot: Improve EFISTUB name and version detection.Spencer Michaels2019-11-181-8/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make two minor cosmetic changes to how config_entry_add_linux() extracts OS information from the embedded /etc/os-release in EFISTUB binaries. This increases the detail of information available to the user for EFISTUB entries. * entry->version, which was previously always null, is now set to the value of VERSION, or VERSION_ID, or BUILD_ID (preferred in that order). * entry->title, which was previously set to the value of PRETTY_NAME, can now fall back to NAME or ID if PRETTY_NAME is not present. In that case, NAME is preferred over ID.
| * | boot: Retain ".conf" suffix for loader config IDs.Spencer Michaels2019-11-181-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change config_entry_add_from_file() so that it does not remove the `.conf` ending from the filename that it uses for entry->id. This is necessary because otherwise an EFISTUB binary and a loader config entry might end up with the same ID, as the loader config IDs previously didn't include the config filename's .conf extension (see boot.c:1435). Consider, for instance, an EFISTUB /EFI/Linux/linux.efi and a loader config /loader/entries/linux.efi.conf; both would have the ID linux.efi. In addition, update a comment that previously stated that IDs are non-unique (which is no longer the case, as of this commit).
| * | boot: Ignore EFISTUB binaries starting with "auto-".Spencer Michaels2019-11-181-0/+2
| | | | | | | | | | | | | | | To further increase similarity with loader configs and provide global uniqueness, ignore filenames starting with auto- (see boot.c:1512).
| * | boot: Make EFISTUB IDs use binaries' filenames.Spencer Michaels2019-11-181-3/+2
| | | | | | | | | | | | | | | | | | Change config_entry_add_linux() so that Linux EFISTUB entries' ids are simply the binaries' filenames, as is already the case with loader configs. This guarantees that EFISTUB binaries' IDs are mutually unique.
* | | sd-boot: Add a 0.1 second delay before key-probing for showing menuLeonid Bloch2019-12-041-0/+6
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there is no boot menu timeout, pressing a key during boot should get the boot menu displayed. However, on some systems the keyboard is not initialized right away, which causes the menu to be inaccessible if no timeout is specified. To resolve this, if the error is "not ready" after the initial attempt of detection, wait for 0.1 second and retry. This solves the problem described above on all the tested systems. The reason for just a single retry, and not retrying while "not ready", is that some firmwares continue to return the "not ready" error on every probe attempt if no key is pressed. Signed-off-by: Leonid Bloch <lb.workbox@gmail.com>
* | bootctl: make 'random-seed' handle inability to write system token EFI ↵Lennart Poettering2019-11-211-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | variable gracefully Apparently some firmwares don't allow us to write this token, and refuse it with EINVAL. We should normally consider that a fatal error, but not really in the case of "bootctl random-seed" when called from the systemd-boot-system-token.service since it's called as "best effort" service after boot on various systems, and hence we shouldn't fail loudly. Similar, when we cannot find the ESP don't fail either, since there are systems (arch install ISOs) that carry a boot loader capable of the random seed logic but don't mount it after boot. Fixes: #13603
* | Rename "system-options" to "systemd-efi-options"Zbigniew Jędrzejewski-Szmek2019-11-181-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | bootctl: update --help textZbigniew Jędrzejewski-Szmek2019-11-181-1/+1
| |
* | tree-wide: clean up --help texts a bitLennart Poettering2019-11-183-16/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cleans up and unifies the outut of --help texts a bit: 1. Highlight the human friendly description string, not the command line via ANSI sequences. Previously both this description string and the brief command line summary was marked with the same ANSI highlight sequence, but given we auto-page to less and less does not honour multi-line highlights only the command line summary was affectively highlighted. Rationale: for highlighting the description instead of the command line: the command line summary is relatively boring, and mostly the same for out tools, the description on the other hand is pregnant, important and captions the whole thing and hence deserves highlighting. 2. Always suffix "Options" with ":" in the help text 3. Rename "Flags" → "Options" in one case 4. Move commands to the top in a few cases 5. add coloring to many more help pages 6. Unify on COMMAND instead of {COMMAND} in the command line summary. Some tools did it one way, others the other way. I am not sure what precisely {} is supposed to mean, that uppercasing doesn't, hence let's simplify and stick to the {}-less syntax And minor other tweaks.
* | boot: Add ARM64 support to the EFI stubDimitri John Ledkov2019-11-141-0/+2
| |
* | boot: Load LoadOptions cmdline, if none is available.Dimitri John Ledkov2019-11-141-2/+2
|/ | | | Fixes #13694
* bootctl: create leading dirs when "bootctl random-seed" is called if neededLennart Poettering2019-11-041-0/+8
| | | | Prompted by: #13603
* Merge pull request #13906 from yuwata/drop-missing-take2Zbigniew Jędrzejewski-Szmek2019-11-041-6/+0
|\ | | | | tree-wide: drop xxx.h when xxx-util.h is included
| * tree-wide: drop stdio.h when stdio-util.h is includedYu Watanabe2019-11-041-1/+0
| |
| * tree-wide: drop stat.h or statfs.h when stat-util.h is includedYu Watanabe2019-11-041-2/+0
| |
| * tree-wide: drop blkid.h when blkid-util.h is includedYu Watanabe2019-11-041-1/+0
| |
| * tree-wide: drop dirent.h when dirent-util.h is includedYu Watanabe2019-11-041-1/+0
| |