Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -xve
- # Download the artifact
- wget -q --timestamp https://d1b0l86ne08fsf.cloudfront.net/2.0.1/raspberrypi3/raspberrypi3_release_1_2.0.1.mender
- # Download the mender-artifact tool
- wget -q --timestamp https://d1b0l86ne08fsf.cloudfront.net/mender-artifact/3.0.1/mender-artifact
- chmod +x ./mender-artifact
- # Generate a private key for signing the artifact
- rm testkey*
- ssh-keygen -b 3072 -t rsa -f testkey -N ""
- # Assume the mender-cli tool is already present
- hash mender-cli || (echo "mender-cli needs to be present" ; exit 1)
- # Unpack the downloaded artifact and generate a new one with the troubled command
- tar xOf raspberrypi3_release_1_2.0.1.mender data/0000.tar.gz | tar xz
- # Create a dummy script
- cat > ArtifactInstall_Enter_01_retain_wpa_supplicant << EOF
- #!/bin/bash
- echo foobar
- EOF
- ./mender-artifact --compression "lzma" write rootfs-image \
- --file "core-image-full-cmdline-raspberrypi3.ext4" \
- --device-type "raspberrypi3" \
- --artifact-name "test-release-2" \
- --output-path "test.mender" \
- --script "ArtifactInstall_Enter_01_retain_wpa_supplicant" \
- --key testkey
- # Upload the artifact to hosted mender
- mender-cli login --server https://hosted.mender.io --username ${EMAIL} \
- --password $PASSWORD || exit 1
- mender-cli artifacts --server https://hosted.mender.io upload "test.mender" || exit 1
Advertisement
Add Comment
Please, Sign In to add comment