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