public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc:openrc-0.11.x commit in: init.d/
Date: Thu, 29 Nov 2012 23:45:29 +0000 (UTC)	[thread overview]
Message-ID: <1354232570.611ed4204412f9de47a89d7d64f65b8d45def3cf.WilliamH@OpenRC> (raw)

commit:     611ed4204412f9de47a89d7d64f65b8d45def3cf
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Nov 29 16:19:20 2012 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Nov 29 23:42:50 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=611ed420

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 <AT> gentoo.org

---
 init.d/localmount.in |    8 +++++++-
 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)$"
 


             reply	other threads:[~2012-11-29 23:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29 23:45 William Hubbs [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-11-30 18:07 [gentoo-commits] proj/openrc:openrc-0.11.x commit in: init.d/ William Hubbs
2012-10-22 21:35 William Hubbs
2012-10-20  2:53 William Hubbs
2012-10-20  2:53 William Hubbs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354232570.611ed4204412f9de47a89d7d64f65b8d45def3cf.WilliamH@OpenRC \
    --to=williamh@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox