Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/udev-gentoo-scripts:master commit in: init.d/
Date: Mon, 02 Jan 2012 00:01:52
Message-Id: 8b6ebd414edec59d31ed413dfa8f7e7cd09bc8c8.WilliamH@gentoo
1 commit: 8b6ebd414edec59d31ed413dfa8f7e7cd09bc8c8
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 1 23:56:41 2012 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 1 23:56:41 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/udev-gentoo-scripts.git;a=commit;h=8b6ebd41
7
8 udev-mount: require devtmpfs
9
10 Upstream udev now requires that a devtmpfs be mounted on /dev, so we
11 require this as well.
12
13 ---
14 init.d/udev-mount | 32 +++++++++++++++++++++++---------
15 1 files changed, 23 insertions(+), 9 deletions(-)
16
17 diff --git a/init.d/udev-mount b/init.d/udev-mount
18 index 62742bd..096e710 100644
19 --- a/init.d/udev-mount
20 +++ b/init.d/udev-mount
21 @@ -2,7 +2,7 @@
22 # Copyright 1999-2010 Gentoo Foundation
23 # Distributed under the terms of the GNU General Public License v2
24
25 -description="mount devtmpfs or tmpfs on /dev"
26 +description="mount devtmpfs on /dev"
27
28 depend()
29 {
30 @@ -11,22 +11,36 @@ depend()
31
32 mount_dev_directory()
33 {
34 - if mountinfo -q /dev; then
35 + local rc=0
36 +
37 + if mountinfo -q -f devtmpfs /dev; then
38 einfo "/dev is already mounted"
39 return 0
40 fi
41
42 + # If an entry for /dev exists in fstab it must be a devtmpfs.
43 + if fstabinfo -q /dev && ! fstabinfo -q -f devtmpfs /dev; then
44 + eerror "The entry in /etc/fstab is not correct."
45 + eerror "Udev requires it to be a devtmpfs file system."
46 + return 1
47 + fi
48 +
49 # No options are processed here as they should all be in /etc/fstab
50 ebegin "Mounting /dev"
51 if ! fstabinfo --mount /dev; then
52 - # we mount devtmpfs if supported
53 - local fs=tmpfs
54 - grep -qs devtmpfs /proc/filesystems && fs=devtmpfs
55 -
56 - # Some devices require exec, Bug #92921
57 - mount -n -t "$fs" -o "exec,nosuid,mode=0755,size=10M" udev /dev
58 + if grep -qs devtmpfs /proc/filesystems; then
59 + # Some devices require exec, Bug #92921
60 + mount -n -t devtmpfs -o "exec,nosuid,mode=0755,size=10M" udev /dev
61 + rc=$?
62 + else
63 + eerror "Udev uses a devtmpfs mounted on /dev to manage devices."
64 + eerror "This means that CONFIG_DEVTMPFS=y is required"
65 + eerror "in the kernel configuration."
66 + return 1
67 + fi
68 fi
69 - eend $?
70 +
71 + eend $rc
72 }
73
74 seed_dev()