Magellan Linux

Contents of /branches/magellan-next/core/udev/udev-162-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6668 - (show annotations) (download)
Wed Sep 15 13:15:11 2010 UTC (13 years, 8 months ago) by niro
File size: 6707 byte(s)
auto added: ver bump to 162-r3
1 # $Id: udev-151-r2.smage2 5611 2010-07-14 13:23:26Z niro $
2
3 PNAME="udev"
4 PVER="162"
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.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 --exec-prefix= \
57 --with-libdir-name='$(mlibdir)' \
58 --libexecdir=/lib/udev \
59 --enable-logging \
60 --without-selinux \
61 --disable-introspection \
62 --with-systemdsystemunitdir=/lib/systemd/system \
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 || 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 deprecated pnp-aliases
162 if [[ -f ${MROOT}/etc/modprobe.d/pnp-aliases ]]
163 then
164 rm -f ${MROOT}/etc/modprobe.d/pnp-aliases
165 fi
166
167 # delete all udev.rules which are moved from /etc/udev to /lib/udev
168 local rule
169 for rule in 40-arch-s390.rules \
170 61-persistent-storage-edd.rules \
171 75-persistent-net-generator.rules \
172 64-md-raid.rules \
173 65-permissions.rules \
174 64-device-mapper.rules \
175 40-alsa.rules \
176 40-zaptel.rules \
177 60-persistent-input.rules \
178 40-arch-ia64.rules \
179 05-udev-early.rules \
180 40-arch-ppc.rules \
181 60-cdrom_id.rules \
182 40-pilot-links.rules \
183 95-udev-late.rules \
184 40-magellan.rules \
185 50-udev-default.rules \
186 80-drivers.rules \
187 30-kernel-compat.rules \
188 40-video.rules \
189 60-persistent-storage-tape.rules \
190 75-cd-aliases-generator.rules \
191 60-persistent-storage.rules
192 do
193 # delete obsolete hotplug.dev script
194 if [[ -f ${MROOT}/etc/udev/rules.d/${rule} ]]
195 then
196 rm -f ${MROOT}/etc/udev/rules.d/${rule}
197 fi
198 done
199 }
200
201 postinstall()
202 {
203 # create some nodes that we need if they not exist
204 [[ ! -e ${MROOT}/lib/udev/devices/null ]] &&
205 mknod ${MROOT}/lib/udev/devices/null c 1 3
206 chmod 666 ${MROOT}/lib/udev/devices/null
207 touch -t 198002220222 ${MROOT}/lib/udev/devices/null
208
209 [[ ! -e ${MROOT}/lib/udev/devices/zero ]] &&
210 mknod ${MROOT}/lib/udev/devices/zero c 1 5
211 chmod 666 ${MROOT}/lib/udev/devices/zero
212 touch -t 198002220222 ${MROOT}/lib/udev/devices/zero
213
214 [[ ! -e ${MROOT}/lib/udev/devices/console ]] &&
215 mknod ${MROOT}/lib/udev/devices/console c 5 1
216 chmod 600 ${MROOT}/lib/udev/devices/console
217 chown root:tty ${MROOT}/lib/udev/devices/console
218 touch -t 198002220222 ${MROOT}/lib/udev/devices/console
219
220 [[ ! -e ${MROOT}/lib/udev/devices/urandom ]] &&
221 mknod ${MROOT}/lib/udev/devices/urandom c 1 9
222 chmod 666 ${MROOT}/lib/udev/devices/urandom
223 touch -t 198002220222 ${MROOT}/lib/udev/devices/urandom
224
225 # after install/uprade, udev *must* be reloaded if already running
226 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] &&
227 [[ -n $(pidof udevd) ]] && [[ ${MAGE_BOOTSTRAP} != true ]]
228 then
229 echo "MROOT=/; restarting udev daemon ..."
230 killall -15 udevd &> /dev/null
231 sleep 1
232 killall -9 udevd &> /dev/null
233 /sbin/udevd --daemon
234 fi
235 }