From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 852101381F3 for ; Thu, 29 Nov 2012 16:38:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7BB9021C008; Thu, 29 Nov 2012 16:38:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DE56E21C008 for ; Thu, 29 Nov 2012 16:38:06 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EC68733DAD6 for ; Thu, 29 Nov 2012 16:38:05 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 4D972E5436 for ; Thu, 29 Nov 2012 16:38:04 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1354205960.5cce37837b89145832c75b310791ae3a69d883ec.WilliamH@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/localmount.in X-VCS-Directories: init.d/ X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 5cce37837b89145832c75b310791ae3a69d883ec X-VCS-Branch: master Date: Thu, 29 Nov 2012 16:38:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 1dba2aed-d5f9-4095-8ef7-d28fa4946820 X-Archives-Hash: a6c2ef2c91719f5fb8e0a68836e4f2eb commit: 5cce37837b89145832c75b310791ae3a69d883ec Author: William Hubbs gmail com> AuthorDate: Thu Nov 29 16:19:20 2012 +0000 Commit: William Hubbs gentoo org> CommitDate: Thu Nov 29 16:19:20 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=5cce3783 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 --- 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)$"