The crashkernel kernel parameter failed to be configured with the error,
/lib/kdump/kdump-lib.sh: line 976: /dev/fd/63: No such file or directory
_crashkernel_add uses process substitution (<(command)) which won't work when /dev and /proc are not mounted. This patch bind-mounts /proc/ and /dev so _crashkernel_add won't return empty value.
Signed-off-by: Coiby Xu coxu@redhat.com Fixes: 64f2827a ("kdump-lib: Harden _crashkernel_add") --- tests/scripts/image-init-lib.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tests/scripts/image-init-lib.sh b/tests/scripts/image-init-lib.sh index b0af7f8c..5082ae59 100644 --- a/tests/scripts/image-init-lib.sh +++ b/tests/scripts/image-init-lib.sh @@ -178,11 +178,17 @@ mount_image() { $SUDO mount $mnt_dev $mnt [ $? -ne 0 ] && perror_exit "failed to mount device '$mnt_dev'" boot=$(get_mount_boot "$dev") + root=$(get_image_mount_root $image) if [[ -n "$boot" ]]; then - root=$(get_image_mount_root $image) $SUDO mount $boot $root/boot [ $? -ne 0 ] && perror_exit "failed to mount the bootable partition for device '$mnt_dev'" fi + + # bind-mount /proc/ and /dev to support process substitution <(command) + # Currently needed for setting up the crashkernel kernel parameter + for target in proc dev; do + $SUDO mount -o bind /$target $root/$target + done }
get_image_mount_root() {