From b1cee3a6e1ff379fbb2093bec867f2b73465a8d2 Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Fri, 12 Jun 2020 11:07:57 +0200 Subject: [PATCH] Optimized shellcheck hints --- scripts/base.sh | 6 +++++- scripts/image/base.sh | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/base.sh b/scripts/base.sh index aae9d51..69acf88 100644 --- a/scripts/base.sh +++ b/scripts/base.sh @@ -3,6 +3,10 @@ # This script contains the global program variables and functions # # shellcheck disable=SC2034 #Deactivate checking of unused variables +# shellcheck disable=SC2003 #Deactivate "expr is antiquated" +# shellcheck disable=SC2015 #Deactivate bool hint +# shellcheck disable=SC2005 #Remove useless echo hint +# shellcheck disable=SC2010 #Deactivate ls | grep hint REPOSITORY_PATH=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../../") # Propably this can be optimized CONFIGURATION_PATH="$REPOSITORY_PATH""/configuration/" @@ -76,7 +80,7 @@ set_device_path(){ error "$device_path is not valid device." fi # @see https://www.heise.de/ct/hotline/Optimale-Blockgroesse-fuer-dd-2056768.html - OPTIMAL_BLOCKSIZE=$(expr 64 \* "$(sudo cat /sys/block/$device/queue/physical_block_size)") && + OPTIMAL_BLOCKSIZE=$(expr 64 \* "$(sudo cat /sys/block/"$device"/queue/physical_block_size)") && info "Device path set to: $device_path" && info "Optimal blocksize set to: $OPTIMAL_BLOCKSIZE" || error diff --git a/scripts/image/base.sh b/scripts/image/base.sh index e734fac..fa28e13 100644 --- a/scripts/image/base.sh +++ b/scripts/image/base.sh @@ -6,6 +6,7 @@ # shellcheck disable=SC2010 # ls | grep allowed # shellcheck source=/dev/null # Deactivate SC1090 # shellcheck disable=SC2015 # Deactivate bools hints +# shellcheck disable=SC2154 # Deactivate referenced but not assigned hints source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) # Writes the full partition name