From 6ae626f17cc77679a6e4d8deecd5b241d66d074e Mon Sep 17 00:00:00 2001 From: "Guilherme G. Piccoli" Date: Wed, 23 Feb 2022 16:48:26 -0300 Subject: [PATCH] kdump-steamos: Fix remaining shellcheck complaints Signed-off-by: Guilherme G. Piccoli --- kdump-collect.sh | 3 +++ kdump-load.sh | 2 +- module-setup.sh | 12 ++++++------ submitter-load.sh | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/kdump-collect.sh b/kdump-collect.sh index dd14dea..63fc6cb 100644 --- a/kdump-collect.sh +++ b/kdump-collect.sh @@ -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 diff --git a/kdump-load.sh b/kdump-load.sh index a5e9d44..094d610 100644 --- a/kdump-load.sh +++ b/kdump-load.sh @@ -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 diff --git a/module-setup.sh b/module-setup.sh index f3f0992..f0348e1 100644 --- a/module-setup.sh +++ b/module-setup.sh @@ -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" } diff --git a/submitter-load.sh b/submitter-load.sh index 69eb184..364ee60 100644 --- a/submitter-load.sh +++ b/submitter-load.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # SPDX-License-Identifier: LGPL-2.1+ #