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