From 338e7f1e776b46dce97fd64e52e3551f08067071 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 17 Dec 2015 10:48:11 +0000 Subject: init: add tty from cmdline to securetty --- initramfs-init.in | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/initramfs-init.in b/initramfs-init.in index cdf50b9..e9155e0 100755 --- a/initramfs-init.in +++ b/initramfs-init.in @@ -136,10 +136,15 @@ setup_inittab_console(){ [ "$tty" = "tty0" ] && continue # do nothing if inittab already have the tty set up - grep -q "^$tty:" $sysroot/etc/inittab && continue - echo "# enable login on alternative console" >> $sysroot/etc/inittab - echo "$tty::respawn:/sbin/getty $line $speed $tty $term" \ - >> $sysroot/etc/inittab + if ! grep -q "^$tty:" $sysroot/etc/inittab; then + echo "# enable login on alternative console" \ + >> $sysroot/etc/inittab + echo "$tty::respawn:/sbin/getty $line $speed $tty $term" \ + >> $sysroot/etc/inittab + fi + if [ -e "$sysroot"/etc/securetty ] && ! grep -q -w "$tty"; then + echo "$tty" >> "$sysroot"/etc/securetty + fi done } -- cgit v1.2.3