diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2009-11-13 19:40:33 +0000 |
---|---|---|
committer | Matthias Schwarzott <zzam@gentoo.org> | 2009-11-13 19:40:33 +0000 |
commit | 986a69f3f8f27d584fded998423c4d83e255e95a (patch) | |
tree | eb3e985918f551afe7eb83c3b109c4cf2ab8dc73 /sys-apps | |
parent | Depend on linux-headers-2.6.29 to get bsg.h, Bug #292922. (diff) | |
download | gentoo-2-986a69f3f8f27d584fded998423c4d83e255e95a.tar.gz gentoo-2-986a69f3f8f27d584fded998423c4d83e255e95a.tar.bz2 gentoo-2-986a69f3f8f27d584fded998423c4d83e255e95a.zip |
Cleanup udev enable logic.
(Portage version: 2.2_rc49/cvs/Linux i686)
Diffstat (limited to 'sys-apps')
-rw-r--r-- | sys-apps/openrc/ChangeLog | 6 | ||||
-rw-r--r-- | sys-apps/openrc/openrc-0.5.2-r2.ebuild | 60 | ||||
-rw-r--r-- | sys-apps/openrc/openrc-9999.ebuild | 60 |
3 files changed, 63 insertions, 63 deletions
diff --git a/sys-apps/openrc/ChangeLog b/sys-apps/openrc/ChangeLog index 9c63f54cd78b..5403ad1401ee 100644 --- a/sys-apps/openrc/ChangeLog +++ b/sys-apps/openrc/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for sys-apps/openrc # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/ChangeLog,v 1.96 2009/11/11 15:57:28 williamh Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/ChangeLog,v 1.97 2009/11/13 19:40:33 zzam Exp $ + + 13 Nov 2009; Matthias Schwarzott <zzam@gentoo.org> openrc-0.5.2-r2.ebuild, + openrc-9999.ebuild: + Cleanup udev enable logic. 11 Nov 2009; William Hubbs <williamh@gentoo.org> -openrc-0.5.2.ebuild: removed old version diff --git a/sys-apps/openrc/openrc-0.5.2-r2.ebuild b/sys-apps/openrc/openrc-0.5.2-r2.ebuild index 4ca8f358ead1..47487c05b78d 100644 --- a/sys-apps/openrc/openrc-0.5.2-r2.ebuild +++ b/sys-apps/openrc/openrc-0.5.2-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-0.5.2-r2.ebuild,v 1.2 2009/11/10 18:35:40 williamh Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-0.5.2-r2.ebuild,v 1.3 2009/11/13 19:40:33 zzam Exp $ EAPI="1" @@ -139,21 +139,22 @@ src_install() { add_boot_init() { local initd=$1 + local runlevel=${2:-boot} # if the initscript is not going to be installed and is not # currently installed, return [[ -e ${D}/etc/init.d/${initd} || -e ${ROOT}/etc/init.d/${initd} ]] \ || return - [[ -e ${ROOT}/etc/runlevels/boot/${initd} ]] && return + [[ -e ${ROOT}/etc/runlevels/${runlevel}/${initd} ]] && return # if runlevels dont exist just yet, then create it but still flag # to pkg_postinst that it needs real setup #277323 - if [[ ! -d ${ROOT}/etc/runlevels/boot ]] ; then - mkdir -p "${ROOT}"/etc/runlevels/boot + if [[ ! -d ${ROOT}/etc/runlevels/${runlevel} ]] ; then + mkdir -p "${ROOT}"/etc/runlevels/${runlevel} touch "${ROOT}"/etc/runlevels/.add_boot_init.created fi - elog "Auto-adding '${initd}' service to your boot runlevel" - ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/boot/${initd} + elog "Auto-adding '${initd}' service to your ${runlevel} runlevel" + ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/${runlevel}/${initd} } add_boot_init_mit_config() { local config=$1 initd=$2 @@ -223,30 +224,32 @@ pkg_preinst() { # termencoding was added in 0.2.1 and needed in boot has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding - # openrc-0.4.0 no longer loads the udev addon - enable_udev=0 - if [[ ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] && \ - [[ -e "${ROOT}"/etc/init.d/udev ]] && \ - ! has_version ">=sys-apps/openrc-0.4.0" - then - # make sure udev is in sysinit if it was enabled before - local rc_devices=$( - [[ -f /etc/rc.conf ]] && source /etc/rc.conf - [[ -f /etc/conf.d/rc ]] && source /etc/conf.d/rc - echo "${rc_devices:-${RC_DEVICES:-auto}}" - ) - case ${rc_devices} in - udev|auto) - enable_udev=1 - ;; - esac - fi - # set default interactive shell to sulogin if it exists set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin - # skip remaining migration if we already have openrc installed has_version sys-apps/openrc || migrate_from_baselayout_1 + has_version ">=sys-apps/openrc-0.4.0" || migrate_udev_init_script +} + +# >=openrc-0.4.0 no longer loads the udev addon +migrate_udev_init_script() { + # make sure udev is in sysinit if it was enabled before + local enable_udev=false + local rc_devices=$( + [[ -f /etc/rc.conf ]] && source /etc/rc.conf + [[ -f /etc/conf.d/rc ]] && source /etc/conf.d/rc + echo "${rc_devices:-${RC_DEVICES:-auto}}" + ) + case ${rc_devices} in + udev|auto) + enable_udev=true + ;; + esac + + if $enable_udev; then + add_boot_init udev sysinit + add_boot_init udev-postmount default + fi } migrate_from_baselayout_1() { @@ -349,11 +352,6 @@ pkg_postinst() { fi fi - if [[ "$enable_udev" = 1 ]]; then - elog "Auto adding udev init script to the sysinit runlevel" - ln -sf /etc/init.d/udev "${ROOT}"/etc/runlevels/sysinit/udev - fi - # update the dependency tree bug #224171 [[ "${ROOT}" = "/" ]] && "${ROOT}/${LIBDIR}"/rc/bin/rc-depend -u diff --git a/sys-apps/openrc/openrc-9999.ebuild b/sys-apps/openrc/openrc-9999.ebuild index 67db3ab1e1fc..d6796f345f65 100644 --- a/sys-apps/openrc/openrc-9999.ebuild +++ b/sys-apps/openrc/openrc-9999.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-9999.ebuild,v 1.64 2009/11/10 18:35:40 williamh Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-9999.ebuild,v 1.65 2009/11/13 19:40:33 zzam Exp $ EAPI="1" @@ -134,21 +134,22 @@ src_install() { add_boot_init() { local initd=$1 + local runlevel=${2:-boot} # if the initscript is not going to be installed and is not # currently installed, return [[ -e ${D}/etc/init.d/${initd} || -e ${ROOT}/etc/init.d/${initd} ]] \ || return - [[ -e ${ROOT}/etc/runlevels/boot/${initd} ]] && return + [[ -e ${ROOT}/etc/runlevels/${runlevel}/${initd} ]] && return # if runlevels dont exist just yet, then create it but still flag # to pkg_postinst that it needs real setup #277323 - if [[ ! -d ${ROOT}/etc/runlevels/boot ]] ; then - mkdir -p "${ROOT}"/etc/runlevels/boot + if [[ ! -d ${ROOT}/etc/runlevels/${runlevel} ]] ; then + mkdir -p "${ROOT}"/etc/runlevels/${runlevel} touch "${ROOT}"/etc/runlevels/.add_boot_init.created fi - elog "Auto-adding '${initd}' service to your boot runlevel" - ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/boot/${initd} + elog "Auto-adding '${initd}' service to your ${runlevel} runlevel" + ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/${runlevel}/${initd} } add_boot_init_mit_config() { local config=$1 initd=$2 @@ -218,30 +219,32 @@ pkg_preinst() { # termencoding was added in 0.2.1 and needed in boot has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding - # openrc-0.4.0 no longer loads the udev addon - enable_udev=0 - if [[ ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] && \ - [[ -e "${ROOT}"/etc/init.d/udev ]] && \ - ! has_version ">=sys-apps/openrc-0.4.0" - then - # make sure udev is in sysinit if it was enabled before - local rc_devices=$( - [[ -f /etc/rc.conf ]] && source /etc/rc.conf - [[ -f /etc/conf.d/rc ]] && source /etc/conf.d/rc - echo "${rc_devices:-${RC_DEVICES:-auto}}" - ) - case ${rc_devices} in - udev|auto) - enable_udev=1 - ;; - esac - fi - # set default interactive shell to sulogin if it exists set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin - # skip remaining migration if we already have openrc installed has_version sys-apps/openrc || migrate_from_baselayout_1 + has_version ">=sys-apps/openrc-0.4.0" || migrate_udev_init_script +} + +# >=openrc-0.4.0 no longer loads the udev addon +migrate_udev_init_script() { + # make sure udev is in sysinit if it was enabled before + local enable_udev=false + local rc_devices=$( + [[ -f /etc/rc.conf ]] && source /etc/rc.conf + [[ -f /etc/conf.d/rc ]] && source /etc/conf.d/rc + echo "${rc_devices:-${RC_DEVICES:-auto}}" + ) + case ${rc_devices} in + udev|auto) + enable_udev=true + ;; + esac + + if $enable_udev; then + add_boot_init udev sysinit + add_boot_init udev-postmount default + fi } migrate_from_baselayout_1() { @@ -344,11 +347,6 @@ pkg_postinst() { fi fi - if [[ "$enable_udev" = 1 ]]; then - elog "Auto adding udev init script to the sysinit runlevel" - ln -sf /etc/init.d/udev "${ROOT}"/etc/runlevels/sysinit/udev - fi - # update the dependency tree bug #224171 [[ "${ROOT}" = "/" ]] && "${ROOT}/${LIBDIR}"/rc/bin/rc-depend -u |