Magellan Linux

Contents of /trunk/core/udev/udev-146-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id