From 120fa5a3bfee8bdbdf2441cdd1b5aff0e4513db4 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 27 Jun 2014 18:17:51 +0200 Subject: rework service startup, do not hardcode into postinst scripts --- scripts/update-rcconf | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/update-rcconf (limited to 'scripts/update-rcconf') diff --git a/scripts/update-rcconf b/scripts/update-rcconf new file mode 100755 index 000000000..bc896d3d1 --- /dev/null +++ b/scripts/update-rcconf @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P)) +. $topdir/.config + +rcconf=$topdir/root_${ADK_TARGET_SYSTEM}_${ADK_TARGET_LIBC}/etc/rc.conf + +for service in $(grep ^ADK_RUNTIME_START_ $topdir/.config |grep -v ADK_RUNTIME_START_SERVICES);do + rcname=$(echo $service|sed -e "s#ADK_RUNTIME_START_##") + rcname=$(echo $rcname| sed -e "s#=y##") + rcname=$(echo $rcname| sed -e "s#^BUSYBOX_##") + rcname=$(echo $rcname| tr '[:upper:]' '[:lower:]') + if [ $ADK_PKG_XBMCBOX = "y" ];then + sed -i -e "s#$rcname=\"NO\"#$rcname=\"DAEMON\"#" $rcconf + else + sed -i -e "s#$rcname=\"NO\"#$rcname=\"YES\"#" $rcconf + fi +done -- cgit v1.2.3