mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
busybox/ busybox-initramfs:
- mount partions in initramfs and move the partions to sysroot (faster boot) - rename system and kernel file - update now updates kernel and system in the some process, and then reboot if needed - dont start xorg in textmode
This commit is contained in:
parent
2d784800a0
commit
837b13f07b
@ -2,11 +2,15 @@
|
||||
|
||||
/bin/busybox mount -t proc none /proc
|
||||
/bin/busybox mount -t devtmpfs none /dev
|
||||
/bin/busybox mount -t sysfs none /sys
|
||||
|
||||
BOOT=`/bin/busybox cat /proc/cmdline | /bin/busybox sed 's/.*boot=// ; s/ .*//'`
|
||||
DISK=`/bin/busybox cat /proc/cmdline | /bin/busybox sed 's/.*disk=// ; s/ .*//'`
|
||||
UPDATE_DIR=/storage/.update
|
||||
|
||||
IMAGE_SYSTEM="SYSTEM"
|
||||
IMAGE_KERNEL="KERNEL"
|
||||
|
||||
# parse command line arguments
|
||||
for arg in $(cat /proc/cmdline); do
|
||||
case $arg in
|
||||
@ -52,10 +56,7 @@
|
||||
/bin/busybox mv $UPDATE_DIR/$2 $3
|
||||
/bin/busybox mount -o remount,ro /flash
|
||||
/bin/busybox sync
|
||||
if [ $4 = reboot ]; then
|
||||
echo "System reboots now"
|
||||
/bin/busybox reboot
|
||||
fi
|
||||
[ $4 = "reboot" ] && REBOOT="reboot"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -63,21 +64,23 @@
|
||||
[ -n $DISK ] && mount_part "$DISK" "/storage" "rw,noatime"
|
||||
# mount_part "$DISK" "/storage" "rw,noatime"
|
||||
|
||||
update "Kernel" "openelec.kernel" "/flash/openelec.kernel" "reboot"
|
||||
update "System" "openelec.system" "/flash/openelec.system" "noreboot"
|
||||
|
||||
if [ -f "/flash/openelec.system" ]; then
|
||||
mount_part "/flash/openelec.system" "/sysroot" "loop"
|
||||
update "Kernel" "$IMAGE_KERNEL" "/flash/$IMAGE_KERNEL" "reboot"
|
||||
update "System" "$IMAGE_SYSTEM" "/flash/$IMAGE_SYSTEM"
|
||||
[ $REBOOT = "reboot" ] && echo "System reboots now..." && /bin/busybox reboot
|
||||
|
||||
if [ -f "/flash/$IMAGE_SYSTEM" ]; then
|
||||
mount_part "/flash/$IMAGE_SYSTEM" "/sysroot" "loop"
|
||||
[ $ERR_ENV -ne 0 ] && debug_shell
|
||||
else
|
||||
error "INIT_2" "Could not find system."
|
||||
debug_shell
|
||||
fi
|
||||
|
||||
/bin/busybox mount --bind /flash /sysroot/flash
|
||||
/bin/busybox mount --bind /storage /sysroot/storage
|
||||
/bin/busybox umount /proc
|
||||
/bin/busybox umount /dev
|
||||
/bin/busybox mount --move /proc /sysroot/proc
|
||||
/bin/busybox mount --move /sys /sysroot/sys
|
||||
/bin/busybox mount --move /dev /sysroot/dev
|
||||
/bin/busybox mount --move /flash /sysroot/flash
|
||||
/bin/busybox mount --move /storage /sysroot/storage
|
||||
|
||||
exec /bin/busybox switch_root /sysroot /sbin/init.system
|
||||
# exec /bin/busybox switch_root /sysroot /sbin/cinit
|
||||
|
@ -1,17 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# mounting needed filesystems
|
||||
/bin/mount -t devtmpfs none /dev
|
||||
/bin/mount -t proc none /proc
|
||||
/bin/mount -t sysfs none /sys
|
||||
/bin/mount -t ramfs none /var
|
||||
|
||||
# read config
|
||||
. /etc/sysconfig
|
||||
|
||||
# mounting storage
|
||||
# todo
|
||||
|
||||
# mounting needed filesystems
|
||||
/bin/mount -n -t ramfs none /var
|
||||
|
||||
# make variable directory structure
|
||||
install -m 755 -d /var/log
|
||||
install -m 755 -d /var/lock
|
||||
@ -24,7 +21,7 @@
|
||||
install -m 700 -d /var/run/DeviceKit-disks # for DeviceKit-disks
|
||||
|
||||
# starting Xorg
|
||||
start_xorg
|
||||
[ ! "$TEXTMODE" = "yes" ] && start_xorg
|
||||
|
||||
# copying config into storage
|
||||
mkdir -p $HOME/.config
|
||||
|
Loading…
x
Reference in New Issue
Block a user