flash-images: merge normal and scon to one image.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
Arne Fitzenreiter
2018-04-12 16:21:20 +02:00
parent d1d06e66c0
commit 6b56624445
6 changed files with 286 additions and 55 deletions

View File

@@ -5,24 +5,16 @@ if [ -e /var/ipfire/main/firstsetup_ok ]; then
exit 0;
fi
# 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%%,*}|g" /etc/inittab
shift
;;
*)
shift
;;
esac
done
}
cmdline=`cat /proc/cmdline`
ser_console $cmdline
# disable consoles if tty2 are not present
if [ ! -e /dev/tty2 ]; then
# Disable console on tty2-6
sed -i -e "s|2:2345:respawn:|#2:2345:respawn:|g" /etc/inittab
sed -i -e "s|3:2345:respawn:|#3:2345:respawn:|g" /etc/inittab
sed -i -e "s|4:2345:respawn:|#4:2345:respawn:|g" etc/inittab
sed -i -e "s|5:2345:respawn:|#5:2345:respawn:|g" /etc/inittab
sed -i -e "s|6:2345:respawn:|#6:2345:respawn:|g" /etc/inittab
fi
# reload inittab
/sbin/init q
#