Contents of /trunk/core/udev/udev-119-r2.smage2
Parent Directory | Revision Log
Revision 12 -
(show annotations)
(download)
Fri Oct 10 19:13:10 2008 UTC (15 years, 8 months ago) by niro
File size: 10912 byte(s)
Fri Oct 10 19:13:10 2008 UTC (15 years, 8 months ago) by niro
File size: 10912 byte(s)
-fixed a typo
1 | # $Header: /magellan-cvs/smage/udev/udev-119-r2.smage2,v 1.3 2008/06/18 21:49:46 niro Exp $ |
2 | |
3 | PNAME="udev" |
4 | PVER="119" |
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/initscripts-0.4.11 |
15 | >= sys-apps/hotplug-20040401" |
16 | |
17 | SDEPEND=">= virtual/kernel-sources" |
18 | |
19 | SRCFILE="${PNAME}-${PVER}.tar.bz2" |
20 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
21 | |
22 | # global var: ${LINUX_SOURCES} |
23 | # location where they are |
24 | [[ -z ${LINUX_SOURCES} ]] && LINUX_SOURCES="/usr/src/linux" |
25 | |
26 | sminclude mtools |
27 | |
28 | SRC_URI=( |
29 | http://www.kernel.org/pub/linux/utils/kernel/hotplug/${SRCFILE} |
30 | mirror://${PNAME}/${SRCFILE} |
31 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev.conf |
32 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-alsa.rules.magellan |
33 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-arch-ia64.rules.magellan |
34 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-arch-ppc.rules.magellan |
35 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-arch-s390.rules.magellan |
36 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-cd-aliases-generator.rules.magellan |
37 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-cdrom_id.rules.magellan |
38 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-device-mapper.rules.magellan |
39 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-drivers.rules.magellan |
40 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-early.rules.magellan |
41 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-kernel-compat.rules.magellan |
42 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-late.rules.magellan |
43 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-magellan.rules.magellan |
44 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-md-raid.rules.magellan |
45 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-permissions.rules.magellan |
46 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-persistent-input.rules.magellan |
47 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-persistent-net-generator.rules.magellan |
48 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-persistent-storage-edd.rules.magellan |
49 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-persistent-storage.rules.magellan |
50 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-persistent-storage-tape.rules.magellan |
51 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-pilot-links.rules.magellan |
52 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev.rules.magellan |
53 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-video.rules.magellan |
54 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/udev-zaptel.rules.magellan |
55 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/modprobe.sh |
56 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/write_root_link_rule.sh |
57 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/blacklist |
58 | mirror://${PNAME}/config-${PNAME}-${PVER}-${PBUILD}/pnp-aliases |
59 | ) |
60 | |
61 | UP2DATE="updatecmd http://www.kernel.org/pub/linux/utils/kernel/hotplug | grep ${PNAME}- | lasttarball" |
62 | |
63 | src_prepare() |
64 | { |
65 | munpack ${SRCFILE} || die |
66 | cd ${SRCDIR} |
67 | |
68 | # no need to clutter the logs ... |
69 | sed -i '/^DEBUG/ c\DEBUG = false' Makefile || die |
70 | # do not use optimization flags from the package |
71 | |
72 | sed -i 's|$(OPTIMIZATION)||g' Makefile || die |
73 | |
74 | # multilib fixup |
75 | sed -i "/ =/s:/lib:/$(mlibdir):" extras/volume_id/lib/Makefile || die |
76 | |
77 | # enable udev extras |
78 | export extras="extras/ata_id \ |
79 | extras/cdrom_id \ |
80 | extras/collect \ |
81 | extras/edd_id \ |
82 | extras/firmware \ |
83 | extras/floppy \ |
84 | extras/path_id \ |
85 | extras/rule_generator \ |
86 | extras/scsi_id \ |
87 | extras/usb_id \ |
88 | extras/volume_id" |
89 | } |
90 | |
91 | src_compile() |
92 | { |
93 | cd ${SRCDIR} |
94 | mmake EXTRAS="${extras}" udevdir="/dev/" DEBUG=false || die |
95 | } |
96 | |
97 | src_install() |
98 | { |
99 | cd ${SRCDIR} |
100 | mmake DESTDIR=${BINDIR} EXTRAS="${extras}" udevdir="/dev/" DEBUG=false install || die |
101 | |
102 | # needed directories |
103 | minstalldir /etc/modprobe.d || die |
104 | |
105 | # install vol id library |
106 | rm ${BINDIR}/$(mlibdir)/libvolume_id.* || die |
107 | rm ${BINDIR}/usr/$(mlibdir)/libvolume_id.* || die |
108 | rm ${BINDIR}/usr/$(mlibdir)/pkgconfig/*.pc || die |
109 | minstallexec extras/volume_id/lib/\*.a /usr/$(mlibdir) || die |
110 | # don't use install here, link references will be installed, not the symlinks itself |
111 | cp -a extras/volume_id/lib/*.so* ${BINDIR}/$(mlibdir) || die |
112 | # fix pkgconfig pathes on multilib systems |
113 | sed -i "s:/usr/lib:/usr/$(mlibdir):g" extras/volume_id/lib/*.pc || die |
114 | # pkgconfig |
115 | minstallfile extras/volume_id/lib/\*.pc /usr/$(mlibdir)/pkgconfig || die |
116 | # includes |
117 | minstallfile extras/volume_id/lib/libvolume_id.h /usr/include || die |
118 | |
119 | # generic udev helper scripts |
120 | minstallexec -s modprobe.sh /lib/udev || die |
121 | minstallexec -s write_root_link_rule.sh /lib/udev/write_root_link_rule || die |
122 | |
123 | # create symlinks for these utilities to /sbin |
124 | # where multipath-tools expect them to be |
125 | mlink ../lib/udev/vol_id /sbin/ || die |
126 | mlink ../lib/udev/scsi_id /sbin/ || die |
127 | |
128 | # our config file |
129 | minstalletc udev.conf udev/udev.conf || die |
130 | |
131 | # install our udev rules |
132 | minstalletc udev-early.rules.magellan udev/rules.d/05-udev-early.rules || die |
133 | minstalletc udev-kernel-compat.rules.magellan udev/rules.d/30-kernel-compat.rules || die |
134 | minstalletc udev-alsa.rules.magellan udev/rules.d/40-alsa.rules || die |
135 | minstalletc udev-arch-ia64.rules.magellan udev/rules.d/40-arch-ia64.rules || die |
136 | minstalletc udev-arch-ppc.rules.magellan udev/rules.d/40-arch-ppc.rules || die |
137 | minstalletc udev-arch-s390.rules.magellan udev/rules.d/40-arch-s390.rules || die |
138 | minstalletc udev-magellan.rules.magellan udev/rules.d/40-magellan.rules || die |
139 | minstalletc udev-pilot-links.rules.magellan udev/rules.d/40-pilot-links.rules || die |
140 | minstalletc udev-video.rules.magellan udev/rules.d/40-video.rules || die |
141 | minstalletc udev-zaptel.rules.magellan udev/rules.d/40-zaptel.rules || die |
142 | minstalletc udev.rules.magellan udev/rules.d/50-udev-default.rules || die |
143 | minstalletc udev-cdrom_id.rules.magellan udev/rules.d/60-cdrom_id.rules || die |
144 | minstalletc udev-persistent-input.rules.magellan udev/rules.d/60-persistent-input.rules || die |
145 | minstalletc udev-persistent-storage.rules.magellan udev/rules.d/60-persistent-storage.rules || die |
146 | minstalletc udev-persistent-storage-tape.rules.magellan udev/rules.d/60-persistent-storage-tape.rules || die |
147 | minstalletc udev-persistent-storage-edd.rules.magellan udev/rules.d/61-persistent-storage-edd.rules || die |
148 | minstalletc udev-device-mapper.rules.magellan udev/rules.d/64-device-mapper.rules || die |
149 | minstalletc udev-md-raid.rules.magellan udev/rules.d/64-md-raid.rules || die |
150 | minstalletc udev-permissions.rules.magellan udev/rules.d/65-permissions.rules || die |
151 | minstalletc udev-cd-aliases-generator.rules.magellan udev/rules.d/75-cd-aliases-generator.rules || die |
152 | minstalletc udev-persistent-net-generator.rules.magellan udev/rules.d/75-persistent-net-generator.rules || die |
153 | minstalletc udev-drivers.rules.magellan udev/rules.d/80-drivers.rules || die |
154 | minstalletc udev-late.rules.magellan udev/rules.d/95-udev-late.rules || die |
155 | |
156 | # install our blacklist |
157 | minstalletc blacklist udev/blacklist || die |
158 | |
159 | # install our pnpaliases; now excluded from 50-udev.rules |
160 | minstalletc pnp-aliases modprobe.d/pnp-aliases || die |
161 | |
162 | # mark state dir undeletable |
163 | mkeepdir /lib/udev/state || die |
164 | mkeepdir /lib/udev/devices || die |
165 | |
166 | # CONFIG_PROTECT_MASK for /etc/udev/rules.d |
167 | minstalldir /etc/env.d || die |
168 | echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > ${BINDIR}/etc/env.d/02udev || die |
169 | |
170 | # create some nodes that we know we need |
171 | mknod ${BINDIR}/lib/udev/devices/null c 1 3 || die |
172 | chmod 666 ${BINDIR}/lib/udev/devices/null || die |
173 | # hey, that's my birthday :) |
174 | touch -t 198002220222 ${BINDIR}/lib/udev/devices/null || die |
175 | |
176 | mknod ${BINDIR}/lib/udev/devices/zero c 1 5 || die |
177 | chmod 666 ${BINDIR}/lib/udev/devices/zero || die |
178 | touch -t 198002220222 ${BINDIR}/lib/udev/devices/zero || die |
179 | |
180 | mknod ${BINDIR}/lib/udev/devices/console c 5 1 || die |
181 | chmod 600 ${BINDIR}/lib/udev/devices/console || die |
182 | chown root:tty ${BINDIR}/lib/udev/devices/console || die |
183 | touch -t 198002220222 ${BINDIR}/lib/udev/devices/console || die |
184 | |
185 | mknod ${BINDIR}/lib/udev/devices/urandom c 1 9 || die |
186 | chmod 666 ${BINDIR}/lib/udev/devices/urandom || die |
187 | touch -t 198002220222 ${BINDIR}/lib/udev/devices/urandom || die |
188 | |
189 | cd ${SRCDIR} |
190 | minstalldocs COPYING ChangeLog FAQ RELEASE-NOTES README TODO \ |
191 | docs/{overview,udev_vs_devfs,README-gcov_for_udev} \ |
192 | docs/writing_udev_rules/* \ |
193 | || die |
194 | } |
195 | |
196 | preinstall() |
197 | { |
198 | if [[ -d ${MROOT}/lib/udev-state ]] |
199 | then |
200 | mv -f ${MROOT}/lib/udev-state/* ${MROOT}/lib/udev/state/ |
201 | rm -r ${MROOT}/lib/udev-state |
202 | fi |
203 | |
204 | if [[ -f ${MROOT}/etc/udev/udev.config ]] && |
205 | [[ ! -f ${MROOT}/etc/udev/udev.rules ]] |
206 | then |
207 | mv -f ${MROOT}/etc/udev/udev.config ${MROOT}/etc/udev/udev.rules |
208 | fi |
209 | |
210 | # delete the old udev.hotplug symlink if it is present |
211 | if [[ -h ${MROOT}/etc/hotplug.d/default/udev.hotplug ]] |
212 | then |
213 | rm -f ${MROOT}/etc/hotplug.d/default/udev.hotplug |
214 | fi |
215 | |
216 | # delete the old wait_for_sysfs.hotplug symlink if it is present |
217 | if [[ -h ${MROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] |
218 | then |
219 | rm -f ${MROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug |
220 | fi |
221 | |
222 | # delete the old 10-udev.hotplug symlink if it is present |
223 | if [[ -h ${MROOT}/etc/hotplug.d/default/10-udev.hotplug ]] |
224 | then |
225 | rm -f ${MROOT}/etc/hotplug.d/default/10-udev.hotplug |
226 | fi |
227 | |
228 | # delete the deprectated udev-late rc-script |
229 | [[ -x ${MROOT}/sbin/rc-config ]] && ${MROOT}/sbin/rc-config del udev-late |
230 | |
231 | # delete obsolete hotplug.dev script |
232 | if [[ -f ${MROOT}/etc/dev.d/net/hotplug.dev ]] |
233 | then |
234 | rm -f ${MROOT}/etc/dev.d/net/hotplug.dev |
235 | fi |
236 | } |
237 | |
238 | postinstall() |
239 | { |
240 | # create some nodes that we need if they not exist |
241 | [[ ! -e ${MROOT}/lib/udev/devices/null ]] && |
242 | mknod ${MROOT}/lib/udev/devices/null c 1 3 |
243 | chmod 666 ${MROOT}/lib/udev/devices/null |
244 | touch -t 198002220222 ${MROOT}/lib/udev/devices/null |
245 | |
246 | [[ ! -e ${MROOT}/lib/udev/devices/zero ]] && |
247 | mknod ${MROOT}/lib/udev/devices/zero c 1 5 |
248 | chmod 666 ${MROOT}/lib/udev/devices/zero |
249 | touch -t 198002220222 ${MROOT}/lib/udev/devices/zero |
250 | |
251 | [[ ! -e ${MROOT}/lib/udev/devices/console ]] && |
252 | mknod ${MROOT}/lib/udev/devices/console c 5 1 |
253 | chmod 600 ${MROOT}/lib/udev/devices/console |
254 | chown root:tty ${MROOT}/lib/udev/devices/console |
255 | touch -t 198002220222 ${MROOT}/lib/udev/devices/console |
256 | |
257 | [[ ! -e ${MROOT}/lib/udev/devices/urandom ]] && |
258 | mknod ${MROOT}/lib/udev/devices/urandom c 1 9 |
259 | chmod 666 ${MROOT}/lib/udev/devices/urandom |
260 | touch -t 198002220222 ${MROOT}/lib/udev/devices/urandom |
261 | |
262 | # after install/uprade, udev *must* be reloaded if already running |
263 | if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] && |
264 | [[ -n $(pidof udevd) ]] && [[ ${MAGE_BOOTSTRAP} != true ]] |
265 | then |
266 | echo "MROOT=/; restarting udev daemon ..." |
267 | killall -15 udevd &> /dev/null |
268 | sleep 1 |
269 | killall -9 udevd &> /dev/null |
270 | /sbin/udevd --daemon |
271 | fi |
272 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |