Resolves: RHEL-91468 Upstream: kdump-utils Conflict: None Signed-off-by: Lichen Liu <lichliu@redhat.com>
67 lines
1.7 KiB
Diff
67 lines
1.7 KiB
Diff
From f758448cc7f29a24d8f5ddd7418dc9dd2fc3fd35 Mon Sep 17 00:00:00 2001
|
|
From: Lichen Liu <llc123456a@gmail.com>
|
|
Date: Thu, 8 May 2025 17:22:17 +0800
|
|
Subject: [PATCH] kdumpctl: check and generate /etc/vconsole.conf
|
|
|
|
For VMs created from KVM Guest images, /etc/vconsole.conf is missing
|
|
so that dracut module 10i18n will install all kbd files.
|
|
|
|
```
|
|
# du -sh initramfs/squash/usr/lib/kbd/*
|
|
438K initramfs/squash/usr/lib/kbd/consolefonts
|
|
340K initramfs/squash/usr/lib/kbd/consoletrans
|
|
2.1M initramfs/squash/usr/lib/kbd/keymaps
|
|
232K initramfs/squash/usr/lib/kbd/unimaps
|
|
```
|
|
|
|
From man 5 vconsole.conf, KEYMAP= defaults to "us" if not set. We can
|
|
safely generate a /etc/vconsole.conf with KEYMAP=us by localectl to
|
|
reduce the initramfs size.
|
|
|
|
```
|
|
# du -sh initramfs/squash/usr/lib/kbd/*
|
|
11K initramfs/squash/usr/lib/kbd/consolefonts
|
|
121K initramfs/squash/usr/lib/kbd/keymaps
|
|
```
|
|
|
|
Signed-off-by: Lichen Liu <lichliu@redhat.com>
|
|
---
|
|
kdumpctl | 14 ++++++++++++++
|
|
1 file changed, 14 insertions(+)
|
|
|
|
diff --git a/kdumpctl b/kdumpctl
|
|
index 58de8e6..ae541a3 100755
|
|
--- a/kdumpctl
|
|
+++ b/kdumpctl
|
|
@@ -174,6 +174,18 @@ rebuild_kdump_initrd()
|
|
return 0
|
|
}
|
|
|
|
+check_and_generate_vconsole_conf()
|
|
+{
|
|
+ if [[ ! -e /etc/vconsole.conf ]]; then
|
|
+ dwarn "/etc/vconsole.conf does not exist, trying to set keymap to us to reduce the initramfs size."
|
|
+ if has_command localectl; then
|
|
+ if localectl list-keymaps | grep -q "^us$"; then
|
|
+ localectl set-keymap us 2>/dev/null
|
|
+ fi
|
|
+ fi
|
|
+ fi
|
|
+}
|
|
+
|
|
rebuild_initrd()
|
|
{
|
|
local _ret
|
|
@@ -185,6 +197,8 @@ rebuild_initrd()
|
|
return 1
|
|
fi
|
|
|
|
+ check_and_generate_vconsole_conf
|
|
+
|
|
if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then
|
|
rebuild_fadump_initrd
|
|
else
|
|
--
|
|
2.47.0
|
|
|