Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.37 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. set -xve
  4.  
  5. # Download the artifact
  6. wget -q --timestamp https://d1b0l86ne08fsf.cloudfront.net/2.0.1/raspberrypi3/raspberrypi3_release_1_2.0.1.mender
  7.  
  8. # Download the mender-artifact tool
  9. wget -q --timestamp https://d1b0l86ne08fsf.cloudfront.net/mender-artifact/3.0.1/mender-artifact
  10. chmod +x ./mender-artifact
  11.  
  12. # Generate a private key for signing the artifact
  13. rm testkey*
  14. ssh-keygen -b 3072 -t rsa -f testkey -N ""
  15.  
  16. # Assume the mender-cli tool is already present
  17. hash mender-cli || (echo "mender-cli needs to be present" ; exit 1)
  18.  
  19. # Unpack the downloaded artifact and generate a new one with the troubled command
  20.  
  21. tar xOf raspberrypi3_release_1_2.0.1.mender data/0000.tar.gz | tar xz
  22.  
  23. # Create a dummy script
  24.  
  25. cat > ArtifactInstall_Enter_01_retain_wpa_supplicant << EOF
  26. #!/bin/bash
  27.  
  28. echo foobar
  29.  
  30. EOF
  31.  
  32. ./mender-artifact --compression "lzma" write rootfs-image \
  33.     --file "core-image-full-cmdline-raspberrypi3.ext4" \
  34.     --device-type "raspberrypi3" \
  35.     --artifact-name "test-release-2" \
  36.     --output-path "test.mender" \
  37.     --script "ArtifactInstall_Enter_01_retain_wpa_supplicant" \
  38.     --key testkey
  39.  
  40. # Upload the artifact to hosted mender
  41.  
  42. mender-cli login --server https://hosted.mender.io --username ${EMAIL} \
  43.     --password $PASSWORD || exit 1
  44.  
  45. mender-cli artifacts --server https://hosted.mender.io upload "test.mender" || exit 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement