Files
s390-tools/zipl/dracut/99ngdump/module-setup.sh
Alexander Egorenkov 85c9a49e63 zipl: Add dracut module for NGDump
The NGDump dracut module is required to build an initramfs image to be used
with NGDump stand-alone dump. NGDump stand-alone dump does not
use a pre-built initramfs image in contrast to SCSI stand-alone dump.
Instead, an initramfs image is built with dracut if NGDump stand-alone dump
is installed on a NVMe partition.

The NGDump dracut module ensures that all necessary tools are present
within the built initramfs and a dump of /proc/vmcore is initiated
to the chosen NVMe partition when the installed dumper is IPLed.

The NGDump dracut module installs a new systemd service and a dump script
into dumper initramfs. The systemd init process starts the NGDump service
at boot shortly after the initialization of the dump target device.
The NGDump systemd service, in its turn, starts the dump script provided
by the new dracut module. The dump script mounts then the dump target
device, creates a copy of /proc/vmcore with the makedumpfile tool on it,
and then shuts down the system.

The NGDump dracut module can be used on any Linux distribution which
supports dracut. But the primary targets are:
- Fedora
- RHEL
- SLES

Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Tested-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-06-20 13:14:05 +02:00

41 lines
973 B
Bash
Executable File

#!/bin/bash
#
# Copyright IBM Corp. 2021
#
# s390-tools is free software; you can redistribute it and/or modify
# it under the terms of the MIT license. See LICENSE for details.
#
check() {
require_binaries sync poweroff || return 1
require_binaries cut sha256sum findmnt makedumpfile || return 1
# Only include the dracut module, if another module requires it
# or if explicitly specified in the config file or on the argument list.
return 255
}
depends() {
echo "base shutdown systemd"
}
installkernel() {
instmods nvme ext4
}
install() {
mkdir -p "${initdir}/ngdump"
inst sync
inst poweroff
inst cut
inst sha256sum
inst findmnt
inst makedumpfile
inst "$moddir/ngdump.sh" "/usr/bin/ngdump.sh"
inst "$moddir/ngdump-reipl.sh" "/usr/bin/ngdump-reipl.sh"
inst "$moddir/ngdump.service" "$systemdsystemunitdir/ngdump.service"
systemctl -q --root "$initdir" add-wants initrd.target ngdump.service
}