From a93776085a4f67c1b3fc059d161a4e86956542aa Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 23 May 2022 11:41:59 +0200 Subject: setup-alpine: don't ask for keymap from serial console Only ask user for keymap from virtual consoles. --- setup-alpine.in | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'setup-alpine.in') 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 -- cgit v1.2.3