diff options
author | Daniel Baumann <daniel@debian.org> | 2007-09-23 10:04:34 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2007-09-23 10:04:34 +0200 |
commit | a194193638c1dfa55164fa318b5c8ab8f735d746 (patch) | |
tree | 8c7815ffe9ab83e8de08696bfec37e9a3c2a4afe /src/scripts/14chroot.sh | |
parent | d2b526b342cf6ababb1494dce5d4f6b30f3fb718 (diff) | |
download | vyos-live-build-a194193638c1dfa55164fa318b5c8ab8f735d746.tar.gz vyos-live-build-a194193638c1dfa55164fa318b5c8ab8f735d746.zip |
Adding live-package 0.99.11-1.
Diffstat (limited to 'src/scripts/14chroot.sh')
-rw-r--r-- | src/scripts/14chroot.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/scripts/14chroot.sh b/src/scripts/14chroot.sh index bf3804095..b65071213 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 |