mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 05:06:43 +00:00
system-initramfs:
- kernel manages /dev automatically if /dev is mounted with devtmps - now udev starts faster - adding a debug shell on console 3 - fix kernel panic if initscripts fails
This commit is contained in:
parent
41e3a55065
commit
43867aa97c
@ -1,22 +1,22 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
/bin/busybox test ! -e /proc/cpuinfo && \
|
# funktions
|
||||||
/bin/busybox mount -t proc none /proc
|
mount_sys() {
|
||||||
/bin/busybox test ! -e /sys/kernel && \
|
if ! /bin/mountpoint -q $1; then
|
||||||
/bin/busybox mount -t sysfs none /sys
|
echo "### $1 does not exist, create it ###"
|
||||||
|
/bin/mount -t $2 none $1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# mounting needed filesystems
|
||||||
|
mount_sys "/dev" "devtmpfs"
|
||||||
|
mount_sys "/proc" "proc"
|
||||||
|
mount_sys "/sys" "sysfs"
|
||||||
|
mount_sys "/var" "ramfs"
|
||||||
|
|
||||||
|
# setting up $PATH
|
||||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
|
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
|
||||||
|
|
||||||
mount -t ramfs none /dev
|
|
||||||
# mount -t ramfs none /etc
|
|
||||||
mount -t ramfs none /var
|
|
||||||
mknod /dev/null c 1 3
|
|
||||||
mknod /dev/fb0 c 29 0
|
|
||||||
mknod /dev/tty1 c 4 1
|
|
||||||
mknod /dev/tty2 c 4 2
|
|
||||||
mknod /dev/tty3 c 4 3
|
|
||||||
mknod /dev/console c 5 1
|
|
||||||
|
|
||||||
# parse command line arguments
|
# parse command line arguments
|
||||||
BOOT=`cat /proc/cmdline | sed 's/.*boot=// ; s/ .*//'`
|
BOOT=`cat /proc/cmdline | sed 's/.*boot=// ; s/ .*//'`
|
||||||
DISK=`cat /proc/cmdline | sed 's/.*disk=// ; s/ .*//'`
|
DISK=`cat /proc/cmdline | sed 's/.*disk=// ; s/ .*//'`
|
||||||
@ -27,12 +27,19 @@
|
|||||||
textmode)
|
textmode)
|
||||||
TEXTMODE=yes
|
TEXTMODE=yes
|
||||||
;;
|
;;
|
||||||
configure)
|
debugging)
|
||||||
CONFIGURE=yes
|
DEBUG=yes
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# starting debugging shell
|
||||||
|
if test "$DEBUG" = yes; then
|
||||||
|
echo "### starting debugging shell on console 3 ###"
|
||||||
|
echo "### ...... switch with ctrl-alt-f3 ...... ###"
|
||||||
|
exec /bin/sh </dev/tty3 >/dev/tty3 2>&1 &
|
||||||
|
fi
|
||||||
|
|
||||||
# make variable directory structure
|
# make variable directory structure
|
||||||
install -m 1777 -d /var/run
|
install -m 1777 -d /var/run
|
||||||
install -m 755 -d /var/log
|
install -m 755 -d /var/log
|
||||||
@ -72,7 +79,7 @@
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
exit $RET
|
# exit $RET
|
||||||
|
|
||||||
echo "starting emergency shell"
|
echo "starting emergency shell"
|
||||||
exec /bin/busybox sh </dev/tty3 >/dev/tty3 2>&1
|
exec /bin/sh </dev/tty3 >/dev/tty3 2>&1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user