diff --git a/skel-root/armbox/hd51/etc/init.d/functions b/archive-imagefiles/scripts/init.functions similarity index 83% rename from skel-root/armbox/hd51/etc/init.d/functions rename to archive-imagefiles/scripts/init.functions index e5e3e3df..17aaa0d0 100644 --- a/skel-root/armbox/hd51/etc/init.d/functions +++ b/archive-imagefiles/scripts/init.functions @@ -1,4 +1,7 @@ -# functions that are used by init scripts... +# +# /etc/init.d/functions - global functions that are used by scripts +# +# ----------------------------------------------------------------------------- . /etc/init.d/globals @@ -67,3 +70,8 @@ load_module() insmod $module $params fi } + +get_setting() +{ + test -e $NEUTRINO_CONF && grep "^${1}=" $NEUTRINO_CONF | cut -d'=' -f2 +} diff --git a/skel-root/coolstream/hd2/etc/init.d/globals b/archive-imagefiles/scripts/init.globals similarity index 81% rename from skel-root/coolstream/hd2/etc/init.d/globals rename to archive-imagefiles/scripts/init.globals index 97b49f4d..75e9f484 100644 --- a/skel-root/coolstream/hd2/etc/init.d/globals +++ b/archive-imagefiles/scripts/init.globals @@ -1,7 +1,11 @@ -# global variables and functions that are used by our scripts... +# +# /etc/init.d/globals - global variables and aliases that are used by scripts +# +# ----------------------------------------------------------------------------- HOSTNAME=$(hostname) BASENAME=${0##*/} +NEUTRINO_CONF="/var/tuxbox/config/neutrino.conf" alias LOGINFO='logger -p user.info -t ${BASENAME}[${$}]' alias LOGWARN='logger -p user.warn -t ${BASENAME}[${$}]' @@ -12,10 +16,3 @@ alias SHOWINFO='echo $(date +"%b %d %H:%M:%S") ${HOSTNAME%%.*} user.info ${BASEN alias SHOWWARN='echo $(date +"%b %d %H:%M:%S") ${HOSTNAME%%.*} user.warn ${BASENAME}[${$}]:' alias SHOWDEBUG='echo $(date +"%b %d %H:%M:%S") ${HOSTNAME%%.*} user.debug ${BASENAME}[${$}]:' alias SHOWERROR='echo $(date +"%b %d %H:%M:%S") ${HOSTNAME%%.*} user.error ${BASENAME}[${$}]:' - -NEUTRINO_CONF="/var/tuxbox/config/neutrino.conf" - -get_setting() -{ - test -e $NEUTRINO_CONF && grep "^${1}=" $NEUTRINO_CONF | cut -d'=' -f2 -} diff --git a/make/system-scripts.mk b/make/system-scripts.mk index de88eedb..185404af 100644 --- a/make/system-scripts.mk +++ b/make/system-scripts.mk @@ -4,8 +4,13 @@ # ----------------------------------------------------------------------------- init-scripts: \ + init-helpers \ init-camd +init-helpers: + install -m644 $(IMAGEFILES)/scripts/init.globals $(ETCINITD)/globals + install -m644 $(IMAGEFILES)/scripts/init.functions $(ETCINITD)/functions + init-camd: $(ETCINITD) install -m755 $(IMAGEFILES)/scripts/camd.init $(ETCINITD)/camd install -m755 $(IMAGEFILES)/scripts/camd_datefix.init $(ETCINITD)/camd_datefix diff --git a/skel-root/armbox/hd51/etc/init.d/globals b/skel-root/armbox/hd51/etc/init.d/globals deleted file mode 100644 index 97b49f4d..00000000 --- a/skel-root/armbox/hd51/etc/init.d/globals +++ /dev/null @@ -1,21 +0,0 @@ -# global variables and functions that are used by our scripts... - -HOSTNAME=$(hostname) -BASENAME=${0##*/} - -alias LOGINFO='logger -p user.info -t ${BASENAME}[${$}]' -alias LOGWARN='logger -p user.warn -t ${BASENAME}[${$}]' -alias LOGDEBUG='logger -p user.debug -t ${BASENAME}[${$}]' -alias LOGERROR='logger -p user.error -t ${BASENAME}[${$}]' - -alias SHOWINFO='echo $(date +"%b %d %H:%M:%S") ${HOSTNAME%%.*} user.info ${BASENAME}[${$}]:' -alias SHOWWARN='echo $(date +"%b %d %H:%M:%S") ${HOSTNAME%%.*} user.warn ${BASENAME}[${$}]:' -alias SHOWDEBUG='echo $(date +"%b %d %H:%M:%S") ${HOSTNAME%%.*} user.debug ${BASENAME}[${$}]:' -alias SHOWERROR='echo $(date +"%b %d %H:%M:%S") ${HOSTNAME%%.*} user.error ${BASENAME}[${$}]:' - -NEUTRINO_CONF="/var/tuxbox/config/neutrino.conf" - -get_setting() -{ - test -e $NEUTRINO_CONF && grep "^${1}=" $NEUTRINO_CONF | cut -d'=' -f2 -} diff --git a/skel-root/coolstream/hd1/etc/init.d/functions b/skel-root/coolstream/hd1/etc/init.d/functions deleted file mode 100644 index 7abefa70..00000000 --- a/skel-root/coolstream/hd1/etc/init.d/functions +++ /dev/null @@ -1,28 +0,0 @@ -# functions that are used by init scripts... - -. /etc/init.d/globals - -run_initscripts() { - if [ "x$1" == xstop ]; then - action="stop" - doing="stopping" - files="/etc/init.d/K[0-9][0-9]* /var/etc/init.d/K[0-9][0-9]*" - else - action="start" - doing="starting" - files="/etc/init.d/S[0-9][0-9]* /var/etc/init.d/S[0-9][0-9]*" - fi - - names=$(for file in $files ; do echo ${file##*/} ; done | sort -u) - - for name in $names; do - [ "${name:1}" = "[0-9][0-9]*" ] && continue - for file in /etc/init.d/$name /var/etc/init.d/$name; do - if [ -x "$file" ]; then - LOGINFO "$doing $file ..." - "$file" $action - break; - fi - done - done -} diff --git a/skel-root/coolstream/hd1/etc/init.d/globals b/skel-root/coolstream/hd1/etc/init.d/globals deleted file mode 100644 index 97b49f4d..00000000 --- a/skel-root/coolstream/hd1/etc/init.d/globals +++ /dev/null @@ -1,21 +0,0 @@ -# global variables and functions that are used by our scripts... - -HOSTNAME=$(hostname) -BASENAME=${0##*/} - -alias LOGINFO='logger -p user.info -t ${BASENAME}[${$}]' -alias LOGWARN='logger -p user.warn -t ${BASENAME}[${$}]' -alias LOGDEBUG='logger -p user.debug -t ${BASENAME}[${$}]' -alias LOGERROR='logger -p user.error -t ${BASENAME}[${$}]' - -alias SHOWINFO='echo $(date +"%b %d %H:%M:%S") ${HOSTNAME%%.*} user.info ${BASENAME}[${$}]:' -alias SHOWWARN='echo $(date +"%b %d %H:%M:%S") ${HOSTNAME%%.*} user.warn ${BASENAME}[${$}]:' -alias SHOWDEBUG='echo $(date +"%b %d %H:%M:%S") ${HOSTNAME%%.*} user.debug ${BASENAME}[${$}]:' -alias SHOWERROR='echo $(date +"%b %d %H:%M:%S") ${HOSTNAME%%.*} user.error ${BASENAME}[${$}]:' - -NEUTRINO_CONF="/var/tuxbox/config/neutrino.conf" - -get_setting() -{ - test -e $NEUTRINO_CONF && grep "^${1}=" $NEUTRINO_CONF | cut -d'=' -f2 -} diff --git a/skel-root/coolstream/hd2/etc/init.d/functions b/skel-root/coolstream/hd2/etc/init.d/functions deleted file mode 100644 index e5e3e3df..00000000 --- a/skel-root/coolstream/hd2/etc/init.d/functions +++ /dev/null @@ -1,69 +0,0 @@ -# functions that are used by init scripts... - -. /etc/init.d/globals - -run_initscripts() { - if [ "x$1" == xstop ]; then - action="stop" - doing="stopping" - files="/etc/init.d/K[0-9][0-9]* /var/etc/init.d/K[0-9][0-9]*" - else - action="start" - doing="starting" - files="/etc/init.d/S[0-9][0-9]* /var/etc/init.d/S[0-9][0-9]*" - fi - - names=$(for file in $files ; do echo ${file##*/} ; done | sort -u) - - for name in $names; do - [ "${name:1}" = "[0-9][0-9]*" ] && continue - for file in /etc/init.d/$name /var/etc/init.d/$name; do - if [ -x "$file" ]; then - LOGINFO "$doing $file ..." - "$file" $action - break; - fi - done - done -} - -create_node() -{ - device=$1 - - rm -f /dev/${device} - major=`awk "\\$2==\"$device\" {print \\$1}" /proc/devices` - - if [ ${major} ]; then - LOGINFO "Creating device node $1" - mknod /dev/${device} c $major 0 - fi -} - -create_node_dir() -{ - device=$1 - - rm -rf /dev/${device} - mkdir -p /dev/${device} - - major=`awk "\\$2==\"$device\" {print \\$1}" /proc/devices` - - if [ ${major} ]; then - LOGINFO "Creating device node dir $1" - mknod /dev/${device}/0 c $major 0 - fi -} - -load_module() -{ - kernel=$(uname -r) - module=/lib/modules/${kernel}/$1 - shift - params=$@ - - if [ -e $module ]; then - LOGINFO "Loading ${module##*/} " - insmod $module $params - fi -}