summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2012-11-29 10:19:20 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2012-11-29 17:42:50 -0600
commit611ed4204412f9de47a89d7d64f65b8d45def3cf (patch)
treea2da85d958b5e30da382e3f4f32d214dee2f88a4
parent3f719bbb8ba8cb82ef3253b2415236b5ad93ed32 (diff)
downloadopenrc-611ed4204412f9de47a89d7d64f65b8d45def3cf.tar.gz
openrc-611ed4204412f9de47a89d7d64f65b8d45def3cf.tar.bz2
openrc-611ed4204412f9de47a89d7d64f65b8d45def3cf.tar.xz
localmount: only skip unmounting /usr if it was premounted
Add a test when localmount is started to determine if /usr is mounted from inside an initramfs for Linux systems. If it is not, we can unmount it when localmount stops. On *bsd systems, we always unmount /usr if it is separate. Reported-by: ryao@gentoo.org
-rw-r--r--init.d/localmount.in8
1 files changed, 7 insertions, 1 deletions
diff --git a/init.d/localmount.in b/init.d/localmount.in
index 8e67c38..ab0b1b5 100644
--- a/init.d/localmount.in
+++ b/init.d/localmount.in
@@ -22,6 +22,9 @@ start()
if [ "$RC_UNAME" = Linux ]; then
no_netdev="-O no_netdev"
+ if [ mountinfo -q /usr ]; then
+ touch $rc_svcdir/usr_premounted
+ fi
fi
ebegin "Mounting local filesystems"
mount -at "$types" $no_netdev
@@ -48,7 +51,10 @@ stop()
done
if [ "$RC_UNAME" = Linux ]; then
- no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*|/usr"
+ no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*"
+ if [ -e $rc_svcdir/usr_premounted ]; then
+ no_umounts_r="$no_umounts_r|/usr"
+ fi
fi
no_umounts_r="^($no_umounts_r)$"