From 94d1d199b9f0c17f6b9aaba1d56db995e72bc2da Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Fri, 18 Mar 2016 20:28:46 +0200 Subject: [PATCH] local login tty can now be configured via os.conf --- board/common/overlay/etc/init.d/S01mountall | 48 +++++++++++++-------- board/common/overlay/etc/inittab | 5 +-- board/common/overlay/etc/os.conf | 1 + 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/board/common/overlay/etc/init.d/S01mountall b/board/common/overlay/etc/init.d/S01mountall index 46557f602f..1dc871ee3d 100755 --- a/board/common/overlay/etc/init.d/S01mountall +++ b/board/common/overlay/etc/init.d/S01mountall @@ -5,29 +5,39 @@ conf="/data/etc/os.conf" test -n "$os_version" || source /etc/init.d/base -case "$1" in - start) - msg_begin "Mounting filesystems" - /bin/mount -a +mount_fs() { + msg_begin "Mounting filesystems" + /bin/mount -a + test $? == 0 && msg_done || msg_fail + + if [ -f $sys_conf ] && ! [ -f $conf ]; then + cp $sys_conf $conf + fi + + if [ -f $conf ]; then + source $conf + fi + + if [ "$os_debug" == "true" ]; then + msg_begin "Remounting boot partition read-write" + mount -o remount,rw /boot test $? == 0 && msg_done || msg_fail - if [ -f $sys_conf ] && ! [ -f $conf ]; then - cp $sys_conf $conf - fi + msg_begin "Remounting root partition read-write" + mount -o remount,rw / + test $? == 0 && msg_done || msg_fail + fi +} - if [ -f $conf ]; then - source $conf - fi +mk_tty_login() { + test -z "$os_tty_login" && os_tty_login=tty1 + ln -sf /dev/$os_tty_login /dev/ttylogin +} - if [ "$os_debug" == "true" ]; then - msg_begin "Remounting boot partition read-write" - mount -o remount,rw /boot - test $? == 0 && msg_done || msg_fail - - msg_begin "Remounting root partition read-write" - mount -o remount,rw / - test $? == 0 && msg_done || msg_fail - fi +case "$1" in + start) + mount_fs + mk_tty_login ;; stop) diff --git a/board/common/overlay/etc/inittab b/board/common/overlay/etc/inittab index 3a51a40451..4df8eb21e7 100644 --- a/board/common/overlay/etc/inittab +++ b/board/common/overlay/etc/inittab @@ -17,9 +17,8 @@ ::sysinit:/etc/init.d/mountsys ::sysinit:/etc/init.d/rcS -# Put a getty on the serial port -tty1::respawn:/sbin/getty -L tty1 115200 vt100 -#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 +# Start a getty for local login +ttylogin::respawn:/sbin/getty -L ttylogin 115200 vt100 # Stuff to do for the 3-finger salute ::ctrlaltdel:/sbin/reboot diff --git a/board/common/overlay/etc/os.conf b/board/common/overlay/etc/os.conf index a89e0973ba..2cc5d3e21b 100644 --- a/board/common/overlay/etc/os.conf +++ b/board/common/overlay/etc/os.conf @@ -1,3 +1,4 @@ os_debug="false" os_prereleases="false" +os_tty_login="tty1"