kdump-steamos: Fix remaining shellcheck complaints

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
This commit is contained in:
Guilherme G. Piccoli
2022-02-23 16:48:26 -03:00
parent d279ea84aa
commit 6ae626f17c
4 changed files with 11 additions and 8 deletions

View File

@ -33,10 +33,13 @@ fi
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"
sync "${KDUMP_FOLDER}/dmesg.txt"
if [ "${FULL_COREDUMP}" -ne 0 ]; then
# shellcheck disable=SC2086
/usr/bin/makedumpfile ${MAKEDUMPFILE_COREDUMP_CMD} $VMCORE "${KDUMP_FOLDER}/vmcore.compressed"
sync "${KDUMP_FOLDER}/vmcore.compressed"
fi

View File

@ -92,7 +92,7 @@ if [ "${USE_PSTORE_RAM}" -eq 1 ]; then
MEM_SIZE=$(( 16#${MEM_END} - 16#${MEM_START} ))
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.
logger "kdump-steamos: pstore-RAM was loaded successfully"
grub_update pstore

View File

@ -29,23 +29,23 @@ install() {
# 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
# 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/*
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/lib/kdump
mkdir -p "$initdir"/usr/lib/kdump
# 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
echo "${DEVN}" > "$initdir"/usr/lib/kdump/kdump.devnode
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 /usr/lib/kdump/* "$initdir"/usr/lib/kdump/
cp -LR --preserve=all /etc/default/kdump "$initdir"/usr/lib/kdump/kdump.etc
inst_hook pre-mount 01 "$moddir/kdump-collect.sh"
}

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# SPDX-License-Identifier: LGPL-2.1+
#