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