Message ID | 20240214154820.3544080-2-Sai.Sathujoda@toshiba-tsip.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Upload .swu file and firmware for LAVA testing | expand |
On 14.02.24 16:48, Sai.Sathujoda@toshiba-tsip.com wrote: > From: Sai Sathujoda <Sai.Sathujoda@toshiba-tsip.com> > > Currently software update testing is enabled for QEMU security targets, > so if "USE_SWU" switch is enabled then only the .swu file is uploaded > ignoring the v2 .wic image. Since the project directory in CI will be > cleaned after every job, so the compressed wic file is moved to s3 bucket > instead of copying to avoid "file exists" error in case of two consecutive > builds in a single job. > > U-boot binaries are also uploaded for usage > when required in LAVA job definitionss. > > Signed-off-by: Sai Sathujoda <Sai.Sathujoda@toshiba-tsip.com> > --- > scripts/deploy-cip-core.sh | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/scripts/deploy-cip-core.sh b/scripts/deploy-cip-core.sh > index 7f6cbe9..aece4d1 100755 > --- a/scripts/deploy-cip-core.sh > +++ b/scripts/deploy-cip-core.sh > @@ -15,6 +15,7 @@ TARGET=$2 > EXTENSION=$3 > DTB=$4 > REF=$5 > +USE_SWU=$6 Naming: DEPLOY={swu|wic} would be a nicer interface IMHO. > > BASE_FILENAME=cip-core-image-cip-core-$RELEASE-$TARGET > if [ "${EXTENSION}" != "none" ]; then > @@ -33,7 +34,17 @@ if [ -f "${BASE_PATH}.wic" ]; then > xz -9 -k -T0 "${BASE_PATH}.wic" > > echo "Uploading artifacts..." > - aws s3 cp --no-progress --acl public-read "${BASE_PATH}.wic.xz" "${S3_TARGET}" > + # Condition check to avoid deploying v2 security image and prefer only it's .swu artifact The deployment script should not worry about who is using it. Its interface are the command line options. So, let's drop this comment. > + if [ "$USE_SWU" = "enable" ]; then > + aws s3 cp --no-progress --acl public-read "${BASE_PATH}.swu" "${S3_TARGET}" > + else > + # Move the first wic.xz file to aws s3 bucket to avoid error while compressing v2 image > + aws s3 mv --no-progress --acl public-read "${BASE_PATH}.wic.xz" "${S3_TARGET}" > + fi > + > + if [ -f "build/tmp/deploy/images/$TARGET/firmware.bin" ]; then > + aws s3 cp --no-progress --acl public-read "build/tmp/deploy/images/$TARGET/firmware.bin" "${S3_TARGET}" > + fi > else > if [ -f "${BASE_PATH}.tar.gz" ]; then > echo "Uploading artifacts..." Jan
diff --git a/scripts/deploy-cip-core.sh b/scripts/deploy-cip-core.sh index 7f6cbe9..aece4d1 100755 --- a/scripts/deploy-cip-core.sh +++ b/scripts/deploy-cip-core.sh @@ -15,6 +15,7 @@ TARGET=$2 EXTENSION=$3 DTB=$4 REF=$5 +USE_SWU=$6 BASE_FILENAME=cip-core-image-cip-core-$RELEASE-$TARGET if [ "${EXTENSION}" != "none" ]; then @@ -33,7 +34,17 @@ if [ -f "${BASE_PATH}.wic" ]; then xz -9 -k -T0 "${BASE_PATH}.wic" echo "Uploading artifacts..." - aws s3 cp --no-progress --acl public-read "${BASE_PATH}.wic.xz" "${S3_TARGET}" + # Condition check to avoid deploying v2 security image and prefer only it's .swu artifact + if [ "$USE_SWU" = "enable" ]; then + aws s3 cp --no-progress --acl public-read "${BASE_PATH}.swu" "${S3_TARGET}" + else + # Move the first wic.xz file to aws s3 bucket to avoid error while compressing v2 image + aws s3 mv --no-progress --acl public-read "${BASE_PATH}.wic.xz" "${S3_TARGET}" + fi + + if [ -f "build/tmp/deploy/images/$TARGET/firmware.bin" ]; then + aws s3 cp --no-progress --acl public-read "build/tmp/deploy/images/$TARGET/firmware.bin" "${S3_TARGET}" + fi else if [ -f "${BASE_PATH}.tar.gz" ]; then echo "Uploading artifacts..."