summaryrefslogtreecommitdiff
path: root/src/core/switch-root.c
Commit message (Collapse)AuthorAge
* switch-root: try pivot_root() before overmounting /Lennart Poettering2012-11-16
| | | | | | | | | | | | | | | | We should always try to umount the old root dir if possible, instead of overmounting it -- if that's possible. The initial ("first") kernel rootfs can never be umounted, hence for the usual nitrd case we never bothered using pivot_root() and hence with fully unmounting it. However, fedup now tranisitions twice during boot, and in that case it is highly desirable that the "second" root dir is entirely unmounted when we switch to the "third". This patch makes that possible. The pivot_root() needs a directory in the "third" root dir, to move the "second" root dir to. We use /mnt for that, under the assumption that this directory is likely to exist, and is not itself a mount point.
* namespace: rework namespace supportLennart Poettering2012-08-13
| | | | | | | | - don't use pivot_root() anymore, just reuse root hierarchy - first create all mounts, then mark them read-only so that we get the right behaviour when people want writable mounts inside of read-only mounts - don't pass invalid combinations of MS_ constants to the kernel
* switch-root: remount to MS_PRIVATELennart Poettering2012-08-12
| | | | | | | | | | The kernel does not allow switching roots if things are mounted MS_SHARED. As a work-around, remount things MS_PRIVATE before switching roots. This should be fixed in the kernel for good. https://bugzilla.redhat.com/show_bug.cgi?id=847418
* switch-root: do not use close old_root_fd after rm_rf_children()Harald Hoyer2012-05-22
| | | | rm_rf_children() has already closed the fd with closedir().
* switch-root: move switch_root() call into its own .c fileLennart Poettering2012-05-21