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 B205A1381F3 for ; Thu, 29 Nov 2012 23:45:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 58C1221C088; Thu, 29 Nov 2012 23:45:32 +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 C61F221C00A for ; Thu, 29 Nov 2012 23:45:31 +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 DDF9133D8E5 for ; Thu, 29 Nov 2012 23:45:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 67D72E5444 for ; Thu, 29 Nov 2012 23:45:29 +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: <1354232570.611ed4204412f9de47a89d7d64f65b8d45def3cf.WilliamH@OpenRC> Subject: [gentoo-commits] proj/openrc:openrc-0.11.x 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: 611ed4204412f9de47a89d7d64f65b8d45def3cf X-VCS-Branch: openrc-0.11.x Date: Thu, 29 Nov 2012 23:45:29 +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: af5feaed-46ec-4aab-aeff-42b93f0e85be X-Archives-Hash: b113ced682a03b73b7c4d4357060081a commit: 611ed4204412f9de47a89d7d64f65b8d45def3cf Author: William Hubbs gmail com> AuthorDate: Thu Nov 29 16:19:20 2012 +0000 Commit: William Hubbs gentoo 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 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)$"