Magellan Linux

Contents of /smage/branches/alx-0_6_0/core/udev/udev-166-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3547 - (show annotations) (download)
Wed Apr 25 15:43:15 2012 UTC (12 years ago) by niro
File size: 7456 byte(s)
-added ipw2x00 wlan0 patch
1 # $Id$
2
3 PNAME="udev"
4 PVER="166"
5 PBUILD="r3"
6
7 PCATEGORIE="sys-fs"
8
9 DESCRIPTION="A Userspace Implementation for dynamic /dev nodes."
10 HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
11
12 DEPEND=">= virtual/glibc
13 >= sys-apps/util-linux-2.19
14 >= virtual/initscripts"
15
16 SDEPEND=">= virtual/kernel-sources"
17
18 PROVIDE="virtual/devmanager"
19
20 SRCFILE="${PNAME}-${PVER}.tar.bz2"
21 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
22
23 CONFIG_SRCFILE="config-${PNAME}-${PVER}-r2.tar.bz2"
24 CONFIG_SRCDIR="${BUILDDIR}/config-${PNAME}-${PVER}-r2"
25
26 # global var: ${LINUX_SOURCES}
27 # location where they are
28 [[ -z ${LINUX_SOURCES} ]] && LINUX_SOURCES="/usr/src/linux"
29
30 REMOVE_DEPRECATED_MAGE_TARGETS=1
31 ALX_ONLY_KEEP="etc lib/udev $(mlibdir) sbin usr/$(mlibdir)/*.so usr/$(mlibdir)/*.so.*"
32 sminclude mtools multilib alx-split
33
34 SRC_URI=(
35 http://www.kernel.org/pub/linux/utils/kernel/hotplug/${SRCFILE}
36 mirror://${PNAME}/${SRCFILE}
37 mirror://${PNAME}/${CONFIG_SRCFILE}
38 mirror://${PNAME}/${PNAME}-${PVER}-r2-alx-rename-ipw2x00-to-wlan0.patch
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 # rename ipw2x00 added devices to wlan0 to be compatible to our web-frontend
49 SRCDIR=${CONFIG_SRCDIR} mpatch ${PNAME}-${PVER}-r2-alx-rename-ipw2x00-to-wlan0.patch || die
50 }
51
52 src_compile()
53 {
54 # using /lib/udev as libexecdir also on multilib systems
55 # to have one common rules/script directory!
56 # same with the systemd units dir!
57 #
58 # we set --exec-prefix --bindir and --sbindir to fix ${exec_prefix} issues in the systemd units
59 # variables are not allowd in the beginning of ExecStart
60 # see: http://cgit.freedesktop.org/systemd/commit/?id=d2f316345cfadd07025b1a1770f63804e33c4b50
61 mconfigure \
62 --exec-prefix= \
63 --bindir=/bin \
64 --sbindir=/sbin \
65 --with-libdir-name='$(mlibdir)' \
66 --libexecdir=/lib/udev \
67 --enable-logging \
68 --without-selinux \
69 --disable-introspection \
70 --disable-extras \
71 --with-systemdsystemunitdir=/lib/systemd/system \
72 || die
73
74 mmake || die
75 }
76
77 alx_generic_src_install()
78 {
79 mmake DESTDIR=${BINDIR} install || die
80 minstalldocs COPYING ChangeLog NEWS README TODO || die
81
82 # install our config
83 cd ${CONFIG_SRCDIR}
84 make DESTDIR=${BINDIR} install-basic-files || die
85
86 # create symlinks for these utilities to /sbin
87 # where multipath-tools expect them to be
88 mlink ../lib/udev/scsi_id /sbin/ || die
89
90 # mark some dirs undeletable
91 mkeepdir /etc/udev/rules.d || die
92 mkeepdir /lib/udev/state || die
93 mkeepdir /lib/udev/devices || die
94
95 # CONFIG_PROTECT_MASK for /etc/udev/rules.d
96 minstalldir /etc/env.d || die
97 echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > ${BINDIR}/etc/env.d/02udev || die
98
99 # create some nodes that we know we need
100 mknod ${BINDIR}/lib/udev/devices/null c 1 3 || die
101 chmod 666 ${BINDIR}/lib/udev/devices/null || die
102 # hey, that's my birthday :)
103 touch -t 198002220222 ${BINDIR}/lib/udev/devices/null || die
104
105 mknod ${BINDIR}/lib/udev/devices/zero c 1 5 || die
106 chmod 666 ${BINDIR}/lib/udev/devices/zero || die
107 touch -t 198002220222 ${BINDIR}/lib/udev/devices/zero || die
108
109 mknod ${BINDIR}/lib/udev/devices/console c 5 1 || die
110 chmod 600 ${BINDIR}/lib/udev/devices/console || die
111 chown root:tty ${BINDIR}/lib/udev/devices/console || die
112 touch -t 198002220222 ${BINDIR}/lib/udev/devices/console || die
113
114 mknod ${BINDIR}/lib/udev/devices/urandom c 1 9 || die
115 chmod 666 ${BINDIR}/lib/udev/devices/urandom || die
116 touch -t 198002220222 ${BINDIR}/lib/udev/devices/urandom || die
117 }
118
119 preinstall()
120 {
121 add_conf_prot_mask /etc/udev /etc/env.d /etc/rc.d/init.d /etc/modprobe.d
122
123 if [[ ! -z $(magequery -n hotplug) ]]
124 then
125 echo -e ${COLRED}
126 echo -e "Error: sys-apps/hotplug is installed!!"
127 echo -e "hotplug is now fully provided by udev itself and it is not recommend to use this anymore."
128 echo -e "Please uninstall sys-apps/hotplug first!"
129 echo -e ${COLDEFAULT}
130 die "sys-apps/hotplug found!"
131 fi
132
133 if [[ -d ${MROOT}/lib/udev-state ]]
134 then
135 mv -f ${MROOT}/lib/udev-state/* ${MROOT}/lib/udev/state/
136 rm -r ${MROOT}/lib/udev-state
137 fi
138
139 if [[ -f ${MROOT}/etc/udev/udev.config ]] &&
140 [[ ! -f ${MROOT}/etc/udev/udev.rules ]]
141 then
142 mv -f ${MROOT}/etc/udev/udev.config ${MROOT}/etc/udev/udev.rules
143 fi
144
145 # delete the old udev.hotplug symlink if it is present
146 if [[ -h ${MROOT}/etc/hotplug.d/default/udev.hotplug ]]
147 then
148 rm -f ${MROOT}/etc/hotplug.d/default/udev.hotplug
149 fi
150
151 # delete the old wait_for_sysfs.hotplug symlink if it is present
152 if [[ -h ${MROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]]
153 then
154 rm -f ${MROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug
155 fi
156
157 # delete the old 10-udev.hotplug symlink if it is present
158 if [[ -h ${MROOT}/etc/hotplug.d/default/10-udev.hotplug ]]
159 then
160 rm -f ${MROOT}/etc/hotplug.d/default/10-udev.hotplug
161 fi
162
163 # delete the deprectated udev-late rc-script
164 [[ -x ${MROOT}/sbin/rc-config ]] && ${MROOT}/sbin/rc-config del udev-late
165
166 # delete obsolete hotplug.dev script
167 if [[ -f ${MROOT}/etc/dev.d/net/hotplug.dev ]]
168 then
169 rm -f ${MROOT}/etc/dev.d/net/hotplug.dev
170 fi
171
172 # delete deprecated pnp-aliases
173 if [[ -f ${MROOT}/etc/modprobe.d/pnp-aliases ]]
174 then
175 rm -f ${MROOT}/etc/modprobe.d/pnp-aliases
176 fi
177
178 # delete all udev.rules which are moved from /etc/udev to /lib/udev
179 local rule
180 for rule in 40-arch-s390.rules \
181 61-persistent-storage-edd.rules \
182 75-persistent-net-generator.rules \
183 64-md-raid.rules \
184 65-permissions.rules \
185 64-device-mapper.rules \
186 40-alsa.rules \
187 40-zaptel.rules \
188 60-persistent-input.rules \
189 40-arch-ia64.rules \
190 05-udev-early.rules \
191 40-arch-ppc.rules \
192 60-cdrom_id.rules \
193 40-pilot-links.rules \
194 95-udev-late.rules \
195 40-magellan.rules \
196 50-udev-default.rules \
197 80-drivers.rules \
198 30-kernel-compat.rules \
199 40-video.rules \
200 60-persistent-storage-tape.rules \
201 75-cd-aliases-generator.rules \
202 60-persistent-storage.rules
203 do
204 # delete obsolete hotplug.dev script
205 if [[ -f ${MROOT}/etc/udev/rules.d/${rule} ]]
206 then
207 rm -f ${MROOT}/etc/udev/rules.d/${rule}
208 fi
209 done
210 }
211
212 postinstall()
213 {
214 # create some nodes that we need if they not exist
215 [[ ! -e ${MROOT}/lib/udev/devices/null ]] &&
216 mknod ${MROOT}/lib/udev/devices/null c 1 3
217 chmod 666 ${MROOT}/lib/udev/devices/null
218 touch -t 198002220222 ${MROOT}/lib/udev/devices/null
219
220 [[ ! -e ${MROOT}/lib/udev/devices/zero ]] &&
221 mknod ${MROOT}/lib/udev/devices/zero c 1 5
222 chmod 666 ${MROOT}/lib/udev/devices/zero
223 touch -t 198002220222 ${MROOT}/lib/udev/devices/zero
224
225 [[ ! -e ${MROOT}/lib/udev/devices/console ]] &&
226 mknod ${MROOT}/lib/udev/devices/console c 5 1
227 chmod 600 ${MROOT}/lib/udev/devices/console
228 chown root:tty ${MROOT}/lib/udev/devices/console
229 touch -t 198002220222 ${MROOT}/lib/udev/devices/console
230
231 [[ ! -e ${MROOT}/lib/udev/devices/urandom ]] &&
232 mknod ${MROOT}/lib/udev/devices/urandom c 1 9
233 chmod 666 ${MROOT}/lib/udev/devices/urandom
234 touch -t 198002220222 ${MROOT}/lib/udev/devices/urandom
235
236 # after install/uprade, udev *must* be reloaded if already running
237 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] &&
238 [[ -n $(pidof udevd) ]] && [[ ${MAGE_BOOTSTRAP} != true ]]
239 then
240 echo "MROOT=/; restarting udev daemon ..."
241 killall -15 udevd &> /dev/null
242 sleep 1
243 killall -9 udevd &> /dev/null
244 /sbin/udevd --daemon
245 fi
246
247 # converting databases
248 echo "MROOT=/; converting udev database ..."
249 /sbin/udevadm info --convert-db
250
251 alx-split_postinstall
252 }