Files
s390-tools/zipl/initramfs-tools/hooks/ngdump
Alexander Egorenkov c1d08e1380 zipl: Add initramfs-tools module for NGDump
The NGDump initramfs-tools 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 initramfs-tools if NGDump
stand-alone dump is installed on a NVMe partition.

The NGDump initramfs-tools 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 intramfs-tools module installs a configuration file and
a dump script into dumper initramfs. This dump script starts at boot
shortly after the initialization of the dump target device. It reads
the aforementioned configuration file that contains the name of a dump
partition to store a dump on. The dump script reads the configuration file,
mounts then the dump target device, creates a copy of /proc/vmcore with
the makedumpfile tool on it, and then shuts down the system.

Ubuntu and Debian are the main Linux distributions targeted by this
initramfs-tools module.

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

51 lines
853 B
Bash
Executable File

#!/bin/sh
#
# 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.
#
OPTION=NGDUMP
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case "${1}" in
prereqs)
prereqs
exit 0
;;
esac
. /usr/share/initramfs-tools/hook-functions
#
# Install required kernel modules
#
manual_add_modules nvme ext4
block_dev_mod_add "$NGDUMP_DEVICE"
#
# Installs required tools
#
for tool in logsave findmnt sha256sum makedumpfile; do
path=$(command -v "$tool")
if [ ! -e "$path" ]; then
echo "$tool not found" >&2
exit 1
fi
copy_exec $path
done
force_load nvme
#
# Store the dump partition in a config file within initramfs.
# The config file will be included by the dump script.
#
echo "NGDUMP_DEVICE=${NGDUMP_DEVICE}" > "${DESTDIR}/conf/conf.d/ngdump"