summaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:04:34 +0200
committerDaniel Baumann <daniel@debian.org>2007-09-23 10:04:34 +0200
commita194193638c1dfa55164fa318b5c8ab8f735d746 (patch)
tree8c7815ffe9ab83e8de08696bfec37e9a3c2a4afe /src/scripts
parentd2b526b342cf6ababb1494dce5d4f6b30f3fb718 (diff)
downloadlive-build-a194193638c1dfa55164fa318b5c8ab8f735d746.zip
live-build-a194193638c1dfa55164fa318b5c8ab8f735d746.tar.gz
Adding live-package 0.99.11-1.
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/14chroot.sh37
1 files changed, 37 insertions, 0 deletions
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