Contents of /branches/magellan-0_10_0/core/udev/udev-142-r1.smage2
Parent Directory | Revision Log
Revision 3000 -
(show annotations)
(download)
Mon Oct 5 18:47:41 2009 UTC (14 years, 11 months ago) by niro
File size: 6188 byte(s)
Mon Oct 5 18:47:41 2009 UTC (14 years, 11 months ago) by niro
File size: 6188 byte(s)
created branch 'magellan-0_10_0'
1 | # $Id$ |
2 | |
3 | PNAME="udev" |
4 | PVER="142" |
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.15 |
15 | >= sys-apps/initscripts-0.5" |
16 | |
17 | SDEPEND=">= virtual/kernel-sources" |
18 | |
19 | SRCFILE="${PNAME}-${PVER}.tar.bz2" |
20 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
21 | |
22 | CONFIG_SRCFILE="config-${PNAME}-${PVER}-${PBUILD}.tar.bz2" |
23 | CONFIG_SRCDIR="${BUILDDIR}/config-${PNAME}-${PVER}-${PBUILD}" |
24 | |
25 | # global var: ${LINUX_SOURCES} |
26 | # location where they are |
27 | [[ -z ${LINUX_SOURCES} ]] && LINUX_SOURCES="/usr/src/linux" |
28 | |
29 | sminclude mtools multilib |
30 | |
31 | SRC_URI=( |
32 | http://www.kernel.org/pub/linux/utils/kernel/hotplug/${SRCFILE} |
33 | mirror://${PNAME}/${SRCFILE} |
34 | mirror://${PNAME}/${CONFIG_SRCFILE} |
35 | ) |
36 | |
37 | UP2DATE="updatecmd http://www.kernel.org/pub/linux/utils/kernel/hotplug | grep ${PNAME}- | lasttarball" |
38 | |
39 | src_prepare() |
40 | { |
41 | munpack ${SRCFILE} || die |
42 | oldmunpack ${CONFIG_SRCFILE} || die |
43 | } |
44 | |
45 | src_compile() |
46 | { |
47 | mconfigure \ |
48 | --exec-prefix= \ |
49 | --with-libdir-name='$(mlibdir)' \ |
50 | --enable-logging \ |
51 | --without-selinux \ |
52 | || die |
53 | |
54 | mmake || die |
55 | } |
56 | |
57 | src_install() |
58 | { |
59 | mmake DESTDIR=${BINDIR} install || die |
60 | minstalldocs COPYING ChangeLog NEWS README TODO docs/writing_udev_rules/* || die |
61 | |
62 | # install our config |
63 | cd ${CONFIG_SRCDIR} |
64 | make DESTDIR=${BINDIR} install || die |
65 | |
66 | # create symlinks for these utilities to /sbin |
67 | # where multipath-tools expect them to be |
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 |