summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-08-23 09:19:10 +0000
committerMike Frysinger <vapier@gentoo.org>2009-08-23 09:19:10 +0000
commit1d35ba8d952d025a45b04b8750096054219213e7 (patch)
treeddaf0e722b92abbe5d372e8ad05bb99d39672e1d /sys-apps/openrc/openrc-9999.ebuild
parentppc stable #280590 (diff)
downloadgentoo-2-1d35ba8d952d025a45b04b8750096054219213e7.tar.gz
gentoo-2-1d35ba8d952d025a45b04b8750096054219213e7.tar.bz2
gentoo-2-1d35ba8d952d025a45b04b8750096054219213e7.zip
Make sure ${ROOT}/etc/runlevels exists early enough #277323 by Ed Wildgoose.
(Portage version: 2.2_rc38/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/openrc/openrc-9999.ebuild')
-rw-r--r--sys-apps/openrc/openrc-9999.ebuild15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys-apps/openrc/openrc-9999.ebuild b/sys-apps/openrc/openrc-9999.ebuild
index 4ad8fb4b7599..633f95cc20a8 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.50 2009/06/15 11:11:23 zzam Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-9999.ebuild,v 1.51 2009/08/23 09:19:10 vapier Exp $
inherit eutils flag-o-matic multilib toolchain-funcs
@@ -107,11 +107,19 @@ src_install() {
add_boot_init() {
local initd=$1
- # if the initscript is not going to be installed and is not
+ # 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
+
+ # 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
+ 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}
}
@@ -284,9 +292,10 @@ pkg_postinst() {
[[ -e ${T}/net && ! -e ${ROOT}/etc/conf.d/net ]] && mv "${T}"/net "${ROOT}"/etc/conf.d/net
# Make our runlevels if they don't exist
- if [[ ! -e ${ROOT}/etc/runlevels ]] ; then
+ if [[ ! -e ${ROOT}/etc/runlevels ]] || [[ -e ${ROOT}/etc/runlevels/.add_boot_init.created ]] ; then
einfo "Copying across default runlevels"
cp -RPp "${ROOT}"/usr/share/${PN}/runlevels "${ROOT}"/etc
+ rm -f "${ROOT}"/etc/runlevels/.add_boot_init.created
else
if [[ ! -e ${ROOT}/etc/runlevels/sysinit/devfs ]] ; then
mkdir -p "${ROOT}"/etc/runlevels/sysinit