diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-23 11:41:59 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-23 11:41:59 +0200 |
commit | a93776085a4f67c1b3fc059d161a4e86956542aa (patch) | |
tree | 688304f849fc9fa0687f5a4cee7cb222cd15caeb /setup-alpine.in | |
parent | f17c86eaec4e8f569437994775f0816e29054239 (diff) | |
download | alpine-conf-a93776085a4f67c1b3fc059d161a4e86956542aa.zip |
setup-alpine: don't ask for keymap from serial console
Only ask user for keymap from virtual consoles.
Diffstat (limited to 'setup-alpine.in')
-rw-r--r-- | setup-alpine.in | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/setup-alpine.in b/setup-alpine.in index 6f90f39..dc25f67 100644 --- a/setup-alpine.in +++ b/setup-alpine.in @@ -12,6 +12,13 @@ is_qemu() { || strings /sys/firmware/dmi/tables/DMI 2>/dev/null | grep -q QEMU } +is_virtual_console() { + case "$(readlink "$ROOT"/proc/self/fd/0)" in + /dev/tty[0-9]*) return 0;; + esac + return 1 +} + usage() { cat <<-__EOF__ usage: setup-alpine [-ahq] [-c FILE | -f FILE] @@ -128,7 +135,9 @@ else fi if [ "$rc_sys" != LXC ]; then - $PREFIX/sbin/setup-keymap ${KEYMAPOPTS} + if is_virtual_console || [ -n "$KEYMAPOPTS" ]; then + $PREFIX/sbin/setup-keymap ${KEYMAPOPTS} + fi $PREFIX/sbin/setup-hostname ${HOSTNAMEOPTS} && rc-service hostname --quiet restart $PREFIX/sbin/setup-devd -C mdev # just to bootstrap fi |