From a194193638c1dfa55164fa318b5c8ab8f735d746 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel@debian.org>
Date: Sun, 23 Sep 2007 10:04:34 +0200
Subject: Adding live-package 0.99.11-1.

---
 ChangeLog               |  4 ++++
 FIXME                   | 26 ++++++++++++++++++++++++++
 debian/changelog        |  6 ++++++
 src/main.sh             | 14 +++++++++++---
 src/scripts/14chroot.sh | 37 +++++++++++++++++++++++++++++++++++++
 5 files changed, 84 insertions(+), 3 deletions(-)
 create mode 100644 FIXME

diff --git a/ChangeLog b/ChangeLog
index 7825551..4e77760 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-10-16 Daniel Baumann <daniel@debian.org>
+
+	* Readded and slightly changed --clone and --preseed.
+
 2006-10-01 Daniel Baumann <daniel@debian.org>
 
 	* Added multiple repositories.
diff --git a/FIXME b/FIXME
new file mode 100644
index 0000000..54d350b
--- /dev/null
+++ b/FIXME
@@ -0,0 +1,26 @@
+14chroot.sh
+
+        # Add splashy and conditionally a theme
+        if [ ! -z "${LIVE_SPLASHY}" ]
+        then
+                chroots "apt-get install --yes splashy splashy-themes"
+
+                if [ ! -z "${LIVE_SPLASHY_THEME}" ]
+                then
+                        # not already installed ? Then its a new theme to install!
+                        if [ ! -d "${LIVE_CHROOT}"/etc/splashy/themes/"${LIVE_SPLASHY_THEME}" ]
+                        then
+                                if [ -f "${LIVE_SPLASHY_THEME}".tar.gz ]
+                                then
+                                        cp "${LIVE_SPLASHY_THEME}".tar.gz "${LIVE_CHROOT}"/tmp/"${LIVE_SPLASHY_THEME}".tar.gz # this permits simlink to theme
+                                        chroots "splashy_config -i /tmp/${LIVE_SPLASHY_THEME}.tar.gz"
+                                        rm "${LIVE_CHROOT}"/tmp/"${LIVE_SPLASHY_THEME}".tar.gz
+                                        chroots "splashy_config -s ${LIVE_SPLASHY_THEME}"
+                                else
+                                        echo "Specify the local splashy theme without extension, it also must be in the cwd"
+                                fi
+                        else
+                                chroots "splashy_config -s ${LIVE_SPLASHY_THEME}"
+                        fi
+                fi
+        fi
diff --git a/debian/changelog b/debian/changelog
index 18e0c40..10d17a7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+live-package (0.99.11-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 16 Oct 2006 00:00:00 +0200
+
 live-package (0.99.10-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/src/main.sh b/src/main.sh
index 7367e84..d248961 100755
--- a/src/main.sh
+++ b/src/main.sh
@@ -28,7 +28,7 @@ set -e
 BASE="/usr/share/make-live"
 CONFIG="/etc/make-live.conf"
 PROGRAM="`basename ${0}`"
-VERSION="0.99.10"
+VERSION="0.99.11"
 
 CODENAME_OLDSTABLE="woody"
 CODENAME_STABLE="sarge"
@@ -41,7 +41,7 @@ do
 	. "${SCRIPT}"
 done
 
-USAGE="Usage: ${PROGRAM} [-a|--architecture ARCHITECTURE] [-b|--bootappend KERNEL_PARAMETER|\"KERNEL_PARAMETERS\"] [--config FILE] [-c|--chroot DIRECTORY] [-d|--distribution DISTRIBUTION] [--disable-generic-indices] [--enable-generic-indices] [--filesystem FILESYSTEM] [-f|--flavour BOOTSTRAP_FLAVOUR] [--hook COMMAND|\"COMMANDS\"] [--include-chroot FILE|DIRECTORY] [--include-image FILE|DIRECTORY] [-k|--kernel KERNEL_FLAVOUR] [--manifest PACKAGE] [-m|--mirror URL] [--mirror-security URL] [--packages PACKAGE|\"PACKAGES\"] [-p|--package-list LIST|FILE] [--proxy-ftp URL] [--proxy-http URL] [--repositories NAME] [-r|--root DIRECTORY] [-s|--section SECTION|\"SECTIONS\"] [--server-address HOSTNAME|IP] [--server-path DIRECTORY] [--templates DIRECTORY] [-t|--type TYPE]"
+USAGE="Usage: ${PROGRAM} [-a|--architecture ARCHITECTURE] [-b|--bootappend KERNEL_PARAMETER|\"KERNEL_PARAMETERS\"] [--clone DIRECTORY] [--config FILE] [-c|--chroot DIRECTORY] [-d|--distribution DISTRIBUTION] [--disable-generic-indices] [--enable-generic-indices] [--filesystem FILESYSTEM] [-f|--flavour BOOTSTRAP_FLAVOUR] [--hook COMMAND|\"COMMANDS\"] [--include-chroot FILE|DIRECTORY] [--include-image FILE|DIRECTORY] [-k|--kernel KERNEL_FLAVOUR] [--manifest PACKAGE] [-m|--mirror URL] [--mirror-security URL] [--packages PACKAGE|\"PACKAGES\"] [-p|--package-list LIST|FILE] [--preseed FILE] [--proxy-ftp URL] [--proxy-http URL] [--repositories NAME] [-r|--root DIRECTORY] [-s|--section SECTION|\"SECTIONS\"] [--server-address HOSTNAME|IP] [--server-path DIRECTORY] [--templates DIRECTORY] [-t|--type TYPE]"
 
 Help ()
 {
@@ -159,7 +159,7 @@ Configuration ()
 
 Main ()
 {
-	ARGUMENTS="`getopt --longoptions root:,type:,architecture:,bootappend:,config:,chroot:,distribution:,filesystem:,flavour:,hook:,include-chroot:,include-image:,kernel:,manifest:,mirror:,mirror-security:,output:,packages:,package-list:,proxy-ftp:,proxy-http:,repositories:,section:,server-address:,server-path:,templates:,with-generic-indices,without-generic-indices,with-source,without-source,help,usage,version --name=${PROGRAM} --options r:t:a:b:c:d:f:k:m:o:p:s:huv --shell sh -- "${@}"`"
+	ARGUMENTS="`getopt --longoptions root:,type:,architecture:,bootappend:,clone:,config:,chroot:,distribution:,filesystem:,flavour:,hook:,include-chroot:,include-image:,kernel:,manifest:,mirror:,mirror-security:,output:,packages:,package-list:,proxy-ftp:,preseed:,proxy-http:,repositories:,section:,server-address:,server-path:,templates:,with-generic-indices,without-generic-indices,with-source,without-source,help,usage,version --name=${PROGRAM} --options r:t:a:b:c:d:f:k:m:o:p:s:huv --shell sh -- "${@}"`"
 
 	if [ "${?}" != "0" ]
 	then
@@ -188,6 +188,10 @@ Main ()
 				LIVE_BOOTAPPEND="${2}"; shift 2
 				;;
 
+			--clone)
+				LIVE_CLONE="${2}"; shift 2
+				;;
+
 			--config)
 				LIVE_CONFIG="${2}"; shift 2
 				;;
@@ -247,6 +251,10 @@ Main ()
 				LIVE_PACKAGE_LIST="${2}"; shift 2
 				;;
 
+			--preseed)
+				LIVE_PRESEED="${2}"; shift 2
+				;;
+
 			--proxy-ftp)
 				LIVE_PROXY_FTP="${2}"; shift 2
 				;;
diff --git a/src/scripts/14chroot.sh b/src/scripts/14chroot.sh
index bf38040..b650712 100644
--- a/src/scripts/14chroot.sh
+++ b/src/scripts/14chroot.sh
@@ -70,6 +70,43 @@ Chroot ()
 		# Deconfigure linux-image
 		Patch_linux deapply
 
+		# Cloning existing system configuration
+		if [ -d "${LIVE_CLONE}" ]
+		then
+			# Swapping chroot directories
+			LIVE_CHROOT_TMP="${LIVE_CHROOT}"
+			LIVE_CHROOT="${LIVE_CLONE}"
+
+			# Extract debconf settings
+			Chroot_exec "apt-get install --yes debconf-utils"
+			Chroot_exec "debconf-get-selections" > "${LIVE_ROOT}"/preseed.cloned
+
+			# Extract package selection
+			Chroot_exec "dpkg --get-selections" | grep -v deinstall | cut -f1 > "${LIVE_ROOT}"/package-list.cloned
+
+			# Restoring chroot directories
+			LIVE_CHROOT="${LIVE_CHROOT_TMP}"
+			LIVE_CHROOT_TMP=""
+
+			LIVE_PRESEED="${LIVE_ROOT}/preseed.cloned"
+			LIVE_PACKAGE_LIST_CLONED="${LIVE_ROOT}/package-list.cloned"
+		fi
+
+		# Restore preseed configuration
+		if [ -f "${LIVE_PRESEED}" ]
+		then
+			Chroot_exec "apt-get install --yes debconf-utils"
+			cp "${LIVE_PRESEED}" "${LIVE_CHROOT}"/root/preseed
+			Chroot_exec "debconf-set-selections /root/preseed"
+			rm -f "${LIVE_CHROOT}"/root/preseed
+		fi
+
+		# Restore cloned package selection
+		if [ -f "${LIVE_PACAKGE_LIST_CLONED}" ]
+		then
+			Chroot_exec "xargs --arg-file=/root/`basename ${LIVE_PACKAGE_LIST_CLONED}` apt-get install --yes --force-yes"
+		fi
+
 		# Install packages list
 		if [ -n "${LIVE_PACKAGE_LIST}" ]
 		then
-- 
cgit v1.0