/[pkg-src]/trunk/initscripts-alx/patches/initscripts-0.3.4-r10-alx-use-external-devfs-and-udev-functions.patch |
Annotation of /trunk/initscripts-alx/patches/initscripts-0.3.4-r10-alx-use-external-devfs-and-udev-functions.patch
Parent Directory
|
Revision Log
Revision 1212 -
(hide annotations)
(download)
Thu Dec 2 13:10:11 2010 UTC (13 years, 9 months ago) by niro
File size: 7667 byte(s)
Thu Dec 2 13:10:11 2010 UTC (13 years, 9 months ago) by niro
File size: 7667 byte(s)
use external devicemanager hooks
1 | niro | 1212 | diff -Naur magellan-initscripts/etc/rc.d/init.d/devfs magellan-initscripts-external-udev/etc/rc.d/init.d/devfs |
2 | --- magellan-initscripts/etc/rc.d/init.d/devfs 1970-01-01 01:00:00.000000000 +0100 | ||
3 | +++ magellan-initscripts-external-udev/etc/rc.d/init.d/devfs 2010-12-02 14:07:40.000000000 +0100 | ||
4 | @@ -0,0 +1,44 @@ | ||
5 | +# starts devfs devicemanager | ||
6 | +# $Header$ | ||
7 | + | ||
8 | +start_devfs() | ||
9 | +{ | ||
10 | + # start devfsd daemon, needed for bootsplash; | ||
11 | + # no use of '/etc/rc.d/init.d/devfs' anymore | ||
12 | + # check if devfs was mounted by the kernel, | ||
13 | + # if not mount it (mbuild_livecd needs this one) | ||
14 | + if [ ! -e /dev/.devfsd ] | ||
15 | + then | ||
16 | + echo -e ${COLOREDSTAR}"Mounting devfs file system ..." | ||
17 | + mount -n -t devfs devfs /dev | ||
18 | + evaluate_retval | ||
19 | + fi | ||
20 | + | ||
21 | + if [ -e /dev/.devfsd ] | ||
22 | + then | ||
23 | + echo -e ${COLOREDSTAR}"Starting devfsd ..." | ||
24 | + ## directory /lib/dev-state !must! exists ## | ||
25 | + /sbin/devfsd /dev &> /dev/null | ||
26 | + evaluate_retval | ||
27 | + else | ||
28 | + echo -e ${COLRED}"No devfs filesystem found ..." | ||
29 | + echo -e ${COLYELLOW}"Your Kernel doesn't support the devfs filesystem." | ||
30 | + echo -e ${COLYELLOW}"Devfs is necessary to run Magellan-Linux." | ||
31 | + echo -e ${COLYELLOW}"Please make shure that this is enabled in your kernel." | ||
32 | + echo | ||
33 | + echo -e ${COLYELLOW}"Press any key to shutdown the system safely ..." | ||
34 | + read | ||
35 | + $rc_base/init.d/halt | ||
36 | + fi | ||
37 | +} | ||
38 | + | ||
39 | +start_devicemanager() | ||
40 | +{ | ||
41 | + start_devfs | ||
42 | +} | ||
43 | + | ||
44 | +stop_devicemanager() | ||
45 | +{ | ||
46 | + # do nothing | ||
47 | + return 0 | ||
48 | +} | ||
49 | diff -Naur magellan-initscripts/etc/rc.d/init.d/mountfs magellan-initscripts-external-udev/etc/rc.d/init.d/mountfs | ||
50 | --- magellan-initscripts/etc/rc.d/init.d/mountfs 2005-07-03 23:32:06.000000000 +0200 | ||
51 | +++ magellan-initscripts-external-udev/etc/rc.d/init.d/mountfs 2010-12-02 13:50:21.000000000 +0100 | ||
52 | @@ -44,7 +44,10 @@ | ||
53 | # records udev as mounted | ||
54 | if is_fs_mounted udev | ||
55 | then | ||
56 | - mount -f -t ramfs udev /dev | ||
57 | + fstype=ramfs | ||
58 | + kernel_supports_fs tmpfs && fstype=tmpfs | ||
59 | + kernel_supports_fs devtmpfs && fstype=devtmpfs | ||
60 | + mount -f -t ${fstype}ramfs udev /dev | ||
61 | fi | ||
62 | |||
63 | evaluate_retval | ||
64 | diff -Naur magellan-initscripts/etc/rc.d/init.d/mountfslivecd magellan-initscripts-external-udev/etc/rc.d/init.d/mountfslivecd | ||
65 | --- magellan-initscripts/etc/rc.d/init.d/mountfslivecd 2005-08-31 23:45:02.000000000 +0200 | ||
66 | +++ magellan-initscripts-external-udev/etc/rc.d/init.d/mountfslivecd 2010-12-02 13:51:15.000000000 +0100 | ||
67 | @@ -63,7 +63,10 @@ | ||
68 | # records udev as mounted | ||
69 | if is_fs_mounted udev | ||
70 | then | ||
71 | - mount -f -t ramfs udev /dev | ||
72 | + fstype=ramfs | ||
73 | + kernel_supports_fs tmpfs && fstype=tmpfs | ||
74 | + kernel_supports_fs devtmpfs && fstype=devtmpfs | ||
75 | + mount -f -t ${fstype} udev /dev | ||
76 | fi | ||
77 | |||
78 | # fake mounts tmpfs | ||
79 | diff -Naur magellan-initscripts/etc/rc.d/init.d/rc magellan-initscripts-external-udev/etc/rc.d/init.d/rc | ||
80 | --- magellan-initscripts/etc/rc.d/init.d/rc 2005-07-03 23:34:35.000000000 +0200 | ||
81 | +++ magellan-initscripts-external-udev/etc/rc.d/init.d/rc 2010-12-02 13:24:04.000000000 +0100 | ||
82 | @@ -10,26 +10,16 @@ | ||
83 | # source kernel config if exists | ||
84 | [ -f /etc/conf.d/kernel ] && source /etc/conf.d/kernel | ||
85 | |||
86 | -# some needed functions functions | ||
87 | -populate_udev() { | ||
88 | - /sbin/udevstart | ||
89 | - | ||
90 | - # not provided by sysfs but needed | ||
91 | - ln -snf /proc/self/fd /dev/fd | ||
92 | - ln -snf fd/0 /dev/stdin | ||
93 | - ln -snf fd/1 /dev/stdout | ||
94 | - ln -snf fd/2 /dev/stderr | ||
95 | - ln -snf /proc/kcore /dev/core | ||
96 | - ln -snf /proc/asound/oss/sndstat /dev/sndstat | ||
97 | - | ||
98 | - # create problematic directories | ||
99 | - mkdir -p /dev/{pts,shm} | ||
100 | - | ||
101 | - # same as /dev/.devfsd | ||
102 | - touch /dev/.udev | ||
103 | +# source udev functions | ||
104 | +if [[ ${RC_USED_DEV} = udev ]] && [[ -f ${rc_base}/init.d/udev ]] | ||
105 | +then | ||
106 | + source ${rc_base}/init.d/udev | ||
107 | |||
108 | - return 0 | ||
109 | -} | ||
110 | +# load devfs only with a 2.4 kernel or its really wanted with a 2.6 | ||
111 | +elif [[ $(kernel_major_version) = 2.4 ]] || [[ ${RC_USED_DEV} = devfs ]] && [[ -f ${rc_base}/init.d/devfs ]] | ||
112 | +then | ||
113 | + source ${rc_base}/init.d/devfs | ||
114 | +fi | ||
115 | |||
116 | trap "" INT QUIT TSTP | ||
117 | |||
118 | @@ -70,76 +60,8 @@ | ||
119 | fi | ||
120 | fi | ||
121 | |||
122 | - ## load devfs ## | ||
123 | - # load devfs only with a 2.4 kernel or its really wanted with a 2.6 | ||
124 | - if [[ $(kernel_major_version) = 2.4 ]] || [[ ${RC_USED_DEV} = devfs ]] | ||
125 | - then | ||
126 | - # start devfsd daemon, needed for bootsplash; | ||
127 | - # no use of '/etc/rc.d/init.d/devfs' anymore | ||
128 | - # check if devfs was mounted by the kernel, | ||
129 | - # if not mount it (mbuild_livecd needs this one) | ||
130 | - if [ ! -e /dev/.devfsd ] | ||
131 | - then | ||
132 | - echo -e ${COLOREDSTAR}"Mounting devfs file system ..." | ||
133 | - mount -n -t devfs devfs /dev | ||
134 | - evaluate_retval | ||
135 | - fi | ||
136 | - | ||
137 | - if [ -e /dev/.devfsd ] | ||
138 | - then | ||
139 | - echo -e ${COLOREDSTAR}"Starting devfsd ..." | ||
140 | - ## directory /lib/dev-state !must! exists ## | ||
141 | - /sbin/devfsd /dev &> /dev/null | ||
142 | - evaluate_retval | ||
143 | - else | ||
144 | - echo -e ${COLRED}"No devfs filesystem found ..." | ||
145 | - echo -e ${COLYELLOW}"Your Kernel doesn't support the devfs filesystem." | ||
146 | - echo -e ${COLYELLOW}"Devfs is necessary to run Magellan-Linux." | ||
147 | - echo -e ${COLYELLOW}"Please make shure that this is enabled in your kernel." | ||
148 | - echo | ||
149 | - echo -e ${COLYELLOW}"Press any key to shutdown the system safely ..." | ||
150 | - read | ||
151 | - $rc_base/init.d/halt | ||
152 | - fi | ||
153 | - fi | ||
154 | - | ||
155 | - #### load udev #### | ||
156 | - # load udev only with a 2.6 kernel | ||
157 | - if [[ $(kernel_major_version) = 2.6 ]] && [[ ${RC_USED_DEV} = udev ]] | ||
158 | - then | ||
159 | - # create a ramdisk for populating udev | ||
160 | - echo -e ${COLOREDSTAR}"Mounting udev at /dev ..." | ||
161 | - # tmpfs was suggested by Greg Kroah-Hartman | ||
162 | - # many video drivers needed exec access | ||
163 | - mount -n -t ramfs udev /dev -o exec,nosuid,mode=0755 | ||
164 | - evaluate_retval | ||
165 | - | ||
166 | - # if a device tarball exists load it and if it is activated | ||
167 | - echo -e ${COLOREDSTAR}"Configurating system to use udev ..." | ||
168 | - if [[ ${RC_DEVICE_TARBALL} = yes ]] | ||
169 | - then | ||
170 | - echo -e ${COLOREDSTAR}" Populating /dev with with device nodes ..." | ||
171 | - tar -jxpf /lib/udev-state/devices.tar.bz2 -C /dev | ||
172 | - evaluate_retval | ||
173 | - fi | ||
174 | - | ||
175 | - # now load udev | ||
176 | - populate_udev | ||
177 | - | ||
178 | - # if hotplug support exists in the kernel use it to manage udev | ||
179 | - if [ -e /proc/sys/kernel/hotplug -a -x /sbin/hotplug ] | ||
180 | - then | ||
181 | - echo -e ${COLOREDSTAR}" Using /sbin/hotplug for udev management ..." | ||
182 | - | ||
183 | - elif [ -e /proc/sys/kernel/hotplug ] | ||
184 | - then | ||
185 | - echo -e ${COLOREDSTAR}" Setting /sbin/udev as hotplug agent ..." | ||
186 | - echo "/sbin/udev" > /proc/sys/kernel/hotplug | ||
187 | - else | ||
188 | - echo -e ${COLOREDSTAR}${COLYELLOW}" Kernel was not compiled with hotplug support !" | ||
189 | - fi | ||
190 | - evaluate_retval | ||
191 | - fi | ||
192 | + # load devicemanager (udev or devfs) | ||
193 | + start_devicemanager | ||
194 | |||
195 | ## load devpts ## | ||
196 | # devfs/udev with 2.6 has no ptys, so devpts is also needed | ||
197 | @@ -193,17 +115,8 @@ | ||
198 | # load bootsplash | ||
199 | splash "rc_init" "${runlevel}" | ||
200 | |||
201 | - # if requested save devices to a device tarball before halt | ||
202 | - # only for kernels >=2.6 *and* udev | ||
203 | - # make shure that udev is mounted but *not* devfs --> /dev/.devfsd | ||
204 | - if [[ ${RC_DEVICE_TARBALL} = yes ]] && \ | ||
205 | - [ -e /dev/.udev -a ! -e /dev/.devfsd -a ! -e /.bootdev ] | ||
206 | - then | ||
207 | - echo -e ${COLOREDSTAR}"Saving /dev device nodes ..." | ||
208 | - ( cd /dev; tar -jclpf "/tmp/devices-$$.tar.bz2" * &> /dev/null ) | ||
209 | - mv -f "/tmp/devices-$$.tar.bz2" /lib/udev-state/devices.tar.bz2 | ||
210 | - evaluate_retval | ||
211 | - fi | ||
212 | + # stop devicemanager (udev or devfs) | ||
213 | + stop_devicemanager | ||
214 | fi | ||
215 | |||
216 | |||
217 | diff -Naur magellan-initscripts/sbin/rc-config magellan-initscripts-external-udev/sbin/rc-config | ||
218 | --- magellan-initscripts/sbin/rc-config 2005-07-03 15:54:15.000000000 +0200 | ||
219 | +++ magellan-initscripts-external-udev/sbin/rc-config 2010-12-02 13:52:07.000000000 +0100 | ||
220 | @@ -2,9 +2,9 @@ | ||
221 | # $Header: /magellan-cvs/magellan-src/magellan-initscripts/sbin/rc-config,v 1.3 2005/07/03 13:54:15 niro Exp $ | ||
222 | |||
223 | RC_INIT_BASE=/etc/init.d | ||
224 | -RC_EXCLUDE="rc functions template splash-functions" | ||
225 | +RC_EXCLUDE="rc functions template splash-functions devfs udev" | ||
226 | |||
227 | -VERSION=0.2 | ||
228 | +VERSION=0.2.1 | ||
229 | |||
230 | get_run_levels(){ | ||
231 | local SCRIPT |