summaryrefslogtreecommitdiff
path: root/src/boot/bootctl.c
AgeCommit message (Collapse)Author
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-02-25Merge pull request #5449 from keszybz/blkd-error-handlingMartin Pitt
blkid error handling
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.
2016-12-16bootctl: fix typo (#4897)Lucas Werkmeister
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-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-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-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-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
2015-10-27util-lib: move more file I/O related calls into fileio.[ch]Lennart Poettering
2015-10-25util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering
There are more than enough to deserve their own .c file, hence move them over.
2015-10-24util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering
string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
2015-09-29util: introduce common version() implementation and use it everywhereLennart Poettering
This also allows us to drop build.h from a ton of files, hence do so. Since we touched the #includes of those files, let's order them properly according to CODING_STYLE.
2015-08-06bootctl: fix path in log messageKarel Zak
2015-07-29tree-wide: port everything over to fflush_and_check()Lennart Poettering
Some places invoked fflush() directly with their own manual error checking, let's unify all that by using fflush_and_check(). This also unifies the general error paths of fflush()+rename() file writers.
2015-07-25bootctl: add missing newlineKay Sievers
2015-07-15sd-boot: ignore missing /etc/machine-idDavid Herrmann
If /etc/machine-id is missing (eg., gold images), we should not fail installing sd-boot. This is a perfectly fine use-case and we should simply skip installing the default loader config in that case.
2015-07-04bootctl: fix sdboot to systemd-bootMiguel Bernal Marin
sdboot was renamed to systemd-boot Fixes: e7dd673d1e0a ("gummiboot/sd-boot/systemd-boot: rename galore") Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
2015-05-23bootctl: fix an error checkThomas Hindoe Paaboel Andersen
2015-05-22bootctl: ferror must be called before FILE is closedThomas Hindoe Paaboel Andersen
Otherwise it will not show any error stored
2015-05-19bootctl: try to catch all errorsZbigniew Jędrzejewski-Szmek
Do not print garbage on non-EFI installations.
2015-05-19bootctl: modernizationZbigniew Jędrzejewski-Szmek
Use strjoina to avoid error handling, and openat to simplify things. Some fixes on the way: - ferror does not set errno, so the return value was wrong in some cases - errors are propagated in more cases - EFI/systemd was created, but EFI/systemd-boot was deleted - something is always printed on error - when checking the version, comparison was done against "systemd-bo" for some reason - return value was converted from negative to EXIT_SUCCESS/EXIT_FAILURE twice, resulting in EXIT_SUCCESS all the time
2015-04-08remove duplicated includesRonny Chevalier
2015-04-06util: rework rm_rf() logicLennart Poettering
- Move to its own file rm-rf.c - Change parameters into a single flags parameter - Remove "honour sticky" logic, it's unused these days
2015-03-19bootctl: drop redundant parse_argv()David Herrmann
We already call parse_argv() from main(), don't call it here again.
2015-02-27bootctl: avoid NULL pointer dereferenceZbigniew Jędrzejewski-Szmek
2015-02-25bootctl: check that partition uuid is validThomas Hindoe Paaboel Andersen
It probably is but check anyway to make coverity happy. CID#1271354
2015-02-25bootctl: fix mem leaksThomas Hindoe Paaboel Andersen
CID#1271347/1271348
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.