mirror of
https://github.com/andreili/SBC_builder.git
synced 2025-08-23 11:04:04 +02:00
Fix initial script.
This commit is contained in:
parent
94ed8d5f0c
commit
b2f118ebf2
@ -3,6 +3,9 @@
|
||||
. /etc/init.def
|
||||
. /etc/init.script
|
||||
|
||||
CONSOLE="/dev/$(get_active_console)"
|
||||
exec 0<>${CONSOLE} 1<>${CONSOLE} 2<>${CONSOLE}
|
||||
|
||||
run mount -t sysfs sysfs /sys -o noexec,nosuid,nodev >/dev/null
|
||||
run mount -t devtmpfs -o exec,nosuid,mode=0755,size=10M udev /dev
|
||||
run mkdir -m 0755 /dev/pts
|
||||
|
@ -130,6 +130,21 @@ determine_fs() {
|
||||
echo "${_fs}"
|
||||
}
|
||||
|
||||
get_active_console() {
|
||||
local active_console=console
|
||||
|
||||
while [ -f /sys/class/tty/${active_console}/active ]
|
||||
do
|
||||
active_console=$(cat /sys/class/tty/${active_console}/active)
|
||||
|
||||
# last console will be the active one,
|
||||
# see https://www.kernel.org/doc/html/latest/admin-guide/serial-console.html
|
||||
active_console=${active_console##* }
|
||||
done
|
||||
|
||||
echo ${active_console}
|
||||
}
|
||||
|
||||
findmediamount() {
|
||||
# $1 = mount dir name / media name
|
||||
# $2 = recognition file
|
||||
|
Loading…
x
Reference in New Issue
Block a user