diff --git a/make/target-neutrino.mk b/make/target-neutrino.mk index 8cdab7ce..5252ad33 100644 --- a/make/target-neutrino.mk +++ b/make/target-neutrino.mk @@ -189,7 +189,7 @@ $(NEUTRINO_BUILD_DIR)/config.status: $(NEUTRINO_DEPENDENCIES) neutrino: $(NEUTRINO_BUILD_DIR)/config.status $(MAKE) -C $(NEUTRINO_BUILD_DIR) $(MAKE) -C $(NEUTRINO_BUILD_DIR) install DESTDIR=$(NEUTRINO_INST_DIR) - $(INSTALL_EXEC) $(PKG_FILES_DIR)/start_neutrino.$(BOXTYPE) $(TARGET_sysconfdir)/init.d/start_neutrino + $(INSTALL_EXEC) $(PKG_FILES_DIR)/start_neutrino $(TARGET_sysconfdir)/init.d/start_neutrino $(TOUCH) # ----------------------------------------------------------------------------- diff --git a/package/neutrino/files/start_neutrino.armbox b/package/neutrino/files/start_neutrino similarity index 75% rename from package/neutrino/files/start_neutrino.armbox rename to package/neutrino/files/start_neutrino index b08f2fea..6bfe1b84 100644 --- a/package/neutrino/files/start_neutrino.armbox +++ b/package/neutrino/files/start_neutrino @@ -9,11 +9,15 @@ NORMAL=0 SHUTDOWN=1 REBOOT=2 -# uncomment for gstreamer debugging -#export GST_DEBUG=4 - # if neutrino crashes, just restart it or reboot the box? -REBOOT_ON_ERROR=false +case "$(get_boxmodel)" in + nevis|apollo|shiner|kronos|kronos_v2) + REBOOT_ON_ERROR=true + ;; + *) + REBOOT_ON_ERROR=false + ;; +esac do_cleanup() { # remove files created by neutrino @@ -21,12 +25,12 @@ do_cleanup() { } do_shutdown() { - display_msg "Shutdown ..." + display_msg "N: SHUTDOWN" poweroff } do_reboot() { - display_msg "Reboot ..." + display_msg "N: REBOOT" reboot } @@ -53,10 +57,10 @@ while true; do break fi - display_msg "Neutrino: $RET" + display_msg "NEUTRINO: $RET" # report errors on external display - if [ -e /tmp/.lcd-* ]; then + if [ -e /tmp/.lcd-* -a -e /tmp/lcd ]; then echo "0" > /tmp/lcd/mode_logo echo "Neutrino" > /tmp/lcd/service echo "Error: $RET" > /tmp/lcd/event @@ -68,5 +72,5 @@ while true; do break fi - LOGINFO "Restarting neutrino after exit code $RET" + LOGINFO "Restarting Neutrino after exit code $RET" done diff --git a/package/neutrino/files/start_neutrino.coolstream b/package/neutrino/files/start_neutrino.coolstream deleted file mode 100644 index 718d98da..00000000 --- a/package/neutrino/files/start_neutrino.coolstream +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -. /etc/init.d/globals - -# Neutrino's exit codes -ERROR=-1 -NORMAL=0 -SHUTDOWN=1 -REBOOT=2 - -# if neutrino crashes, just restart it or reboot the box? -REBOOT_ON_ERROR=true - -do_cleanup() { - # remove files created by neutrino - rm -f /tmp/.timer -} - -do_shutdown() { - dt -t"SHUTDOWN" - poweroff -} - -do_reboot() { - dt -t"REBOOT" - reboot -} - -while true; do - do_cleanup - - if [ -e /var/etc/.coredump ]; then - # unlimit core file size - ulimit -c unlimited - fi - - neutrino; RET=$? - LOGINFO "Neutrino exited with exit code $RET" - - if [ $RET -eq $NORMAL ]; then - # do nothing - break - elif [ $RET -eq $SHUTDOWN ]; then - do_shutdown - break - elif [ $RET -eq $REBOOT ]; then - do_cleanup - do_reboot - break - fi - - dt -t"NEUTRINO: $RET" - - # report errors on external display - if [ -e /tmp/.lcd-* ]; then - echo "0" > /tmp/lcd/mode_logo - echo "Neutrino" > /tmp/lcd/service - echo "Error: $RET" > /tmp/lcd/event - fi - - if $REBOOT_ON_ERROR; then - LOGINFO "Rebooting due to REBOOT_ON_ERROR=true and exit code $RET" - do_reboot - break - fi - - LOGINFO "Restarting neutrino after exit code $RET" -done diff --git a/package/sysvinit/files/rcS-vuplus b/package/sysvinit/files/rcS-vuplus index f9166700..527a8a4a 100644 --- a/package/sysvinit/files/rcS-vuplus +++ b/package/sysvinit/files/rcS-vuplus @@ -83,7 +83,7 @@ service ntpdate start # say hi to everyone oled -b 5 -oled -tc "Booting... NI" +display_msg "Booting... NI" # trap CTRL-C only in this shell so we can interrupt subprocesses trap ":" INT QUIT TSTP diff --git a/skel-root/general/scripts/init.functions b/skel-root/general/scripts/init.functions index 089c5f8a..210035b1 100644 --- a/skel-root/general/scripts/init.functions +++ b/skel-root/general/scripts/init.functions @@ -88,9 +88,19 @@ get_boxmodel() display_msg() { msg="$*" - if [ -e /dev/dbox/oled0 ]; then - echo "${msg}" > /dev/dbox/oled0 - fi + case "$(get_boxmodel)" in + nevis|apollo|shiner|kronos|kronos_v2) + dt -t "${msg}" + ;; + hd51|bre2ze4k|h7|hd60|hd61|multiboxse) + if [ -e /dev/dbox/oled0 ]; then + echo "${msg}" > /dev/dbox/oled0 + fi + ;; + solo4k|duo4k|duo4kse|ultimo4k|zero4k|uno4k|uno4kse) + oled -tc "${msg}" + ;; + esac } get_setting()