summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@google.com>2023-02-13 14:22:36 -0500
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-14 09:00:14 +0000
commit83feacdcc05c1e2ebd56a20ccea008be49144aee (patch)
tree1bcdb0c3b544bc90d1f7d1bfc29fc67a34691cd0
parentc00f1b0d670de9a244ff798b0ae52c5cea07f8d9 (diff)
downloadvboot-83feacdcc05c1e2ebd56a20ccea008be49144aee.tar.gz
sign_official_build: Silence shellcheck sed lints
Silence all current instances of "SC2001 (style): See if you can use ${variable//search/replace} instead." Replacing complicated `sed` calls without tests in place would likely lead to mistakes, so leave them alone for now. The lint is not disabled globally though, so new uses can still be flagged. BRANCH=none BUG=None TEST=cros lint scripts/image_signing/sign_official_build.sh TEST=scripts/image_signing/sign_official_build.sh recovery \ TEST= ~/chromiumos/src/build/images/reven/latest/chromiumos_image.bin TEST= tests/devkeys TEST= ~/chromiumos/src/build/images/reven/latest/chromiumos_image.signed Change-Id: I228e78033f891ee09db40b937b4d7a7750de8c18 Signed-off-by: Nicholas Bishop <nicholasbishop@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4245621 Reviewed-by: Mike Frysinger <vapier@chromium.org>
-rwxr-xr-xscripts/image_signing/sign_official_build.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/image_signing/sign_official_build.sh b/scripts/image_signing/sign_official_build.sh
index 953d80ca..340c95ed 100755
--- a/scripts/image_signing/sign_official_build.sh
+++ b/scripts/image_signing/sign_official_build.sh
@@ -190,6 +190,7 @@ calculate_rootfs_hash() {
table="$(echo "${table}" |
sed -s "s|ROOT_DEV|${root_dev}|g;s|HASH_DEV|${hash_dev}|")"
CALCULATED_DM_ARGS="$(set_dm_device "${dm_config}" vroot "${table}")"
+ # shellcheck disable=SC2001
CALCULATED_KERNEL_CONFIG="$(echo "${kernel_config}" |
sed -e 's#\(.*dm="\)\([^"]*\)\(".*\)'"#\1${CALCULATED_DM_ARGS}\3#g")"
}
@@ -282,6 +283,7 @@ update_rootfs_hash() {
info "Skipping empty kernel partition 4 (legacy images)."
continue
fi
+ # shellcheck disable=SC2001
new_kernel_config="$(echo "${new_kernel_config}" |
sed -e 's#\(.*dm="\)\([^"]*\)\(".*\)'"#\1${dm_args}\3#g")"
info "New config for kernel partition ${kernelpart} is:"
@@ -502,6 +504,7 @@ resign_firmware_payload() {
local match
match="$(grep -E "[0-9]+ *= *${key_id}$" "${KEY_DIR}/loem.ini")"
local key_index
+ # shellcheck disable=SC2001
key_index="$(echo "${match}" | sed 's/ *= *.*$//g')"
info "Detected key index from loem.ini as ${key_index} for ${key_id}"
if [[ -z "${key_index}" ]]; then
@@ -952,6 +955,7 @@ update_recovery_kernel_hash() {
fi
new_kerna_config=$(make_temp_file)
+ # shellcheck disable=SC2001
echo "${old_kerna_config}" |
sed -e "s#\(kern_b_hash=\)[a-z0-9]*#\1${new_kernb_hash}#" \
> "${new_kerna_config}"