zipl/dump: add dasd device to ngdump parmline

For dasd devices, we need to enable the device before we can use it.
Add the required dasd device to the kernel commandline when installing
ngdump to a dasd device.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Sven Schnelle
2023-03-03 07:31:20 +00:00
committed by Steffen Eiden
parent 24bcc3141d
commit 01f74c75f5
2 changed files with 28 additions and 2 deletions

View File

@@ -78,11 +78,24 @@ function create_initrd()
[ $# -gt 1 ] || { echo "Usage: $0 <dump partition device> <dryrun>" >&2; exit 1; }
dasd=
device=$(readlink -f $1)
dryrun=$2
type=$(lsblk -dno type "$device")
[ "$type" != "part" ] && { echo "$device with type $type is not a partition." >&2; exit 1; }
case "${device##*/}" in
dasd*)
dasd=$(dasdview -i "$1"|sed -n 's/busid\s*:\s*\([0-9a-fA-F.]\)/dasd=\1/p')
;;
nvme*)
;;
*)
echo "Unsupported device $device." >&2
exit 1
;;
esac
disk_path=$(create_dumpfs $device)
kernel_version=$(get_kernel_version)
kernel=$(get_kernel_image "$kernel_version")
@@ -103,6 +116,6 @@ create_initrd "$disk_path" "$kernel_version" "$initrd"
echo "kernel=$kernel"
echo "initrd=$initrd"
echo "cmdline=reset_devices cgroup_disable=memory nokaslr numa=off irqpoll nr_cpus=1"
echo "cmdline=reset_devices cgroup_disable=memory nokaslr numa=off irqpoll nr_cpus=1 $dasd"
exit 0

View File

@@ -55,10 +55,23 @@ function create_initrd()
device=$(readlink -f $1)
dryrun=$2
dasd=
type=$(lsblk -dno type "$device")
[ "$type" != "part" ] && { echo "$device with type $type is not a partition." >&2; exit 1; }
case "${device##*/}" in
dasd*)
dasd=$(dasdview -i "$1"|sed -n 's/busid\s*:\s*\([0-9a-fA-F.]\)/dasd=\1/p')
;;
nvme*)
;;
*)
echo "Unsupported device $device." >&2
exit 1
;;
esac
disk_path=$(create_dumpfs $device)
kernel_version=$(get_kernel_version)
kernel=$(get_kernel_image "$kernel_version")
@@ -79,6 +92,6 @@ create_initrd "$disk_path" "$kernel_version" "$initrd"
echo "kernel=$kernel"
echo "initrd=$initrd"
echo "cmdline=reset_devices cgroup_disable=memory nokaslr numa=off irqpoll nr_cpus=1"
echo "cmdline=reset_devices cgroup_disable=memory nokaslr numa=off irqpoll nr_cpus=1 $dasd"
exit 0