Browse Source

- skel-root/coolstream: unify stb-update scrits

master
vanhofen 5 years ago
parent
commit
3709f58ec4
  1. 2
      skel-root/hd1/etc/init.d/stb_update.data
  2. 43
      skel-root/hd1/etc/init.d/stb_update.sh
  3. 8
      skel-root/hd2/etc/init.d/stb_update.sh

2
skel-root/hd1/etc/init.d/stb_update.data

@ -0,0 +1,2 @@
# get this info with "make get-update-info"
V_KERNEL="Sat Jun 24 19:32:15 CEST 2017"

43
skel-root/hd1/etc/init.d/stb_update.sh

@ -2,16 +2,37 @@
. /etc/init.d/globals . /etc/init.d/globals
grep "Sat Jun 24 19:32:15 CEST 2017" /proc/version > /dev/null DO_REBOOT=0
if [ $? == 1 ]; then
if [ -e /etc/init.d/stb_update.data ]; then
. /etc/init.d/stb_update.data 2> /dev/null
fi
if [ -e /var/etc/.stb_update ]; then
rm /var/etc/.stb_update
# force an update with a bogus date
V_KERNEL="Sun Jan 1 00:00:00 CET 2042"
fi
if [ -f /var/update/zImage ]; then
DEV=`grep -i kernel /proc/mtd | cut -f 0 -s -d :` DEV=`grep -i kernel /proc/mtd | cut -f 0 -s -d :`
test -e /dev/display && dt -t"Kernel Update. Please wait..." grep -q "$V_KERNEL" /proc/version
SHOWINFO "Updating kernel on device $DEV ..." if [ $? == 1 ]; then
flash_erase /dev/$DEV 0 0 && cat /var/update/zImage > /dev/$DEV test -e /dev/display && dt -t"Kernel Update. Please wait..."
test -e /dev/display && dt -t"Update OK. reboot!" SHOWINFO "Updating kernel on device $DEV ..."
SHOWINFO "Kernel update on device $DEV successful. reboot!" flash_erase /dev/$DEV 0 0 && cat /var/update/zImage > /dev/$DEV
rm -f /var/update/zImage && rm -f /etc/init.d/stb_update.sh && reboot -f test -e /dev/display && dt -t"Update OK. Reboot!"
else SHOWINFO "Kernel update on device $DEV successful. reboot!"
SHOWINFO "Kernel already up-to-date" DO_REBOOT=1
rm -f /var/update/zImage && rm -f /etc/init.d/stb_update.sh else
SHOWINFO "Kernel already up-to-date"
fi
rm -f /var/update/zImage
fi
if [ $DO_REBOOT == 1 ]; then
SHOWINFO "Reboot ..."
sync
sleep 2
reboot -f
fi fi

8
skel-root/hd2/etc/init.d/stb_update.sh

@ -10,10 +10,10 @@ fi
if [ -e /var/etc/.stb_update ]; then if [ -e /var/etc/.stb_update ]; then
rm /var/etc/.stb_update rm /var/etc/.stb_update
#force an update with a bogus date # force an update with a bogus date
V_KERNEL="Jan 01 00:00:00 MSK 2042" V_KERNEL="Sun Jan 1 00:00:00 CET 2042"
V_UBOOT="Jan 01 2042 - 00:00:00" V_UBOOT="Sun Jan 01 2042 - 00:00:00"
V_ULDR="Jan 01 2042 00:00:00" V_ULDR="Sun Jan 01 2042 00:00:00"
fi fi
if [ -f /var/update/vmlinux.ub.gz ]; then if [ -f /var/update/vmlinux.ub.gz ]; then

Loading…
Cancel
Save