summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-03-30 16:06:45 +0000
committerMike Frysinger <vapier@gentoo.org>2008-03-30 16:06:45 +0000
commitb415c637d630e1a70804a65a014e9fd5e7e0ef9c (patch)
tree2faffb77a2cd21550e8ebe99683e1240c997341e /sys-apps
parentversion bump: major upgrade with new database format and great parts rewritten (diff)
downloadgentoo-2-b415c637d630e1a70804a65a014e9fd5e7e0ef9c.tar.gz
gentoo-2-b415c637d630e1a70804a65a014e9fd5e7e0ef9c.tar.bz2
gentoo-2-b415c637d630e1a70804a65a014e9fd5e7e0ef9c.zip
Autoadd dmcrypt/mdraid/lvm init.d scripts when possible #215374.
(Portage version: 2.2_pre5)
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/openrc/ChangeLog6
-rw-r--r--sys-apps/openrc/openrc-0.2-r2.ebuild30
-rw-r--r--sys-apps/openrc/openrc-9999.ebuild30
3 files changed, 57 insertions, 9 deletions
diff --git a/sys-apps/openrc/ChangeLog b/sys-apps/openrc/ChangeLog
index d4ced5656610..234b1b173432 100644
--- a/sys-apps/openrc/ChangeLog
+++ b/sys-apps/openrc/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-apps/openrc
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/ChangeLog,v 1.15 2008/03/29 17:50:11 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/ChangeLog,v 1.16 2008/03/30 16:06:45 vapier Exp $
+
+ 30 Mar 2008; Mike Frysinger <vapier@gentoo.org> openrc-0.2-r2.ebuild,
+ openrc-9999.ebuild:
+ Autoadd dmcrypt/mdraid/lvm init.d scripts when possible #215374.
29 Mar 2008; Jeroen Roovers <jer@gentoo.org> openrc-0.2-r2.ebuild:
Marked ~hppa (bug #214957).
diff --git a/sys-apps/openrc/openrc-0.2-r2.ebuild b/sys-apps/openrc/openrc-0.2-r2.ebuild
index c6b3e0e24cd2..ec38d1837755 100644
--- a/sys-apps/openrc/openrc-0.2-r2.ebuild
+++ b/sys-apps/openrc/openrc-0.2-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-0.2-r2.ebuild,v 1.3 2008/03/29 17:50:11 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-0.2-r2.ebuild,v 1.4 2008/03/30 16:06:45 vapier Exp $
inherit eutils flag-o-matic multilib toolchain-funcs
@@ -105,6 +105,22 @@ src_install() {
(use x86 || use amd64) && sed -i -e '/^windowkeys=/s:NO:YES:' "${D}"/etc/conf.d/keymaps
}
+add_boot_init() {
+ local initd=$1
+ [[ -e ${ROOT}/etc/init.d/${initd} ]] || return
+ [[ -e ${ROOT}/etc/runlevels/boot/${initd} ]] && return
+ elog "Auto-adding '${initd}' service to your boot runlevel"
+ ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/boot/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${ROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${ROOT}"/${config}) ]] ; then
+ maybe_add_boot_init ${initd}
+ fi
+ fi
+}
+
pkg_preinst() {
local f
@@ -156,11 +172,17 @@ pkg_preinst() {
# baselayout boot init scripts have been split out
for f in $(cd "${D}"/usr/share/${PN}/runlevels/boot || exit; echo *) ; do
- [[ -e ${ROOT}/etc/runlevels/boot/${f} ]] && continue
- elog "Auto-adding '${f}' service to your boot runlevel"
- ln -snf /etc/init.d/${f} "${ROOT}"/etc/runlevels/boot/${f}
+ add_boot_init ${f}
done
+ # Try to auto-add some addons when possible
+ add_boot_init_mit_config /etc/conf.d/cryptfs dmcrypt
+ add_boot_init_mit_config /etc/mdadm.conf mdraid
+ [[ -e ${ROOT}/sbin/vgscan ]] && add_boot_init lvm
+ elog "Add on services (such as RAID/dmcrypt/LVM/etc...) are now stand alone"
+ elog "init.d scripts. If you use such a thing, make sure you have the"
+ elog "required init.d scripts added to your boot runlevel."
+
# Upgrade out state for baselayout-1 users
if [[ ! -e ${ROOT}${LIBDIR}/rc/init.d/started ]] ; then
(
diff --git a/sys-apps/openrc/openrc-9999.ebuild b/sys-apps/openrc/openrc-9999.ebuild
index b8014261fdf8..da2d73558bba 100644
--- a/sys-apps/openrc/openrc-9999.ebuild
+++ b/sys-apps/openrc/openrc-9999.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2008 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.15 2008/03/28 18:56:57 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-9999.ebuild,v 1.16 2008/03/30 16:06:45 vapier Exp $
inherit eutils flag-o-matic multilib toolchain-funcs
@@ -98,6 +98,22 @@ src_install() {
(use x86 || use amd64) && sed -i -e '/^windowkeys=/s:NO:YES:' "${D}"/etc/conf.d/keymaps
}
+add_boot_init() {
+ local initd=$1
+ [[ -e ${ROOT}/etc/init.d/${initd} ]] || return
+ [[ -e ${ROOT}/etc/runlevels/boot/${initd} ]] && return
+ elog "Auto-adding '${initd}' service to your boot runlevel"
+ ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/boot/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${ROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${ROOT}"/${config}) ]] ; then
+ maybe_add_boot_init ${initd}
+ fi
+ fi
+}
+
pkg_preinst() {
local f
@@ -149,11 +165,17 @@ pkg_preinst() {
# baselayout boot init scripts have been split out
for f in $(cd "${D}"/usr/share/${PN}/runlevels/boot || exit; echo *) ; do
- [[ -e ${ROOT}/etc/runlevels/boot/${f} ]] && continue
- elog "Auto-adding '${f}' service to your boot runlevel"
- ln -snf /etc/init.d/${f} "${ROOT}"/etc/runlevels/boot/${f}
+ add_boot_init ${f}
done
+ # Try to auto-add some addons when possible
+ add_boot_init_mit_config /etc/conf.d/cryptfs dmcrypt
+ add_boot_init_mit_config /etc/mdadm.conf mdraid
+ [[ -e ${ROOT}/sbin/vgscan ]] && add_boot_init lvm
+ elog "Add on services (such as RAID/dmcrypt/LVM/etc...) are now stand alone"
+ elog "init.d scripts. If you use such a thing, make sure you have the"
+ elog "required init.d scripts added to your boot runlevel."
+
# Upgrade out state for baselayout-1 users
if [[ ! -e ${ROOT}${LIBDIR}/rc/init.d/started ]] ; then
(