summaryrefslogtreecommitdiff
path: root/src/boot
Commit message (Collapse)AuthorAgeFilesLines
* meson: print autodetected sbat fieldsZbigniew Jędrzejewski-Szmek2021-05-141-0/+1
| | | | | | | | ... Message: sbat-distro (from ID): fedora Message: sbat-distro-summary (from NAME): Fedora Message: sbat-distro-url (from BUG_REPORT_URL): https://bugzilla.redhat.com/ ...
* meson: call find_program() once and reuse the variable everywhereZbigniew Jędrzejewski-Szmek2021-05-141-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson 0.58 has gotten quite bad with emitting a message every time a quoted command is used: Program /home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh found: YES (/home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program xsltproc found: YES (/usr/bin/xsltproc) Configuring custom-entities.ent using configuration Message: Skipping bootctl.1 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping journal-remote.conf.5 because HAVE_MICROHTTPD is false Message: Skipping journal-upload.conf.5 because HAVE_MICROHTTPD is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping loader.conf.5 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) ... Let's suffer one message only for each command. Hopefully we can silence even this when https://github.com/mesonbuild/meson/issues/8642 is resolved.
* Merge pull request #19506 from xnox/ship-stub-elfZbigniew Jędrzejewski-Szmek2021-05-121-19/+22
|\ | | | | boot/efi: install ELF linux.elf.stub in addition to PE linux.efi.stub
| * meson: rework test-efi-disk.img creation to not require variablesZbigniew Jędrzejewski-Szmek2021-05-101-21/+20
| | | | | | | | | | The primary goal is to make the name of the custom_target() rule match the output file again. Having them different is confusing.
| * boot/efi: add --build-id=sha1 to ELF efi objectsDimitri John Ledkov2021-05-101-0/+1
| | | | | | | | As it is not nice to ship ELF binary without a note.gnu.build-id set.
| * boot/efi: install ELF linux.elf.stub in addition to PE linux.efi.stubDimitri John Ledkov2021-05-101-4/+7
| | | | | | | | | | | | | | | | Binutils for non-x86 architectures currently does not support PE binaries. Thus linux.efi.stub is useless on those, as one cannot use any tooling to add linux/cmdline/splash sections to it. In addition to PE linux.efi.stub also install ELF linux.elf.stub, such that one can use objcopy ELF target to copy in linux/cmdline/splash sections and then convert the result to a PE binary.
* | bootctl: same entry path check case-insensitivezsien2021-05-111-1/+5
|/ | | | | Some motherboards convert the path to uppercase under certain circumstances (e.g. after booting into the Boot Menu in the ASUS ROG STRIX B350-F GAMING).
* boot: add optional EFI SBAT supportDimitri John Ledkov2021-05-072-0/+44
| | | | | | | | | | Add SBAT support, when -Dsbat-distro value is specified. One can use -Dsbat-distro=auto for autodetection of all sbat options. Many meson configure options added to customize SBAT CSV values, but sensible defaults are auto detected by default. SBAT support is required if shim v15+ is used to load systemd-boot binary or kernel.efi (Type II BootLoaderSpec). Fixes #19247
* boot/efi: add ARM (THUMB) and RISCV64 machine typesDimitri John Ledkov2021-05-061-1/+5
| | | | Also drop defines from shared/pe-header.h, appear to be unused.
* Merge pull request #19507 from nabijaczleweli/bootctlpsko-liteYu Watanabe2021-05-061-11/+105
|\ | | | | bootctl: take --make-machine-id-directory=yes|no|auto and make/remove \$MACHINE_ID accordingly
| * bootctl: take --make-machine-id-directory=yes|no|auto and make/remove ↵наб2021-05-051-11/+105
| | | | | | | | | | | | | | | | \$MACHINE_ID accordingly auto resolves to yes if /etc/machine-id resides on non-tmpfs This effectively reverts commit 31e57550b552e113bd3d44355b237c41e42beb58
* | meson: make one check shorterZbigniew Jędrzejewski-Szmek2021-05-041-1/+1
|/
* boot/efi: compile on riscv64Emil Renner Berthing2021-04-221-3/+3
| | | | | This makes systemd-boot compile against the latest gnu-efi which just added support for riscv64.
* src: shellcheck-ify shell scriptsFrantisek Sumsal2021-04-201-2/+3
|
* tree-wide: avoid uninitialized warning on _cleanup_ variablesLuca Boccassi2021-04-145-7/+7
| | | | | | | With some versions of the compiler, the _cleanup_ attr makes it think the variable might be freed/closed when uninitialized, even though it cannot happen. The added cost is small enough to be worth the benefit, and optimized builds will help reduce it even further.
* meson: fix warning about comparison between different typesYu Watanabe2021-03-221-7/+5
| | | | Follow-up for e39288193fcdf3a36dbc49b78e6c9bf86a764e31.
* systemd-boot: LLVM/lld does not support PE/COFF relocations. Bail out with ↵tpgxyz2021-03-191-1/+8
| | | | an error message
* boot: Move console declarations to missing_efi.hDaan De Meyer2021-03-133-61/+69
| | | | | | These were added to eficonex.h in gnu-efi 3.0.13. Let's move them to missing_efi.h behind an appropriate guard to fix the build with recent versions of gnu-efi.
* efi: introduce UINT32_MAX and UINT64_MAXYu Watanabe2021-03-052-24/+30
|
* tree-wide: use UINT64_MAX or friendsYu Watanabe2021-03-051-1/+1
|
* util: add helpers for generating colored check mark glyphs from boolsLennart Poettering2021-03-031-2/+2
|
* efi stub: accept it if our loaded image has no FilePath field setLennart Poettering2021-02-231-2/+8
| | | | | | | | | | | The firmware spec doesn't really say whether FilePath of the LoadedImage protocol may be NULL or not. So far we assumed it to be non-NULL, but apparently the FreeBSD UEFI chainloader sets it to NULL. Handle this gracefully. (Noticed and tracked down by Alexander Schreiber) Fixes: #18733
* bootctl: show whether the firmware has TPM2 supportLennart Poettering2021-02-111-0/+1
|
* tree-wide: use -EINVAL for enum invalid valuesZbigniew Jędrzejewski-Szmek2021-02-101-1/+2
| | | | | | | | | 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.
* tree-wide: replace strverscmp() and str_verscmp() with strverscmp_improved()Yu Watanabe2021-02-092-59/+2
|
* fundamental: move several macros and functions into src/fundamental/Yu Watanabe2021-02-095-96/+11
| | | | | | | | | | sd-boot has a copy of a subset of codes from libbasic. This makes sd-boot share the code with libbasic, and dedup the code. Note, startswith_no_case() is dropped from sd-boot, as - it is not used, - the previous implementation is not correct, - gnu-efi does not have StrniCmp() or so.
* boot: Replace efivar_set() persistent argument with flags argumentDaan De Meyer2021-02-045-45/+47
| | | | | | To add secure-boot enrolling support, we need to be able to specify the EFI_VARIABLE_APPEND_WRITE flag so let's make the efivar_set() methods more generic so we can set that flag.
* boot: Add startswith() and endswith() functions with no_case variantsDaan De Meyer2021-02-023-12/+66
| | | | Adapted from string-util
* boot: Drop unnecessary bracesDaan De Meyer2021-02-021-2/+1
|
* boot: Fix void pointer arithmetic warningDaan De Meyer2021-02-021-1/+1
|
* boot: Replace raw efivar gets with typed variantsDaan De Meyer2021-02-021-21/+15
|
* boot: Add efivar_get/set_uint64_le() functionsDaan De Meyer2021-02-022-0/+65
| | | | | | These are implemented as bit-shifting functions that allow reading and writing UEFI variables stored as little endian 64-bit unsigned values.
* boot: Rename efivar_get/set_int() to efivar_get/set_uint_string()Daan De Meyer2021-02-023-9/+9
| | | | | Let's clearly indicate that these are used to set/get uints that are stored as strings.
* boot: Tighten scope of variables used in loopsDaan De Meyer2021-02-029-101/+70
|
* boot: Add efivar_get_boolean_u8()Daan De Meyer2021-02-023-5/+17
|
* boot: Make all efivar util functions take the guid as an argumentDaan De Meyer2021-01-314-44/+50
| | | | | | | Let's make these functions a little more generic so we can have them work on more than one GUID. More specifically, this allows using them with the global guid which will be used a bit more to extend the secure boot support.
* boot: Turn all guid constants into C99 compound initializersDaan De Meyer2021-01-3110-60/+56
| | | | | Avoids having to use the address operator all the time and avoids having to cast or do other unintuitive stuff.
* boot: Enable C99Daan De Meyer2021-01-311-2/+2
| | | | | | | | | Instead of using -nostdinc, we use -nostdlib. This is necessary to allow moving to C99 as efibind.h includes stdint.h when C99 is enabled. It isn't necessarily problematic to use some standard library headers as long as they don't contain functions defined in libc or another system library (or in other words, header only headers are fine to use in sd-boot).
* boot: Move Secure Boot logic to new fileDaan De Meyer2021-01-318-27/+30
|
* sd-boot: Add missing includesDaan De Meyer2021-01-318-0/+15
| | | | | Let's make all headers self-sufficient by including the necessary EFI headers in the headers themselves.
* sd-boot: Make internal functions staticDaan De Meyer2021-01-313-4/+4
|
* tree-wide: Drop custom formatting for print() help messagesDaan De Meyer2021-01-313-18/+17
| | | | | | | | | | | | I think this formatting was originally used because it simplified adding new options to the help messages. However, these days, most tools their help message end with "\nSee the %s for details.\n" so the final line almost never has to be edited which eliminates the benefit of the custom formatting used for printf() help messages. Let's make things more consistent and use the same formatting for printf() help messages that we use everywhere else. Prompted by https://github.com/systemd/systemd/pull/18355#discussion_r567241580
* tree-wide: add spdx header on all scripts and helpersZbigniew Jędrzejewski-Szmek2021-01-281-0/+1
| | | | | | Even though many of those scripts are very simple, it is easier to include the header than to try to say whether each of those files is trivial enough not to require one.
* boot: at least one of os_name_pretty or os_name exists in this blockYu Watanabe2021-01-121-2/+2
| | | | Closes CID#1438933.
* A typo fix in bootctl.c (#18106)Endre Szabo2020-12-301-1/+1
|
* efi: Only use arm flags if supportedAndrew Balmos2020-12-151-1/+7
| | | | Support gcc 8 on arm
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-0931-31/+31
|
* headers: use custom LicenseRef- spdx tag for various "public domain" filesZbigniew Jędrzejewski-Szmek2020-10-292-1/+2
| | | | | | | | There is no spdx tag defined for those versions of "public domain", but we can add a custom tag, see https://spdx.github.io/spdx-spec/6-other-licensing-information-detected/. crc32.h is updated to match crc32.c.
* headers: add spdx tags to imported files with a known licenseZbigniew Jędrzejewski-Szmek2020-10-291-0/+2
| | | | | | | | | | | | | | | I added the header in the cases where the license text is present and it is easy to find the appropriate SPDX header. For "public domain" stuff: SDPX treats each "public domain" license as unique [1], but luckily the one in siphash24.c is one of the identified variants. There are some other cases which specify "public domain" but there doesn't seem to be a SPDX identifier. [1] https://wiki.spdx.org/view/Legal_Team/Decisions/Dealing_with_Public_Domain_within_SPDX_Files gunicode.[ch] are imported from glib, which is licensed as LGPL2.1+, see https://gitlab.gnome.org/GNOME/glib/-/blob/master/glib/gunicode.h.
* tree-wide: use the usual SPDX header for our own filesZbigniew Jędrzejewski-Szmek2020-10-291-0/+2
|