Advertisement
Guest User

Untitled

a guest
Jan 11th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. SUMMARY = "Encrypted update.sh script for SWU generation"
  2. LICENSE = "CLOSED"
  3.  
  4. FILESEXTRAPATHS_prepend := "${THISDIR}/fod-testing-image-swu:${THISDIR}/encryption:"
  5.  
  6. SRC_URI = " file://update.sh"
  7.  
  8. DEPENDS += " openssl-native"
  9.  
  10. S = "${WORKDIR}"
  11.  
  12. do_copy_script () {
  13. cp ${THISDIR}/fod-testing-image-swu/update.sh ${DEPLOY_DIR_IMAGE}/update.sh
  14. }
  15.  
  16. do_encrypt_script () {
  17. aes_key=$(cut -d " " -f1 "${THISDIR}/encryption/aes-key.txt")
  18. aes_iv=$(cut -d " " -f2 "${THISDIR}/encryption/aes-key.txt")
  19.  
  20. openssl enc -aes-256-cbc -in ${DEPLOY_DIR_IMAGE}/update.sh -out ${DEPLOY_DIR_IMAGE}/update.sh.enc -K "$aes_key" -iv "$aes_iv"
  21. }
  22.  
  23. addtask copy_script before do_build
  24. addtask encrypt_script after copy_script before do_build
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement