Skip to content

Commit b9e39e1

Browse files
authored
Merge pull request #28505 from bluca/vconsole_debian
vconsole-setup: don't fail with an empty keymap
2 parents 739bbc5 + febbc24 commit b9e39e1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

mkosi.presets/00-base/mkosi.build

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ if [ ! -f "$BUILDDIR"/build.ninja ]; then
5555
UKIFY=true
5656
fi
5757

58+
# On Debian 'loadkeys us' fails
59+
if [ "$ID" = "debian" ] || [ "$ID_LIKE" = "debian" ]; then
60+
DEFAULT_KEYMAP=""
61+
else
62+
DEFAULT_KEYMAP="us"
63+
fi
64+
5865
CONFIGURE_OPTS=(
5966
-D sysvinit-path="$sysvinit_path"
6067
-D rootprefix="$rootprefix"
@@ -149,6 +156,7 @@ if [ ! -f "$BUILDDIR"/build.ninja ]; then
149156
-D first-boot-full-preset=true
150157
-D initrd=true
151158
-D fexecve=true
159+
-D default-keymap="$DEFAULT_KEYMAP"
152160
)
153161

154162
# On debian-like systems the library directory is not /usr/lib64 but /usr/lib/<arch-triplet>/.

src/vconsole/vconsole-setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ static int keyboard_load_and_wait(const char *vc, Context *c, bool utf8) {
280280
map_toggle = context_get_config(c, VC_KEYMAP_TOGGLE);
281281

282282
/* An empty map means kernel map */
283-
if (!map)
283+
if (isempty(map))
284284
return 0;
285285

286286
args[i++] = KBD_LOADKEYS;

0 commit comments

Comments
 (0)