gbmc-no-initrd: Fix shellcheck SC2157 error The check [ -n '@ALWAYS_CLEAR@' ] becomes [ -n '1' ] when substituted, which shellcheck flags as always true. Change it to a value comparison [ '@ALWAYS_CLEAR@' = '1' ] which satisfies shellcheck and maintains the same logic. no fusion2 link for preEVT Tested: ``` MACHINE=platform28 GBMC_CONFIG=dev bitbake gbmc-no-initrd // pass ``` Google-Bug-Id: n/a Change-Id: I556deaadcf55bc983290746dd4bc1bf543e0a279 Signed-off-by: Tom Tung <tomtung@google.com>
diff --git a/recipes-google/boot/gbmc-no-initrd/clean-rwfs.sh.in b/recipes-google/boot/gbmc-no-initrd/clean-rwfs.sh.in index 4fc36f3..04084e5 100644 --- a/recipes-google/boot/gbmc-no-initrd/clean-rwfs.sh.in +++ b/recipes-google/boot/gbmc-no-initrd/clean-rwfs.sh.in
@@ -39,7 +39,7 @@ mount_rwfs || ret=$? mkdir -p "$(dirname "$done_job_id")" cp -v "$job_id_tmp" "$done_job_id" -elif [ -n '@ALWAYS_CLEAR@' ] || ! cmp "$rwfs"/os-release /etc/os-release 2>/dev/null; then +elif [ '@ALWAYS_CLEAR@' = '1' ] || ! cmp "$rwfs"/os-release /etc/os-release 2>/dev/null; then declare -A allowed=() while read -r line; do allowed["$line/*"]=1