From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RvORP-0001HS-MO for garchives@archives.gentoo.org; Thu, 09 Feb 2012 07:29:16 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7D75BE070F; Thu, 9 Feb 2012 07:29:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 45175E070F for ; Thu, 9 Feb 2012 07:29:08 +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 7B6651B4013 for ; Thu, 9 Feb 2012 07:29:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 57DEAE53FF for ; Thu, 9 Feb 2012 07:29:05 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <497ff7ee41168d863971efb52e2ca6b42f765832.robbat2@gentoo> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/root.in X-VCS-Directories: init.d/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 497ff7ee41168d863971efb52e2ca6b42f765832 Date: Thu, 9 Feb 2012 07:29:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 3c5dec2d-371c-4aa9-a1bc-bbaac359582d X-Archives-Hash: 6a5414c82ee23450344e09171106969f commit: 497ff7ee41168d863971efb52e2ca6b42f765832 Author: Piotr Karbowski gmail com> AuthorDate: Fri Feb 3 20:17:18 2012 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Thu Feb 9 07:27:56 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D= commit;h=3D497ff7ee Remount already mounted filesystems. This was modified by William Hubbs to use the checkpath helper and to improve readability. Signed-off-by: William Hubbs gentoo.org> Signed-off-by: Robin H. Johnson gentoo.org> (tested with genkernel /usr mount changes); --- init.d/root.in | 48 ++++++++++++++++++++++++++++++++++-------------- 1 files changed, 34 insertions(+), 14 deletions(-) diff --git a/init.d/root.in b/init.d/root.in index 1c93771..4d63919 100644 --- a/init.d/root.in +++ b/init.d/root.in @@ -13,20 +13,40 @@ depend() start() { case ",$(fstabinfo -o /)," in - *,ro,*) return 0;; + *,ro,*) + ;; + *) + # Check if the rootfs isn't already writable. + if checkpath -W /; then + rm -f /fastboot /forcefsck + else + ebegin "Remounting root filesystem read/write" + case "$RC_UNAME" in + Linux) + mount -n -o remount,rw / + ;; + *) + mount -u -o rw / + ;; + esac + eend $? "Root filesystem could not be mounted read/write" + if [ $? -eq 0 ]; then + rm -f /fastboot /forcefsck + fi + fi + ;; esac =20 - if echo 2>/dev/null >/.test.$$; then - rm -f /.test.$$ /fastboot /forcefsck - return 0 - fi - - ebegin "Remounting root filesystem read/write" - case "$RC_UNAME" in - Linux) mount -n -o remount,rw /;; - *) mount -u -o rw /;; - esac - if eend $? "Root filesystem could not be mounted read/write"; then - rm -f /fastboot /forcefsck - fi + ebegin "Remounting filesystems" + local mountpoint + for mountpoint in $(fstabinfo); do + case "${mountpoint}" in + /) + ;; + /*) + mountinfo -q "${mountpoint}" && fstabinfo --remount "${mountpoint}" + ;; + esac + done + eend 0 }