diff options
author | Daniel Baumann <daniel@debian.org> | 2007-09-23 10:05:15 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 18:22:26 +0100 |
commit | c79ab34a7c597c9e3ab202c644121c6944789424 (patch) | |
tree | 324691f4f851c719b864229b399584f035b2873f /helpers/lh_binary_encryption | |
parent | 0d5ff4ca7596790f853cf637e0fe225cad810a76 (diff) | |
download | vyos-live-build-c79ab34a7c597c9e3ab202c644121c6944789424.tar.gz vyos-live-build-c79ab34a7c597c9e3ab202c644121c6944789424.zip |
Adding live-helper 1.0~a19-1.
Diffstat (limited to 'helpers/lh_binary_encryption')
-rwxr-xr-x | helpers/lh_binary_encryption | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/helpers/lh_binary_encryption b/helpers/lh_binary_encryption index 1a9265a41..06ad2c4cf 100755 --- a/helpers/lh_binary_encryption +++ b/helpers/lh_binary_encryption @@ -80,11 +80,16 @@ esac # Checking depends Check_package chroot/usr/bin/aespipe aespipe +# Restoring cache +Restore_cache cache/packages_binary + # Installing depends Install_package -# Moving image -mv binary/${INITFS}/filesystem.${LIVE_CHROOT_FILESYSTEM} chroot +case "${LIVE_CHROOT_BUILD}" in + enabled) + # Moving image + mv binary/${INITFS}/filesystem.${LIVE_CHROOT_FILESYSTEM} chroot echo "Encrypting binary/${INITFS}/filesystem.${ROOTFS} with ${LIVE_ENCRYPTION}..." @@ -105,11 +110,33 @@ do done EOF -Chroot "sh encrypt.sh" + Chroot "sh encrypt.sh" + + # Move image + mv chroot/filesystem.${LIVE_CHROOT_FILESYSTEM} binary/${INITFS} + rm -f chroot/encrypt.sh + ;; + + disabled) + while true + do + cat binary/${INITFS}/filesystem.${ROOTFS} | aespipe -e ${LIVE_ENCRYPTION} -T > binary/${INITFS}/filesystem.${ROOTFS}.tmp && mv binary/${INITFS}/filesystem.${ROOTFS}.tmp binary/${INITFS}/filesystem.${ROOTFS} && break + + echo -n "Something went wrong... Retry? [YES/no] " + + read ANSWER + + if [ "no" = "${ANSWER}" ] + then + unset ANSWER + break + fi + done + ;; +esac -# Move image -mv chroot/filesystem.${LIVE_CHROOT_FILESYSTEM} binary/${INITFS} -rm -f chroot/encrypt.sh +# Saving cache +Save_cache cache/packages_binary # Removing depends Remove_package |