all: Rename the tool to kdumpst

Big but self-explanatory commit: rename the tool. The name choice was
kdumpst, since it's a tool to enable both kdump and pstore setting, also
it's a silly wordplay with the superlative of kdump, as in "kdumpest".

It's an invasive change (touches most of the files), but should
offer no functional change other than logging messages showing
kdumpst now, instead of kdump, and some filenames.

Notice it doesn't touch documentation, which will be done in
a subsequent commit.

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
This commit is contained in:
Guilherme G. Piccoli
2023-03-22 20:08:47 -03:00
parent 756e698650
commit 4b5746a60e
19 changed files with 98 additions and 98 deletions

View File

@ -23,5 +23,5 @@ Target = INITRD
Description = Managing kdump minimal initramfs and INITRD hooks...
Depends=INITRD
When = PostTransaction
Exec = /usr/lib/kdump/kdump-INITRD-hook.sh
Exec = /usr/lib/kdumpst/kdump-INITRD-hook.sh
NeedsTargets

View File

@ -7,7 +7,7 @@ set -eo pipefail # exclude -u on purpose to avoid issues with param checking
# Maintainer: Guilherme G. Piccoli <gpiccoli@igalia.com>
#
# This is the generic alpm-hook script that handles kernel/package
# installation for INITRD users, on behalf of kdump. Covers both manual
# installation for INITRD users, on behalf of kdumpst. Covers both manual
# invocation (to create the initramfs image for a given kernel) as
# well as kernel package installation/removal trigger. It also handles
# the event of installing the package INITRD, which requires the

View File

@ -1,4 +1,4 @@
load_kdump_config
load_kdumpst_config
# General comment of a caveat here: INITRD_installation() must be
# reentrant and only install the INITRD handlers if they're not

View File

