summaryrefslogtreecommitdiff
path: root/src/gpt-auto-generator
AgeCommit message (Collapse)Author
2015-08-11gpt-auto-generator: warn on ambiguous blkid probeTom Gundersen
2015-08-11gpt-auto-generator: don't warn on !ENABLE_EFITom Gundersen
add_automount() was only used on EFI systems, compile it conditionally to avoid the warning.
2015-08-11gpt-auto-generator: apply partition-type flags only to specific partition-typesKay Sievers
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
2015-08-04gpt-auto-generator: remove unused variableThomas Hindoe Paaboel Andersen
2015-07-30tree-wide: use free_and_strdup()Daniel Mack
Use free_and_strdup() where appropriate and replace equivalent, open-coded versions.
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-29gpt-auto-generator: merge efi-boot-generatorKay Sievers
2015-07-06fileio: consolidate write_string_file*()Daniel Mack
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.
2015-05-29path-util: Change path_is_mount_point() symlink arg from bool to flagsMartin Pitt
This makes path_is_mount_point() consistent with fd_is_mount_point() wrt. flags.
2015-05-05core: rework unit name validation and manipulation logicLennart Poettering
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
2015-04-12gpt-generator: Find device on a stateless systemTobias Hunger
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.
2015-03-14gpt-auto-generator: prefix messages with device nameZbigniew Jędrzejewski-Szmek
2015-03-13gpt-auto-generator: allow type check to failZbigniew Jędrzejewski-Szmek
add_mount() is OK with unknow file type, but we have to initalize the variable to NULL not to pass garbage on error.
2015-03-13gpt-auto-generator: fix detection of /srvMathieu Chevrier
https://bugs.freedesktop.org/show_bug.cgi?id=89226
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.
2015-02-03util: rework strappenda(), and rename it strjoina()Lennart Poettering
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.
2014-12-12gpt-auto-generator: make use of new btrfs-util.h APIsLennart Poettering
2014-11-28treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
2014-11-28treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
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.
2014-11-28treewide: more log_*_errno + return simplificationsMichal Schmidt
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
2014-11-24gpt-auto-generator: properly ignore valueZbigniew Jędrzejewski-Szmek
A negative return code was treated as a true value.
2014-11-07util: simplify proc_cmdline() to reuse get_process_cmdline()Lennart Poettering
Also, make all parsing of the kernel cmdline non-fatal.
2014-09-25readahead: wipe out readaheadDaniel Buch
2014-09-16gpt-auto-generator: fix typoLukas Nykryn
2014-06-19stop complaining about unknown kernel cmdline optionsLennart Poettering
Also stop warning about unknown kernel cmdline options in the various tools, not just in PID 1
2014-03-13gpt-auto-generator: there's no point in looking for a superblock on raw ↵Lennart Poettering
disk, we only care for a partition table
2014-03-13gpt-auto-generator: print debug messages when we ignore a block deviceLennart Poettering
2014-03-13gpt-auto-generator: honour read-only and no-auto flag from GPT dataLennart Poettering
Similar to the read-only and no-automount flags of Microsoft Basic Data Partitions, introduce our own flags. We map them to the same flag bits as Microsoft's, to keep things simple.
2014-03-12gpt-auto-generator: don't return OOM on parentless devicesTomasz Torcz
2014-03-11gpt-auto-generator: rename root device node symlink to /dev/gpt-auto-rootLennart Poettering
Before it was placed in /dev/disk/by-id, which makes it a bit too much API. However, it's mostly an implementation detail for now, hence move it out of the stable block device dir.
2014-03-10nspawn: add --image= switch to boot GPT disk images that follow the ↵Lennart Poettering
Discoverable Partitions Specification
2014-03-08gpt-auto-generator: probe only partition table and partitions we are ↵Lennart Poettering
interested in Instead of iterating through the list of partitions and probing them all with blkid, simply probe the partition table and use that information to only probe the partitions we care for.
2014-03-07gpt-auto-generator: automatically find the root disk of the systemLennart Poettering
When run in an initrd and no root= argument is set (or is set to root=gpt-auto) we will automatically look for the root partition on the same disk the EFI ESP is located on. Since we look for swap, /home and /srv on the disk the root partition is located on, we hence have a fully discoverable chain: Firmware discovers the EFI ESP partition → the initrd discovers the root partition → the host OS discovers swap, /home, and /srv. Note that this requires an EFI boot loader that sets the LoaderDevicePartUUID EFI variable, such as Gummiboot.
2014-03-06generators: make automatic discovery generators work correctly when reloadingLennart Poettering
In addition to checking whether the diestination mount point is populated, check whether it is already a mount point. If it is already a mount point, or if it is unpopulated, let's create the unit.
2014-03-06generators: add Documentation= fields that point to the generator man pagesLennart Poettering
2014-03-06gpt-auto-generation: set a pretty description stringLennart Poettering
2014-03-06gpt-auto-generator: properly handle LUKS partitionsLennart Poettering
2014-03-06update TODOLennart Poettering
2014-03-06generators: rework mount generatorsLennart Poettering
- Add support for finding and mounting /srv based on GPT data, similar to how we already handly /home. - Share the fsck logic between GPT, EFI and fstab generators - Make sure we never run the EFI generator inside containers - Drop DefaultDependencies=no from EFI mount units - Other fixes
2014-01-11gpt-auto-generator: use EBADSLT code when unable to detect partition typeZbigniew Jędrzejewski-Szmek
ENODEV suggests that something is missing, which is be misleading here.
2014-01-11gpt-auto-generator: skip nonexistent devicesŁukasz Stelmach
The devices we work with have eMMC chips for storage. The chips provide four "hardware" partitions. The first is /dev/mmcblk0, it takes almost whole space and holds a GPT with several real partitions (/dev/mmcblk0p?). Then there are three block devices (mmcblk0boot0, mmcblk0boot1, rpmb) that are part of the same hardware as mmcblk0 that are presented by the kernel as children of the latter. That relationship makes gpt-auto-generator try to peek them but since they are not GPT partitions blkid_do_safeprobe() returns -2 making verify_gpt_parition() function return -ENODEV.
2013-12-10fix scan-build issuesThomas Hindoe Paaboel Andersen
The static analyzer scan-build had a few issues with analysing parts of systemd. gpt-auto-generator.c: scan-build could not find blkid.h. Whether it should be blkid.h or blkid/blkid.h seems to depend on the version used. We already use blkid/blkid.h in udev-builtin-blkid.c so it seems safe to use that here too. Makefile.am: Moved some -D's from CFLAGS to CPPFLAGS. I also simplified them a bit and got rid of a left over DBUS_CFLAGS. test-cgroup-mask.c/test-sched-prio.c A variable was added to store the replaced TEST_DIR. When wrapped in an assert_se TEST_DIR was not replaced in the logged error. While not an issue introduced in this patch we might as well fix it up while we are here.
2013-12-03bus: add generator that turns old dbus1 activation files into .busname + ↵Lennart Poettering
.service units
2013-10-19gpt-auto-generator: Generate explicit dependencies on systemd-fsck@.service ↵Thomas Bächler
instead of using FsckPassNo [tomegun: check for OOM]
2013-10-14util: allow trailing semicolons on define_trivial_cleanup_func linesLennart Poettering
Emacs C indenting really gets confused by these lines if they carry no trailing semicolon, hence let's make this nicer for good old emacs. The other macros which define functions already do this too, so let's copy the scheme here. Also, let's use an uppercase name for the macro. So far our rough rule was that macros that are totally not function-like (like this ones, which define a function) are uppercase. (Well, admittedly it is a rough rule only, for example function and variable decorators are all lower-case SINCE THE CONSTANT YELLING IN THE SOURCES WOULD SUCK, and also they at least got underscore prefixes.) Also, the macros that define functions that we already have are all uppercase, so let's do the same here...
2013-10-13Introduce udev object cleanup functionsZbigniew Jędrzejewski-Szmek
2013-10-13ModernizationZbigniew Jędrzejewski-Szmek
Fixes minor leak in error path in device.c.
2013-10-03gpt-auto-generator: exit immediately if in containerZbigniew Jędrzejewski-Szmek
Otherwise we get an ugly warning when running systemd in a container.