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