Subject: [PATCH alpine-conf] setup-disk: Add keymap to initfs if root is ZFS

From: Edin Taric <[email-masked]>
Date: Thu, 17 Feb 2022 12:17:18 +0100

Checks whether $rootfs is ZFS and adds "keymap" to $initfs_features.
This is required for encrypted ZFS installations that prompt for a
passphrase at boot to ensure that the appropriate keymap is used for
non-US keyboard users.
ref: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13291

Signed-off-by: Edin Taric <[email-masked]>
---
 setup-disk.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/setup-disk.in b/setup-disk.in
index 58ea7c8..df760ab 100644
--- a/setup-disk.in
+++ b/setup-disk.in
@@ -492,6 +492,10 @@ install_mounted_root() {
 	root_fs=$(find_mount_fs "$mnt")
 	initfs_features="$initfs_features $root_fs"
 
+	if [ "$rootfs" = "zfs" ]; then
+		initfs_features="$initfs_features keymap"
+	fi
+
 	if is_lvm "$rootdev"; then
 		initfs_features="$initfs_features lvm"
 		local vg=$(find_volume_group "$rootdev")
-- 
2.34.1