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