From f5dcda11682c6f3ad267b73673946d425bb70fd9 Mon Sep 17 00:00:00 2001 From: Miriam Zimmerman Date: Mon, 24 Apr 2023 11:18:55 -0400 Subject: scripts: Support compressed about_os_credits.html. BUG=b:187790036 BRANCH=none TEST=ensure_not_tainted_license.sh /path/to/chromiumos_test_image.bin Signed-off-by: Miriam Zimmerman Change-Id: Id3ad6535b1bc9635050d467208614f97e0aeca35 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4467627 Commit-Queue: Miriam Zimmerman Tested-by: Miriam Zimmerman Reviewed-by: Mike Frysinger --- scripts/image_signing/ensure_not_tainted_license.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/image_signing/ensure_not_tainted_license.sh b/scripts/image_signing/ensure_not_tainted_license.sh index f289cde6..28b71d15 100755 --- a/scripts/image_signing/ensure_not_tainted_license.sh +++ b/scripts/image_signing/ensure_not_tainted_license.sh @@ -33,7 +33,7 @@ main() { mount_loop_image_partition_ro "${loopdev}" 3 "${rootfs}" fi - local license_dir license tainted_tag tainted_status + local license_dir license license_gz tainted_tag tainted_status license_dir="${rootfs}/opt/google/chrome/" if [[ ! -d "${license_dir}" ]]; then echo "Directory ${license_dir} does not exist. Skipping the tainted check." @@ -41,6 +41,13 @@ main() { fi license=$(find "${license_dir}" -name about_os_credits.html 2>/dev/null) + license_gz=$(find "${license_dir}" -name about_os_credits.html.gz 2>/dev/null) + if [[ -n "${license_gz}" ]]; then + local tmpfile + tmpfile=$(make_temp_file) + gunzip --stdout "${license_gz}" > "${tmpfile}" + license="${tmpfile}" + fi if [[ -z "${license}" ]]; then echo "License file about_os_credits.html not found in ${license_dir}." echo "Skipping the check of tainted license." -- cgit v1.2.1