From 866f81aaa5e438537e6a4b30c1f0fcecc713a1a2 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 20 Feb 2018 21:20:18 -0600 Subject: system/openrc: migrate from aports fork --- system/openrc/openrc.post-install | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 system/openrc/openrc.post-install (limited to 'system/openrc/openrc.post-install') diff --git a/system/openrc/openrc.post-install b/system/openrc/openrc.post-install new file mode 100644 index 000000000..1057eed41 --- /dev/null +++ b/system/openrc/openrc.post-install @@ -0,0 +1,36 @@ +#!/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 + oldsvc=${i##*/S[0-9][0-9]} + # some services are renamed + case "$oldsvc" in + modutils) svc=modules;; + procps) svc=sysctl;; + bootmisc.sh) svc=bootmisc;; + keymap) svc=keymaps;; + rc.local) svc=local;; + *) svc=$oldsvc;; + esac + + # add the service to correct "runlevel" + case "$svc" in + hwclock|modules|sysctl|hostname|keymaps|syslog|bootmisc) + rc_update $svc boot;; + *) rc_update $svc default;; + esac + + rm $i +done + -- cgit v1.2.3-70-g09d2