module-setup: Re-indent the file

This way, the file matches the others in the package.

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
This commit is contained in:
Guilherme G. Piccoli
2022-12-22 19:02:05 -03:00
parent f68b45b1c6
commit a967f5b553

View File

@ -11,57 +11,57 @@
# Only include kdump if it is explicitly asked in the argument list # Only include kdump if it is explicitly asked in the argument list
check() { check() {
return 255 return 255
} }
installkernel() { installkernel() {
hostonly='' instmods ext4 hostonly='' instmods ext4
} }
install() { install() {
# A valid makedumpfile is essential for the kdump initrd creation. # A valid makedumpfile is essential for the kdump initrd creation.
if [ ! -x "$(command -v makedumpfile)" ]; then if [ ! -x "$(command -v makedumpfile)" ]; then
logger "kdump: failed to create initrd, makedumpfile is missing" logger "kdump: failed to create initrd, makedumpfile is missing"
exit 1 exit 1
fi fi
# Load the necessary external variables, otherwise it'll fail later. # Load the necessary external variables, otherwise it'll fail later.
HAVE_CFG_FILES=0 HAVE_CFG_FILES=0
shopt -s nullglob shopt -s nullglob
for cfg in "/usr/share/kdump.d"/*; do for cfg in "/usr/share/kdump.d"/*; do
if [ -f "$cfg" ]; then if [ -f "$cfg" ]; then
. "$cfg" . "$cfg"
HAVE_CFG_FILES=1 HAVE_CFG_FILES=1
fi fi
done done
shopt -u nullglob shopt -u nullglob
if [ ${HAVE_CFG_FILES} -eq 0 ]; then if [ ${HAVE_CFG_FILES} -eq 0 ]; then
logger "kdump: no config files in /usr/share/kdump.d/ - aborting." logger "kdump: no config files in /usr/share/kdump.d/ - aborting."
exit 1 exit 1
fi fi
# First clear all unnecessary firmwares/drivers added by drm in order to # First clear all unnecessary firmwares/drivers added by drm in order
# reduce the size of this minimal initramfs being created. This should # to reduce the size of the minimal initramfs being created. This
# be already done via command-line arguments, but let's play safe and delete # should be already done via dracut cmdline arguments, but let's play
# from here as well just in case. # safe and delete from here as well just in case.
rm -rf "$initdir"/usr/lib/firmware/amdgpu/ rm -rf "$initdir"/usr/lib/firmware/amdgpu/
rm -rf "$initdir"/usr/lib/modules/*/kernel/drivers/gpu/drm/amd/* rm -rf "$initdir"/usr/lib/modules/*/kernel/drivers/gpu/drm/amd/*
# Install necessary binaries # Install necessary binaries
inst date inst date
inst sync inst sync
inst makedumpfile inst makedumpfile
mkdir -p "$initdir"/usr/share/kdump.d/ mkdir -p "$initdir"/usr/share/kdump.d/
cp -LR --preserve=all /usr/share/kdump.d/* "$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; # Determine the numerical devnode for kdump, and save it on initrd;
# notice that partset link is not available that early in boot time. # notice that partset link is not available that early in boot time.
DEVN="$(readlink -f "${MOUNT_DEVNODE}")" DEVN="$(readlink -f "${MOUNT_DEVNODE}")"
echo "${DEVN}" > "$initdir"/usr/lib/kdump/kdump.devnode echo "${DEVN}" > "$initdir"/usr/lib/kdump/kdump.devnode
cp -LR --preserve=all /usr/lib/kdump/* "$initdir"/usr/lib/kdump/ cp -LR --preserve=all /usr/lib/kdump/* "$initdir"/usr/lib/kdump/
inst_hook pre-mount 01 "$moddir/kdump-collect.sh" inst_hook pre-mount 01 "$moddir/kdump-collect.sh"
} }