1 |
commit: 5cce37837b89145832c75b310791ae3a69d883ec |
2 |
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Nov 29 16:19:20 2012 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Nov 29 16:19:20 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=5cce3783 |
7 |
|
8 |
localmount: only skip unmounting /usr if it was premounted |
9 |
|
10 |
Add a test when localmount is started to determine if /usr is mounted |
11 |
from inside an initramfs for Linux systems. If it is not, we can unmount it when |
12 |
localmount stops. |
13 |
|
14 |
On *bsd systems, we always unmount /usr if it is separate. |
15 |
|
16 |
Reported-by: ryao <AT> gentoo.org |
17 |
|
18 |
--- |
19 |
init.d/localmount.in | 8 +++++++- |
20 |
1 files changed, 7 insertions(+), 1 deletions(-) |
21 |
|
22 |
diff --git a/init.d/localmount.in b/init.d/localmount.in |
23 |
index 8e67c38..ab0b1b5 100644 |
24 |
--- a/init.d/localmount.in |
25 |
+++ b/init.d/localmount.in |
26 |
@@ -22,6 +22,9 @@ start() |
27 |
|
28 |
if [ "$RC_UNAME" = Linux ]; then |
29 |
no_netdev="-O no_netdev" |
30 |
+ if [ mountinfo -q /usr ]; then |
31 |
+ touch $rc_svcdir/usr_premounted |
32 |
+ fi |
33 |
fi |
34 |
ebegin "Mounting local filesystems" |
35 |
mount -at "$types" $no_netdev |
36 |
@@ -48,7 +51,10 @@ stop() |
37 |
done |
38 |
|
39 |
if [ "$RC_UNAME" = Linux ]; then |
40 |
- no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*|/usr" |
41 |
+ no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*" |
42 |
+ if [ -e $rc_svcdir/usr_premounted ]; then |
43 |
+ no_umounts_r="$no_umounts_r|/usr" |
44 |
+ fi |
45 |
fi |
46 |
no_umounts_r="^($no_umounts_r)$" |