aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* fstab-generator: use RequiresOverridable for fsck unitsZbigniew Jędrzejewski-Szmek2013-11-151-1/+1
| | | | | | | | | | | | | | | | | | This allows the user to disable fsck's by masking. If fsck fails, emergency target is started, the user might mount the unit using mount and disable fsck by masking the unit. In this case, .mount will be active because the mount is detect through /proc/self/mountinfo, but systemd-fsck@.service will still be in failed mode. This results in a funny situation where $ systemctl show -p ActiveState local-fs.target yyy.mount ActiveState=active ActiveState=active $ sudo systemctl start local-fs.target [sudo] password for test: Failed to start local-fs.target: Unit systemd-fsck@xxx.service is masked.
* fsck,fstab-generator: be lenient about missing fsck.<type>Zbigniew Jędrzejewski-Szmek2013-11-151-27/+50
| | | | | | | | | | | | | If fstab contains 1 for passno, treat this as an error, but only warn briefly. If fstab doesn't contain this information, don't complain at all. Patch is complicated a bit by the fact that we might have the fstype specified in fstab or on /proc/cmdline, in which case we can check if we have the appropriate fsck tool, or not specified, or specified as auto, in which case we have to look and check the type of the filesystem ourselves. It cannot be done before the device appears, so it is too early in the generator phase, and it must be done directly in fsck service.
* util: unify reading of /proc/cmdlineLennart Poettering2013-11-061-14/+10
| | | | | | Instead of individually checking for containers in each user do this once in a new call proc_cmdline() that read the file only if we are not in a container.
* fsck-root: only run when requested in fstabTom Gundersen2013-10-191-9/+22
| | | | | | fsck-root is redundant in case an initrd is used, or in case the rootfs is never remounted 'rw', so the new default is the correct behavior for most users. For the rest, they should enable it in fstab.
* fstab-generator: Generate explicit dependencies on systemd-fsck@.service ↵Thomas Bächler2013-10-191-4/+17
| | | | | | | | | instead of using FsckPassNo [tomegun: * order all fsck instances after fsck-root * check for OOM * added notes in the manpages]
* fstab-generator: When parsing the root= cmdline option, set FsckPassNo to 1Thomas Bächler2013-10-191-1/+1
| | | | | | [tomegun: without this we would never fsck the rootfs if it was directly mounted 'rw' from the initrd. We now risk fsck'ing it twice in the case it is mounted 'ro', so that should be addressed in a separate patch.]
* Introduce _cleanup_endmntent_Zbigniew Jędrzejewski-Szmek2013-10-031-12/+5
|
* Remove six unused variables and add annotationZbigniew Jędrzejewski-Szmek2013-09-171-2/+2
| | | | clang FTW!
* swap: create .wants symlink to 'auto' swap devicesTom Gundersen2013-09-161-2/+16
| | | | | | | | | | | As we load unit files lazily, we need to make sure something pulls in swap units that should be started automatically, otherwise the default dependencies will never be applied. This partially reinstates code removed in commit 64347fc2b983f33e7efb0fd2bb44e133fb9f30f4. Also don't order swap devices after swap.target when they are 'nofail'.
* swap: handle nofail/noauto in coreTom Gundersen2013-09-111-56/+3
|
* mount: move device links handling from generatorTom Gundersen2013-09-111-37/+3
| | | | | | | This makes mount units work like swap units: when the backing device appears the mount unit will be started. v2: the device should want the mount unconditionally, not only for DefaultDependencies=yes
* fstab-generator: use DefaultDependencies=yesTom Gundersen2013-09-111-46/+6
| | | | This removes some redundancy between the generator and the core mount handling.
* fstab-generator: log_oom() if automount_name is nullWANG Chao2013-08-141-1/+1
|
* fstab-generator: read rd.fstab=on/off switch correctlyWANG Chao2013-08-091-2/+2
|
* fstab-generator: respect noauto/nofail when adding sysroot mountWANG Chao2013-08-091-1/+5
| | | | | | | Currently we don't respect noauto/nofail root mount options (from rootflags kernel cmdline). We should map these two flags to the corresponding boolean variable noauto and nofail when calling add_mount().
* move _cleanup_ attribute in front of the typeHarald Hoyer2013-04-181-7/+7
| | | | http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
* Always use errno > 0 to help gccZbigniew Jędrzejewski-Szmek2013-03-291-1/+1
| | | | | | gcc thinks that errno might be negative, and functions could return something positive on error (-errno). Should not matter in practice, but makes an -O4 build much quieter.
* unit: replace remote-fs-setup.target by network-online.targetLennart Poettering2013-03-291-14/+21
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=787314
* fstab-generator: drop x-initrd.rootfs mount optionHarald Hoyer2013-03-261-7/+1
| | | | | | | | | | | x-initrd.mount now has different meanings, if fstab-generator is called in the initramfs. initrd:/etc/fstab and x-initrd.mount defines mounts for the initrd-root-fs.target initrd:/sysroot/etc/fstab and x-initrd.mount defines mounts for the initrd-fs.target
* fstab-generator: degrade the message about missing "root=" to log_debugHarald Hoyer2013-03-261-1/+1
| | | | | Some installation media (fedora at least) does not have and need a "root=" argument on the kernel command line.
* units: introduce remote-fs-setup.target to pull in dependencies from remote ↵Lennart Poettering2013-03-251-10/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | mounts This introduces remote-fs-setup.target independently of remote-fs-pre.target. The former is only for pulling things in, the latter only for ordering. The new semantics: remote-fs-setup.target: is pulled in automatically by all remote mounts. Shall be used to pull in other units that want to run when at least one remote mount is set up. Is not ordered against the actual mount units, in order to allow activation of its dependencies even 'a posteriori', i.e. when a mount is established outside of systemd and is only picked up by it. remote-fs-pre.target: needs to be pulled in automatically by the implementing service, is otherwise not part of the initial transaction. This is ordered before all remote mount units. A service that wants to be pulled in and run before all remote mounts should hence have: a) WantedBy=remote-fs-setup.target -- so that it is pulled in b) Wants=remote-fs-pre.target + Before=remote-fs-pre.target -- so that it is ordered before the mount point, normally.
* fstab-generator: add missing strempty() callsMantas Mikulėnas2013-03-251-2/+2
|
* fstab-generator: fix minor memory leak on error pathLennart Poettering2013-03-251-12/+15
|
* fstab-generator: add missing OOM checkLennart Poettering2013-03-251-4/+6
|
* fstab-generator: rename x-initrd-rootfs.mount to x-initrd.rootfsLennart Poettering2013-03-251-1/+1
| | | | | | This changes the fstab mount option x-initrd-rootfs.mount to x-initrd.rootfs, in order to only use a single namespace "x-initrd." for all mount options of the initrd.
* Make initrd.target the default target in the initrdHarald Hoyer2013-03-151-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, rename root-fs.target to initrd-root-fs.target to clarify its usage. Mount units with "x-initrd-rootfs.mount" are now ordered before initrd-root-fs.target. As we sometimes construct /sysroot mounts in /etc/fstab in the initrd, we want these to be mounted before the initrd-root-fs.target is active. initrd.target can be the default target in the initrd. (normal startup) : : v basic.target | ______________________/| / | | sysroot.mount | | | v | initrd-root-fs.target | | | v | initrd-parse-etc.service (custom initrd services) | | v | (sysroot-usr.mount and | various mounts marked | with fstab option | x-initrd.mount) | | | v | initrd-fs.target | | \______________________ | \| v initrd.target | v initrd-cleanup.service isolates to initrd-switch-root.target | v ______________________/| / | | initrd-udevadm-cleanup-db.service | | (custom initrd services) | | | \______________________ | \| v initrd-switch-root.target | v initrd-switch-root.service | v switch-root
* add initrd-fs.target and root-fs.targetHarald Hoyer2013-03-131-34/+45
| | | | | | | | | | | | | | Instead of using local-fs*.target in the initrd, use root-fs.target for sysroot.mount and initrd-fs.target for /sysroot/usr and friends. Using local-fs.target would mean to carry over the activated local-fs.target to the isolated initrd-switch-root.target and thus in the real root. Having local-fs.target already active after deserialization causes ordering problems with the real root services and targets. We better isolate to targets for initrd-switch-root.target, which are only available in the initrd.
* Revert "fstab-generator: place initrd /sysroot mounts in initrd-fs.target"Harald Hoyer2013-03-051-43/+17
| | | | | | | This reverts commit 8330847e949fc0c26b16910e5240eef1fe2c330a. Conflicts: src/fstab-generator/fstab-generator.c
* fstab-generator: only handle block devices with root= kernel command line ↵Harald Hoyer2013-03-041-9/+12
| | | | | | parameter skip s.th. like root=nfs:... root=iscsi:... root=nbd:...
* fstab-generator: place initrd /sysroot mounts in initrd-fs.targetHarald Hoyer2013-03-041-17/+43
| | | | also do not overwrite /sysroot*.mount units already generated from fstab
* fstab-generator: initrd - mount selected entries from /sysroot/etc/fstabTom Gundersen2013-03-011-11/+28
| | | | | | | | | | | | | | | | We only mount "/usr" and entries marked with "x-initrd.mount". This (together with the right unit files) is needed in the initramfs in order to natively support mounting /usr (and friends) from the initramfs. The way it is meant to work is: * wait for sysroot.mount to be mounted * do a daemon-reload to generate sysroot-usr.mount (++) from /sysroot/etc/fstab * wait for sysroot-usr.mount to be mounted * switch-root Cc: Harald Hoyer <harald.hoyer@gmail.com> Cc: Dave Reisner <d@falconindy.com>
* fstab-generator: drop rootwait supportTom Gundersen2013-03-011-13/+6
| | | | | | I originally added this to stay as compatible as possible with the kernel, but as Lennart argued it is not really useful in the initramfs, so let's drop it (we already don't support 'rootdealy').
* fstab-generator: set "ro" as default for sysroot.mountHarald Hoyer2013-03-011-1/+2
|
* fstab-generator: fix commit 92094b7Harald Hoyer2013-03-011-1/+1
|
* fstab-generator: parse_new_root_from_proc_cmdline() don't use "defaults"Harald Hoyer2013-03-011-1/+0
| | | | | | | Don't use "defaults" as default option string. "defaults,<anyotheroption>" does not even work for the mount unit mount options.
* fstab,mount: detect rbind as bind mountFrederic Crozat2013-03-011-1/+3
| | | | | | Correctly detect rbind mount option as bind mount. Fixes https://bugzilla.novell.com/show_bug.cgi?id=804575.
* fstab-generator: change kernel command line mount path for rootHarald Hoyer2013-02-211-2/+2
| | | | | Use /sysroot instead of /new_root to mount the real root in the initramfs.
* honor SELinux labels, when creating and writing config filesHarald Hoyer2013-02-141-0/+1
| | | | | | | Also split out some fileio functions to fileio.c and provide a SELinux aware pendant in fileio-label.c see https://bugzilla.redhat.com/show_bug.cgi?id=881577
* tabs to spacesThomas Hindoe Paaboel Andersen2013-01-091-2/+2
| | | | | Skipped bootchart and various files that looked like they should be kept in sync with external sources.
* fstab-generator: modernize styleZbigniew Jędrzejewski-Szmek2013-01-061-123/+52
|
* fstab-generator: fix typoTom Gundersen2012-12-291-1/+0
|
* fstab-generator: generate new_root.mount in initrdTom Gundersen2012-12-281-25/+118
| | | | | | | | | | | | | | The configuration is taken from /proc/cmdline, aiming at emulating the behavior of the kernel when no initramfs is used. The supported options are: root=, rootfstype=, rootwait=, rootflags=, ro, and rw. rootdelay= was dropped, as it is not really useful in a systemd world, but could easily be added. v2: fix comments by Lennart, and complain loudly if root= can not be found Cc: Harald Hoyer <harald@redhat.com> Cc: Dave Reisner <dreisner@archlinux.org>
* fstab-generator: properly detect bind mountsLennart Poettering2012-12-241-1/+9
| | | | | | This kinda undoes a83cbaccd03c3f28e47e9330f4a22ff65ce4b561 and 1d634e21b453f3c80d7c6c4bd90a6b84e42a3d2a but corrects the original code to compare the mount type with "bind" rather than the mount options.
* fstab-generator: make error more helpful in case of duplicates in fstabTom Gundersen2012-11-271-2/+8
| | | | | | | | | | | | Traditional sysvinit systems would not complain about duplicates in fstab. Rather it (through monut -a) would mount one fs on top of another, in effect the last entry taking precedent. In systemd, the first entry takes precedent, all subsequent ones are ignored and an error is printed. The change of behavior and the source of this error message was causing some confusion, so give a hint what migt be wrong.
* fstab-generator: drop mount_is_bindTom Gundersen2012-11-271-7/+1
| | | | Do the check in-line instead, as the function is now a bit pointless.
* fstab-generator: remove redundancy in mount_is_bindTom Gundersen2012-11-271-3/+1
|
* fstab-generator: more specific error messagesMichal Schmidt2012-11-091-11/+11
|
* log.h: new log_oom() -> int -ENOMEM, use itShawn Landden2012-07-261-38/+19
| | | | | | also a number of minor fixups and bug fixes: spelling, oom errors that didn't print errors, not properly forwarding error codes, few more consistency issues, et cetera
* use "Out of memory." consistantly (or with "\n")Shawn Landden2012-07-251-15/+15
| | | | | | | | glibc/glib both use "out of memory" consistantly so maybe we should consider that instead of this. Eliminates one string out of a number of binaries. Also fixes extra newline in udev/scsi_id
* util: rename join() to strjoin()Lennart Poettering2012-07-131-8/+8
| | | | This is to match strappend() and the other string related functions.