Gentoo Archives: gentoo-commits

From: "Matthias Schwarzott (zzam)" <zzam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-fs/udev: ChangeLog udev-116-r1.ebuild
Date: Sun, 21 Oct 2007 20:46:24
Message-Id: E1IjhWH-0001Pr-GL@stork.gentoo.org
1 zzam 07/10/21 20:35:33
2
3 Modified: ChangeLog
4 Added: udev-116-r1.ebuild
5 Log:
6 udev-rules update. Fixes bugs #195607 #195728 #195839.
7 (Portage version: 2.1.3.15)
8
9 Revision Changes Path
10 1.364 sys-fs/udev/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.364&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.364&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?r1=1.363&r2=1.364
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v
19 retrieving revision 1.363
20 retrieving revision 1.364
21 diff -u -r1.363 -r1.364
22 --- ChangeLog 15 Oct 2007 06:11:38 -0000 1.363
23 +++ ChangeLog 21 Oct 2007 20:35:32 -0000 1.364
24 @@ -1,6 +1,12 @@
25 # ChangeLog for sys-fs/udev
26 # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.363 2007/10/15 06:11:38 tgall Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.364 2007/10/21 20:35:32 zzam Exp $
29 +
30 +*udev-116-r1 (21 Oct 2007)
31 +
32 + 21 Oct 2007; Matthias Schwarzott <zzam@g.o>
33 + +files/udev-116-gentoo-rules-update.diff, +udev-116-r1.ebuild:
34 + udev-rules update. Fixes bugs #195607 #195728 #195839.
35
36 15 Oct 2007; Tom Gall <tgall@g.o> udev-115-r1.ebuild:
37 stable on ppc64, bug #195289
38
39
40
41 1.1 sys-fs/udev/udev-116-r1.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-116-r1.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-116-r1.ebuild?rev=1.1&content-type=text/plain
45
46 Index: udev-116-r1.ebuild
47 ===================================================================
48 # Copyright 1999-2007 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-116-r1.ebuild,v 1.1 2007/10/21 20:35:32 zzam Exp $
51
52 inherit eutils flag-o-matic multilib toolchain-funcs versionator
53
54 DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
55 HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
56 SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2"
57
58 LICENSE="GPL-2"
59 SLOT="0"
60 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
61 IUSE="selinux"
62
63 DEPEND="selinux? ( sys-libs/libselinux )"
64 RDEPEND="!sys-apps/coldplug
65 !<sys-fs/device-mapper-1.02.19-r1"
66 RDEPEND="${DEPEND} ${RDEPEND}
67 >=sys-apps/baselayout-1.12.5"
68 # We need the lib/rcscripts/addon support
69 PROVIDE="virtual/dev-manager"
70
71 pkg_setup() {
72 udev_helper_dir="/$(get_libdir)/udev"
73
74 myconf=
75 extras="extras/ata_id \
76 extras/cdrom_id \
77 extras/edd_id \
78 extras/firmware \
79 extras/floppy \
80 extras/path_id \
81 extras/scsi_id \
82 extras/usb_id \
83 extras/volume_id \
84 extras/collect \
85 extras/rule_generator \
86 extras/root_link"
87
88 use selinux && myconf="${myconf} USE_SELINUX=true"
89
90 # comparing kernel version without linux-info.eclass to not pull
91 # virtual/linux-sources
92
93 local KV=$(uname -r)
94 local KV_MAJOR=$(get_major_version ${KV})
95 local KV_MINOR=$(get_version_component_range 2 ${KV})
96 local KV_MICRO=$(get_version_component_range 3 ${KV})
97
98 local ok=0
99 if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 && ${KV_MICRO} -ge 15 ]]
100 then
101 ok=1
102 fi
103
104 if [[ ${ok} == 0 ]]
105 then
106 ewarn
107 ewarn "${P} does not support Linux kernel before version 2.6.15!"
108 ewarn "If you want to use udev you need to update"
109 ewarn "to kernel >=2.6.15!"
110 ewarn
111 ebeep
112 fi
113 }
114
115 sed_helper_dir() {
116 sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@"
117 }
118
119 src_unpack() {
120 unpack ${A}
121
122 cd "${S}"
123
124 # patches go here...
125 epatch "${WORKDIR}/${PATCH}"
126 EPATCH_OPTS="-p1" epatch "${FILESDIR}/${PN}-114-root-link-2.diff"
127
128 epatch "${FILESDIR}/${P}-gentoo-rules-update.diff"
129
130 # Bug 195317
131 epatch "${FILESDIR}"/${P}-path-to-logger.diff
132
133 # add blacklisting option where needed
134 #sed -e '/MODALIAS/s#modprobe#modprobe --use-blacklist#' \
135 # -e '/while read id/s#modprobe#modprobe --use-blacklist#' \
136 # -i etc/udev/rules.d/80-drivers.rules
137
138 # No need to clutter the logs ...
139 sed -ie '/^DEBUG/ c\DEBUG = false' Makefile
140 # Do not use optimization flags from the package
141 sed -ie 's|$(OPTIMIZATION)||g' Makefile
142 # Do not require xmlto to refresh manpages
143 sed -ie 's|$(MAN_PAGES)||g' Makefile
144
145 # Make sure there is no sudden changes to upstream rules file
146 # (more for my own needs than anything else ...)
147 MD5=$(md5sum < "${S}/etc/udev/rules.d/50-udev-default.rules")
148 MD5=${MD5/ -/}
149 if [[ ${MD5} != 42ee128b936ebad2e80f011597c869b2 ]]
150 then
151 echo
152 eerror "50-udev-default.rules has been updated, please validate!"
153 die "50-udev-default.rules has been updated, please validate!"
154 fi
155
156 sed_helper_dir \
157 etc/udev/rules.d/50-udev-default.rules \
158 extras/rule_generator/write_*_rules \
159 udev_rules_parse.c \
160 udev_rules.c
161
162 # Use correct multilib dir
163 sed -i extras/volume_id/lib/Makefile \
164 -e "/ =/s-/lib-/$(get_libdir)-"
165 }
166
167 src_compile() {
168 filter-flags -fprefetch-loop-arrays
169
170 # Not everyone has full $CHOST-{ld,ar,etc...} yet
171 local mycross=""
172 type -p ${CHOST}-ar && mycross=${CHOST}-
173
174 emake \
175 EXTRAS="${extras}" \
176 libudevdir=${udev_helper_dir} \
177 CROSS_COMPILE=${mycross} \
178 OPTFLAGS="" \
179 ${myconf} || die "compiling udev failed"
180 }
181
182 src_install() {
183 into /
184 emake \
185 DESTDIR="${D}" \
186 libudevdir=${udev_helper_dir} \
187 EXTRAS="${extras}" \
188 ${myconf} \
189 install || die "make install failed"
190
191 # make install does not install this
192 dosbin udevstart || die "Required binary not installed properly"
193 doman udevstart.8
194
195 exeinto "${udev_helper_dir}"
196 newexe "${FILESDIR}"/net-104-r10.sh net.sh || die "Required binary not installed properly"
197 newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \
198 || die "Required binary not installed properly"
199
200 keepdir "${udev_helper_dir}"/state
201 keepdir "${udev_helper_dir}"/devices
202
203 # create symlinks for these utilities to /sbin
204 # where multipath-tools expect them to be (Bug #168588)
205 dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id
206 dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id
207
208 # vol_id library (needed by mount and HAL)
209 into /
210 rm "${D}/$(get_libdir)"/libvolume_id.so* 2>/dev/null
211 dolib extras/volume_id/lib/*.so* || die "Failed installing libvolume_id.so"
212 into /usr
213 dolib extras/volume_id/lib/*.a || die "Failed installing libvolume_id.a"
214
215 # handle static linking bug #4411
216 rm -f "${D}/usr/$(get_libdir)/libvolume_id.so"
217 gen_usr_ldscript libvolume_id.so
218
219 # Add gentoo stuff to udev.conf
220 cat "${FILESDIR}"/udev.conf.115-r6 >> "${D}"/etc/udev/udev.conf
221
222 # Now installing rules
223 cd etc/udev
224 insinto /etc/udev/rules.d/
225
226 # Our rules files
227 doins gentoo/??-*.rules
228 doins packages/40-alsa.rules
229
230 # Adding arch specific rules
231 if [[ -f packages/40-${ARCH}.rules ]]
232 then
233 doins "packages/40-${ARCH}.rules"
234 fi
235 cd "${S}"
236
237 # our udev hooks into the rc system
238 insinto /$(get_libdir)/rcscripts/addons
239 newins "${FILESDIR}"/udev-start-115-r6.sh udev-start.sh
240 newins "${FILESDIR}"/udev-stop-111-r2.sh udev-stop.sh
241
242 # The udev-post init-script
243 newinitd "${FILESDIR}"/udev-postmount-initd-111-r2 udev-postmount
244
245 insinto /etc/modprobe.d
246 newins "${FILESDIR}"/blacklist-110 blacklist
247 doins "${FILESDIR}"/pnp-aliases
248
249 # convert /lib/udev to real used dir
250 sed_helper_dir \
251 "${D}/$(get_libdir)"/rcscripts/addons/*.sh \
252 "${D}"/etc/init.d/udev* \
253 "${D}"/etc/modprobe.d/*
254
255 # documentation
256 dodoc ChangeLog FAQ README TODO RELEASE-NOTES
257 dodoc docs/{overview,udev_vs_devfs}
258 dodoc docs/writing_udev_rules/*
259
260 newdoc extras/volume_id/README README_volume_id
261
262 echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev
263 doenvd 20udev
264 }
265
266 pkg_preinst() {
267 if [[ -d ${ROOT}/lib/udev-state ]]
268 then
269 mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/
270 rm -r "${ROOT}"/lib/udev-state
271 fi
272
273 if [[ -f ${ROOT}/etc/udev/udev.config &&
274 ! -f ${ROOT}/etc/udev/udev.rules ]]
275 then
276 mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules
277 fi
278
279 # delete the old udev.hotplug symlink if it is present
280 if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]]
281 then
282 rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug
283 fi
284
285 # delete the old wait_for_sysfs.hotplug symlink if it is present
286 if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]]
287 then
288 rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug
289 fi
290
291 # delete the old wait_for_sysfs.hotplug symlink if it is present
292 if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]]
293 then
294 rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug
295 fi
296
297 # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind)
298 coldplug_stale=""
299 if [[ -f ${ROOT}/etc/init.d/coldplug ]]
300 then
301 coldplug_stale="1"
302 fi
303 }
304
305 pkg_postinst() {
306 # people want reminders, I'll give them reminders. Odds are they will
307 # just ignore them anyway...
308
309 if [[ ${coldplug_stale} == 1 ]]
310 then
311 ewarn "A stale coldplug init script found. You should run:"
312 ewarn
313 ewarn " rc-update del coldplug"
314 ewarn " rm -f /etc/init.d/coldplug"
315 ewarn
316 ewarn "udev now provides its own coldplug functionality."
317 fi
318
319 # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules
320 if has_version "=sys-fs/udev-103-r3" &&
321 [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]]
322 then
323 ewarn "Deleting stray 40-scsi-hotplug.rules"
324 ewarn "installed by sys-fs/udev-103-r3"
325 rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules
326 fi
327
328 # Removing some device-nodes we thought we need some time ago
329 if [[ -d ${ROOT}/lib/udev/devices ]]
330 then
331 rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom}
332 fi
333
334 # Removing some old file
335 if has_version "<sys-fs/udev-104-r5"
336 then
337 rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev
338 rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null
339 fi
340
341 if has_version "<sys-fs/udev-106-r5" &&
342 [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]]
343 then
344 rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules
345 fi
346
347 # Try to remove /etc/dev.d as that is obsolete
348 if [[ -d ${ROOT}/etc/dev.d ]]
349 then
350 rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null
351 if [[ -d ${ROOT}/etc/dev.d ]]
352 then
353 ewarn "You still have the directory /etc/dev.d on your system."
354 ewarn "This is no longer used by udev and can be removed."
355 fi
356 fi
357
358 # 64-device-mapper.rules now gets installed by sys-fs/device-mapper
359 # remove it if user don't has sys-fs/device-mapper installed
360 if has_version "<sys-fs/udev-113" &&
361 [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] &&
362 ! has_version sys-fs/device-mapper
363 then
364 rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules
365 einfo "Removed unneeded file 64-device-mapper.rules"
366 fi
367
368 if [[ ${ROOT} == / ]]
369 then
370 # check if root of init-process is identical to ours
371 if [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]]
372 then
373 einfo "restarting udevd now."
374 if [[ -n $(pidof udevd) ]]
375 then
376 killall -15 udevd &>/dev/null
377 sleep 1
378 killall -9 udevd &>/dev/null
379 fi
380 /sbin/udevd --daemon
381 fi
382 fi
383
384 einfo
385 einfo "For more information on udev on Gentoo, writing udev rules, and"
386 einfo " fixing known issues visit:"
387 einfo " http://www.gentoo.org/doc/en/udev-guide.xml"
388 }
389
390
391
392 --
393 gentoo-commits@g.o mailing list