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