Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id