Merge pull request #2365 from deitch/test-dev-existence-getty

Test dev existence getty
This commit is contained in:
Justin Cormack
2017-08-07 20:32:39 +01:00
committed by GitHub
22 changed files with 28 additions and 22 deletions

View File

@@ -15,6 +15,12 @@ start_getty() {
term="linux"
[ "$speed" = "$1" ] && speed=115200
# does the device even exist?
if [ ! -c /dev/$tty ]; then
echo "getty: cmdline has console=$tty but /dev/$tty is not a character device; not starting getty for $tty" | tee /dev/console
return
fi
case "$tty" in
ttyS*|ttyAMA*|ttyUSB*|ttyMFD*)
line="-L"
@@ -35,7 +41,7 @@ start_getty() {
if ! grep -q -w "$tty" "$securetty"; then
# we could not find the tty in securetty, so start a getty but warn that root login will not work
echo "getty: cmdline has console=$tty but does not exist in $securetty; will not be able to log in as root on this tty $tty." > /dev/$tty
echo "getty: cmdline has console=$tty but does not exist in $securetty; will not be able to log in as root on this tty $tty." | tee /dev/$tty
fi
# respawn forever
infinite_loop setsid.getty -w /sbin/agetty $loginargs $line $speed $tty $term &