summaryrefslogtreecommitdiffstats
path: root/src/shared/bootspec.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: use -EINVAL for enum invalid valuesZbigniew Jędrzejewski-Szmek2021-02-101-1/+1
| | | | | | | | | As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617. This does not touch anything exposed in src/systemd. Changing the defines there would be a compatibility break. Note that tests are broken after this commit. They will be fixed in the next one.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* efi: cache LoaderEntries EFI variableLennart Poettering2020-05-291-7/+1
| | | | | | Based-on: https://github.com/systemd/systemd/issues/14828#issuecomment-634202054
* bootspec: parse random-seed-mode line in loader.confYu Watanabe2020-01-261-0/+1
| | | | Fixes #14657.
* boot: Deduplicate old-style loader entries.Spencer Michaels2019-11-221-2/+6
| | | | | | | | | | | In cases where systemd (and thus bootctl) is updated to a version including the earlier unique-ID fix, but the corresponding new version of systemd-boot is not installed to the ESP and run at least once, the bootloader will report old-style entry IDs cached in the LoaderEntries EFI variable, while bootctl will report new-style IDs for the same entries, producing duplicate entries. This commit makes bootctl compute and retain old-style IDs for non-auto entries so that it can properly deduplicate entries even if the cache contains old-style IDs.
* bootspec: fix build when EFI support is disabledYu Watanabe2019-04-171-0/+6
| | | | Follow-up for ce4c4f810876b2d6e50041c8bbe089e8a9e2576e.
* bootspec: remove now-unused boot_entry_type_tableZbigniew Jędrzejewski-Szmek2019-04-051-3/+0
|
* bootspec: get rid of find_default_boot_entry() entirelyLennart Poettering2019-03-051-2/+7
| | | | | | Now only two operations are left. Let's just move this into the caller, since it should make things simpler, clearer and shorter, in particular as there's only a single user for this.
* bootspec: introduce new helper boot_entries_load_config_auto()Lennart Poettering2019-03-051-0/+1
| | | | | | | | It's a simple wrapper around boot_entries_load_config(), but determines the ESP/XBOOTLDR paths automatically at first. Also, it looks for a path /run/boot-loader-entries/ and loads the entries from there if it exists. This is supposed to be a hook for other boot loaders to make our tools aware of their own entries.
* bootspec: move augmentation of loader-discovered entries into bootspec.cLennart Poettering2019-03-051-0/+25
| | | | | | | | | Previously, bootctl would show boot loader entries discovered by the boot loader which couldn't found locally separately in the output. Let's move this code into bootspec.c, and beef it up a bit. This way we can use it later on for logind, and correctly show automatically discovered windows/macos entries too.
* bootspec: simplify find_default_boot_entry()Lennart Poettering2019-03-051-1/+1
| | | | | If the only caller passes NULL for the two paths, let's remove the parameter altogether.
* bootspec: load entries from both the ESP and XBOOTLDR partitionsLennart Poettering2019-03-011-2/+2
| | | | Let's simply search in both.
* bootspec: store 'root' field in each bootspec entry we loadLennart Poettering2019-03-011-2/+3
| | | | | | | | | | This 'root' field contains the root path of the partition we found the snippet in. The 'kernel', 'initrd', 'efi', … fields are relative to this path. This becomes particularly useful later when we add support for loading snippets from both the ESP and XBOOTLDR, but already simplifies the code for us a bit in systemctl.
* bootspec: add internal APIs to discover the XBOOTLDR partitionLennart Poettering2019-03-011-0/+1
|
* bootspec: reduce number of functions we exportLennart Poettering2018-10-081-5/+0
| | | | Let's internalize these four calls as noone else calls them.
* shared/bootspec: remember the full path to boot entry and use it in loggingZbigniew Jędrzejewski-Szmek2018-10-081-1/+2
| | | | | It's much easier to understand what is going on when the full path is logged.
* Move logic to find default sd-boot entry from systemctl to sharedZbigniew Jędrzejewski-Szmek2018-10-081-0/+2
| | | | In preparation for use in other places. No functional change.
* bootspec: rename "filename" field to "id"Lennart Poettering2018-09-271-3/+2
| | | | | | | This follows the renaming done a few commits earlier too systemd-boot itself. Also, let's show the ID, since it's useful.
* bootspec: fix include linesLennart Poettering2018-09-271-1/+5
| | | | List all files we use definitions from.
* Fix SPDX license tagsZbigniew Jędrzejewski-Szmek2018-06-141-1/+1
|
* Drop my copyright headersZbigniew Jędrzejewski-Szmek2018-06-141-3/+1
| | | | | | | perl -i -0pe 's/\s*Copyright © .... Zbigniew Jędrzejewski.*?\n/\n/gms' man/*xml git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/(#\n)?# +Copyright © [0-9, -]+ Zbigniew Jędrzejewski.*?\n//gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s*\/\*\*\*\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*?\s*\*\*\*\/\s*/\n\n/gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*//gms'
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-141-1/+1
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* Merge pull request #8086 from hdante/sdboot-setmode-v2Zbigniew Jędrzejewski-Szmek2018-03-071-0/+1
|\
| * bootctl: synchronize bootctl code with sd-boot codeHenrique Dante de Almeida2018-02-031-0/+1
| | | | | | | | | | This patch adds a line with "#console-mode keep" as a documentation for the console mode feature and duplicates console-mode parsing to bootctl.
* | systemd-boot: Make automatic entries configurableJan Janssen2018-01-281-0/+2
|/ | | | | | | | | | | | | | | | Hiding automatic entries allows for giving custom entry names like "Windows 10" instead of "Windows Boot Manager" by creating an appropriate loader file in the loader/entries folder. Note that it is already doable by renaming bootmgfw.efi (or the other auto-detected boot loaders) and then using the renamed file for a custom entry. But windows will automatically recreate the boot loader on updates, including the default EFI bootloader entry if that one is missing. Make hiding EFI reboot a separate option because there is no simple way to create it with a custom loader entry and people may still want that around while still hiding the other auto entries. Also, turn no_editor into a positive boolean name while we're touching this code.
* efi: rework find_esp() error propagation/logging a bitLennart Poettering2017-12-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This renames find_esp() to find_esp_and_warn() and tries to normalize its behaviour: 1. Change the error that is returned when we can't find the ESP to ENOKEY (from ENOENT). This way the error code can only mean one thing: that our search loop didn't find a good candidate. 2. Really log about all errors, except for ENOKEY and EACCES, and document the letter cases. 3. Normalize parameters to the call: separate out the path parameter in two: an input path and an output path. That way the memory management is clear: we will access the input parameter only for reading, and only write out the output parameter, using malloc() memory. Before the calling convention were quire surprising for internal API code, as the path parameter had to be malloc() memory and might and might not have changed. 4. Rename bootctl's find_esp_warn() to acquire_esp(), and make it a simple wrapper around find_esp_warn(), that basically just adds the friendly logging for the ENOKEY case. This rework removes double logging in a number of error cases, as we no longer log here in anything but ENOKEY, and leave that entirely to find_esp_warn(). 5. find_esp_and_warn() now takes a bool flag parameter "unprivileged_mode", which disables logging in the EACCES case, and skips privileged validation of the path. This makes the function less magic, and doesn't hide this internal silencing automatism from the caller anymore. With all that in place "bootctl list" and "bootctl status" work properly (or as good as they can) when I invoke the tools whithout privileges on my system where /boot is not world-readable
* bootspec: make boot_entries_select_default() staticYu Watanabe2017-12-071-1/+0
| | | | | The function is used only in bootspec.c. So, let's make the function static.
* bootctl: move find_esp() to sharedZbigniew Jędrzejewski-Szmek2017-11-071-0/+3
| | | | | | | In preparation for use in systemctl. The original function that prints hints is renamed to find_esp_and_warn() to make its purpose clearer.
* bootctl: show unique titlesZbigniew Jędrzejewski-Szmek2017-11-071-0/+5
|
* bootctl: add listing of loader entriesZbigniew Jędrzejewski-Szmek2017-11-071-0/+58