all: Move the multi-configuration file reading routine to a common helper
Based on Emil's (xexaxo) feedback, we now have a common.sh file that contains the implementation of the routine to read all config files for kdump/pstore, and we use Makefile to join the files, having the same implemention in all users. Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
This commit is contained in:
42
module-setup.sh.in
Normal file
42
module-setup.sh.in
Normal file
@ -0,0 +1,42 @@
|
||||
# Only include kdump if it is explicitly asked in the argument list
|
||||
check() {
|
||||
return 255
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
hostonly='' instmods ext4
|
||||
}
|
||||
|
||||
install() {
|
||||
# A valid makedumpfile is essential for the kdump initrd creation.
|
||||
if [ ! -x "$(command -v makedumpfile)" ]; then
|
||||
logger "kdump: failed to create initrd, makedumpfile is missing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
load_kdump_config
|
||||
|
||||
# First clear all unnecessary firmwares/drivers added by drm in order
|
||||
# to reduce the size of the minimal initramfs being created. This
|
||||
# should be already done via dracut cmdline arguments, but let's play
|
||||
# safe and delete from here as well just in case.
|
||||
rm -rf "$initdir"/usr/lib/firmware/amdgpu/
|
||||
rm -rf "$initdir"/usr/lib/modules/*/kernel/drivers/gpu/drm/amd/*
|
||||
|
||||
# Install necessary binaries
|
||||
inst date
|
||||
inst sync
|
||||
inst makedumpfile
|
||||
|
||||
mkdir -p "$initdir"/usr/share/kdump.d/
|
||||
cp -LR --preserve=all /usr/share/kdump.d/* "$initdir"/usr/share/kdump.d/
|
||||
|
||||
# Determine the numerical devnode for kdump, and save it on initrd;
|
||||
# notice that partset link is not available that early in boot time.
|
||||
DEVN="$(readlink -f "${MOUNT_DEVNODE}")"
|
||||
echo "${DEVN}" > "$initdir"/usr/lib/kdump/kdump.devnode
|
||||
|
||||
cp -LR --preserve=all /usr/lib/kdump/* "$initdir"/usr/lib/kdump/
|
||||
|
||||
inst_hook pre-mount 01 "$moddir/kdump-collect.sh"
|
||||
}
|
||||
Reference in New Issue
Block a user