From 4cfc7bc648e3bc7b1d6710fcea44f35eb642c30a Mon Sep 17 00:00:00 2001 From: Kristian Amlie Date: Mon, 16 Dec 2019 11:20:48 +0100 Subject: [PATCH 1/3] MEN-2927: Make sure `.mender` file is uploaded for use in tutorial. Changelog: None Signed-off-by: Kristian Amlie --- .gitlab-ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 210ced1..6542da6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -109,7 +109,10 @@ publish:s3: stage: publish image: debian:buster before_script: - - apt update && apt install -yyq awscli + - apt update && apt install -yyq awscli curl + + - curl -Lo /usr/bin/mender-artifact https://d1b0l86ne08fsf.cloudfront.net/mender-artifact/${MENDER_ARTIFACT_VERSION}/linux/mender-artifact + - chmod ugo+x /usr/bin/mender-artifact # Fetch artifacts from temporary S3 bucket - aws s3 cp s3://mender-gitlab-tmp-storage/$CI_PROJECT_NAME/$CI_PIPELINE_ID/deploy.tar.gz deploy.tar.gz @@ -124,3 +127,9 @@ publish:s3: s3://$S3_BUCKET_NAME/${RASPBIAN_NAME}/arm/${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.img.xz - aws s3api put-object-acl --acl public-read --bucket $S3_BUCKET_NAME --key ${RASPBIAN_NAME}/arm/${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.img.xz + + - mender-artifact modify -n release-1 deploy/raspberrypi-${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.mender + - aws s3 cp deploy/raspberrypi-${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.mender + s3://$S3_BUCKET_NAME/${RASPBIAN_NAME}/arm/${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}_release-1.mender + - aws s3api put-object-acl --acl public-read --bucket $S3_BUCKET_NAME + --key ${RASPBIAN_NAME}/arm/${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}_release-1.mender From ec3d5bc37feafa7f1d988e70185ce54c480ff37f Mon Sep 17 00:00:00 2001 From: Kristian Amlie Date: Mon, 16 Dec 2019 12:48:51 +0100 Subject: [PATCH 2/3] Move version dependent Dockerfile step last to avoid repeating steps. Changelog: None Signed-off-by: Kristian Amlie --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3002abb..5aff7bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,13 +47,13 @@ RUN apt-get update && apt-get install -y \ COPY --from=build /root/pxz/pxz /usr/bin/pxz -RUN wget -q -O /usr/bin/mender-artifact https://d1b0l86ne08fsf.cloudfront.net/mender-artifact/$MENDER_ARTIFACT_VERSION/linux/mender-artifact \ - && chmod +x /usr/bin/mender-artifact - # allow us to keep original PATH variables when sudoing RUN echo "Defaults secure_path=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:$PATH\"" > /etc/sudoers.d/secure_path_override RUN chmod 0440 /etc/sudoers.d/secure_path_override +RUN wget -q -O /usr/bin/mender-artifact https://d1b0l86ne08fsf.cloudfront.net/mender-artifact/$MENDER_ARTIFACT_VERSION/linux/mender-artifact \ + && chmod +x /usr/bin/mender-artifact + WORKDIR / COPY docker-entrypoint.sh /usr/local/bin/ From 50bc5dbf6f9394f558def4befd1bb0f470f3096c Mon Sep 17 00:00:00 2001 From: Kristian Amlie Date: Mon, 16 Dec 2019 12:49:26 +0100 Subject: [PATCH 3/3] Turn off default ext4 filesystem feature `metadata_csum`. This feature is not supported by tools on Ubuntu 16.04. Changelog: Commit Signed-off-by: Kristian Amlie --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index 5aff7bb..5377ba9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,6 +51,12 @@ COPY --from=build /root/pxz/pxz /usr/bin/pxz RUN echo "Defaults secure_path=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:$PATH\"" > /etc/sudoers.d/secure_path_override RUN chmod 0440 /etc/sudoers.d/secure_path_override +# Turn off default filesystem feature which is supported in newer mke2fs tools, +# but not in Ubuntu 16.04. The result is that mender-artifact can not be used to +# modify the artifact. Once 16.04 goes out of support, this can probably be +# removed. +RUN sed -i -e 's/,metadata_csum//' /etc/mke2fs.conf + RUN wget -q -O /usr/bin/mender-artifact https://d1b0l86ne08fsf.cloudfront.net/mender-artifact/$MENDER_ARTIFACT_VERSION/linux/mender-artifact \ && chmod +x /usr/bin/mender-artifact