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>
44 lines
1.3 KiB
Bash
44 lines
1.3 KiB
Bash
load_kdumpst_config
|
|
|
|
# General comment of a caveat here: INITRD_installation() must be
|
|
# reentrant and only install the INITRD handlers if they're not
|
|
# already installed. This is necessary due to a kinda chicken-egg
|
|
# problem: the first time initramfs creation is attempted, we did't
|
|
# necessarily run the INITRD package installation hooks yet, hence
|
|
# we may be unable to properly create the initramfs image. "Easy"
|
|
# solution is to just try to install them always, it's cheap and not
|
|
# dependent of package install time magic.
|
|
|
|
# Parameter passing case - since this is invoked by the kdump-load
|
|
# script, we must be sure that the INITRD package is available.
|
|
if [ -n "$1" ]; then
|
|
|
|
if command -v INITRD 1>/dev/null; then
|
|
INITRD_installation
|
|
create_initramfs_INITRD "$1"
|
|
fi
|
|
exit 0
|
|
fi
|
|
|
|
while read -r line; do
|
|
# First case is the INITRD package installation.
|
|
if [[ "$line" != */vmlinuz ]]; then
|
|
INITRD_installation
|
|
exit 0
|
|
fi
|
|
|
|
# If reaching this point, we're installing/removing the kernel image.
|
|
VERSION="$(basename "$(dirname "$line")")"
|
|
|
|
# If the file exists, means it's an installation step;
|
|
# notice that alpm suppresses the leading '/'.
|
|
if [ -f /"$line" ]; then
|
|
INITRD_installation
|
|
create_initramfs_INITRD "$VERSION"
|
|
else
|
|
rm -f "${MOUNT_FOLDER}"/kdump-initrd-"$VERSION".img
|
|
|
|
fi
|
|
exit 0
|
|
done
|