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 1RzbR8-0001oe-Sj for garchives@archives.gentoo.org; Mon, 20 Feb 2012 22:10:23 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 23721E0AE3; Mon, 20 Feb 2012 22:10:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id CFF2AE0AE3 for ; Mon, 20 Feb 2012 22:10:14 +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 124DD1B4001 for ; Mon, 20 Feb 2012 22:10:14 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 085CEE53FF for ; Mon, 20 Feb 2012 22:10:12 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1329775120.0ed42d35995bc6c35a6b6fe02a5164c4fa73a71c.WilliamH@gentoo> Subject: [gentoo-commits] proj/udev-gentoo-scripts:master commit in: init.d/ X-VCS-Repository: proj/udev-gentoo-scripts X-VCS-Files: init.d/udev-mount X-VCS-Directories: init.d/ X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 0ed42d35995bc6c35a6b6fe02a5164c4fa73a71c X-VCS-Branch: master Date: Mon, 20 Feb 2012 22:10:12 +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: 3c52f392-a887-4197-985d-8d95a5b930f2 X-Archives-Hash: bff35bae12cfce7e3925113995d6be65 commit: 0ed42d35995bc6c35a6b6fe02a5164c4fa73a71c Author: William Hubbs gentoo org> AuthorDate: Mon Feb 20 21:58:40 2012 +0000 Commit: William Hubbs gentoo org> CommitDate: Mon Feb 20 21:58:40 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/udev-gentoo-s= cripts.git;a=3Dcommit;h=3D0ed42d35 fix mounting logic in udev-mount Udev-mount now follows the following logic: 1. If there is an entry in fstab for /dev: a. If /dev is mounted, remount it according to fstab. b. Otherwise, mount it according to fstab. 2. Otherwise, if /dev is not mounted: a. Mount it with default settings. B. Otherwise, output a message and use the mounted /dev. Reported-by: duncan <1i5t5.duncan cox.net> X-Gentoo-Bug: 402845 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=3D402845 --- init.d/udev-mount | 43 ++++++++++++++++++++++--------------------- 1 files changed, 22 insertions(+), 21 deletions(-) diff --git a/init.d/udev-mount b/init.d/udev-mount index 096e710..676643f 100644 --- a/init.d/udev-mount +++ b/init.d/udev-mount @@ -11,33 +11,34 @@ depend() =20 mount_dev_directory() { - local rc=3D0 + local mounted=3Dfalse fstab=3Dfalse action=3D--mount msg=3DMounting rc=3D= 0 =20 - if mountinfo -q -f devtmpfs /dev; then - einfo "/dev is already mounted" - return 0 + if ! grep -qs devtmpfs /proc/filesystems; then + eerror "Udev uses a devtmpfs mounted on /dev to manage devices." + eerror "This means that CONFIG_DEVTMPFS=3Dy is required" + eerror "in the kernel configuration." + return 1 fi =20 + # Is /dev already a mounted devtmpfs? + mountinfo -q -f devtmpfs /dev && mounted=3Dtrue + # If an entry for /dev exists in fstab it must be a devtmpfs. - if fstabinfo -q /dev && ! fstabinfo -q -f devtmpfs /dev; then - eerror "The entry in /etc/fstab is not correct." - eerror "Udev requires it to be a devtmpfs file system." - return 1 - fi + fstabinfo -q -t devtmpfs /dev && fstab=3Dtrue =20 # No options are processed here as they should all be in /etc/fstab - ebegin "Mounting /dev" - if ! fstabinfo --mount /dev; then - if grep -qs devtmpfs /proc/filesystems; then - # Some devices require exec, Bug #92921 - mount -n -t devtmpfs -o "exec,nosuid,mode=3D0755,size=3D10M" udev /de= v - rc=3D$? - else - eerror "Udev uses a devtmpfs mounted on /dev to manage devices." - eerror "This means that CONFIG_DEVTMPFS=3Dy is required" - eerror "in the kernel configuration." - return 1 - fi + if $fstab; then + $mounted && action=3D--remount && msg=3DRemounting + ebegin "$msg /dev according to /etc/fstab" + fstabinfo $action /dev + rc=3D$? + elif ! $mounted; then + ebegin "Mounting /dev" + # Some devices require exec, Bug #92921 + mount -n -t devtmpfs -o "exec,nosuid,mode=3D0755,size=3D10M" udev /dev + rc=3D$? + else + ebegin "Using /dev mounted from kernel" fi =20 eend $rc