Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-fs/udev: udev-182-r3.ebuild ChangeLog
Date: Sun, 01 Apr 2012 01:49:02
Message-Id: 20120401014853.0CBC42004B@flycatcher.gentoo.org
1 flameeyes 12/04/01 01:48:53
2
3 Modified: ChangeLog
4 Added: udev-182-r3.ebuild
5 Log:
6 Make use of the new hwids ebuild.
7
8 (Portage version: 2.2.0_alpha96/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.676 sys-fs/udev/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.676&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.676&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/ChangeLog?r1=1.675&r2=1.676
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v
20 retrieving revision 1.675
21 retrieving revision 1.676
22 diff -u -r1.675 -r1.676
23 --- ChangeLog 28 Mar 2012 21:54:03 -0000 1.675
24 +++ ChangeLog 1 Apr 2012 01:48:52 -0000 1.676
25 @@ -1,6 +1,11 @@
26 # ChangeLog for sys-fs/udev
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.675 2012/03/28 21:54:03 zmedico Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.676 2012/04/01 01:48:52 flameeyes Exp $
30 +
31 +*udev-182-r3 (01 Apr 2012)
32 +
33 + 01 Apr 2012; Diego E. Pettenò <flameeyes@g.o> +udev-182-r3.ebuild:
34 + Make use of the new hwids ebuild.
35
36 28 Mar 2012; Zac Medico <zmedico@g.o> udev-182-r2.ebuild,
37 udev-9999.ebuild:
38
39
40
41 1.1 sys-fs/udev/udev-182-r3.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-182-r3.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-182-r3.ebuild?rev=1.1&content-type=text/plain
45
46 Index: udev-182-r3.ebuild
47 ===================================================================
48 # Copyright 1999-2012 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-182-r3.ebuild,v 1.1 2012/04/01 01:48:52 flameeyes Exp $
51
52 EAPI=4
53
54 KV_min=2.6.34
55 # patchversion=1
56 udev_rules_md5=ebc2cf422aa9e46cf7d9a555670412ba
57
58 EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git"
59
60 [[ ${PV} == "9999" ]] && vcs="git-2 autotools"
61 inherit ${vcs} eutils flag-o-matic multilib toolchain-funcs linux-info systemd libtool
62
63 if [[ ${PV} != "9999" ]]
64 then
65 KEYWORDS="~amd64"
66 SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2"
67 if [[ -n "${patchversion}" ]]
68 then
69 patchset=${P}-patchset-${patchversion}
70 SRC_URI="${SRC_URI} mirror://gentoo/${patchset}.tar.bz2"
71 fi
72 fi
73
74 DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
75 HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html http://git.kernel.org/?p=linux/hotplug/udev.git;a=summary"
76
77 LICENSE="GPL-2"
78 SLOT="0"
79 IUSE="build selinux debug +rule_generator hwdb gudev introspection
80 keymap floppy doc static-libs +openrc"
81
82 COMMON_DEPEND="selinux? ( sys-libs/libselinux )
83 gudev? ( dev-libs/glib:2 )
84 introspection? ( dev-libs/gobject-introspection )
85 >=sys-apps/kmod-5
86 >=sys-apps/util-linux-2.20
87 >=sys-libs/glibc-2.10"
88
89 DEPEND="${COMMON_DEPEND}
90 keymap? ( dev-util/gperf )
91 dev-util/pkgconfig
92 virtual/os-headers
93 !<sys-kernel/linux-headers-2.6.34"
94
95 if [[ $PV == "9999" ]]
96 then
97 RESTRICT="test? ( userpriv )"
98 IUSE="${IUSE} test"
99 DEPEND="${DEPEND}
100 dev-util/gtk-doc
101 test? ( app-text/tree )"
102 else
103 DEPEND="${DEPEND}
104 doc? ( dev-util/gtk-doc )"
105 fi
106
107 RDEPEND="${COMMON_DEPEND}
108 hwdb? ( sys-apps/hwids )
109 openrc? ( >=sys-fs/udev-init-scripts-10
110 !<sys-apps/openrc-0.9.9 )
111 !sys-apps/coldplug
112 !<sys-fs/lvm2-2.02.45
113 !sys-fs/device-mapper
114 !<sys-fs/udev-init-scripts-10
115 !<sys-kernel/dracut-017-r1
116 !<sys-kernel/genkernel-3.4.25"
117
118 udev_check_KV()
119 {
120 if kernel_is lt ${KV_min//./ }
121 then
122 return 1
123 fi
124 return 0
125 }
126
127 pkg_setup()
128 {
129 # required kernel options
130 CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~HOTPLUG ~INOTIFY_USER ~NET ~PROC_FS
131 ~SIGNALFD ~SYSFS
132 ~!IDE ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2"
133
134 linux-info_pkg_setup
135
136 # always print kernel version requirements
137 ewarn
138 ewarn "${P} does not support Linux kernel before version ${KV_min}!"
139
140 if ! udev_check_KV
141 then
142 eerror "Your kernel version (${KV_FULL}) is too old to run ${P}"
143 fi
144
145 KV_FULL_SRC=${KV_FULL}
146 get_running_version
147 if ! udev_check_KV
148 then
149 eerror
150 eerror "udev cannot be restarted after emerging,"
151 eerror "as your running kernel version (${KV_FULL}) is too old."
152 eerror "You really need to use a newer kernel after a reboot!"
153 NO_RESTART=1
154 fi
155 }
156
157 src_prepare()
158 {
159 # backport some patches
160 if [[ -n "${patchset}" ]]
161 then
162 EPATCH_SOURCE="${WORKDIR}/${patchset}" EPATCH_SUFFIX="patch" \
163 EPATCH_FORCE="yes" epatch
164 fi
165
166 # change rules back to group uucp instead of dialout for now
167 sed -e 's/GROUP="dialout"/GROUP="uucp"/' \
168 -i rules/*.rules \
169 || die "failed to change group dialout to uucp"
170
171 if [ ! -e configure ]
172 then
173 gtkdocize --copy || die "gtkdocize failed"
174 eautoreconf
175 else
176 # Make sure there are no sudden changes to upstream rules file
177 # (more for my own needs than anything else ...)
178 MD5=$(md5sum < "${S}/rules/50-udev-default.rules")
179 MD5=${MD5/ -/}
180 if [[ ${MD5} != ${udev_rules_md5} ]]
181 then
182 eerror "50-udev-default.rules has been updated, please validate!"
183 eerror "md5sum: ${MD5}"
184 die "50-udev-default.rules has been updated, please validate!"
185 fi
186 elibtoolize
187 fi
188 }
189
190 src_configure()
191 {
192 filter-flags -fprefetch-loop-arrays
193 econf \
194 --with-rootprefix=/ \
195 --libdir=/usr/$(get_libdir) \
196 --libexecdir=/lib \
197 $(use_enable static-libs static) \
198 $(use_with selinux) \
199 $(use_enable debug) \
200 $(use_enable rule_generator) \
201 --with-pci-ids-path=/usr/share/misc/pci.ids \
202 --with-usb-ids-path=/usr/share/misc/usb.ids \
203 $(use_enable gudev) \
204 $(use_enable introspection) \
205 $(use_enable keymap) \
206 $(use_enable floppy) \
207 $(use_enable doc gtk-doc) \
208 "$(systemd_with_unitdir)" \
209 --docdir=/usr/share/doc/${PF} \
210 --with-html-dir=/usr/share/doc/${PF}/html
211 }
212
213 src_install()
214 {
215 emake DESTDIR="${D}" install
216
217 find "${ED}" -type f -name '*.la' -exec rm -f {} +
218
219 dodoc ChangeLog NEWS README TODO
220 use keymap && dodoc src/keymap/README.keymap.txt
221
222 # udevadm is now in /usr/bin.
223 dosym /usr/bin/udevadm /sbin/udevadm
224
225 # create symlinks for these utilities to /sbin
226 # where multipath-tools expect them to be (Bug #168588)
227 dosym /lib/udev/scsi_id /sbin/scsi_id
228
229 # Now install rules
230 insinto /lib/udev/rules.d
231 doins "${FILESDIR}"/40-gentoo.rules
232 }
233
234 pkg_preinst()
235 {
236 local htmldir
237 for htmldir in gudev libudev; do
238 if [[ -d ${ROOT}usr/share/gtk-doc/html/${htmldir} ]]; then
239 rm -rf "${ROOT}"usr/share/gtk-doc/html/${htmldir}
240 fi
241 if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then
242 dosym /usr/share/doc/${PF}/html/${htmldir} \
243 /usr/share/gtk-doc/html/${htmldir}
244 fi
245 done
246 }
247
248 # 19 Nov 2008
249 fix_old_persistent_net_rules()
250 {
251 local rules="${ROOT}"/etc/udev/rules.d/70-persistent-net.rules
252 [[ -f ${rules} ]] || return
253
254 elog
255 elog "Updating persistent-net rules file"
256
257 # Change ATTRS to ATTR matches, Bug #246927
258 sed -i -e 's/ATTRS{/ATTR{/g' "${rules}"
259
260 # Add KERNEL matches if missing, Bug #246849
261 sed -ri \
262 -e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \
263 "${rules}"
264 }
265
266 # See Bug #129204 for a discussion about restarting udevd
267 restart_udevd()
268 {
269 if [[ ${NO_RESTART} = "1" ]]
270 then
271 ewarn "Not restarting udevd, as your kernel is too old!"
272 return
273 fi
274
275 # need to merge to our system
276 [[ ${ROOT} = / ]] || return
277
278 # check if root of init-process is identical to ours (not in chroot)
279 [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return
280
281 # abort if there is no udevd running
282 [[ -n $(pidof udevd) ]] || return
283
284 # abort if no /run/udev exists
285 [[ -e /run/udev ]] || return
286
287 elog
288 elog "restarting udevd now."
289
290 killall -15 udevd &>/dev/null
291 sleep 1
292 killall -9 udevd &>/dev/null
293
294 /lib/udev/udevd --daemon
295 sleep 3
296 if [[ ! -n $(pidof udevd) ]]
297 then
298 eerror "FATAL: udev died, please check your kernel is"
299 eerror "new enough and configured correctly for ${P}."
300 eerror
301 eerror "Please have a look at this before rebooting."
302 eerror "If in doubt, please downgrade udev back to your old version"
303 fi
304 }
305
306 # This function determines if a directory is a mount point.
307 # It was lifted from dracut.
308 ismounted()
309 {
310 while read a m a; do
311 [ "$m" = "$1" ] && return 0
312 done < "${ROOT}"/proc/mounts
313 return 1
314 }
315
316 pkg_postinst()
317 {
318 mkdir -p "${ROOT}"/run
319 fix_old_persistent_net_rules
320
321 # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
322 # So try to remove it here (will only work if empty).
323 rmdir "${ROOT}"/dev/loop 2>/dev/null
324 if [[ -d "${ROOT}"/dev/loop ]]
325 then
326 ewarn "Please make sure your remove /dev/loop,"
327 ewarn "else losetup may be confused when looking for unused devices."
328 fi
329
330 restart_udevd
331
332 # people want reminders, I'll give them reminders. Odds are they will
333 # just ignore them anyway...
334
335 # Removing some device-nodes we thought we need some time ago, 25 Jan 2007
336 if [[ -d ${ROOT}/lib/udev/devices ]]
337 then
338 rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom}
339 fi
340
341 # Try to remove /etc/dev.d as that is obsolete, 23 Apr 2007
342 if [[ -d ${ROOT}/etc/dev.d ]]
343 then
344 rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null
345 if [[ -d ${ROOT}/etc/dev.d ]]
346 then
347 ewarn "You still have the directory /etc/dev.d on your system."
348 ewarn "This is no longer used by udev and can be removed."
349 fi
350 fi
351
352 # 64-device-mapper.rules now gets installed by sys-fs/device-mapper
353 # remove it if user don't has sys-fs/device-mapper installed, 27 Jun 2007
354 if [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] &&
355 ! has_version sys-fs/device-mapper
356 then
357 rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules
358 einfo "Removed unneeded file 64-device-mapper.rules"
359 fi
360
361 # requested in Bug #225033:
362 elog
363 elog "persistent-net assigns fixed names to network devices."
364 elog "If you have problems with the persistent-net rules,"
365 elog "just delete the rules file"
366 elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules"
367 elog "then reboot."
368 elog
369 elog "This may however number your devices in a different way than they are now."
370
371 ewarn
372 ewarn "If you build an initramfs including udev, then please"
373 ewarn "make sure that the /usr/bin/udevadm binary gets included,"
374 ewarn "and your scripts changed to use it,as it replaces the"
375 ewarn "old helper apps udevinfo, udevtrigger, ..."
376
377 ewarn
378 ewarn "mount options for directory /dev are no longer"
379 ewarn "set in /etc/udev/udev.conf, but in /etc/fstab"
380 ewarn "as for other directories."
381
382 ewarn
383 ewarn "If you use /dev/md/*, /dev/loop/* or /dev/rd/*,"
384 ewarn "then please migrate over to using the device names"
385 ewarn "/dev/md*, /dev/loop* and /dev/ram*."
386 ewarn "The devfs-compat rules have been removed."
387 ewarn "For reference see Bug #269359."
388
389 ewarn
390 ewarn "Rules for /dev/hd* devices have been removed"
391 ewarn "Please migrate to libata."
392
393 ewarn
394 ewarn "action_modeswitch has been removed by upstream."
395 ewarn "Please use sys-apps/usb_modeswitch."
396
397 if ismounted /usr
398 then
399 ewarn
400 ewarn "Your system has /usr on a separate partition. This means"
401 ewarn "you will need to use an initramfs to pre-mount /usr before"
402 ewarn "udev runs."
403 ewarn "This must be set up before your next reboot, or you may"
404 ewarn "experience failures which are very difficult to troubleshoot."
405 ewarn "For a more detailed explanation, see the following URL:"
406 ewarn "http://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken"
407 fi
408
409 ewarn
410 ewarn "The udev-acl functionality has been removed from udev."
411 ewarn "This functionality will appear in a future version of consolekit."
412
413 elog
414 elog "For more information on udev on Gentoo, writing udev rules, and"
415 elog " fixing known issues visit:"
416 elog " http://www.gentoo.org/doc/en/udev-guide.xml"
417 }