summaryrefslogtreecommitdiff
path: root/src/boot
AgeCommit message (Collapse)Author
2017-04-25meson: also indent scripts with 8 spacesZbigniew Jędrzejewski-Szmek
2017-04-24meson: define gnu_efi_arch for the arch efi name, fix ldsdir detectionZbigniew Jędrzejewski-Szmek
This fixes ldsdir detection under Debian. v2: - define gnu_efi_arch for the arch efi include directory name In the autotools naming convention, efi_arch and this directory always had the same name. But meson.cpu_family() uses a slightly different convention, so those two don't always match.
2017-04-23meson: use "sh -eu" and make .sh +x, .py -xZbigniew Jędrzejewski-Szmek
Shell scripts should be executable so that meson reports their invocation succinctly (does not print 'sh' '-e'). Python scripts should not be executable so that meson does the detection of the right python binary itself. Add -u everywhere to catch potential errors.
2017-04-23meson: reindent all files with 8 spacesZbigniew Jędrzejewski-Szmek
The indentation for emacs'es meson-mode is added .dir-locals. All files are reindented automatically, using the lasest meson-mode from git. Indentation should now be fairly consistent.
2017-04-23meson: use efi-includedir to look for headerZbigniew Jędrzejewski-Szmek
This change mirrors cba49f2deab481045408d5452ac8c84fc03bccd5.
2017-04-23test-efi-create-disk.sh: allow running from separate build dir, hook up to mesonZbigniew Jędrzejewski-Szmek
This allow test-efi-disk.img to be created under meson. The invocation of qemu is not converted yet, in particular because the command-line used in Makefile.am is outdated.
2017-04-23meson: replace yes/no/auto with true/false/autoZbigniew Jędrzejewski-Szmek
This doesn't feel as natural, but is more consistent with the boolean options which require true/false, and allows setting of options without knowing of which type the option is.
2017-04-23meson: use join_paths consistentlyMichael Biebl
With -Dsplit-usr=true, we set rootprefix to /. This leads to //lib/systemd or //lib/udev for various dir variables. Using join_paths() avoids this.
2017-04-23meson: add support for building efi modulesZbigniew Jędrzejewski-Szmek
This is a very straightforward conversion of the rules in Makefile.am. Generated objects (on arm64) are identical. The only difference in executed commands is that automake uses ld -m elf_x86_64, without us specifying the -m option anywhere. I suspect that using the default for the given linker should be OK, so it's fine to just skip it.
2017-04-17Merge pull request #5708 from vcatechnology/arm-cross-compileLennart Poettering
ARM32 cross-compile fixes
2017-04-06build-sys: correct blkid.h includesMatt Clarkson
When using pkg-config to determine the include flags for blkid the flags are returned as: $ pkg-config blkid --cflags -I/usr/include/blkid -I/usr/include/uuid We use the <blkid/blkid.h> include which would be correct when using the default compiler /usr/include header search path. However, when cross-compiling the blkid.h will not be installed at /usr/include and highly likely in a temporary system root. It is futher compounded if the cross-compile packages are split up and the blkid package is not available in the same sysroot as the compiler. Regardless of the compilation setup, the correct include path should be <blkid.h> if using the pkg-config returned CFLAGS.
2017-04-04tree-wide: standardize on $(PACKAGE_VERSION) for the version stringZbigniew Jędrzejewski-Szmek
We defined both $(VERSION) and $(PACKAGE_VERSION) with the same contents. $(PACKAGE_VERSION) is slightly more descriptive, so settle on that, and drop the other define.
2017-02-27sd-boot: stub: check LoadOptions contains data (#5467)Mikko Ylinen
With some UEFI shells LoadOptionsSize is reported being > 0 but the corresponding LoadOptions does not contain any data (the first element has value 0). When that happens, the stub feature that allows .cmdline to be replaced by what's in LoadOptions ends up copying nothing/random data to the kernel cmdline resulting in different kinds of boot problems. To fix this, add a check to see if LoadOptions contains data before replacing the .cmdline. Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com>
2017-02-25Merge pull request #5449 from keszybz/blkd-error-handlingMartin Pitt
blkid error handling
2017-02-24Fix missing space in comments (#5439)AsciiWolf
2017-02-21tree-wide: simplify handling of blkid errorsZbigniew Jędrzejewski-Szmek
2017-02-21bootctl: create loader.conf only if it doesn't exist yetLennart Poettering
If the snippet aleady exists, don't do anything, as the file was already installed then. (This also reworks the code to create the file atomically) Fixes: #5396
2017-02-21bootctl: rework file copy routines to reuse copy_bytes() from copy.cLennart Poettering
Also, make sure to reuse temporary file handling used elsewhere.
2017-01-31boot: fix two typosZbigniew Jędrzejewski-Szmek
2016-12-16bootctl: fix typo (#4897)Lucas Werkmeister
2016-12-01Update boot.c (#4780)Yassine Imounachen
2016-10-19bootctl: don't try to remove esp_path (#4407)Evgeny Vereshchagin
This is a follow-up for 9ee051b9c7623
2016-10-19boot: fix `bootctl install` segfault (#4404)Yu Watanabe
2016-10-09sd-boot: trigger to record further logs to tcg 2.0 final event log area (#4302)Lans Zhang
According to TCG EFI Protocol Specification for TPM 2.0 family, all events generated after the invocation of EFI_TCG2_GET_EVENT_LOG shall be stored in an instance of an EFI_CONFIGURATION_TABLE aka EFI TCG 2.0 final events table. Hence, it is necessary to trigger the internal switch through calling get_event_log() in order to allow to retrieve the logs from OS runtime. msekletar: > I've looked at EDK2 and indeed log entry is added to FinalEventsTable only after > EFI_TCG2_PROTOCOL.GetEventLog was called[1][2]. Also, same patch was currently > merged to shim by Peter Jones [3]. [1] https://github.com/tianocore/edk2/blob/master/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c#L698 [2] https://github.com/tianocore/edk2/blob/master/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c#L824 [3] rhinstaller/shim#64
2016-08-30bootctl: properly skip duplicate entries (#4048)Mantas Mikulėnas
'continue' is a fancy no-op here – it only skips through the inner loop, not the outer one, so entries already in BootOrder get printed twice. This partially reverts f939cff71577 "bootctl: various coding style updates".
2016-07-31Add enable_disable() helperZbigniew Jędrzejewski-Szmek
In this patch "enabled" and "disabled" is used exclusively, but "enable" and "disable" forms are need for the following patch.
2016-07-25Merge pull request #3757 from poettering/efi-searchZbigniew Jędrzejewski-Szmek
2016-07-22tree-wide: use sd_id128_is_null() instead of sd_id128_equal where appropriateLennart Poettering
It's a bit easier to read because shorter. Also, most likely a tiny bit faster.
2016-07-21bootctl: modernize install_loader_config()Lennart Poettering
let's the proper APIs to read the machine ID, and properly check for all errors.
2016-07-21bootctl: various coding style updatesLennart Poettering
2016-07-21bootctl: clean up get_file_version()Lennart Poettering
Make sure that we always initialize the return parameter on success, and that all errors result in an error message, not just some.
2016-07-21bootctl: use F_TYPE_EQUAL() to compare statfs' .f_type fieldLennart Poettering
After all, the field is kinda borked.
2016-07-21bootctl: move toupper() implementation to string-util.hLennart Poettering
We already have tolower() calls there, hence let's unify this at one place. Also, update the code to only use ASCII operations, so that we don't end up being locale dependant.
2016-07-21bootctl: make use of STRV_FOREACH() where we canLennart Poettering
2016-07-21bootctl: rework to use common verbs parsing, and add searching of ESP pathLennart Poettering
This rearranges bootctl a bit, so that it uses the usual verbs parsing routines, and automatically searches the ESP in /boot, /efi or /boot/efi, thus increasing compatibility with mainstream distros that insist on /boot/efi. This also adds minimal support for running bootctl in a container environment: when run inside a container verification of the ESP via raw block device access, trusting the container manager to mount the ESP correctly. Moreover, EFI variables are not accessed when running in the container.
2016-07-21bootctl: fix error message checkLennart Poettering
2016-07-21bootctl: minor coding style improvementsLennart Poettering
2016-07-21bootctl: Always use upper case for "/EFI/BOOT" and "/EFI/BOOT/BOOT*.EFI".Alexander Kurtz
If the ESP is not mounted with "iocharset=ascii", but with "iocharset=utf8" (which is for example the default in Debian), the file system becomes case sensitive. This means that a file created as "FooBarBaz" cannot be accessed as "foobarbaz" since those are then considered different files. Moreover, a file created as "FooBar" can then also not be accessed as "foobar", and it also prevents such a file from being created, as both would use the same 8.3 short name "FOOBAR". Even though the UEFI specification [0] does give the canonical spelling for the files mentioned above, not all implementations completely conform to that, so it's possible that those files would already exist, but with a different spelling, causing subtle bugs when scanning or modifying the ESP. While the proper fix would of course be that everybody conformed to the standard, we can work around this problem by just referencing the files by their 8.3 short names, i.e. using upper case. Fixes: #3740 [0] <http://www.uefi.org/specifications>, version 2.6, section 3.5.1.1
2016-07-21bootctl: Use lower case string constants in case-insensitive comparisons.Alexander Kurtz
2016-07-18sd-boot: Fix waiting for keyboard input (#3735)Jan Janssen
WaitForKeyEx may never return on some UEFI systems depending on firmware, hardware configuration and the phase of the moon. Use ConIn->WaitForKey unconditionally instead. Fixes #3632
2016-07-12Various fixes for typos found by lintian (#3705)Michael Biebl
2016-05-09tree-wide: rename draw_special_char to special_glyphZbigniew Jędrzejewski-Szmek
That function doesn't draw anything on it's own, just returns a string, which sometimes is more than one character. Also remove "DRAW_" prefix from character names, TREE_* and ARROW and BLACK_CIRCLE are unambigous on their own, don't draw anything, and are always used as an argument to special_glyph(). Rename "DASH" to "MDASH", as there's more than one type of dash.
2016-02-23tree-wide: minor formatting inconsistency cleanupsVito Caputo
2016-02-11sd-boot: put hashed kernel command line in a PCR of the TPMHarald Hoyer
The UEFI BIOS already hashes the contents of the loaded image, so the initrd and the command line of the binary are recorded. Because manually added LoadOptions are not taken into account, these should be recorded also. This patch logs and extends a TPM PCR register with the LoadOptions. This feature can be enabled with configure --enable-tpm The PCR register index can be specified with configure --with-tpm-pcrindex=<NUM>
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2016-01-31bootctl: replace readdir() loops with FOREACH_DIRENTMichal Sekletar
2016-01-20bootctl: use DRAW_TREE_RIGHT rather than hard-coded UTF-8 characterDaniel Mack
Fixes #2384
2015-11-16tree-wide: sort includesThomas Hindoe Paaboel Andersen
Sort the includes accoding to the new coding style.
2015-10-27util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering
2015-10-27util-lib: move more locale-related calls to locale-util.[ch]Lennart Poettering