add a simple update mechanism: put a file openelec.kernel or/and openelec.system to a /.update dir on storage device and the OpenELEC system does a automatic update and removes this files on /.update

This commit is contained in:
Stephan Raue
2009-04-06 02:00:30 +02:00
parent 4c65fa207e
commit 0ce6f9a219
2 changed files with 36 additions and 9 deletions

View File

@@ -11,10 +11,30 @@
/bin/busybox mount -t ext3 -o ro,noatime $BOOT /flash
/bin/busybox mount -t ext3 -o rw,noatime $DISK /storage
if [ -f "/storage/.update/openelec.kernel" ]; then
echo "updating Kernel..."
/bin/busybox mount -o remount,rw /flash
/bin/busybox mv /storage/.update/openelec.kernel /flash/openelec.kernel
/bin/busybox mount -o remount,ro /flash
/bin/busybox sync
echo "... done"
echo "System reboots in 5 seconds"
/bin/busybox sleep 5
/bin/busybox reboot
fi
if [ -f "/storage/.update/openelec.system" ]; then
echo "updating System..."
/bin/busybox mount -o remount,rw /flash
/bin/busybox mv /storage/.update/openelec.system /flash/openelec.system
/bin/busybox mount -o remount,ro /flash
echo "... done"
fi
if [ -f "/flash/openelec.system" ]; then
/bin/busybox mount /flash/openelec.system /sysroot
if [ $? -ne 0 ] ; then
echo Could not mount system on /sysroot. Starting debugging shell....
echo "Could not mount system on /sysroot. Starting debugging shell..."
/bin/busybox sh </dev/tty1 >/dev/tty1 2>&1
fi
fi
@@ -26,3 +46,6 @@
/bin/busybox umount /sys
exec /bin/busybox switch_root /sysroot /sbin/init.system
echo "Error in initramfs. Starting debugging shell..."
/bin/busybox sh </dev/tty1 >/dev/tty1 2>&1