/usr/lib/kdumpst/kdump-mkinitcpio-hook.sh is run by the kernel hook when using mkinitcpio and a new kernel is installed. If MOUNT_FOLDER does not exist it will fail with the following error message: ==> ERROR: Invalid option -g -- '<MOUNT_FOLDER>/<IMG_FILE>' must be writable
31 lines
1.0 KiB
Bash
31 lines
1.0 KiB
Bash
# Functions to deal with initcpio specifics, both for building
|
|
# the initramfs for mkinitcpio users, but also with regards to
|
|
# installing its specific hooks.
|
|
#
|
|
# IMPORTANT: it is assumed that kdumpst configuration was loaded
|
|
# before running any of these functions!
|
|
#
|
|
create_initramfs_mkinitcpio() {
|
|
mkdir -p "${MOUNT_FOLDER}"
|
|
rm -f "${MOUNT_FOLDER}/kdump-initrd-$1.img"
|
|
|
|
mkinitcpio -A kdump -S microcode,kms,plymouth -g "${MOUNT_FOLDER}/kdump-initrd-$1.img" -k "$1" 1>/dev/null
|
|
|
|
if [ -s "${MOUNT_FOLDER}/kdump-initrd-$1.img" ]; then
|
|
logger "kdumpst: created initcpio minimal initramfs"
|
|
fi
|
|
}
|
|
|
|
mkinitcpio_installation() {
|
|
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 "kdumpst: initcpio hooks installed"
|
|
fi
|
|
}
|
|
|