mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-01 15:07:49 +00:00
busybox-initramfs: add support to mount and run installator image
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
df54c81b87
commit
fb3f04554d
@ -3,6 +3,7 @@
|
|||||||
UPDATE_DIR=/storage/.update
|
UPDATE_DIR=/storage/.update
|
||||||
|
|
||||||
IMAGE_SYSTEM="SYSTEM"
|
IMAGE_SYSTEM="SYSTEM"
|
||||||
|
IMAGE_INSTALLATOR="INSTALLATOR"
|
||||||
IMAGE_KERNEL="KERNEL"
|
IMAGE_KERNEL="KERNEL"
|
||||||
REBOOT=0
|
REBOOT=0
|
||||||
|
|
||||||
@ -25,9 +26,18 @@ REBOOT=0
|
|||||||
fastboot)
|
fastboot)
|
||||||
FASTBOOT=yes
|
FASTBOOT=yes
|
||||||
;;
|
;;
|
||||||
|
installer)
|
||||||
|
INSTALLATOR=yes
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ ! "$INSTALLATOR" = "yes" ]; then
|
||||||
|
IMAGE="$IMAGE_SYSTEM"
|
||||||
|
else
|
||||||
|
IMAGE="$IMAGE_INSTALLATOR"
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$FASTBOOT" = yes; then
|
if test "$FASTBOOT" = yes; then
|
||||||
IONICE="/bin/busybox ionice -c 1 -n 0"
|
IONICE="/bin/busybox ionice -c 1 -n 0"
|
||||||
fi
|
fi
|
||||||
@ -80,18 +90,21 @@ REBOOT=0
|
|||||||
show_splash
|
show_splash
|
||||||
|
|
||||||
mount_part "$boot" "/flash" "ro,noatime"
|
mount_part "$boot" "/flash" "ro,noatime"
|
||||||
mount_part "$disk" "/storage" "rw,noatime"
|
|
||||||
|
|
||||||
update "Kernel" "$IMAGE_KERNEL" "/flash/$IMAGE_KERNEL"
|
if [ ! "$INSTALLATOR" = "yes" ]; then
|
||||||
update "System" "$IMAGE_SYSTEM" "/flash/$IMAGE_SYSTEM"
|
mount_part "$disk" "/storage" "rw,noatime"
|
||||||
|
update "Kernel" "$IMAGE_KERNEL" "/flash/$IMAGE_KERNEL"
|
||||||
|
update "System" "$IMAGE_SYSTEM" "/flash/$IMAGE_SYSTEM"
|
||||||
|
update "Installator" "$IMAGE_INSTALLATOR" "/flash/$IMAGE_INSTALLATOR"
|
||||||
|
|
||||||
if test "$REBOOT" -eq 1; then
|
if test "$REBOOT" -eq 1; then
|
||||||
echo "System reboots now..." && \
|
echo "System reboots now..." && \
|
||||||
/bin/busybox reboot
|
/bin/busybox reboot
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "/flash/$IMAGE_SYSTEM" ]; then
|
if [ -f "/flash/$IMAGE" ]; then
|
||||||
mount_part "/flash/$IMAGE_SYSTEM" "/sysroot" "loop"
|
mount_part "/flash/$IMAGE" "/sysroot" "loop"
|
||||||
[ $ERR_ENV -ne 0 ] && debug_shell
|
[ $ERR_ENV -ne 0 ] && debug_shell
|
||||||
else
|
else
|
||||||
error "INIT_2" "Could not find system."
|
error "INIT_2" "Could not find system."
|
||||||
@ -100,7 +113,10 @@ REBOOT=0
|
|||||||
|
|
||||||
# move /flash and /storage to /sysroot
|
# move /flash and /storage to /sysroot
|
||||||
/bin/busybox mount --move /flash /sysroot/flash
|
/bin/busybox mount --move /flash /sysroot/flash
|
||||||
/bin/busybox mount --move /storage /sysroot/storage
|
|
||||||
|
if [ ! "$INSTALLATOR" = "yes" ]; then
|
||||||
|
/bin/busybox mount --move /storage /sysroot/storage
|
||||||
|
fi
|
||||||
|
|
||||||
# unmount all other filesystems
|
# unmount all other filesystems
|
||||||
/bin/busybox umount /dev
|
/bin/busybox umount /dev
|
||||||
|
Loading…
x
Reference in New Issue
Block a user