Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/busybox/files: mdev-start.sh
Date: Sun, 20 Apr 2008 01:17:52
Message-Id: E1JnOBh-0006xX-VV@stork.gentoo.org
1 vapier 08/04/20 01:17:49
2
3 Modified: mdev-start.sh
4 Log:
5 Add support for baselayout-2 and create /dev/null before we use it #211827.
6 (Portage version: 2.2_pre5)
7
8 Revision Changes Path
9 1.3 sys-apps/busybox/files/mdev-start.sh
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/busybox/files/mdev-start.sh?rev=1.3&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/busybox/files/mdev-start.sh?rev=1.3&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/busybox/files/mdev-start.sh?r1=1.2&r2=1.3
14
15 Index: mdev-start.sh
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/mdev-start.sh,v
18 retrieving revision 1.2
19 retrieving revision 1.3
20 diff -u -r1.2 -r1.3
21 --- mdev-start.sh 28 May 2007 01:47:37 -0000 1.2
22 +++ mdev-start.sh 20 Apr 2008 01:17:49 -0000 1.3
23 @@ -1,7 +1,8 @@
24 -# Copyright 1999-2007 Gentoo Foundation
25 +# Copyright 1999-2008 Gentoo Foundation
26 # Distributed under the terms of the GNU General Public License v2
27
28 -find_mdev() {
29 +find_mdev()
30 +{
31 if [ -x /sbin/mdev ] ; then
32 echo "/sbin/mdev"
33 else
34 @@ -9,7 +10,8 @@
35 fi
36 }
37
38 -populate_mdev() {
39 +populate_mdev()
40 +{
41 # populate /dev with devices already found by the kernel
42
43 if get_bootparam "nocoldplug" ; then
44 @@ -24,18 +26,22 @@
45 return 0
46 }
47
48 -seed_dev() {
49 +seed_dev()
50 +{
51 # Seed /dev with some things that we know we need
52 - ebegin "Seeding /dev with needed nodes"
53
54 # creating /dev/console and /dev/tty1 to be able to write
55 # to $CONSOLE with/without bootsplash before mdev creates it
56 - [ ! -c /dev/console ] && mknod /dev/console c 5 1
57 - [ ! -c /dev/tty1 ] && mknod /dev/tty1 c 4 1
58 + [ -c /dev/console ] || mknod /dev/console c 5 1
59 + [ -c /dev/tty1 ] || mknod /dev/tty1 c 4 1
60 +
61 + # udevd will dup its stdin/stdout/stderr to /dev/null
62 + # and we do not want a file which gets buffered in ram
63 + [ -c /dev/null ] || mknod /dev/null c 1 3
64
65 # copy over any persistant things
66 if [ -d /lib/mdev/devices ] ; then
67 - cp --preserve=all --recursive --update /lib/mdev/devices/* /dev 2>/dev/null
68 + cp -RPp /lib/mdev/devices/* /dev 2>/dev/null
69 fi
70
71 # Not provided by sysfs but needed
72 @@ -47,12 +53,10 @@
73
74 # Create problematic directories
75 mkdir -p /dev/pts /dev/shm
76 - eend 0
77 }
78
79 -main() {
80 - # Setup temporary storage for /dev
81 - ebegin "Mounting /dev for mdev"
82 +mount_it_b1()
83 +{
84 if [ "${RC_USE_FSTAB}" = "yes" ] ; then
85 mntcmd=$(get_mount_fstab /dev)
86 else
87 @@ -69,6 +73,26 @@
88 # many video drivers require exec access in /dev #92921
89 try mount -n -t "${mntcmd}" -o exec,nosuid,mode=0755 mdev /dev
90 fi
91 +}
92 +mount_it_b2()
93 +{
94 + if fstabinfo --quiet /dev ; then
95 + mount -n /dev
96 + else
97 + # Some devices require exec, Bug #92921
98 + mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" mdev /dev
99 + fi
100 +}
101 +mount_it()
102 +{
103 + type fstabinfo && mount_b2 || mount_b1
104 +}
105 +
106 +main()
107 +{
108 + # Setup temporary storage for /dev
109 + ebegin "Mounting /dev for mdev"
110 + mount_it
111 eend $?
112
113 # Create a file so that our rc system knows it's still in sysinit.
114
115
116
117 --
118 gentoo-commits@l.g.o mailing list