introduce hwids package, providing usb.ids and co
[openadk.git] / scripts / update-rcconf
blob4e816448fb95f9ea70dba3627d332104f25a3324
1 #!/usr/bin/env bash
2 # This file is part of the OpenADK project. OpenADK is copyrighted
3 # material, please see the LICENCE file in the top-level directory.
5 topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
6 . $topdir/.config
8 if [ -z ${ADK_TARGET_ABI} ];then
9 rcconf=$topdir/root_${ADK_TARGET_SYSTEM}_${ADK_TARGET_LIBC}_${ADK_TARGET_CPU_ARCH}/etc/rc.conf
10 else
11 rcconf=$topdir/root_${ADK_TARGET_SYSTEM}_${ADK_TARGET_LIBC}_${ADK_TARGET_CPU_ARCH}_${ADK_TARGET_ABI}/etc/rc.conf
14 if [ ! -f $rcconf ];then
15 exit 0
18 for service in $(grep ^ADK_RUNTIME_START_ $topdir/.config |grep -v ADK_RUNTIME_START_SERVICES);do
19 rcname=$(echo $service|sed -e "s#ADK_RUNTIME_START_##")
20 rcname=$(echo $rcname| sed -e "s#=y##")
21 rcname=$(echo $rcname| sed -e "s#^BUSYBOX_##")
22 rcname=$(echo $rcname| tr '[:upper:]' '[:lower:]')
23 # workarounds where package name not equal to service name
24 if [ $rcname = "iptables" ];then
25 rcname=firewall
27 if [ $rcname = "openssh_server" ];then
28 rcname=openssh
30 if [ "$ADK_APPLIANCE_KODI" = "y" -o "$ADK_APPLIANCE_MPD" = "y" ];then
31 sed -i -e "s#$rcname=\"NO\"#$rcname=\"DAEMON\"#" $rcconf
32 else
33 sed -i -e "s#$rcname=\"NO\"#$rcname=\"YES\"#" $rcconf
35 done