diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/main.sh | 14 | ||||
-rw-r--r-- | src/scripts/14chroot.sh | 37 |
2 files changed, 48 insertions, 3 deletions
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 |