mirror of
https://github.com/LibreELEC/LibreELEC.tv
synced 2025-09-24 19:46:01 +07:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user