From 55d80d62c2d102412302222c7d18762763c4ac38 Mon Sep 17 00:00:00 2001 From: Danny Sonnenschein Date: Tue, 5 Feb 2019 21:08:22 +0000 Subject: Disable services (sysfixtime, sysntpd, led) These services aren't necessary in a container, because there are no leds and time is kept in sync inside the hypervisor system. --- scripts/build_rootfs.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/build_rootfs.sh b/scripts/build_rootfs.sh index b4f6ce9..ac31541 100755 --- a/scripts/build_rootfs.sh +++ b/scripts/build_rootfs.sh @@ -3,7 +3,7 @@ set -e usage() { - echo "Usage: $0 [-a|--arch ] [-s|--subarch ] [-o|--output ] [-p|--packages ] [-f|--files ] [-m|--metadata ] [-u|--upgrade] " + echo "Usage: $0 [-a|--arch ] [-d|--disable-services ] [-s|--subarch ] [-o|--output ] [-p|--packages ] [-f|--files ] [-m|--metadata ] [-u|--upgrade] " exit 1 } @@ -12,16 +12,19 @@ subarch=64 packages= dst_file=/dev/stdout files= +services= metadata= metadata_dir= upgrade= -temp=$(getopt -o "a:o:p:s:f:m:u:" -l "arch:,output:,packages:,subarch:,files:,metadata:,upgrade,help" -- "$@") +temp=$(getopt -o "a:d:o:p:s:f:m:u:" -l "arch:,disable-services:,output:,packages:,subarch:,files:,metadata:,upgrade,help" -- "$@") eval set -- "$temp" while true; do case "$1" in -a|--arch) arch="$2"; shift 2;; + -d|--disable-services) + services="$2"; shift 2;; -s|--subarch) subarch="$2"; shift 2;; -p|--packages) @@ -143,6 +146,14 @@ install_packages() { done } +disable_services() { + local services="$1" + for service in $services; do + echo Disabling $service + env IPKG_INSTROOT=$instroot sh $instroot/etc/rc.common $instroot/etc/init.d/$service disable + done +} + unpack disable_root if test -n "$metadata"; then @@ -154,6 +165,7 @@ if test -n "$upgrade"; then update_packages fi install_packages "$packages" +disable_services "$services" add_files $files_dir $instroot if test -n "$files"; then add_files $files $instroot -- cgit v1.2.3