diff options
author | William Hubbs <williamh@gentoo.org> | 2011-11-03 01:58:08 +0000 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2011-11-03 01:58:08 +0000 |
commit | 06f08e1d8a6d6e58c7df9b8571d03def25181245 (patch) | |
tree | 0d1f29e170975b8662d428c10b6ff21a306e4f56 /sys-fs | |
parent | Use new egetshell helper rather than calling getent directly. (diff) | |
download | gentoo-2-06f08e1d8a6d6e58c7df9b8571d03def25181245.tar.gz gentoo-2-06f08e1d8a6d6e58c7df9b8571d03def25181245.tar.bz2 gentoo-2-06f08e1d8a6d6e58c7df9b8571d03def25181245.zip |
Major updates for the live ebuild:
- The src_test function was set back to the default per upstream's
recommendations. Also, test has been restricted to run if userpriv is
not active.
- The src_unpack and pkg_preinst functions were removed.
- a new version of the udev startup scripts was included which is more
integrated to openrc and has had some outdated files removed.
- Now the ebuild manually installs the files from udev-gentoo-scripts.
- Several other small code cleanups.
(Portage version: 2.2.0_alpha72/cvs/Linux i686)
Diffstat (limited to 'sys-fs')
-rw-r--r-- | sys-fs/udev/ChangeLog | 13 | ||||
-rw-r--r-- | sys-fs/udev/udev-9999.ebuild | 305 |
2 files changed, 94 insertions, 224 deletions
diff --git a/sys-fs/udev/ChangeLog b/sys-fs/udev/ChangeLog index 9f8d4bc93d1f..4e1cb960ae89 100644 --- a/sys-fs/udev/ChangeLog +++ b/sys-fs/udev/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for sys-fs/udev # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.603 2011/09/18 06:42:42 zmedico Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.604 2011/11/03 01:58:08 williamh Exp $ + + 03 Nov 2011; William Hubbs <williamh@gentoo.org> udev-9999.ebuild: + Major updates to the live ebuild: + - The src_test function was set back to the default per upstream's + recommendations. Also, test has been restricted to run if userpriv is + not active. + - The src_unpack and pkg_preinst functions were removed. + - a new version of the udev startup scripts was included which is more + integrated to openrc and has had some outdated files removed. + - Now the ebuild manually installs the files from udev-gentoo-scripts. + - Several other small code cleanups. 18 Sep 2011; Zac Medico <zmedico@gentoo.org> udev-171-r2.ebuild, udev-9999.ebuild: diff --git a/sys-fs/udev/udev-9999.ebuild b/sys-fs/udev/udev-9999.ebuild index 88067d8ece1e..061481e1f65c 100644 --- a/sys-fs/udev/udev-9999.ebuild +++ b/sys-fs/udev/udev-9999.ebuild @@ -1,35 +1,30 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-9999.ebuild,v 1.53 2011/09/18 06:42:42 zmedico Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-9999.ebuild,v 1.54 2011/11/03 01:58:08 williamh Exp $ EAPI=4 -KV_min=2.6.32 -KV_reliable=2.6.32 +KV_min=2.6.34 #PATCHSET=${P}-gentoo-patchset-v1 -scriptversion=v4 -scriptname=udev-gentoo-scripts-${scriptversion} +scriptversion=5 +scriptname=${PN}-gentoo-scripts +udev_rules_md5=9fadfc5642284b82e75005c4e85142f1 -if [[ ${PV} == "9999" ]] -then - EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git" - EGIT_BRANCH="master" - vcs="git-2 autotools" -fi +EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git" +[[ ${PV} == "9999" ]] && vcs="git-2 autotools" inherit ${vcs} eutils flag-o-matic multilib toolchain-funcs linux-info systemd if [[ ${PV} != "9999" ]] then KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-linux" - # please update testsys-tarball whenever udev-xxx/test/sys/ is changed - SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2 - test? ( mirror://gentoo/${PN}-171-testsys.tar.bz2 )" + SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" if [[ -n "${PATCHSET}" ]] then SRC_URI="${SRC_URI} mirror://gentoo/${PATCHSET}.tar.bz2" fi fi +scriptname="${scriptname}-${scriptversion}" SRC_URI="${SRC_URI} mirror://gentoo/${scriptname}.tar.bz2" DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" @@ -37,14 +32,16 @@ HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" LICENSE="GPL-2" SLOT="0" -IUSE="build selinux test debug +rule_generator hwdb acl gudev introspection - keymap floppy edd action_modeswitch" +IUSE="build selinux debug +rule_generator hwdb acl gudev introspection + keymap floppy edd doc" +[[ ${PV} == "9999" ]] && IUSE="${IUSE} test" + +RESTRICT="test? ( userpriv )" COMMON_DEPEND="selinux? ( sys-libs/libselinux ) acl? ( sys-apps/acl dev-libs/glib:2 ) gudev? ( dev-libs/glib:2 ) introspection? ( dev-libs/gobject-introspection ) - action_modeswitch? ( virtual/libusb:0 ) >=sys-apps/util-linux-2.16 >=sys-libs/glibc-2.10" @@ -55,17 +52,6 @@ DEPEND="${COMMON_DEPEND} !<sys-kernel/linux-headers-2.6.34 test? ( app-text/tree )" -RDEPEND="${COMMON_DEPEND} - hwdb? - ( - >=sys-apps/usbutils-0.82 - sys-apps/pciutils - ) - !sys-apps/coldplug - !<sys-fs/lvm2-2.02.45 - !sys-fs/device-mapper - >=sys-apps/baselayout-1.12.5" - if [[ ${PV} == "9999" ]] then # for documentation processing with xsltproc @@ -75,51 +61,43 @@ then dev-util/gtk-doc" fi +RDEPEND="${COMMON_DEPEND} + hwdb? ( >=sys-apps/usbutils-0.82 sys-apps/pciutils ) + acl? ( sys-apps/coreutils[acl] ) + !sys-apps/coldplug + !<sys-fs/lvm2-2.02.45 + !sys-fs/device-mapper + >=sys-apps/baselayout-1.12.5" + # required kernel options CONFIG_CHECK="~INOTIFY_USER ~SIGNALFD ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 - ~!IDE ~BLK_DEV_BSG" - -# Return values: -# 2 - reliable -# 1 - unreliable -# 0 - too old -udev_check_KV() { - local ok=0 - if kernel_is -ge ${KV_reliable//./ } - then - ok=2 - elif kernel_is -ge ${KV_min//./ } + ~!IDE ~BLK_DEV_BSG ~TMPFS_POSIX_ACL" + +udev_check_KV() +{ + if kernel_is lt ${KV_min//./ } then - ok=1 + return 1 fi - return $ok + return 0 } -pkg_setup() { +pkg_setup() +{ linux-info_pkg_setup # always print kernel version requirements ewarn ewarn "${P} does not support Linux kernel before version ${KV_min}!" - if [[ ${KV_min} != ${KV_reliable} ]] + + if ! udev_check_KV then - ewarn "For a reliable udev, use at least kernel ${KV_reliable}" + eerror "Your kernel version (${KV_FULL}) is too old to run ${P}" fi - udev_check_KV - case "$?" in - 2) einfo "Your kernel version (${KV_FULL}) is new enough to run ${P} reliably." ;; - 1) ewarn "Your kernel version (${KV_FULL}) is new enough to run ${P}," - ewarn "but it may be unreliable in some cases." - ;; - 0) eerror "Your kernel version (${KV_FULL}) is too old to run ${P}" - ;; - esac - KV_FULL_SRC=${KV_FULL} get_running_version - udev_check_KV - if [[ "$?" = "0" ]] + if ! udev_check_KV then eerror eerror "udev cannot be restarted after emerging," @@ -129,27 +107,13 @@ pkg_setup() { fi } -src_unpack() { - unpack ${A} - if [[ ${PV} == "9999" ]] - then - git-2_src_unpack - fi -} - -src_prepare() { - if use test && [[ -d "${WORKDIR}"/test/sys ]] - then - mv "${WORKDIR}"/test/sys "${S}"/test/ - fi - - # patches go here... - +src_prepare() +{ # backport some patches if [[ -n "${PATCHSET}" ]] then EPATCH_SOURCE="${WORKDIR}/${PATCHSET}" EPATCH_SUFFIX="patch" \ - EPATCH_FORCE="yes" epatch + EPATCH_FORCE="yes" epatch fi # change rules back to group uucp instead of dialout for now @@ -163,7 +127,7 @@ src_prepare() { # (more for my own needs than anything else ...) MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") MD5=${MD5/ -/} - if [[ ${MD5} != a9954d57e97aa0ad2e0ed53899d9559a ]] + if [[ ${MD5} != ${udev_rules_md5} ]] then eerror "50-udev-default.rules has been updated, please validate!" eerror "md5sum: ${MD5}" @@ -178,7 +142,9 @@ src_prepare() { fi } -src_configure() { +src_configure() +{ + filter-flags -fprefetch-loop-arrays econf \ --prefix="${EPREFIX}/usr" \ --sysconfdir="${EPREFIX}/etc" \ @@ -200,32 +166,24 @@ src_configure() { $(use_enable keymap) \ $(use_enable floppy) \ $(use_enable edd) \ - $(use_enable action_modeswitch) \ + $(use_enable doc gtk-doc) \ $(systemd_with_unitdir) } -src_compile() { - filter-flags -fprefetch-loop-arrays - - emake -} +src_install() +{ + emake DESTDIR="${D}" docdir="/usr/share/doc/${P}" install -src_install() { - emake -C "${WORKDIR}/${scriptname}" \ - DESTDIR="${D}" LIBDIR="${EPREFIX}$(get_libdir)" \ - LIBUDEV="${EPREFIX}/lib/udev" \ - MODPROBE_DIR="${EPREFIX}/etc/modprobe.d" \ - INITD="${EPREFIX}/etc/init.d" \ - CONFD="${EPREFIX}/etc/conf.d" \ - KV_min="${KV_min}" KV_reliable="${KV_reliable}" \ - install + # documentation + dodoc ChangeLog README TODO - into / - emake DESTDIR="${D}" install + if use keymap + then + dodoc extras/keymap/README.keymap.txt + fi - exeinto /lib/udev - keepdir /lib/udev/state - keepdir /lib/udev/devices + # Upstream moved udevd to /lib/udev,, so symlnking it is the easiest option + dosym "../lib/udev/udevd" /sbin/udevd # create symlinks for these utilities to /sbin # where multipath-tools expect them to be (Bug #168588) @@ -235,114 +193,32 @@ src_install() { echo "# If you need to change mount-options, do it in /etc/fstab" \ >> "${ED}"/etc/udev/udev.conf - # let the dir exist at least - keepdir /etc/udev/rules.d - - # Now installing rules - cd "${S}"/rules + # Now install rules insinto /lib/udev/rules.d/ # support older kernels - doins misc/30-kernel-compat.rules - - # Adding arch specific rules - if [[ -f arch/40-${ARCH}.rules ]] - then - doins "arch/40-${ARCH}.rules" - fi - cd "${S}" - - insinto /etc/modprobe.d - newins "${FILESDIR}"/blacklist-146 blacklist.conf - newins "${FILESDIR}"/pnp-aliases pnp-aliases.conf - - # documentation - dodoc ChangeLog README TODO + doins rules/misc/30-kernel-compat.rules - # keep doc in just one directory, Bug #281137 - rm -rf "${ED}/usr/share/doc/${PN}" - if use keymap + # add arch specific rules + if [[ -f rules/arch/40-${ARCH}.rules ]] then - dodoc extras/keymap/README.keymap.txt + doins "rules/arch/40-${ARCH}.rules" fi -} -src_test() { - local emake_cmd="${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE}" cd "${WORKDIR}/${scriptname}" - vecho ">>> Test phase [scripts:test]: ${CATEGORY}/${PF}" - if ! $emake_cmd -j1 test - then - has test $FEATURES && die "scripts: Make test failed. See above for details." - has test $FEATURES || eerror "scripts: Make test failed. See above for details." - fi - - cd "${S}" - vecho ">>> Test phase [udev:check]: ${CATEGORY}/${PF}" - has userpriv $FEATURES && einfo "Disable FEATURES userpriv to run the udev tests" - if ! $emake_cmd -j1 check - then - has test $FEATURES && die "udev: Make test failed. See above for details." - has test $FEATURES || eerror "udev: Make test failed. See above for details." - fi -} - -pkg_preinst() { - # moving old files to support newer modprobe, 12 May 2009 - local f dir=${EROOT}/etc/modprobe.d/ - for f in pnp-aliases blacklist; do - if [[ -f $dir/$f && ! -f $dir/$f.conf ]] - then - elog "Moving $dir/$f to $f.conf" - mv -f "$dir/$f" "$dir/$f.conf" - fi - done - - if [[ -d ${EROOT}/lib/udev-state ]] - then - mv -f "${EROOT}"/lib/udev-state/* "${ED}"/lib/udev/state/ - rm -r "${EROOT}"/lib/udev-state - fi - - if [[ -f ${EROOT}/etc/udev/udev.config && - ! -f ${EROOT}/etc/udev/udev.rules ]] - then - mv -f "${EROOT}"/etc/udev/udev.config "${EROOT}"/etc/udev/udev.rules - fi - - # delete the old udev.hotplug symlink if it is present - if [[ -h ${EROOT}/etc/hotplug.d/default/udev.hotplug ]] - then - rm -f "${EROOT}"/etc/hotplug.d/default/udev.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${EROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] - then - rm -f "${EROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${EROOT}/etc/hotplug.d/default/10-udev.hotplug ]] - then - rm -f "${EROOT}"/etc/hotplug.d/default/10-udev.hotplug - fi - - has_version "=${CATEGORY}/${PN}-103-r3" - previous_equal_to_103_r3=$? - - has_version "<${CATEGORY}/${PN}-104-r5" - previous_less_than_104_r5=$? - - has_version "<${CATEGORY}/${PN}-106-r5" - previous_less_than_106_r5=$? - - has_version "<${CATEGORY}/${PN}-113" - previous_less_than_113=$? + doconfd conf.d/* + exeinto /lib/udev + doexe helpers/* + doinitd init.d/* + insinto /etc/modprobe.d + doins modprobe.d/* + insinto /lib/udev/rules.d + doins rules.d/* } # 19 Nov 2008 -fix_old_persistent_net_rules() { +fix_old_persistent_net_rules() +{ local rules=${EROOT}/etc/udev/rules.d/70-persistent-net.rules [[ -f ${rules} ]] || return @@ -359,7 +235,8 @@ fix_old_persistent_net_rules() { } # See Bug #129204 for a discussion about restarting udevd -restart_udevd() { +restart_udevd() +{ if [[ ${NO_RESTART} = "1" ]] then ewarn "Not restarting udevd, as your kernel is too old!" @@ -397,7 +274,8 @@ restart_udevd() { fi } -postinst_init_scripts() { +postinst_init_scripts() +{ local enable_postmount=false # FIXME: inconsistent handling of init-scripts here @@ -454,7 +332,8 @@ postinst_init_scripts() { fi } -pkg_postinst() { +pkg_postinst() +{ fix_old_persistent_net_rules # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766 @@ -473,35 +352,12 @@ pkg_postinst() { # people want reminders, I'll give them reminders. Odds are they will # just ignore them anyway... - # delete 40-scsi-hotplug.rules, it is integrated in 50-udev.rules, 19 Jan 2007 - if [[ $previous_equal_to_103_r3 = 0 ]] && - [[ -e ${EROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] - then - ewarn "Deleting stray 40-scsi-hotplug.rules" - ewarn "installed by sys-fs/udev-103-r3" - rm -f "${EROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules - fi - # Removing some device-nodes we thought we need some time ago, 25 Jan 2007 if [[ -d ${EROOT}/lib/udev/devices ]] then rm -f "${EROOT}"/lib/udev/devices/{null,zero,console,urandom} fi - # Removing some old file, 29 Jan 2007 - if [[ $previous_less_than_104_r5 = 0 ]] - then - rm -f "${EROOT}"/etc/dev.d/net/hotplug.dev - rmdir --ignore-fail-on-non-empty "${EROOT}"/etc/dev.d/net 2>/dev/null - fi - - # 19 Mar 2007 - if [[ $previous_less_than_106_r5 = 0 ]] && - [[ -e ${EROOT}/etc/udev/rules.d/95-net.rules ]] - then - rm -f "${EROOT}"/etc/udev/rules.d/95-net.rules - fi - # Try to remove /etc/dev.d as that is obsolete, 23 Apr 2007 if [[ -d ${EROOT}/etc/dev.d ]] then @@ -515,8 +371,7 @@ pkg_postinst() { # 64-device-mapper.rules now gets installed by sys-fs/device-mapper # remove it if user don't has sys-fs/device-mapper installed, 27 Jun 2007 - if [[ $previous_less_than_113 = 0 ]] && - [[ -f ${EROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && + if [[ -f ${EROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && ! has_version sys-fs/device-mapper then rm -f "${EROOT}"/etc/udev/rules.d/64-device-mapper.rules @@ -525,11 +380,11 @@ pkg_postinst() { # requested in Bug #225033: elog - elog "persistent-net does assigning fixed names to network devices." + elog "persistent-net assigns fixed names to network devices." elog "If you have problems with the persistent-net rules," elog "just delete the rules file" elog "\trm ${EROOT}etc/udev/rules.d/70-persistent-net.rules" - elog "and then reboot." + elog "then reboot." elog elog "This may however number your devices in a different way than they are now." @@ -555,6 +410,10 @@ pkg_postinst() { ewarn "Rules for /dev/hd* devices have been removed" ewarn "Please migrate to libata." + ewarn + ewarn "action_modeswitch has been removed by upstream." + ewarn "Please use sys-apps/usb_modeswitch." + elog elog "For more information on udev on Gentoo, writing udev rules, and" elog " fixing known issues visit:" |