@ -2,7 +2,7 @@
# the initramfs for dracut users, but also with regards to
# installing dracut specific hooks/scripts.
#
# IMPORTANT: it is assumed that kdump configuration was loaded
# IMPORTANT: it is assumed that kdumpst configuration was loaded
# before running any of these functions!
#
create_initramfs_dracut() {
@ -22,12 +22,12 @@ create_initramfs_dracut() {
--kver "$1" "${MOUNT_FOLDER}/kdump-initrd-$1.img"
if [ -s "${MOUNT_FOLDER}/kdump-initrd-$1.img" ]; then
logger "kdump: created dracut minimal initramfs"
logger "kdumpst: created dracut minimal initramfs"
fi
}
dracut_installation() {
HOOKS_DIR="/usr/lib/kdump/dracut/"
HOOKS_DIR="/usr/lib/kdumpst/dracut/"
DRACUT_DIR="$(pkg-config --variable=dracutmodulesdir dracut 2>/dev/null)"
if [ -z "${DRACUT_DIR}" ]; then
@ -37,7 +37,7 @@ dracut_installation() {
if [ ! -d "${DRACUT_DIR}"/55kdump/ ]; then
install -D -m0755 "${HOOKS_DIR}"/kdump-collect.sh "${DRACUT_DIR}"/55kdump/kdump-collect.sh
install -D -m0755 "${HOOKS_DIR}"/module-setup.sh "${DRACUT_DIR}"/55kdump/module-setup.sh
logger "kdump: dracut hooks/scripts installed"
logger "kdumpst: dracut hooks/scripts installed"
fi
}

View File

@ -6,5 +6,5 @@
# Maintainer: Guilherme G. Piccoli <gpiccoli@igalia.com>
#
# Kdump-initrd module construction/inclusion script for
# Dracut-based initramfs.
# Dracut-based initramfs - part of the kdumpst tooling.
#

View File

@ -4,7 +4,7 @@ check() {
}
installkernel() {
load_kdump_config
load_kdumpst_config
# First clear all unnecessary firmwares/drivers added by drm in order
# to reduce the size of the minimal initramfs being created - kdump
@ -16,7 +16,7 @@ installkernel() {
FSMOD="$(findmnt -n -o FSTYPE --target "${MOUNT_FOLDER}")"
if [ -z "${FSMOD}" ]; then
logger "kdump: error on filesystem discovery"
logger "kdumpst: error on filesystem discovery"
exit 1
fi
@ -39,38 +39,38 @@ installkernel() {
install() {
# A valid makedumpfile is essential for the kdump initrd creation.
if ! command -v makedumpfile 1>/dev/null; then
logger "kdump: failed to create dracut initrd, makedumpfile is missing"
logger "kdumpst: failed to create dracut initrd, makedumpfile is missing"
exit 1
fi
load_kdump_config
load_kdumpst_config
# Install necessary binaries
inst date
inst sync
inst makedumpfile
# Copying kdump config/lib files is essential for a functional kdump.
cp -LR --preserve=all /usr/share/kdump.d/ "$initdir"/usr/share/
cp -LR --preserve=all /usr/lib/kdump/ "$initdir"/usr/lib/
# Copying kdumpst config/lib files is essential for a functional kdump.
cp -LR --preserve=all /usr/share/kdumpst.d/ "$initdir"/usr/share/
cp -LR --preserve=all /usr/lib/kdumpst/ "$initdir"/usr/lib/
# Finally, we need to derive the proper place to save the dump from the
# config files, in a way that makes possible to mount it in early boot.
DEVNODE="$(findmnt -n -o SOURCE --target "${MOUNT_FOLDER}")"
if [ -z "${DEVNODE}" ]; then
logger "kdump: error on devnode discovery"
logger "kdumpst: error on devnode discovery"
exit 1
fi
echo "${DEVNODE}" > "$initdir"/usr/lib/kdump/kdump.mnt
echo "${DEVNODE}" > "$initdir"/usr/lib/kdumpst/kdump.mnt
TGT="$(findmnt -n -o TARGET --target "${MOUNT_FOLDER}")"
if [ -z "${TGT}" ]; then
logger "kdump: error on base folder discovery"
logger "kdumpst: error on base folder discovery"
exit 1
fi
BASE_FLD="${MOUNT_FOLDER#*$TGT}"
echo "${BASE_FLD}" > "$initdir"/usr/lib/kdump/kdump.dir
echo "${BASE_FLD}" > "$initdir"/usr/lib/kdumpst/kdump.dir
inst_hook pre-mount 01 "$moddir/kdump-collect.sh"
}

View File

@ -2,7 +2,7 @@
# the initramfs for mkinitcpio users, but also with regards to
# installing its specific hooks.
#
# IMPORTANT: it is assumed that kdump configuration was loaded
# IMPORTANT: it is assumed that kdumpst configuration was loaded
# before running any of these functions!
#
create_initramfs_mkinitcpio() {
@ -11,19 +11,19 @@ create_initramfs_mkinitcpio() {
mkinitcpio -A kdump -g "${MOUNT_FOLDER}/kdump-initrd-$1.img" "$1" 1>/dev/null
if [ -s "${MOUNT_FOLDER}/kdump-initrd-$1.img" ]; then
logger "kdump: created initcpio minimal initramfs"
logger "kdumpst: created initcpio minimal initramfs"
fi
}
mkinitcpio_installation() {
KDUMP_HOOKS_DIR="/usr/lib/kdump/initcpio/"
KDUMP_HOOKS_DIR="/usr/lib/kdumpst/initcpio/"
INITCPIO_HOOKS="/usr/lib/initcpio/hooks"
INITCPIO_INST="/usr/lib/initcpio/install"
if [ ! -e "${INITCPIO_HOOKS}"/kdump ] || [ ! -e "${INITCPIO_INST}"/kdump ]; then
install -D -m0644 "${KDUMP_HOOKS_DIR}"/kdump.hook "${INITCPIO_HOOKS}"/kdump
install -D -m0644 "${KDUMP_HOOKS_DIR}"/kdump.install "${INITCPIO_INST}"/kdump
logger "kdump: initcpio hooks installed"
logger "kdumpst: initcpio hooks installed"
fi
}

View File

@ -5,5 +5,5 @@
# Maintainer: Guilherme G. Piccoli <gpiccoli@igalia.com>
#
# Kdump-initrd module construction/inclusion script for
# initcpio-based initramfs.
# initcpio-based initramfs - part of the kdumpst tooling.
#

View File

@ -1,9 +1,9 @@
build() {
load_kdump_config
load_kdumpst_config
# A valid makedumpfile is essential for the kdump initrd creation.
if ! command -v makedumpfile 1>/dev/null; then
logger "kdump: failed to create minimal initrd, makedumpfile is missing"
logger "kdumpst: failed to create minimal initrd, makedumpfile is missing"
exit 1
fi
@ -12,26 +12,26 @@ build() {
add_binary "$(command -v makedumpfile)"
# Copying kdump config/lib files is essential for a functional kdump.
add_full_dir /usr/share/kdump.d/
add_full_dir /usr/lib/kdump/
add_full_dir /usr/share/kdumpst.d/
add_full_dir /usr/lib/kdumpst/
# We need to derive the proper place to save the dump from the
# config files, in a way that makes possible to mount it in early boot.
DEVNODE="$(findmnt -n -o SOURCE --target "${MOUNT_FOLDER}")"
if [ -z "${DEVNODE}" ]; then
logger "kdump: error on devnode discovery"
logger "kdumpst: error on devnode discovery"
exit 1
fi
echo "${DEVNODE}" > "${BUILDROOT}"/usr/lib/kdump/kdump.mnt
echo "${DEVNODE}" > "${BUILDROOT}"/usr/lib/kdumpst/kdump.mnt
TGT="$(findmnt -n -o TARGET --target "${MOUNT_FOLDER}")"
if [ -z "${TGT}" ]; then
logger "kdump: error on base folder discovery"
logger "kdumpst: error on base folder discovery"
exit 1
fi
BASE_FLD="${MOUNT_FOLDER#*$TGT}"
echo "${BASE_FLD}" > "${BUILDROOT}"/usr/lib/kdump/kdump.dir
echo "${BASE_FLD}" > "${BUILDROOT}"/usr/lib/kdumpst/kdump.dir
# Finally, we shouldn't have DRM/GPU drivers and firmwares here,
# but...just in case, let's remove all of that nevertheless.
@ -44,7 +44,7 @@ build() {
help() {
cat <<HELPEOF
This hook is responsible for creating the minimal kdump initramfs.
Hook responsible for creating the kdumpst minimal kdump initramfs.
HELPEOF
}

View File

@ -6,7 +6,7 @@
# Maintainer: Guilherme G. Piccoli <gpiccoli@igalia.com>
#
# Script for effectively collecting the core dump/dmesg from
# within a minimal initrd - part of the kdump/pstore tooling.
# within a minimal initrd - part of the kdumpst tooling.
# The most fail-prone operations are guarded with conditionals to
# bail in case we indeed fail - worst thing here would be to have
# a bad condition and get stuck in this minimal initrd with no
@ -26,13 +26,13 @@
# files here, since we manually added them in the initrd and
# the validation also happened there, during such addition,
# hence not requiring checks here.
for cfg in "/usr/share/kdump.d"/*; do
for cfg in "/usr/share/kdumpst.d"/*; do
. "$cfg"
done
KDUMP_TIMESTAMP=$(date -u +"%Y%m%d%H%M")
MOUNT_POINT="$(cat /usr/lib/kdump/kdump.mnt)"
BASE_FOLDER="$(cat /usr/lib/kdump/kdump.dir)"
MOUNT_POINT="$(cat /usr/lib/kdumpst/kdump.mnt)"
BASE_FOLDER="$(cat /usr/lib/kdumpst/kdump.dir)"
KDUMP_FOLDER="/kdump_path/${BASE_FOLDER}/crash/${KDUMP_TIMESTAMP}"
# Check if the device node exists - or else, just bails-out.