kdump-steamos: Fix remaining shellcheck complaints
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
This commit is contained in:
@ -33,10 +33,13 @@ fi
|
|||||||
|
|
||||||
mkdir -p "${KDUMP_FOLDER}"
|
mkdir -p "${KDUMP_FOLDER}"
|
||||||
|
|
||||||
|
# we want to split on spaces, it's a set of parameters!
|
||||||
|
# shellcheck disable=SC2086
|
||||||
/usr/bin/makedumpfile ${MAKEDUMPFILE_DMESG_CMD} $VMCORE "${KDUMP_FOLDER}/dmesg.txt"
|
/usr/bin/makedumpfile ${MAKEDUMPFILE_DMESG_CMD} $VMCORE "${KDUMP_FOLDER}/dmesg.txt"
|
||||||
sync "${KDUMP_FOLDER}/dmesg.txt"
|
sync "${KDUMP_FOLDER}/dmesg.txt"
|
||||||
|
|
||||||
if [ "${FULL_COREDUMP}" -ne 0 ]; then
|
if [ "${FULL_COREDUMP}" -ne 0 ]; then
|
||||||
|
# shellcheck disable=SC2086
|
||||||
/usr/bin/makedumpfile ${MAKEDUMPFILE_COREDUMP_CMD} $VMCORE "${KDUMP_FOLDER}/vmcore.compressed"
|
/usr/bin/makedumpfile ${MAKEDUMPFILE_COREDUMP_CMD} $VMCORE "${KDUMP_FOLDER}/vmcore.compressed"
|
||||||
sync "${KDUMP_FOLDER}/vmcore.compressed"
|
sync "${KDUMP_FOLDER}/vmcore.compressed"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -92,7 +92,7 @@ if [ "${USE_PSTORE_RAM}" -eq 1 ]; then
|
|||||||
MEM_SIZE=$(( 16#${MEM_END} - 16#${MEM_START} ))
|
MEM_SIZE=$(( 16#${MEM_END} - 16#${MEM_START} ))
|
||||||
|
|
||||||
if [ ${MEM_SIZE} -ge ${MEM_REQUIRED} ]; then
|
if [ ${MEM_SIZE} -ge ${MEM_REQUIRED} ]; then
|
||||||
if modprobe ramoops mem_address=0x${MEM_START} mem_size=${MEM_REQUIRED} record_size=${RECORD_SIZE}; then
|
if modprobe ramoops mem_address=0x"${MEM_START}" mem_size=${MEM_REQUIRED} record_size=${RECORD_SIZE}; then
|
||||||
# If Pstore is set, update grub.cfg to avoid reserving crashkernel memory.
|
# If Pstore is set, update grub.cfg to avoid reserving crashkernel memory.
|
||||||
logger "kdump-steamos: pstore-RAM was loaded successfully"
|
logger "kdump-steamos: pstore-RAM was loaded successfully"
|
||||||
grub_update pstore
|
grub_update pstore
|
||||||
|
|||||||
@ -29,23 +29,23 @@ install() {
|
|||||||
# reduce the size of this minimal initramfs being created. This should
|
# reduce the size of this minimal initramfs being created. This should
|
||||||
# be already done via command-line arguments, but let's play safe and delete
|
# be already done via command-line arguments, but let's play safe and delete
|
||||||
# from here as well just in case.
|
# 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/lib/kdump
|
mkdir -p "$initdir"/usr/lib/kdump
|
||||||
|
|
||||||
# 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/
|
||||||
cp -LR --preserve=all /etc/default/kdump $initdir/usr/lib/kdump/kdump.etc
|
cp -LR --preserve=all /etc/default/kdump "$initdir"/usr/lib/kdump/kdump.etc
|
||||||
|
|
||||||
inst_hook pre-mount 01 "$moddir/kdump-collect.sh"
|
inst_hook pre-mount 01 "$moddir/kdump-collect.sh"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: LGPL-2.1+
|
# SPDX-License-Identifier: LGPL-2.1+
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user