Browse Source

- move neutrino's start script away from skel-root

master
vanhofen 6 years ago
parent
commit
09f2f051f0
  1. 7
      make/neutrino.mk
  2. 66
      skel-root/armbox/hd51/etc/init.d/start_neutrino
  3. 63
      skel-root/coolstream/hd2/etc/init.d/start_neutrino
  4. 0
      skel-root/general/scripts/start_neutrino.armbox
  5. 0
      skel-root/general/scripts/start_neutrino.coolstream

7
make/neutrino.mk

@ -168,10 +168,16 @@ $(D)/neutrino: $(N_OBJ_DIR)/config.status
PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) \
$(MAKE) -C $(N_OBJ_DIR) all DESTDIR=$(TARGET_DIR)
$(MAKE) -C $(N_OBJ_DIR) install DESTDIR=$(N_INST_DIR)
$(MAKE) $(TARGET_DIR)/etc/init.d/start_neutrino
$(TOUCH)
# -----------------------------------------------------------------------------
$(TARGET_DIR)/etc/init.d/start_neutrino:
$(INSTALL_EXEC) -D $(IMAGEFILES)/scripts/start_neutrino.$(BOXTYPE) $@
# -----------------------------------------------------------------------------
LH_OBJ_DIR = $(BUILD_TMP)/$(NI-LIBSTB-HAL)
# -----------------------------------------------------------------------------
@ -253,6 +259,7 @@ neutrino-distclean:
neutrino-clean: neutrino-uninstall neutrino-distclean
rm -f $(N_OBJ_DIR)/config.status
rm -f $(D)/neutrino
rm -f $(TARGET_DIR)/etc/init.d/start_neutrino
neutrino-clean-all: neutrino-clean
rm -rf $(N_OBJ_DIR)

66
skel-root/armbox/hd51/etc/init.d/start_neutrino

@ -1,66 +0,0 @@
#!/bin/sh
. /etc/init.d/globals
# Neutrino's exit codes
ERROR=-1
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
do_cleanup() {
# remove files created by neutrino
rm -f /tmp/.timer
}
do_shutdown() {
echo "Shutdown ..." > /dev/dbox/oled0
poweroff
}
do_reboot() {
echo "Reboot ..." > /dev/dbox/oled0
reboot
}
while true; do
do_cleanup
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
echo "Neutrino: $RET" > /dev/dbox/oled0
# 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

63
skel-root/coolstream/hd2/etc/init.d/start_neutrino

@ -1,63 +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
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

0
skel-root/armbox/bre2ze4k/etc/init.d/start_neutrino → skel-root/general/scripts/start_neutrino.armbox

0
skel-root/coolstream/hd1/etc/init.d/start_neutrino → skel-root/general/scripts/start_neutrino.coolstream

Loading…
Cancel
Save