diff --git a/modules/system/boot/stage-1-init.sh b/modules/system/boot/stage-1-init.sh index 593b9397e66..53d528fcd56 100644 --- a/modules/system/boot/stage-1-init.sh +++ b/modules/system/boot/stage-1-init.sh @@ -147,6 +147,10 @@ modprobe scsi_wait_scan || true udevadm settle || true +# Load boot-time keymap before any LVM/LUKS initialization +@extraUtils@/bin/busybox loadkmap < "@busyboxKeymap@" + + # XXX: Use case usb->lvm will still fail, usb->luks->lvm is covered @preLVMCommands@ diff --git a/modules/system/boot/stage-1.nix b/modules/system/boot/stage-1.nix index d7925c0f7d3..feb4b583839 100644 --- a/modules/system/boot/stage-1.nix +++ b/modules/system/boot/stage-1.nix @@ -288,6 +288,14 @@ let ''; + # the binary keymap for busybox to load at boot + busyboxKeymap = pkgs.runCommand "boottime-keymap" + { preferLocalBuild = true; } + '' + ${pkgs.kbd}/bin/loadkeys -qb "${config.i18n.consoleKeyMap}" > $out + ''; + + # The init script of boot stage 1 (loading kernel modules for # mounting the root FS). bootStage1 = pkgs.substituteAll { @@ -297,7 +305,7 @@ let isExecutable = true; - inherit udevConf extraUtils modulesClosure; + inherit udevConf busyboxKeymap extraUtils modulesClosure; inherit (config.boot) resumeDevice devSize runSize;