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