summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDanny Sonnenschein <admin@kauz.net>2019-02-05 21:08:22 +0000
committerMikma <mikma@users.noreply.github.com>2019-02-11 00:06:31 +0100
commit55d80d62c2d102412302222c7d18762763c4ac38 (patch)
tree4eed78a93d21739d0475c694787af6503ec67039 /scripts
parentdcc1b3816849b5f6041fa0b0b36beaa22f603741 (diff)
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build_rootfs.sh16
1 files changed, 14 insertions, 2 deletions
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 <arch>] [-s|--subarch <subarch>] [-o|--output <dst file>] [-p|--packages <packages>] [-f|--files <files>] [-m|--metadata <metadata.yaml>] [-u|--upgrade] <src tar>"
+ echo "Usage: $0 [-a|--arch <arch>] [-d|--disable-services <services>] [-s|--subarch <subarch>] [-o|--output <dst file>] [-p|--packages <packages>] [-f|--files <files>] [-m|--metadata <metadata.yaml>] [-u|--upgrade] <src tar>"
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