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