Magellan Linux

Contents of /trunk/core/udev/udev-141-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id