Hi Kelvin
On Wed, Feb 3, 2021 at 11:45 AM Kelvin Fan <kfan(a)redhat.com> wrote:
In the latest releases of Fedora CoreOS, the /boot
directory is mounted read-only. Instead of always placing the
generated kdump initrd next to the default initrd (which is
usually under /boot), make the generated initrd's location
configurable in `/etc/sysconfig/kdump`.
Signed-off by: Kelvin Fan <kfan(a)redhat.com>
---
Changes v1 -> v2:
- Fixed typo `ARGET_INITRD=` -> `TARGET_INITRD`
kdump.sysconfig | 3 +++
kdumpctl | 12 +++++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/kdump.sysconfig b/kdump.sysconfig
index 30f0c63..952d5c7 100644
--- a/kdump.sysconfig
+++ b/kdump.sysconfig
@@ -30,6 +30,9 @@ KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 reset_devices
novmcoredd"
# KEXEC_ARGS="--elf32-core-headers"
KEXEC_ARGS=""
+# Where to store the generated kdump initrd
+TARGET_INITRD_DIR=""
+
#Where to find the boot image
#KDUMP_BOOTDIR="/boot"
diff --git a/kdumpctl b/kdumpctl
index 24f5cf7..4df41b2 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -151,8 +151,9 @@ rebuild_kdump_initrd()
rebuild_initrd()
{
- if [[ ! -w "$KDUMP_BOOTDIR" ]];then
- derror "$KDUMP_BOOTDIR does not have write permission. Can not
rebuild $TARGET_INITRD"
+ TARGET_INITRD_DIR=$(dirname $TARGET_INITRD)
+ if [[ ! -w "$TARGET_INITRD_DIR" ]];then
+ derror "$TARGET_INITRD_DIR does not have write permission. Can not
rebuild $TARGET_INITRD"
return 1
fi
@@ -335,7 +336,12 @@ setup_initrd()
# with fadump aware initrd
backup_default_initrd
else
- TARGET_INITRD="$KDUMP_INITRD"
+ if [ -z $TARGET_INITRD_DIR ]; then
+ TARGET_INITRD="$KDUMP_INITRD"
+ else
+ KDUMP_INITRD_BASE=$(basename "$KDUMP_INITRD")
+
TARGET_INITRD="$TARGET_INITRD_DIR"/"$KDUMP_INITRD_BASE"
+ fi
With this change, kdump on CoreOS still won't work out of box right?
User have to specify a TARGET_INITRD_DIR manually or it will fail.
I think put the initramfs image under /var/lib/kdump if /boot is not
writable should be a better idea, how do you think?
# check if a backup of default initrd exists. If yes,
# it signifies a switch from fadump mode. So, restore
--
2.29.2
_______________________________________________
kexec mailing list -- kexec(a)lists.fedoraproject.org
To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org
--
Best Regards,
Kairui Song