zdev/dracut: add rd.dasd cmdline option handling

Add parsing of dracut cmdline option "rd.dasd=..." at initrd runtime.
It delegates configuration to chzdev.

Implement `dracut --print-cmdline` and `dracut --hostonly-cmdline` for
initrd build time. Emit an rd.dasd option for each DASD disk in dracut's
device dependency graph (to mount the root-fs, or to access the kdump
target).

This allows a distribution independent device configuration.
Configuration is consistent by using chzdev as backend.
It also prevents duplicate activations of the same device.

Copy the udev rule for unique DASD device nodes under /dev/disk/
[59-dasd.rules] into initrd for the same functionality like 95dasd or
95dasd_rules.

Along with the existing functionality of zdev/dracut, it makes the
following dracut modules superfluous:
https://github.com/dracutdevs/dracut/tree/master/modules.d/95dasd
https://github.com/dracutdevs/dracut/tree/master/modules.d/95dasd_mod
https://github.com/dracutdevs/dracut/tree/master/modules.d/95dasd_rules

Github-ID: https://github.com/ibm-s390-linux/s390-tools/pull/158
Acked-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Acked-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Steffen Maier
2023-03-23 17:48:56 +01:00
committed by Jan Höppner
parent 9b2fb1d4d2
commit 9927023680
5 changed files with 63 additions and 4 deletions
+8 -1
View File
@@ -10,7 +10,8 @@
# This module installs configuration files (udev rules and modprobe.conf
# files) required to enable the root device on s390. It will only work when
# the root device was configured using the chzdev tool. In addition,
# hooks are installed to parse rd.zdev= and rd.zfcp= kernel parameters.
# hooks are installed to parse rd.zdev= and rd.zfcp= and rd.dasd=
# kernel parameters.
#
# called by dracut
@@ -76,10 +77,16 @@ install() {
inst_hook cmdline 95 "$moddir/parse-zdev.sh"
# Hook to parse zfcp dracut cmdline parameter
inst_hook cmdline 95 "$moddir/parse-zfcp.sh"
# Hook to parse dasd dracut cmdline parameter
# Must be the first one to use chzdev so dasd_mod is not yet loaded.
inst_hook cmdline 94 "$moddir/parse-dasd.sh"
inst_multiple /lib/s390-tools/zdev-from-dasd_mod.dasd
# Rule to automatically enable devices when running in DPM
inst_rules "81-dpm.rules"
inst_rules "59-dasd.rules"
# Obtain early + root device configuration
# shellcheck disable=SC2154