From 0cad5ae10c7eccca8220ce88bfdd49e9fb2b27fa Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 6 Jul 2009 09:58:29 +0000 Subject: core/openrc: fix post-install to handle upgrades better We don't have the init.d scripts there so rc-update add don't work. --- core/openrc/APKBUILD | 4 ++-- core/openrc/openrc.post-install | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'core') diff --git a/core/openrc/APKBUILD b/core/openrc/APKBUILD index 6ba416ce..415f24a5 100644 --- a/core/openrc/APKBUILD +++ b/core/openrc/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa pkgname=openrc pkgver=0.5.0 -pkgrel=5 +pkgrel=6 pkgdesc="OpenRC manages the services, startup and shutdown of a host" url="http://roy.marples.name/openrc" license='BSD-2' @@ -52,5 +52,5 @@ b1e64885f301166df30be3e3cf5338ff hwdrivers.initd 098a1f16812f56fcb56eb6b6f0fa31f6 modules.initd c77cb4a67aa7ef40dfb12dd1ff5bf5e2 modloop.initd 747168eee535e845179eaef5a3fcb334 networking.initd -6e834194b246563fc5acd77e91e038c4 openrc.post-install +71d823acc9935a8ac82649a94b5bc0b9 openrc.post-install 393ff61bc0bf2c07f9af81795554c584 openrc.post-upgrade" diff --git a/core/openrc/openrc.post-install b/core/openrc/openrc.post-install index de119c7d..1d0201d3 100644 --- a/core/openrc/openrc.post-install +++ b/core/openrc/openrc.post-install @@ -1,26 +1,35 @@ #!/bin/sh +rc_update() { + local svc="$1" + local level="$2" + mkdir -p /etc/runlevels/$level + ln -sf /etc/init.d/$svc /etc/runlevels/$level +} + if [ ! -d etc/rcS.d ] && [ ! -d etc/rcL.d ]; then exit 0 fi for i in etc/rc[SL].d/*; do [ -L "$i" ] || continue - svc=${i##*/S[0-9][0-9]} + oldsvc=${i##*/S[0-9][0-9]} # some services are renamed - case "$svc" in + case "$oldsvc" in modutils) svc=modules;; procps) svc=sysctl;; bootmisc.sh) svc=bootmisc;; keymap) svc=keymaps;; + *) svc=$oldsvc;; esac # add the service to correct "runlevel" case "$svc" in hwclock|modules|sysctl|hostname|keymaps|syslog|bootmisc) - rc-update add $svc boot;; - *) rc-update add $svc default;; + rc_update $svc boot;; + *) rc_update $svc default;; esac rm $i done + -- cgit v1.2.3