about summary refs log tree commit diff
path: root/dracut/getty-autologin.sh
blob: 842c7685b22918a933a3a466cae9fa93cd1fd57d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh

USERNAME=$(getarg live.user)
[ -z "$USERNAME" ] && USERNAME=anon

printf '%s\n' '#!/bin/sh' "exec setsid agetty --noclear --autologin root 38400 tty1 linux" >${NEWROOT}/etc/sv/agetty-tty1/run
printf '%s\n' '#!/bin/sh' "exec setsid agetty --autologin root --login-pause 38400 \${PWD##*-} linux" >${NEWROOT}/etc/sv/agetty-generic/run