scripts: Copy special firmware archives only when requested to sign
Currently pushimage copies firmware_from_source.tar.bz2 to 5 different
locations. They're weird since they contents are identical while their
names suggest that contents are different (e.g. hps_firmware vs.
gsc_firmware).
This patch changes pushimage to copy specialized firmware archives only
when they are requested to sign. The assumption here is that firmware
archives are not useful without signing.
BUG=b:258256803
TEST=./run_tests
Change-Id: Iaee1b2aae731f4d1a5d99161d8670204a7f00232
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4546962
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Shuhei Takahashi <nya@chromium.org>
Commit-Queue: Shuhei Takahashi <nya@chromium.org>
diff --git a/scripts/pushimage.py b/scripts/pushimage.py
index d07aca6..5bd0288 100644
--- a/scripts/pushimage.py
+++ b/scripts/pushimage.py
@@ -478,6 +478,19 @@
"tar.bz2",
constants.IMAGE_TYPE_FIRMWARE,
),
+ )
+
+ # The following build artifacts are copied and marked for signing, if
+ # they are present *and* if the image type is specified via
+ # |sign_types|.
+ files_to_maybe_copy_and_sign = (
+ # (<src>, <dst>, <suffix>, <signing type>),
+ (
+ constants.BASE_IMAGE_TAR,
+ base_basename,
+ "tar.xz",
+ constants.IMAGE_TYPE_BASE,
+ ),
(
"firmware_from_source.tar.bz2",
hps_firmware_basename,
@@ -504,18 +517,6 @@
),
)
- # The following build artifacts are copied and marked for signing, if
- # they are present *and* if the image type is specified via |sign_types|.
- files_to_maybe_copy_and_sign = (
- # (<src>, <dst>, <suffix>, <signing type>),
- (
- constants.BASE_IMAGE_TAR,
- base_basename,
- "tar.xz",
- constants.IMAGE_TYPE_BASE,
- ),
- )
-
def _CopyFileToGS(src, dst=None, suffix=None):
"""Returns |dst| file name if the copying was successful."""
if dst is None: