[Debian-live-changes] r2532 - in dists/trunk/live-helper: docs functions helpers

daniel at alioth.debian.org daniel at alioth.debian.org
Thu Jul 19 21:36:18 UTC 2007


Author: daniel
Date: 2007-07-19 21:36:18 +0000 (Thu, 19 Jul 2007)
New Revision: 2532

Modified:
   dists/trunk/live-helper/docs/ChangeLog
   dists/trunk/live-helper/functions/defaults.sh
   dists/trunk/live-helper/functions/package.sh
   dists/trunk/live-helper/helpers/lh_binary_chroot
   dists/trunk/live-helper/helpers/lh_binary_encryption
   dists/trunk/live-helper/helpers/lh_binary_rootfs
   dists/trunk/live-helper/helpers/lh_config
Log:


Modified: dists/trunk/live-helper/docs/ChangeLog
===================================================================
--- dists/trunk/live-helper/docs/ChangeLog	2007-07-19 20:59:41 UTC (rev 2531)
+++ dists/trunk/live-helper/docs/ChangeLog	2007-07-19 21:36:18 UTC (rev 2532)
@@ -6,6 +6,9 @@
 	* helpers/lh_binary_syslinux:
 	  - Using etch workaround for long filenames in syslinux on all
 	    distributions.
+	* functions/defaults.sh, package.sh, helpers/lh_config,
+	  lh_binary_rootfs, lh_binary_encryption, lh_binary_chroot:
+	  - Partially implemented support for non-chrooted build.
 
 2007-07-15  Daniel Baumann  <daniel at debian.org>
 

Modified: dists/trunk/live-helper/functions/defaults.sh
===================================================================
--- dists/trunk/live-helper/functions/defaults.sh	2007-07-19 20:59:41 UTC (rev 2531)
+++ dists/trunk/live-helper/functions/defaults.sh	2007-07-19 21:36:18 UTC (rev 2532)
@@ -126,6 +126,9 @@
 	LH_CACHE_PACKAGES="${LH_CACHE_PACKAGES:-enabled}"
 	LH_CACHE_STAGES="${LH_CACHE_STAGES:-bootstrap}"
 
+	# Setting chroot option
+	LH_CHROOT_BUILD="${LH_CHROOT_BUILD:-enabled}"
+
 	# Setting debconf frontend
 	LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND:-noninteractive}"
 	LH_DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS:-yes}"

Modified: dists/trunk/live-helper/functions/package.sh
===================================================================
--- dists/trunk/live-helper/functions/package.sh	2007-07-19 20:59:41 UTC (rev 2531)
+++ dists/trunk/live-helper/functions/package.sh	2007-07-19 21:36:18 UTC (rev 2532)
@@ -14,10 +14,22 @@
 	FILE="${1}"
 	PACKAGE="${2}"
 
-	if [ ! -f "${FILE}" ]
-	then
-		PACKAGES="${PACKAGES} ${PACKAGE}"
-	fi
+	case "${LH_CHROOT_BUILD}"
+		enabled)
+			if [ ! -f "${FILE}" ]
+			then
+				PACKAGES="${PACKAGES} ${PACKAGE}"
+			fi
+			;;
+
+		disabled)
+			if [ ! -f "`echo ${FILE} | sed -e 's/chroot//'`" ]
+			then
+				Echo_error "You need to install ${PACKAGE} on your host system."
+				exit 1
+			fi
+			;;
+	esac
 }
 
 Install_package ()

Modified: dists/trunk/live-helper/helpers/lh_binary_chroot
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_chroot	2007-07-19 20:59:41 UTC (rev 2531)
+++ dists/trunk/live-helper/helpers/lh_binary_chroot	2007-07-19 21:36:18 UTC (rev 2532)
@@ -58,6 +58,11 @@
 	${LH_ROOT_COMMAND} umount chroot/sys
 fi
 
+if [ "${LH_CHROOT_BUILD}" = "disabled" ]
+then
+	exit 0
+fi
+
 # Removing old chroot
 ${LH_ROOT_COMMAND} rm -rf chroot/chroot
 ${LH_ROOT_COMMAND} rm -rf chroot.tmp

Modified: dists/trunk/live-helper/helpers/lh_binary_encryption
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_encryption	2007-07-19 20:59:41 UTC (rev 2531)
+++ dists/trunk/live-helper/helpers/lh_binary_encryption	2007-07-19 21:36:18 UTC (rev 2532)
@@ -83,8 +83,10 @@
 # Installing depends
 Install_package
 
-# Moving image
-mv binary/${INITFS}/filesystem.${LIVE_CHROOT_FILESYSTEM} chroot
+case "${LH_CHROOT_BUILD}" in
+	enabled)
+		# Moving image
+		mv binary/${INITFS}/filesystem.${LIVE_CHROOT_FILESYSTEM} chroot
 
 echo "Encrypting binary/${INITFS}/filesystem.${ROOTFS} with ${LIVE_ENCRYPTION}..."
 
@@ -105,12 +107,31 @@
 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
+		# 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
+
 # Removing depends
 Remove_package
 

Modified: dists/trunk/live-helper/helpers/lh_binary_rootfs
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_rootfs	2007-07-19 20:59:41 UTC (rev 2531)
+++ dists/trunk/live-helper/helpers/lh_binary_rootfs	2007-07-19 21:36:18 UTC (rev 2532)
@@ -109,12 +109,20 @@
 		DU_DIM="`du -ks chroot/chroot | cut -f1`"
 		REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here...
 
-		Chroot "genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root=chroot filesystem.ext2"
+		case "${LH_CHROOT_BUILD}" in
+			enabled)
+				Chroot "genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root=chroot filesystem.ext2"
 
-		# Move image
-		mv chroot/filesystem.ext2 binary/${INITFS}
-		rm -rf chroot/chroot
+				# Move image
+				mv chroot/filesystem.ext2 binary/${INITFS}
+				rm -rf chroot/chroot
+				;;
 
+			disabled)
+				genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root=chroot binary/${INITFS}/filesystem.ext2
+				;;
+		esac
+
 		# Removing depends
 		Remove_package
 		;;
@@ -125,7 +133,15 @@
 			rm -rf binary/${INITFS}/filesystem.dir
 		fi
 
-		mv chroot/chroot binary/${INITFS}/filesystem.dir
+		case "${LH_CHROOT_BUILD}" in
+			enabled)
+				mv chroot/chroot binary/${INITFS}/filesystem.dir
+				;;
+
+			disabled)
+				cp -a chroot binary/${INITFS}/filesystem.dir
+				;;
+		esac
 		;;
 
 	squashfs)
@@ -159,16 +175,24 @@
 		if [ -f config/binary_rootfs/squashfs.sort ]
 		then
 			MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -sort squashfs.sort"
-			cp config/binary_rootfs/squashfs.sort chroot
+			cp config/binary_rootfs/squashfs.sort chroot #FIXME
 		fi
 
-		# Create image
-		Chroot "mksquashfs chroot filesystem.squashfs ${MKSQUASHFS_OPTIONS}"
+		case "${LH_CHROOT_BUILD}" in
+			enabled)
+				# Create image
+				Chroot "mksquashfs chroot filesystem.squashfs ${MKSQUASHFS_OPTIONS}"
 
-		# Move image
-		${LH_ROOT_COMMAND} mv chroot/filesystem.squashfs binary/${INITFS}
-		${LH_ROOT_COMMAND} rm -rf chroot/chroot chroot/squashfs.sort
+				# Move image
+				${LH_ROOT_COMMAND} mv chroot/filesystem.squashfs binary/${INITFS}
+				${LH_ROOT_COMMAND} rm -rf chroot/chroot chroot/squashfs.sort
+				;;
 
+			disabled)
+				mksquashfs chroot binary/${INITFS}/filesystem.squashfs ${MKSQUASHFS_OPTIONS}
+				;;
+		esac
+
 		if [ -n "${LH_ROOT_COMMAND}" ]
 		then
 			${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` binary/${INITFS}

Modified: dists/trunk/live-helper/helpers/lh_config
===================================================================
--- dists/trunk/live-helper/helpers/lh_config	2007-07-19 20:59:41 UTC (rev 2531)
+++ dists/trunk/live-helper/helpers/lh_config	2007-07-19 21:36:18 UTC (rev 2532)
@@ -106,6 +106,11 @@
 # (Default: ${LH_CACHE_STAGES})
 LH_CACHE_STAGES="${LH_CACHE_STAGES}"
 
+# \${LH_CHROOT_BUILD: control if we build binary images chrooted
+# (Default: ${LH_CHROOT_BUILD})
+# DO NEVER, *NEVER*, *N*E*V*E*R* SET THIS OPTION to disabled.
+LH_CHROOT_BUILD="${LH_CHROOT_BUILD}"
+
 # \$LH_DEBCONF_FRONTEND: set debconf(1) frontend to use
 # (Default: ${LH_DEBCONF_FRONTEND})
 LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND}"




More information about the Debian-live-changes mailing list