mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-19 23:43:00 +02:00
firstsetup: edit serial console device matching to commandline.
This commit is contained in:
@@ -1,4 +1,25 @@
|
||||
#!/bin/bash
|
||||
# Edit the serial console entry at /etc/inittab matching to console parameter.
|
||||
ser_console() {
|
||||
while test x"$1" != x
|
||||
do
|
||||
case $1 in
|
||||
console=*)
|
||||
scon=${1##console=};
|
||||
sed -i -e "s|^7:2345:respawn:/sbin/agetty.*|7:2345:respawn:/sbin/agetty ${scon%%,*} ${scon##*,}|g" /etc/inittab
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
cmdline=`cat /proc/cmdline`
|
||||
ser_console $cmdline
|
||||
# reload inittab
|
||||
/sbin/init q
|
||||
#
|
||||
/etc/init.d/sysklogd start
|
||||
export LANG=en_US.utf8
|
||||
/usr/local/sbin/setup /dev/tty2 INSTALL
|
||||
|
||||
Reference in New Issue
Block a user