summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-04-23 14:46:37 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-12-03 14:39:57 +1100
commitf110c98b582be12c9d4ac4a13a7bf5aff2b7dd57 (patch)
tree07b12f4cd2693d0a441a6876569a29dd745c55ec
parenta73d5c25b9de93289b620a54d2ab2c4b4634c793 (diff)
downloadtalos-petitboot-f110c98b582be12c9d4ac4a13a7bf5aff2b7dd57.zip
talos-petitboot-f110c98b582be12c9d4ac4a13a7bf5aff2b7dd57.tar.gz
utils/pb-console: Support agetty's autologin option
If the getty arguments include '-a' do not set the '-l' option. This implies the environment has been configured with users and will launch the subsequent pb-console instance itself. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rw-r--r--utils/pb-console16
1 files changed, 14 insertions, 2 deletions
diff --git a/utils/pb-console b/utils/pb-console
index 282fca1..ef9ed0f 100644
--- a/utils/pb-console
+++ b/utils/pb-console
@@ -80,12 +80,24 @@ then
then
getty="$getty_arg"
fi
+
+ login_arg="-l$0"
+ for ttyarg in "$@"
+ do
+ # If the getty args include autologin don't override with -l
+ # and leave calling petitboot-nc to the user's init
+ if [ "$ttyarg" == "-a" ]
+ then
+ login_arg=""
+ fi
+ done
+
if [ "$detach" = 1 ]
then
- $getty -l $0 "$@" &
+ $getty $login_arg "$@" &
exit
else
- exec $getty -l $0 "$@"
+ exec $getty $login_arg "$@"
fi
fi
OpenPOWER on IntegriCloud