Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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