Steffen Maier
9927023680
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 >
2023-12-14 15:25:22 +01:00
Steffen Maier
06a30ae529
zdev/dracut: add rd.zfcp cmdline option handling
...
Add parsing of dracut cmdline option "rd.zfcp=..." at initrd runtime.
It delegates configuration to chzdev.
Implement `dracut --print-cmdline` and `dracut --hostonly-cmdline` for
initrd build time. Emit an rd.zfcp option for each zfcp-attached SCSI 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.
Along with the existing functionality of zdev/dracut, it makes the
following dracut modules superfluous:
https://github.com/dracutdevs/dracut/tree/master/modules.d/95zfcp
[rd.zfcp.conf is no longer needed and thus ignored here; the preceding
("zdev/dracut: fix marking hostonly files so delete option works")
makes rd.hostonly=0 work as a generic replacement]
https://github.com/dracutdevs/dracut/tree/master/modules.d/95zfcp_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 >
2023-12-14 15:25:22 +01:00
Steffen Maier
54e016ae71
zdev/dracut: use namespace prefix in functions of zdev-lib.sh
...
Use namespace prefix in functions of zdev-lib.sh to avoid collisions with
different modules being sourced in the shell.
Github-ID: https://github.com/ibm-s390-linux/s390-tools/pull/158
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com >
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com >
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 >
2023-12-14 15:25:22 +01:00
Steffen Maier
1266f86444
zdev/dracut: add shellcheck annotations for recently added code
...
The annotations and the one non-functional code change in
zdev/dracut/95zdev-kdump/module-setup.sh check() clear all shellcheck
reports.
complements
73c46a3056 ("zdev/dracut: fix kdump by only activating required devices")
Github-ID: https://github.com/ibm-s390-linux/s390-tools/pull/158
Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com >
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 >
2023-12-14 15:25:22 +01:00
Marc Hartmayer
a2baeb2fe2
zdev/dracut/zdev-lib.sh: add ShellCheck shell directive
...
Add a ShellCheck [1] directive before the first command in the file to tell
ShellCheck and the reader which shell to use. See
https://www.shellcheck.net/wiki/SC2148 for details.
[1] https://www.shellcheck.net/
Reviewed-by: Steffen Maier <maier@linux.ibm.com >
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com >
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com >
2023-08-02 14:48:12 +02:00
Steffen Maier
73c46a3056
zdev/dracut: fix kdump by only activating required devices
...
This prevents out-of-memory (OOM) situations in the kdump crashkernel
environment.
Please note that the new dracut module 95zdev-kdump and the new library
zdev-lib.sh need to be packaged into the same (core) (sub)package as
95zdev.
This patch introduces a new dracut module "zdev-kdump", which is used
instead of module "zdev" when building a kdump initrd:
1. Ignore all persistently configured block devices and disable zfcp auto
LUN scanning => minimize the number of SCSI devices enabled during kdump.
2. Do not rely on chzdev's persistent configuration => work with systems
that do not use chzdev for persistent device configuration.
The detection of kdump is based on strict hostonly mode and on $IN_KDUMP.
See also
https://src.fedoraproject.org/rpms/kexec-tools commit
4eedcae5e154 ("dracut-module-setup.sh: don't include multipath-hostonly")
and https://github.com/dracutdevs/dracut commits
35e86ac117ac ("Merge 90-multipath-hostonly and 90-multipath")
a695250ec7db ("Introduce tri-state hostonly mode")
and
https://src.fedoraproject.org/rpms/kexec-tools/blob/rawhide/f/mkdumprd#_17
https://src.fedoraproject.org/rpms/kexec-tools/blob/rawhide/f/dracut-module-setup.sh#_23 .
The detection of kdump is also based on kdump_needed() in
https://github.com/openSUSE/kdump/blob/master/dracut/module-setup.sh .
Reviewed-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 >
2023-03-03 09:58:40 +01:00