summaryrefslogtreecommitdiff
path: root/src/gpt-auto-generator
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: stop using canonicalize_file_name(), use chase_symlinks() insteadLennart Poettering2016-12-011-1/+1
| | | | | | | | Let's use chase_symlinks() everywhere, and stop using GNU canonicalize_file_name() everywhere. For most cases this should not change behaviour, however increase exposure of our function to get better tested. Most importantly in a few cases (most notably nspawn) it can take the correct root directory into account when chasing symlinks.
* tree-wide: add PRI_[NU]SEC, and use time format strings moreZbigniew Jędrzejewski-Szmek2016-11-071-2/+2
|
* tree-wide: drop NULL sentinel from strjoinZbigniew Jędrzejewski-Szmek2016-10-231-12/+12
| | | | | | | | | | | | | This makes strjoin and strjoina more similar and avoids the useless final argument. spatch -I . -I ./src -I ./src/basic -I ./src/basic -I ./src/shared -I ./src/shared -I ./src/network -I ./src/locale -I ./src/login -I ./src/journal -I ./src/journal -I ./src/timedate -I ./src/timesync -I ./src/nspawn -I ./src/resolve -I ./src/resolve -I ./src/systemd -I ./src/core -I ./src/core -I ./src/libudev -I ./src/udev -I ./src/udev/net -I ./src/udev -I ./src/libsystemd/sd-bus -I ./src/libsystemd/sd-event -I ./src/libsystemd/sd-login -I ./src/libsystemd/sd-netlink -I ./src/libsystemd/sd-network -I ./src/libsystemd/sd-hwdb -I ./src/libsystemd/sd-device -I ./src/libsystemd/sd-id128 -I ./src/libsystemd-network --sp-file coccinelle/strjoin.cocci --in-place $(git ls-files src/*.c) git grep -e '\bstrjoin\b.*NULL' -l|xargs sed -i -r 's/strjoin\((.*), NULL\)/strjoin(\1)/' This might have missed a few cases (spatch has a really hard time dealing with _cleanup_ macros), but that's no big issue, they can always be fixed later.
* tree-wide: make parse_proc_cmdline() strip "rd." prefix automaticallyZbigniew Jędrzejewski-Szmek2016-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This stripping is contolled by a new boolean parameter. When the parameter is true, it means that the caller does not care about the distinction between initrd and real root, and wants to act on both rd-dot-prefixed and unprefixed parameters in the initramfs, and only on the unprefixed parameters in real root. If the parameter is false, behaviour is the same as before. Changes by caller: log.c (systemd.log_*): changed to accept rd-dot-prefix params pid1: no change, custom logic cryptsetup-generator: no change, still accepts rd-dot-prefix params debug-generator: no change, does not accept rd-dot-prefix params fsck: changed to accept rd-dot-prefix params fstab-generator: no change, custom logic gpt-auto-generator: no change, custom logic hibernate-resume-generator: no change, does not accept rd-dot-prefix params journald: changed to accept rd-dot-prefix params modules-load: no change, still accepts rd-dot-prefix params quote-check: no change, does not accept rd-dot-prefix params udevd: no change, still accepts rd-dot-prefix params I added support for "rd." params in the three cases where I think it's useful: logging, fsck options, journald forwarding options.
* tree-wide: allow state to be passed through to parse_proc_cmdline_itemZbigniew Jędrzejewski-Szmek2016-10-221-2/+2
| | | | No functional change.
* Merge pull request #3757 from poettering/efi-searchZbigniew Jędrzejewski-Szmek2016-07-251-65/+67
|\
| * gpt-generator: relax EFI check a bitLennart Poettering2016-07-211-54/+53
| | | | | | | | | | | | | | | | Previously, we'd not mount the ESP except on EFI boots, and only when the ESP used for booting matches the ESP we found. With this change on non-EFI boots we'll mount a discovered ESP anyway, and on EFI boots we'll only mount it if it matches the ESP we booted from.
| * gpt-generator: use /efi as mount point for the ESP if it existsLennart Poettering2016-07-211-19/+22
| | | | | | | | | | | | | | Let's make the EFI generator a bit smarter: if /efi exists it is used as mount point for the ESP, otherwise /boot is used. This should increase compatibility with distros which use legacy boot loaders that insist on having /boot as something that isn't the ESP.
* | Use "return log_error_errno" in more places"Zbigniew Jędrzejewski-Szmek2016-07-221-4/+2
|/
* Create initrd-root-device.target synchronization point (#3239)Daniel Drake2016-05-121-0/+6
| | | | | | | | | Add a synchronization point so that custom initramfs units can run after the root device becomes available, before it is fsck'd and mounted. This is useful for custom initramfs units that may modify the root disk partition table, where the root device is not known in advance (it's dynamically selected by the generators).
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* gpt-auto: handle errors from blkid more correctlyLennart Poettering2016-02-031-2/+3
| | | | | | Let's make sure we don't choke if blkid_probe_lookup_value() returns a NULL string. Also, make sur we propagate the correct error when blkid_probe_lookup_value() fails.
* gpt-auto: don't log an EIO error if blkid finds something which is not a ↵Lennart Poettering2016-02-011-4/+7
| | | | | | partition table Fixes: #2483
* tree-wide: group include of libudev.h with sd-*Thomas Hindoe Paaboel Andersen2015-11-171-1/+1
|
* tree-wide: sort includesThomas Hindoe Paaboel Andersen2015-11-161-3/+3
| | | | Sort the includes accoding to the new coding style.
* treewide: apply errno.cocciMichal Schmidt2015-11-091-4/+2
| | | | with small manual cleanups for style.
* util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: move /proc/cmdline parsing code to proc-cmdline.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split stat()/statfs()/stavfs() related calls into stat-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: introduce dirent-util.[ch] for directory entry callsLennart Poettering2015-10-271-0/+1
| | | | Also, move a couple of more path-related functions to path-util.c.
* util-lib: move mount related utility calls to mount-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering2015-10-251-0/+1
| | | | | There are more than enough to deserve their own .c file, hence move them over.
* util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering2015-10-241-12/+14
| | | | | | | | | | | | | | 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.
* gpt-auto-generator: fix duplicate backing partition checkLennart Poettering2015-10-061-1/+0
| | | | | We shouldn't exit the loop early, otherwise our duplicate backing partition check won't work.
* gpt-auto-generator: check fstab for /boot entriesKay Sievers2015-09-301-0/+7
| | | | | | | We need to prevent the creation of the gpt automount unit, which will not get overridden by the fstab mount unit. https://github.com/systemd/systemd/issues/1378
* gpt-auto: fix ESP options and descriptionMarius Thesing2015-09-081-2/+2
| | | | | | | | | Since 59512f21 the parameters were passed in the wrong order, causing the options to be interpreted as the description. Also, while "false" was supposed to be passed for "rw", the ESP should actually be mounted read-write. It just happened to be "true" since the description char* was passed for "rw".
* basic: rework virtualization detection APILennart Poettering2015-09-071-2/+2
| | | | | | Introduce a proper enum, and don't pass around string ids anymore. This simplifies things quite a bit, and makes virtualization detection more similar to architecture detection.
* gpt-auto: minor simplificatin handling the no-auto GPT flagLennart Poettering2015-09-071-6/+7
| | | | | Let's query the flags only once, and document why we ignore it for the ESP.
* gpt-auto: try to handle LUKS root partitions betterLennart Poettering2015-09-071-2/+77
| | | | | | | | | If the root file system is located on an encrypted root disk, we'll not find the GPT partition table for it. Let's fix that by following the slaves/ symlinks in /sys for the device. We only handle devices having exactly one backing device. Also see: #1167
* gpt-auto-generator: warn on ambiguous blkid probeTom Gundersen2015-08-111-2/+5
|
* gpt-auto-generator: don't warn on !ENABLE_EFITom Gundersen2015-08-111-78/+80
| | | | | add_automount() was only used on EFI systems, compile it conditionally to avoid the warning.
* gpt-auto-generator: apply partition-type flags only to specific partition-typesKay Sievers2015-08-111-8/+15
| | | | | | | | The partition-type flags are defined independently for every partition-type. Apply them only to the types where they are defined, and not to the ESP, which does not appear to share the same set of flags. https://github.com/systemd/systemd/issues/920
* gpt-auto-generator: remove unused variableThomas Hindoe Paaboel Andersen2015-08-041-1/+1
|
* tree-wide: use free_and_strdup()Daniel Mack2015-07-301-9/+6
| | | | | Use free_and_strdup() where appropriate and replace equivalent, open-coded versions.
* tree-wide: port everything over to fflush_and_check()Lennart Poettering2015-07-291-12/+12
| | | | | | | | 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.
* gpt-auto-generator: merge efi-boot-generatorKay Sievers2015-07-291-50/+268
|
* fileio: consolidate write_string_file*()Daniel Mack2015-07-061-1/+2
| | | | | | | Merge write_string_file(), write_string_file_no_create() and write_string_file_atomic() into write_string_file() and provide a flags mask that allows combinations of atomic writing, newline appending and automatic file creation. Change all users accordingly.
* path-util: Change path_is_mount_point() symlink arg from bool to flagsMartin Pitt2015-05-291-1/+1
| | | | | This makes path_is_mount_point() consistent with fd_is_mount_point() wrt. flags.
* core: rework unit name validation and manipulation logicLennart Poettering2015-05-051-12/+13
| | | | | | | | | | | | | | | A variety of changes: - Make sure all our calls distuingish OOM from other errors if OOM is not the only error possible. - Be much stricter when parsing escaped paths, do not accept trailing or leading escaped slashes. - Change unit validation to take a bit mask for allowing plain names, instance names or template names or an combination thereof. - Refuse manipulating invalid unit name
* gpt-generator: Find device on a stateless systemTobias Hunger2015-04-121-2/+7
| | | | | | A stateless system has a tmpfs as root file system. That obviously does not have any block device associated with it. So try falling back to the device of the /usr filesystem if the root filesystem fails.
* gpt-auto-generator: prefix messages with device nameZbigniew Jędrzejewski-Szmek2015-03-141-26/+26
|
* gpt-auto-generator: allow type check to failZbigniew Jędrzejewski-Szmek2015-03-131-8/+5
| | | | | add_mount() is OK with unknow file type, but we have to initalize the variable to NULL not to pass garbage on error.
* gpt-auto-generator: fix detection of /srvbaserock/v219-314-gd736e4f-network_fixesMathieu Chevrier2015-03-131-1/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=89226
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-231-2/+0
| | | | | | 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.
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-031-1/+1
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* gpt-auto-generator: make use of new btrfs-util.h APIsLennart Poettering2014-12-121-53/+2
|
* treewide: another round of simplificationsMichal Schmidt2014-11-281-44/+22
| | | | | Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-281-17/+17
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: more log_*_errno + return simplificationsMichal Schmidt2014-11-281-16/+9
|