kdumpctl: check and generate /etc/vconsole.conf
Resolves: RHEL-91468 Upstream: kdump-utils Conflict: None Signed-off-by: Lichen Liu <lichliu@redhat.com>
This commit is contained in:
parent
0f7139c853
commit
535d27bfdb
66
0001-kdumpctl-check-and-generate-etc-vconsole.conf.patch
Normal file
66
0001-kdumpctl-check-and-generate-etc-vconsole.conf.patch
Normal file
@ -0,0 +1,66 @@
|
||||
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
|
||||
|
||||
@ -8,6 +8,7 @@ Summary: Kernel crash dump collection utilities
|
||||
License: GPL-2.0-only
|
||||
URL: https://github.com/rhkdump/kdump-utils
|
||||
Source0: https://github.com/rhkdump/kdump-utils/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||
Patch01: 0001-kdumpctl-check-and-generate-etc-vconsole.conf.patch
|
||||
|
||||
%ifarch ppc64 ppc64le
|
||||
Requires(post): servicelog
|
||||
|
||||
Loading…
Reference in New Issue
Block a user