From 0825c29009c84109c13fedd727807268af4589af Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 25 Feb 2016 18:48:35 +0100 Subject: [PATCH] rcS: unpack and run extra services from the data mtd partition --- Makefile | 2 +- fs-add/etc/init.d/customd | 4 ---- fs-add/etc/init.d/rcS | 29 +++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 9c79b3e5..3ec1395a 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ endef define PACKAGE -mkdir -p out/packages - tar cvj -C $(1) -f out/packages/$(2).tar.bz2 $(3) + tar cvz -C $(1) -f out/packages/$(2).tar.gz $(3) endef # diff --git a/fs-add/etc/init.d/customd b/fs-add/etc/init.d/customd index 7b9a3f66..85d58786 100755 --- a/fs-add/etc/init.d/customd +++ b/fs-add/etc/init.d/customd @@ -2,10 +2,6 @@ test -r /etc/sysconfig/config && . /etc/sysconfig/config -if test "$CUSTOMD" != "yes"; then - exit 0 -fi - if test -x "${CUSTOMD}" ; then . "${CUSTOMD}" fi diff --git a/fs-add/etc/init.d/rcS b/fs-add/etc/init.d/rcS index 16bff771..72105231 100755 --- a/fs-add/etc/init.d/rcS +++ b/fs-add/etc/init.d/rcS @@ -145,6 +145,35 @@ fi ifconfig eth0 txqueuelen 2000 up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 +# unpack extra packages +for package in /mnt/data/satip-axe/packages/*.tar.gz; do + if test -r "$package"; then + logger -p local0.notice "Unpacking package $package" + tar xz -C / -f "$package" + fi +done +for package in /mnt/data/satip-axe/packages/*.tar.bz2; do + if test -r "$package"; then + logger -p local0.notice "Unpacking package $package" + tar xj -C / -f "$package" + fi +done + +# run extra services +inithup= +for prg in /etc/init.extra/*; do + if test -x "$prg"; then + if test -z "$inithup"; then + echo "# Added by /etc/init.d/rcS - init.extra" >> /etc/inittab + fi + echo "::respawn:${prg}" >> /etc/inittab + inithup=1 + fi +done +if test -n "$inithup"; then + kill -SIGHUP 1 +fi + # local boot if test -x /etc/sysconfig/localboot ; then /etc/sysconfig/localboot