From 9a280c0dc1591777bc5014ef6450a8cef7eb033a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 23 Sep 2007 10:05:15 +0200 Subject: Adding live-helper 1.0~a19-1. --- helpers/lh_binary_encryption | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) (limited to 'helpers/lh_binary_encryption') 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 -- cgit v1.2.3