Annotation of /trunk/core/udev/udev-151-r2.smage2
Parent Directory | Revision Log
Revision 5611 -
(hide annotations)
(download)
Wed Jul 14 13:23:26 2010 UTC (14 years, 2 months ago) by niro
File size: 6782 byte(s)
Wed Jul 14 13:23:26 2010 UTC (14 years, 2 months ago) by niro
File size: 6782 byte(s)
-rev bump to 151-r2; provide rc script with this package, not via initscript anymore
1 | niro | 5611 | # $Id$ |
2 | |||
3 | PNAME="udev" | ||
4 | PVER="151" | ||
5 | PBUILD="r2" | ||
6 | |||
7 | PCATEGORIE="sys-fs" | ||
8 | STATE="unstable" | ||
9 | |||
10 | DESCRIPTION="A Userspace Implementation for dynamic /dev nodes." | ||
11 | HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" | ||
12 | |||
13 | DEPEND=">= virtual/glibc | ||
14 | >= sys-apps/util-linux-2.16 | ||
15 | >= sys-apps/acl-2.2 | ||
16 | >= sys-apps/usbutils-0.86 | ||
17 | >= sys-apps/pciutils-3.1 | ||
18 | >= sys-apps/initscripts-0.5 | ||
19 | >= dev-libs/glib2-2.22" | ||
20 | |||
21 | SDEPEND=">= virtual/kernel-sources" | ||
22 | |||
23 | SRCFILE="${PNAME}-${PVER}.tar.bz2" | ||
24 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" | ||
25 | |||
26 | CONFIG_SRCFILE="config-${PNAME}-${PVER}-${PBUILD}.tar.bz2" | ||
27 | CONFIG_SRCDIR="${BUILDDIR}/config-${PNAME}-${PVER}-${PBUILD}" | ||
28 | |||
29 | # global var: ${LINUX_SOURCES} | ||
30 | # location where they are | ||
31 | [[ -z ${LINUX_SOURCES} ]] && LINUX_SOURCES="/usr/src/linux" | ||
32 | |||
33 | sminclude mtools multilib | ||
34 | |||
35 | SRC_URI=( | ||
36 | http://www.kernel.org/pub/linux/utils/kernel/hotplug/${SRCFILE} | ||
37 | mirror://${PNAME}/${SRCFILE} | ||
38 | mirror://${PNAME}/${CONFIG_SRCFILE} | ||
39 | mirror://${PNAME}/${PNAME}-${PVER}-fix-missing-firmware-timeout.patch | ||
40 | ) | ||
41 | |||
42 | UP2DATE="updatecmd http://www.kernel.org/pub/linux/utils/kernel/hotplug | grep ${PNAME}- | lasttarball" | ||
43 | |||
44 | src_prepare() | ||
45 | { | ||
46 | munpack ${SRCFILE} || die | ||
47 | oldmunpack ${CONFIG_SRCFILE} || die | ||
48 | |||
49 | # fix missing firmware timeouts which make modprobe probe for 60 seconds on a failure | ||
50 | mpatch ${PNAME}-${PVER}-fix-missing-firmware-timeout.patch || die | ||
51 | } | ||
52 | |||
53 | src_compile() | ||
54 | { | ||
55 | # using /lib/udev as libexecdir also on multilib systems | ||
56 | # to have one common rules/script directory! | ||
57 | mconfigure \ | ||
58 | --exec-prefix= \ | ||
59 | --with-libdir-name='$(mlibdir)' \ | ||
60 | --libexecdir=/lib/udev \ | ||
61 | --enable-logging \ | ||
62 | --without-selinux \ | ||
63 | --disable-introspection \ | ||
64 | || die | ||
65 | |||
66 | mmake || die | ||
67 | } | ||
68 | |||
69 | src_install() | ||
70 | { | ||
71 | mmake DESTDIR=${BINDIR} install || die | ||
72 | minstalldocs COPYING ChangeLog NEWS README TODO || die | ||
73 | |||
74 | # install our config | ||
75 | cd ${CONFIG_SRCDIR} | ||
76 | make DESTDIR=${BINDIR} install || die | ||
77 | |||
78 | # create symlinks for these utilities to /sbin | ||
79 | # where multipath-tools expect them to be | ||
80 | mlink ../lib/udev/scsi_id /sbin/ || die | ||
81 | |||
82 | # mark some dirs undeletable | ||
83 | mkeepdir /etc/udev/rules.d || die | ||
84 | mkeepdir /lib/udev/state || die | ||
85 | mkeepdir /lib/udev/devices || die | ||
86 | |||
87 | # CONFIG_PROTECT_MASK for /etc/udev/rules.d | ||
88 | minstalldir /etc/env.d || die | ||
89 | echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > ${BINDIR}/etc/env.d/02udev || die | ||
90 | |||
91 | # create some nodes that we know we need | ||
92 | mknod ${BINDIR}/lib/udev/devices/null c 1 3 || die | ||
93 | chmod 666 ${BINDIR}/lib/udev/devices/null || die | ||
94 | # hey, that's my birthday :) | ||
95 | touch -t 198002220222 ${BINDIR}/lib/udev/devices/null || die | ||
96 | |||
97 | mknod ${BINDIR}/lib/udev/devices/zero c 1 5 || die | ||
98 | chmod 666 ${BINDIR}/lib/udev/devices/zero || die | ||
99 | touch -t 198002220222 ${BINDIR}/lib/udev/devices/zero || die | ||
100 | |||
101 | mknod ${BINDIR}/lib/udev/devices/console c 5 1 || die | ||
102 | chmod 600 ${BINDIR}/lib/udev/devices/console || die | ||
103 | chown root:tty ${BINDIR}/lib/udev/devices/console || die | ||
104 | touch -t 198002220222 ${BINDIR}/lib/udev/devices/console || die | ||
105 | |||
106 | mknod ${BINDIR}/lib/udev/devices/urandom c 1 9 || die | ||
107 | chmod 666 ${BINDIR}/lib/udev/devices/urandom || die | ||
108 | touch -t 198002220222 ${BINDIR}/lib/udev/devices/urandom || die | ||
109 | } | ||
110 | |||
111 | preinstall() | ||
112 | { | ||
113 | if [[ ! -z $(magequery -n hotplug) ]] | ||
114 | then | ||
115 | echo -e ${COLRED} | ||
116 | echo -e "Error: sys-apps/hotplug is installed!!" | ||
117 | echo -e "hotplug is now fully provided by udev itself and it is not recommend to use this anymore." | ||
118 | echo -e "Please uninstall sys-apps/hotplug first!" | ||
119 | echo -e ${COLDEFAULT} | ||
120 | die "sys-apps/hotplug found!" | ||
121 | fi | ||
122 | |||
123 | if [[ -d ${MROOT}/lib/udev-state ]] | ||
124 | then | ||
125 | mv -f ${MROOT}/lib/udev-state/* ${MROOT}/lib/udev/state/ | ||
126 | rm -r ${MROOT}/lib/udev-state | ||
127 | fi | ||
128 | |||
129 | if [[ -f ${MROOT}/etc/udev/udev.config ]] && | ||
130 | [[ ! -f ${MROOT}/etc/udev/udev.rules ]] | ||
131 | then | ||
132 | mv -f ${MROOT}/etc/udev/udev.config ${MROOT}/etc/udev/udev.rules | ||
133 | fi | ||
134 | |||
135 | # delete the old udev.hotplug symlink if it is present | ||
136 | if [[ -h ${MROOT}/etc/hotplug.d/default/udev.hotplug ]] | ||
137 | then | ||
138 | rm -f ${MROOT}/etc/hotplug.d/default/udev.hotplug | ||
139 | fi | ||
140 | |||
141 | # delete the old wait_for_sysfs.hotplug symlink if it is present | ||
142 | if [[ -h ${MROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] | ||
143 | then | ||
144 | rm -f ${MROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug | ||
145 | fi | ||
146 | |||
147 | # delete the old 10-udev.hotplug symlink if it is present | ||
148 | if [[ -h ${MROOT}/etc/hotplug.d/default/10-udev.hotplug ]] | ||
149 | then | ||
150 | rm -f ${MROOT}/etc/hotplug.d/default/10-udev.hotplug | ||
151 | fi | ||
152 | |||
153 | # delete the deprectated udev-late rc-script | ||
154 | [[ -x ${MROOT}/sbin/rc-config ]] && ${MROOT}/sbin/rc-config del udev-late | ||
155 | |||
156 | # delete obsolete hotplug.dev script | ||
157 | if [[ -f ${MROOT}/etc/dev.d/net/hotplug.dev ]] | ||
158 | then | ||
159 | rm -f ${MROOT}/etc/dev.d/net/hotplug.dev | ||
160 | fi | ||
161 | |||
162 | # delete deprecated pnp-aliases | ||
163 | if [[ -f ${MROOT}/etc/modprobe.d/pnp-aliases ]] | ||
164 | then | ||
165 | rm -f ${MROOT}/etc/modprobe.d/pnp-aliases | ||
166 | fi | ||
167 | |||
168 | # delete all udev.rules which are moved from /etc/udev to /lib/udev | ||
169 | local rule | ||
170 | for rule in 40-arch-s390.rules \ | ||
171 | 61-persistent-storage-edd.rules \ | ||
172 | 75-persistent-net-generator.rules \ | ||
173 | 64-md-raid.rules \ | ||
174 | 65-permissions.rules \ | ||
175 | 64-device-mapper.rules \ | ||
176 | 40-alsa.rules \ | ||
177 | 40-zaptel.rules \ | ||
178 | 60-persistent-input.rules \ | ||
179 | 40-arch-ia64.rules \ | ||
180 | 05-udev-early.rules \ | ||
181 | 40-arch-ppc.rules \ | ||
182 | 60-cdrom_id.rules \ | ||
183 | 40-pilot-links.rules \ | ||
184 | 95-udev-late.rules \ | ||
185 | 40-magellan.rules \ | ||
186 | 50-udev-default.rules \ | ||
187 | 80-drivers.rules \ | ||
188 | 30-kernel-compat.rules \ | ||
189 | 40-video.rules \ | ||
190 | 60-persistent-storage-tape.rules \ | ||
191 | 75-cd-aliases-generator.rules \ | ||
192 | 60-persistent-storage.rules | ||
193 | do | ||
194 | # delete obsolete hotplug.dev script | ||
195 | if [[ -f ${MROOT}/etc/udev/rules.d/${rule} ]] | ||
196 | then | ||
197 | rm -f ${MROOT}/etc/udev/rules.d/${rule} | ||
198 | fi | ||
199 | done | ||
200 | } | ||
201 | |||
202 | postinstall() | ||
203 | { | ||
204 | # create some nodes that we need if they not exist | ||
205 | [[ ! -e ${MROOT}/lib/udev/devices/null ]] && | ||
206 | mknod ${MROOT}/lib/udev/devices/null c 1 3 | ||
207 | chmod 666 ${MROOT}/lib/udev/devices/null | ||
208 | touch -t 198002220222 ${MROOT}/lib/udev/devices/null | ||
209 | |||
210 | [[ ! -e ${MROOT}/lib/udev/devices/zero ]] && | ||
211 | mknod ${MROOT}/lib/udev/devices/zero c 1 5 | ||
212 | chmod 666 ${MROOT}/lib/udev/devices/zero | ||
213 | touch -t 198002220222 ${MROOT}/lib/udev/devices/zero | ||
214 | |||
215 | [[ ! -e ${MROOT}/lib/udev/devices/console ]] && | ||
216 | mknod ${MROOT}/lib/udev/devices/console c 5 1 | ||
217 | chmod 600 ${MROOT}/lib/udev/devices/console | ||
218 | chown root:tty ${MROOT}/lib/udev/devices/console | ||
219 | touch -t 198002220222 ${MROOT}/lib/udev/devices/console | ||
220 | |||
221 | [[ ! -e ${MROOT}/lib/udev/devices/urandom ]] && | ||
222 | mknod ${MROOT}/lib/udev/devices/urandom c 1 9 | ||
223 | chmod 666 ${MROOT}/lib/udev/devices/urandom | ||
224 | touch -t 198002220222 ${MROOT}/lib/udev/devices/urandom | ||
225 | |||
226 | # after install/uprade, udev *must* be reloaded if already running | ||
227 | if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] && | ||
228 | [[ -n $(pidof udevd) ]] && [[ ${MAGE_BOOTSTRAP} != true ]] | ||
229 | then | ||
230 | echo "MROOT=/; restarting udev daemon ..." | ||
231 | killall -15 udevd &> /dev/null | ||
232 | sleep 1 | ||
233 | killall -9 udevd &> /dev/null | ||
234 | /sbin/udevd --daemon | ||
235 | fi | ||
236 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |