summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:04:40 +0200
committerDaniel Baumann <daniel@debian.org>2007-09-23 10:04:40 +0200
commit6f5e2da03e5fd1af2200d2f55ca84647bc8d3626 (patch)
treee2a861c1995eea707b2ac1c72930351191714493 /src
parent9a9491318d4a0469e4c97b28879ab34391c39095 (diff)
downloadlive-build-6f5e2da03e5fd1af2200d2f55ca84647bc8d3626.zip
live-build-6f5e2da03e5fd1af2200d2f55ca84647bc8d3626.tar.gz
Adding live-package 0.99.22-1.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/main.sh60
-rw-r--r--src/scripts/01init.sh20
-rw-r--r--src/scripts/02defaults.sh61
-rw-r--r--src/scripts/11bootstrap.sh48
-rw-r--r--src/scripts/12patch.sh165
-rw-r--r--src/scripts/13chroot.sh230
-rw-r--r--src/scripts/21image.sh372
-rw-r--r--src/scripts/22iso.sh155
-rw-r--r--src/scripts/23net.sh180
-rw-r--r--src/scripts/24.usb.sh218
10 files changed, 140 insertions, 1369 deletions
diff --git a/src/main.sh b/src/main.sh
index 50b84e6..b858a3e 100755
--- a/src/main.sh
+++ b/src/main.sh
@@ -28,7 +28,9 @@ set -e
BASE=${LIVE_BASE:-"/usr/share/make-live"}
CONFIG="/etc/make-live.conf"
PROGRAM="`basename ${0}`"
-VERSION="0.99.21"
+VERSION="0.99.22"
+
+export VERSION
CODENAME_OLDSTABLE="woody"
CODENAME_STABLE="sarge"
@@ -41,7 +43,7 @@ do
. "${SCRIPT}"
done
-USAGE="Usage: ${PROGRAM} [-a|--architecture ARCHITECTURE] [-b|--bootappend KERNEL_PARAMETER|\"KERNEL_PARAMETERS\"] [--clone DIRECTORY] [--config FILE] [-c|--chroot DIRECTORY] [-d|--distribution DISTRIBUTION] [--with-generic-indices] [--without-generic-indices] [--with-recommends] [--without-recommends] [--with-daemons] [--without-daemons] [--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] [-k|--keyring] [--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] [--tasks TASK]"
+USAGE="Usage: ${PROGRAM} [-a|--architecture ARCHITECTURE] [-b|--bootappend KERNEL_PARAMETER|\"KERNEL_PARAMETERS\"] [--clone DIRECTORY] [--config FILE] [-c|--chroot DIRECTORY] [-d|--distribution DISTRIBUTION] [-e|--encryption ALGORITHM] [--with-generic-indices] [--without-generic-indices] [--with-recommends] [--without-recommends] [--with-daemons] [--without-daemons] [--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] [-k|--keyring] [--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] [--tasks TASK]"
Help ()
{
@@ -69,6 +71,7 @@ Help ()
echo " -c, --chroot: specifies the chroot directory."
echo " --clone: specifies a chroot directory to clone."
echo " -d, --distribution: specifies the debian distribution."
+ echo " -e, --encryption: specifies the filesystem encryption algorithm."
echo " --filesystem: specifies the chroot filesystem."
echo " -f, --flavour: specifies the bootstrap flavour."
echo " --bootstrap-config: specifies the suite configuration to be used for bootstraping."
@@ -168,7 +171,7 @@ Configuration ()
Main ()
{
- ARGUMENTS="`getopt --longoptions root:,tasks:,type:,architecture:,bootappend:,clone:,config:,chroot:,distribution:,filesystem:,flavour:,bootstrap-config:,hook:,include-chroot:,include-image:,kernel:,manifest:,mirror:,keyring:,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-recommends,without-recommends,with-daemons,without-daemons,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:,tasks:,type:,architecture:,bootappend:,clone:,config:,chroot:,distribution:,encryption:,filesystem:,flavour:,bootstrap-config:,hook:,include-chroot:,include-image:,kernel:,manifest:,mirror:,keyring:,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-recommends,without-recommends,with-daemons,without-daemons,with-source,without-source,help,usage,version --name=${PROGRAM} --options r:t:a:b:c:d:e:f:k:m:o:p:s:huv --shell sh -- "${@}"`"
if [ "${?}" != "0" ]
then
@@ -183,156 +186,200 @@ Main ()
case "${1}" in
-r|--root)
LIVE_ROOT="${2}"; shift 2
+ export LIVE_ROOT
;;
-t|--type)
LIVE_TYPE="${2}"; shift 2
+ export LIVE_TYPE
;;
--tasks)
LIVE_TASKS="${2}"; shift 2
+ export LIVE_TASKS
;;
-a|--architecture)
LIVE_ARCHITECTURE="${2}"; shift 2
+ export LIVE_ARCHITECTURE
;;
-b|--bootappend)
LIVE_BOOTAPPEND="${2}"; shift 2
+ export LIVE_BOOTAPPEND
;;
--clone)
LIVE_CLONE="${2}"; shift 2
+ export LIVE_CLONE
;;
--config)
LIVE_CONFIG="${2}"; shift 2
+ export LIVE_CONFIG
;;
-c|--chroot)
LIVE_CHROOT="${2}"; shift 2
+ export LIVE_CHROOT
;;
-d|--distribution)
LIVE_DISTRIBUTION="${2}"; shift 2
+ export LIVE_DISTRIBUTION
+ ;;
+
+ -e|--encryption)
+ LIVE_ENCRYPTION="${2}"; shift 2
+ export LIVE_ENCRYPTION
;;
--filesystem)
LIVE_FILESYSTEM="${2}"; shift 2
+ export LIVE_FILESYSTEM
;;
-f|--flavour)
LIVE_FLAVOUR="${2}"; shift 2
+ export LIVE_FLAVOUR
;;
--bootstrap-config)
LIVE_BOOTSTRAP_CONFIG="${2}"; shift 2
+ export LIVE_BOOTSTRAP_CONFIG
;;
--hook)
LIVE_HOOK="${2}"; shift 2
+ export LIVE_HOOK
;;
--include-chroot)
LIVE_INCLUDE_CHROOT="${2}"; shift 2
+ export LIVE_INCLUDE_CHROOT
;;
--include-image)
LIVE_INCLUDE_IMAGE="${2}"; shift 2
+ export LIVE_INCLUDE_IMAGE
;;
-k|--kernel)
LIVE_KERNEL="${2}"; shift 2
+ export LIVE_KERNEL
;;
--manifest)
LIVE_MANIFEST="${2}"; shift 2
+ export LIVE_MANIFEST
;;
-m|--mirror)
LIVE_MIRROR="${2}"; shift 2
+ export LIVE_MIRROR
;;
--keyring)
LIVE_REPOSITORY_KEYRING="${2}"; shift 2
+ export LIVE_REPOSITORY_KEYRING
;;
--mirror-security)
LIVE_MIRROR_SECURITY="${2}"; shift 2
+ export LIVE_MIRROR_SECURITY
;;
-o|--output)
LIVE_IMAGE="${2}"; shift 2
+ export LIVE_IMAGE
;;
--packages)
LIVE_PACKAGES="${2}"; shift 2
+ export LIVE_PACKAGES
;;
-p|--package-list)
LIVE_PACKAGE_LIST="${2}"; shift 2
+ export LIVE_PACKAGE_LIST
;;
--preseed)
LIVE_PRESEED="${2}"; shift 2
+ export LIVE_PRESEED
;;
--proxy-ftp)
LIVE_PROXY_FTP="${2}"; shift 2
+ export LIVE_PROXY_FTP
;;
--proxy-http)
LIVE_PROXY_HTTP="${2}"; shift 2
+ export LIVE_PROXY_HTTP
;;
--repositories)
LIVE_REPOSITORIES="${2}"; shift 2
+ export LIVE_REPOSITORIES
;;
-s|--section)
LIVE_SECTION="${2}"; shift 2
+ export LIVE_SECTION
;;
--server-address)
LIVE_SERVER_ADDRESS="${2}"; shift 2
+ export LIVE_SERVER_ADDRESS
;;
--server-path)
LIVE_SERVER_PATH="${2}"; shift 2
+ export LIVE_SERVER_PATH
;;
--templates)
LIVE_TEMPLATES="${2}"; shift 2
+ export LIVE_TEMPLATES
;;
--with-generic-indices)
LIVE_GENERIC_INDICES="yes"; shift
+ export LIVE_GENERIC_INDICES
;;
--without-generic-indices)
LIVE_GENERIC_INDICES="no"; shift
+ export LIVE_GENERIC_INDIDCES
;;
--with-recommends)
LIVE_RECOMMENDS="yes"; shift
+ export LIVE_RECOMMENDS
;;
--without-recommends)
LIVE_RECOMMENDS="no"; shift
+ export LIVE_RECOMMENDS
;;
--with-daemons)
LIVE_DAEMONS="yes"; shift
+ export LIVE_DAEMONS
;;
--without-daemons)
LIVE_DAEMONS="no"; shift
+ export LIVE_DEAMONS
;;
--with-source)
LIVE_SOURCE="yes"; shift
+ export LIVE_SOURCE
;;
--without-source)
LIVE_SOURCE="no"; shift
+ export LIVE_SOURCE
;;
-h|--help)
@@ -359,16 +406,17 @@ Main ()
done
# Initialising
- Init
+ lh_testroot
Configuration
Defaults
# Building live system
- Bootstrap
+ lh_cdebootstrap
Chroot
# Building live image
- "${LIVE_TYPE}"
+ lh_buildbinary
+ lh_buildsource
}
Main "${@}"
diff --git a/src/scripts/01init.sh b/src/scripts/01init.sh
deleted file mode 100644
index 6947f6f..0000000
--- a/src/scripts/01init.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-# make-live - utility to build Debian Live systems
-#
-# Copyright (C) 2006 Daniel Baumann <daniel@debian.org>
-# Copyright (C) 2006 Marco Amadori <marco.amadori@gmail.com>
-#
-# make-live comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
-# This is free software, and you are welcome to redistribute it
-# under certain conditions; see COPYING for details.
-
-Init ()
-{
- # Check if user is root
- if [ "`id -u`" -ne "0" ]
- then
- echo "E: ${PROGRAM} requires superuser privilege."
- exit 1
- fi
-}
diff --git a/src/scripts/02defaults.sh b/src/scripts/02defaults.sh
index e0590f4..3960e72 100644
--- a/src/scripts/02defaults.sh
+++ b/src/scripts/02defaults.sh
@@ -17,6 +17,8 @@ Defaults ()
LIVE_ROOT="`pwd`/debian-live"
fi
+ export LIVE_ROOT
+
# Set image type
if [ -n "${LIVE_TYPE}" ]
then
@@ -42,18 +44,24 @@ Defaults ()
LIVE_TYPE="Iso"
fi
+ export LIVE_TYPE
+
# Set bootstrap architecture
if [ -z "${LIVE_ARCHITECTURE}" ]
then
LIVE_ARCHITECTURE="`dpkg --print-architecture`"
fi
+ export LIVE_ARCHITECTURE
+
# Set chroot directory
if [ -z "${LIVE_CHROOT}" ]
then
LIVE_CHROOT="${LIVE_ROOT}/chroot"
fi
+ export LIVE_CHROOT
+
# Set debian distribution
if [ -z "${LIVE_DISTRIBUTION}" ]
then
@@ -64,14 +72,19 @@ Defaults ()
then
LIVE_DISTRIBUTION="unstable"
LIVE_DISTRIBUTION_EXPERIMENTAL="yes"
+ export LIVE_DISTRIBUTION_EXPERIMENTAL
fi
+ export LIVE_DISTRIBUTION
+
# Set bootstrap flavour
if [ -z "${LIVE_FLAVOUR}" ]
then
LIVE_FLAVOUR="standard"
fi
+ export LIVE_FLAVOUR
+
# Set filesystem
if [ -z "${LIVE_FILESYSTEM}" ] && [ "${LIVE_TYPE}" = "Iso" ]
then
@@ -84,6 +97,8 @@ Defaults ()
LIVE_FILESYSTEM="plain"
fi
+ export LIVE_FILESYSTEM
+
# Set kernel flavour
if [ -z "${LIVE_KERNEL}" ]
then
@@ -143,10 +158,19 @@ Defaults ()
esac
fi
+ export LIVE_KERNEL
+
# Set kernel packages
if [ -z "${LIVE_KERNEL_PACKAGES}" ]
then
LIVE_KERNEL_PACKAGES="linux-image-2.6-${LIVE_KERNEL} squashfs-modules-2.6-${LIVE_KERNEL} unionfs-modules-2.6-${LIVE_KERNEL}"
+
+ if [ -n "${LIVE_ENCRYPTION}" ]
+ then
+ LIVE_KERNEL_PACKAGES="${LIVE_KERNEL_PACKAGES} loop-aes-modules-2.6-${LIVE_KERNEL} loop-aes-utils"
+ fi
+
+ export LIVE_KERNEL_PACKAGES
fi
# Set debian mirror
@@ -155,16 +179,20 @@ Defaults ()
LIVE_MIRROR="http://ftp.debian.org/debian/"
fi
+ export LIVE_MIRROR
+
# Set debian keyring
if [ -z "${LIVE_REPOSITORY_KEYRING}" ]
then
LIVE_REPOSITORY_KEYRING="debian-archive-keyring"
+ export LIVE_REPOSITORY_KEYRING
fi
# Set debian security mirror
if [ -z "${LIVE_MIRROR_SECURITY}" ]
then
LIVE_MIRROR_SECURITY="http://security.debian.org/"
+ export LIVE_MIRROR_SECURITY
fi
# Set default aptitude tasks
@@ -172,14 +200,17 @@ Defaults ()
then
LIVE_PACKAGE_LIST="gnome"
LIVE_TASKS="${LIVE_TASKS} standard laptop desktop gnome-desktop"
+ export LIVE_PACKAGE_LIST LIVE_TASKS
elif [ "${LIVE_PACKAGE_LIST}" = "kde-desktop" ]
then
LIVE_PACKAGE_LIST="kde"
LIVE_TASKS="${LIVE_TASKS} standard laptop desktop kde-desktop"
+ export LIVE_PACKAGE_LIST LIVE_TASKS
elif [ "${LIVE_PACKAGE_LIST}" = "xfce-desktop" ]
then
LIVE_PACKAGE_LIST="xfce"
LIVE_TASKS="${LIVE_TASKS} standard laptop desktop xfce-desktop"
+ export LIVE_PACKAGE_LIST LIVE_TASKS
fi
# Check for package lists
@@ -209,6 +240,8 @@ Defaults ()
fi
fi
+ export LIVE_PACKAGE_LIST
+
# Set FTP proxy
if [ -z "${LIVE_PROXY_FTP}" ] && [ -n "${ftp_proxy}" ]
then
@@ -241,63 +274,85 @@ Defaults ()
LIVE_SECTIONS="main"
fi
+ export LIVE_SECTIONS
+
# Set netboot server
if [ -z "${LIVE_SERVER_ADDRESS}" ]
then
LIVE_SERVER_ADDRESS="192.168.1.1"
fi
+ export LIVE_SERVER_ADDRESS
+
# Set netboot path
if [ -z "${LIVE_SERVER_PATH}" ]
then
LIVE_SERVER_PATH="/srv/debian-live"
fi
+ export LIVE_SERVER_PATH
+
# Set templates directory
if [ -z "${LIVE_TEMPLATES}" ]
then
LIVE_TEMPLATES="${BASE}/templates"
fi
+ export LIVE_TEMPLATES
+
# Set package indices
if [ -z "${LIVE_GENERIC_INDICES}" ] && [ "${LIVE_FLAVOUR}" != "minimal" ] && [ "${LIVE_FLAVOUR}" != "mini" ]
then
LIVE_GENERIC_INDICES="yes"
fi
+ export LIVE_GENERIC_INDICES
+
# Set recommends
if [ -z "${LIVE_RECOMMENDS}" ]
then
LIVE_RECOMMENDS="no"
fi
+ export LIVE_RECOMMENDS
+
# Set source image
if [ -z "${LIVE_SOURCE}" ]
then
LIVE_SOURCE="no"
fi
+ export LIVE_SOURCE
+
# Set disk volume
if [ -z "${LIVE_DISK_VOLUME}" ]
then
LIVE_DISK_VOLUME="Debian Live `date +%Y%m%d`"
fi
+ export LIVE_DISK_VOLUME
+
if [ -z "${LIVE_DEBCONF_FRONTEND}" ]
then
LIVE_DEBCONF_FRONTEND="noninteractive"
fi
+ export LIVE_DEBCONF_FRONTEND
+
if [ -z "${LIVE_DEBCONF_PRIORITY}" ]
then
LIVE_DEBCONF_PRIORITY="critical"
fi
+ export LIVE_DEBCONF_PRIORITY
+
if [ -z "${LIVE_DAEMONS}" ]
then
LIVE_DAEMONS="yes"
fi
+ export LIVE_DAEMONS
+
# This is a hack because Ubuntu does not ship cdrkit already
if [ -x /usr/bin/genisoimage ]
then
@@ -305,4 +360,10 @@ Defaults ()
else
GENISOIMAGE="/usr/bin/mkisofs"
fi
+
+ export GENISOIMAGE
+
+ # Variables that do not have defaults but need to be exported to
+ # allow other helpers to use their values
+ export LIVE_BOOTSTRAP_CONFIG
}
diff --git a/src/scripts/11bootstrap.sh b/src/scripts/11bootstrap.sh
deleted file mode 100644
index bc3a2ab..0000000
--- a/src/scripts/11bootstrap.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-# make-live - utility to build Debian Live systems
-#
-# Copyright (C) 2006 Daniel Baumann <daniel@debian.org>
-# Copyright (C) 2006 Marco Amadori <marco.amadori@gmail.com>
-#
-# make-live comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
-# This is free software, and you are welcome to redistribute it
-# under certain conditions; see COPYING for details.
-
-Bootstrap ()
-{
- if [ ! -f "${LIVE_ROOT}"/.stage/bootstrap ]
- then
- # Create chroot directory
- if [ ! -d "${LIVE_CHROOT}" ]
- then
- mkdir -p "${LIVE_CHROOT}"
- fi
-
- if [ -n "${LIVE_BOOTSTRAP_CONFIG}" ]; then
- SUITE_CONFIG="--suite-config ${LIVE_BOOTSTRAP_CONFIG}"
- fi
-
- # Bootstrap system
- if [ "${LIVE_FLAVOUR}" = "mini" ]
- then
- cdebootstrap --arch="${LIVE_ARCHITECTURE}" --flavour=minimal ${SUITE_CONFIG} "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}"
- else
- cdebootstrap --arch="${LIVE_ARCHITECTURE}" --flavour="${LIVE_FLAVOUR}" ${SUITE_CONFIG} "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}"
- fi
-
- # Remove unused packages
- Chroot_exec "dpkg -P cdebootstrap-helper-diverts"
-
- # Remove package cache
- rm -rf "${LIVE_CHROOT}"/var/cache/bootstrap
-
- # Touching stage file
- if [ ! -d "${LIVE_ROOT}"/.stage ]
- then
- mkdir "${LIVE_ROOT}"/.stage
- fi
-
- touch "${LIVE_ROOT}"/.stage/bootstrap
- fi
-}
diff --git a/src/scripts/12patch.sh b/src/scripts/12patch.sh
deleted file mode 100644
index 326ba4a..0000000
--- a/src/scripts/12patch.sh
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/bin/sh
-
-# make-live - utility to build Debian Live systems
-#
-# Copyright (C) 2006 Daniel Baumann <daniel@debian.org>
-# Copyright (C) 2006 Marco Amadori <marco.amadori@gmail.com>
-#
-# make-live comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
-# This is free software, and you are welcome to redistribute it
-# under certain conditions; see COPYING for details.
-
-Patch_chroot ()
-{
- # Some maintainer scripts can detect if they are in a chrooted system.
- # Therefore, we create the needed file.
-
- case "${1}" in
- apply)
- # Create chroot file
- echo "debian-live" > "${LIVE_CHROOT}"/etc/debian_chroot
- ;;
-
- deapply)
- # Remove chroot file
- rm -f "${LIVE_CHROOT}"/etc/debian_chroot
- ;;
- esac
-}
-
-Patch_runlevel ()
-{
- # Disabling all init scripts with a blocking policy as in
- # /usr/share/doc/sysv-rc/README.policy-rc.d.gz.
-
- case "${1}" in
- apply)
- # Create init policy
- cat > "${LIVE_CHROOT}"/usr/sbin/policy-rc.d <<EOF
-#!/bin/sh
-
-exit 101
-EOF
-
- chmod 0755 "${LIVE_CHROOT}"/usr/sbin/policy-rc.d
- ;;
-
- deapply)
- # Removing init policy
- rm -f "${LIVE_CHROOT}"/usr/sbin/policy-rc.d
- ;;
- esac
-}
-
-Patch_network ()
-{
- # Packages which are manually installed inside the chroot are installed
- # from the network. Therefore, we need to be able to resolv hosts.
-
- case "${1}" in
- apply)
- # Save apt configuration
- if [ -f "${LIVE_CHROOT}"/etc/apt/apt.conf ]
- then
- cp "${LIVE_CHROOT}"/etc/apt/apt.conf "${LIVE_CHROOT}"/etc/apt/apt.conf.orig
- fi
-
- # Configure apt.conf
- if [ -n "${LIVE_PROXY_FTP}" ]
- then
- echo "Acquire::ftp::Proxy \"${LIVE_PROXY_FTP}\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf
- elif [ -n "${LIVE_PROXY_HTTP}" ]
- then
- echo "Acquire::http::Proxy \"${LIVE_PROXY_HTTP}\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf
- fi
-
- # Configure recommends
- if [ "${LIVE_RECOMMENDS}" = "yes" ]
- then
- echo "Aptitude::Recommends-Important \"true\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf
- else
- echo "Aptitude::Recommends-Important \"false\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf
- fi
-
- # Save host lookup table
- if [ -f "${LIVE_CHROOT}"/etc/hosts ]
- then
- cp "${LIVE_CHROOT}"/etc/hosts "${LIVE_CHROOT}"/etc/hosts.orig
- fi
-
- # Copy host lookup table
- if [ -f /etc/hosts ]
- then
- cp /etc/hosts "${LIVE_CHROOT}"/etc/hosts
- fi
-
- # Save resolver configuration
- if [ -f "${LIVE_CHROOT}"/etc/resolv.conf ]
- then
- cp "${LIVE_CHROOT}"/etc/resolv.conf "${LIVE_CHROOT}"/etc/resolv.conf.orig
- fi
-
- # Copy resolver configuration
- if [ -f /etc/resolv.conf ]
- then
- cp /etc/resolv.conf "${LIVE_CHROOT}"/etc/resolv.conf
- fi
- ;;
-
- deapply)
- # Restore apt configuration
- if [ -f "${LIVE_CHROOT}"/etc/apt/apt.conf.orig ]
- then
- mv "${LIVE_CHROOT}"/etc/apt/apt.conf.orig "${LIVE_CHROOT}"/etc/apt/apt.conf
- else
- rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf
- fi
-
- # Restore host lookup table
- if [ -f "${LIVE_CHROOT}"/etc/hosts.orig ]
- then
- mv "${LIVE_CHROOT}"/etc/hosts.orig "${LIVE_CHROOT}"/etc/hosts
- else
- rm -f "${LIVE_CHROOT}"/etc/hosts
- fi
-
- # Restore resolver configuration
- if [ -f "${LIVE_CHROOT}"/etc/resolv.conf.orig ]
- then
- mv "${LIVE_CHROOT}"/etc/resolv.conf.orig "${LIVE_CHROOT}"/etc/resolv.conf
- else
- rm -f "${LIVE_CHROOT}"/etc/resolv.conf
- fi
- ;;
- esac
-}
-
-Patch_linux ()
-{
- # The linux-image package asks interactively for initial ramdisk
- # creation. Therefore, we preconfigure /etc/kernel-img.conf.
- # FIXME: preseeding?
-
- case "${1}" in
- apply)
- # Save kernel configuration
- if [ -f "${LIVE_CHROOT}"/etc/kernel-img.conf ]
- then
- cp "${LIVE_CHROOT}"/etc/kernel-img.conf "${LIVE_CHROOT}"/etc/kernel-img.conf.old
- fi
-
- # Configure kernel-img.conf
- echo "do_initrd = Yes" >> "${LIVE_CHROOT}"/etc/kernel-img.conf
- ;;
-
- deapply)
- # Restore kernel configuration
- if [ -f "${LIVE_CHROOT}"/etc/kernel-img.conf.old ]
- then
- mv "${LIVE_CHROOT}"/etc/kernel-img.conf.old "${LIVE_CHROOT}"/etc/kernel-img.conf
- else
- rm -f "${LIVE_CHROOT}"/etc/kernel-img.conf
- fi
- ;;
- esac
-}
diff --git a/src/scripts/13chroot.sh b/src/scripts/13chroot.sh
index 9403448..f06cf4d 100644
--- a/src/scripts/13chroot.sh
+++ b/src/scripts/13chroot.sh
@@ -9,234 +9,57 @@
# This is free software, and you are welcome to redistribute it
# under certain conditions; see COPYING for details.
-Chroot_exec ()
-{
- # Execute commands chrooted
- chroot "${LIVE_CHROOT}" /usr/bin/env -i HOME="/root" PATH="/usr/sbin:/usr/bin:/sbin:/bin" TERM="${TERM}" ftp_proxy="${LIVE_PROXY_FTP}" http_proxy="${LIVE_PPROXY_HTTP}" DEBIAN_FRONTEND="${LIVE_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LIVE_DEBCONF_PRIORITY}" ${1}
- return ${?}
-}
-
Chroot ()
{
if [ ! -f "${LIVE_ROOT}"/.stage/chroot ]
then
# Configure chroot
- Patch_chroot apply
- Patch_runlevel apply
+ lh_patchchroot apply
+ lh_patchrunlevel apply
# Configure network
- Patch_network apply
+ lh_patchnetwork apply
# Mount proc
mount proc-live -t proc "${LIVE_CHROOT}"/proc
- # Avoid daemon starting
- cat > "${LIVE_CHROOT}"/usr/sbin/policy-rc.d <<EOF
-#!/bin/sh
-echo
-echo "Warning: invoke-rc.d policy in action. Skiping daemon starting"
-
-exit 101
-EOF
- chmod 755 "${LIVE_CHROOT}"/usr/sbin/policy-rc.d
-
# Configure sources.list
- Indices custom initial
+ lh_setupapt custom initial
+ lh_configapt apply-proxy
+ lh_configapt apply-recommends
# Install aptitude
- Chroot_exec "apt-get install --yes --force-yes aptitude"
-
- # Install secure apt
- if [ "${LIVE_DISTRIBUTION}" = "unstable" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_UNSTABLE}" ] || \
- [ "${LIVE_DISTRIBUTION}" = "testing" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_TESTING}" ]
- then
- if [ "${LIVE_FLAVOUR}" != "minimal" ] || [ "${LIVE_FLAVOUR}" != "mini" ]
- then
- Chroot_exec "apt-get install --yes --force-yes ${LIVE_REPOSITORY_KEYRING}"
-
- for NAME in ${LIVE_REPOSITORIES}
- do
- eval REPOSITORY_KEY="$`echo LIVE_REPOSITORY_KEY_$NAME`"
- eval REPOSITORY_KEYRING="$`echo LIVE_REPOSITORY_KEYRING_$NAME`"
-
- if [ -n "${REPOSITORY_KEYRING}" ]
- then
- Chroot_exec "aptiude install ${REPOSITORY_KEYRING}"
- elif [ -n "${REPOSITORY_KEY}" ]
- then
- Chroot_exec "wget ${REPOSITORY_KEY}"
- Chroot_exec "apt-key add `basename ${REPOSITORY_KEY}`"
- Chroot_exec "rm -f `basename ${REPOSITORY_KEY}`"
- fi
- done
- fi
- fi
+ lh_installapt
# Update indices
- Chroot_exec "aptitude update"
+ lh_chroot "aptitude update"
# Configure linux-image
- Patch_linux apply
+ lh_patchlinux apply
# Install linux-image, modules and casper
- Chroot_exec "aptitude install --assume-yes ${LIVE_KERNEL_PACKAGES} casper"
+ lh_chroot "aptitude install --assume-yes ${LIVE_KERNEL_PACKAGES} casper"
# 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 "aptitude install --assume-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
+ lh_patchlinux deapply
- # Restore preseed configuration
- if [ -f "${LIVE_PRESEED}" ]
- then
- Chroot_exec "aptitude install --assume-yes debconf-utils"
- cp "${LIVE_PRESEED}" "${LIVE_CHROOT}"/root/preseed
- Chroot_exec "debconf-set-selections /root/preseed"
- rm -f "${LIVE_CHROOT}"/root/preseed
- else
- if [ -n "${LIVE_PRESEED}" ]; then
- echo "'${LIVE_PRESEED}' file doesn't exists. Exiting..."
- exit 1
- fi
- fi
+ lh_clone
+ lh_preseed
- # Restore cloned package selection
- if [ -f "${LIVE_PACKAGE_LIST_CLONED}" ]
- then
- Chroot_exec "xargs --arg-file=/root/`basename ${LIVE_PACKAGE_LIST_CLONED}` aptitude install --assume-yes"
- fi
-
- # Install aptitude tasks
- if [ -n "${LIVE_TASKS}" ]
- then
- for TASK in ${LIVE_TASKS}
- do
- Chroot_exec "aptitude install --assume-yes ${TASK}"
- done
- fi
-
- # Install packages list
- if [ -n "${LIVE_PACKAGE_LIST}" ]
- then
- if [ "${LIVE_PACKAGE_LIST}" = "everything" ]
- then
- #for FILE in "${LIVE_CHROOT}"/var/lib/apt/lists/*_Packages
- #do
- # awk '/Package: / { print $2 }' "${FILE}" | grep -v ".*-dbg$" >> "${LIVE_CHROOT}"/root/everything
- #done
-
- #Chroot_exec "xargs --arg-file=/root/everything aptitude install --assume-yes"
- #rm -f "${LIVE_CHROOT}"/root/everything
-
- # FIXME
-
- for SECTION in admin base comm devel doc editors electronics embedded games gnome graphics hamradio interpreters kde libs libdevel mail math misc net news oldlibs otherosfs perl python science shells sound tex text utils web x11
- do
- Chroot_exec "aptitude install --assume-yes ~s${SECTION}"
- done
- else
- grep -v "^#" "${LIVE_PACKAGE_LIST}" > "${LIVE_CHROOT}"/root/"`basename ${LIVE_PACKAGE_LIST}`"
- Chroot_exec "xargs --arg-file=/root/`basename ${LIVE_PACKAGE_LIST}` aptitude install --assume-yes"
- rm -f "${LIVE_CHROOT}"/root/"`basename ${LIVE_PACKAGE_LIST}`"
- fi
- fi
-
- # Install extra packages
- if [ -n "${LIVE_PACKAGES}" ]
- then
- Chroot_exec "aptitude install --assume-yes ${LIVE_PACKAGES}"
- fi
-
- # Copy external directory into the chroot
- if [ -d "${LIVE_INCLUDE_CHROOT}" ]
- then
- cd "${LIVE_INCLUDE_CHROOT}"
- find . | cpio -pumd "${LIVE_CHROOT}"
- cd "${OLDPWD}"
- fi
-
- # Process flavour specific hooks
- if [ -r "${BASE}"/hooks/"${LIVE_FLAVOUR}" ]
- then
- grep -v "^#" "${BASE}"/hooks/"${LIVE_FLAVOUR}" > "${LIVE_CHROOT}"/root/"${LIVE_FLAVOUR}"
- LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" Chroot_exec "sh /root/${LIVE_FLAVOUR}"
- rm -f "${LIVE_CHROOT}"/root/"${LIVE_FLAVOUR}"
- fi
-
- # Execute extra command in the chroot
- if [ -r "${LIVE_HOOK}" ]
- then
- # FIXME
- LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" Chroot_exec "`cat ${LIVE_HOOK}`"
- elif [ -n "${LIVE_HOOK}" ]
- then
- LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" Chroot_exec "${LIVE_HOOK}"
- fi
+ lh_installtasks
+ lh_installpackagelists
+ lh_installpackages
+ lh_includechroot
+ lh_hook
# Save package list
- Chroot_exec "dpkg --get-selections" > "${LIVE_ROOT}"/packages.txt
-
- # Disable daemons
- if [ "${LIVE_DAEMONS}" = "no" ]
- then
- # Disable all
- for FILE in "${LIVE_CHROOT}"/etc/init.d/*
- do
- Chroot_exec "update-rc.d -f `basename ${FILE}` remove"
- done
+ lh_chroot "dpkg --get-selections" > "${LIVE_ROOT}"/packages.txt
- # Re-enable all required (taken from -f standard chroot)
- for PACKAGE in casper console-common cron dpkg ifupdown initscripts kbd klogd libc6 libdevmapper1.02 libselinux1 libsepol1 login makedev module-init-tools netbase openbsd-inetd procps sudo sysklogd udev util-linux
- do
- # Re-configure if existing
- if [ -f "${LIVE_CHROOT}"/var/lib/dpkg/info/${PACKAGE}.postinst ]
- then
- Chroot_exec "/var/lib/dpkg/info/${PACKAGE}.postinst configure"
- fi
- done
- fi
+ lh_config disable-daemons
- # Add filesystem.manifest
- Chroot_exec "dpkg-query -W \*" | awk '$2 ~ /./ {print $1 " " $2 }' > "${LIVE_ROOT}"/filesystem.manifest
+ lh_manifest
- if [ ! -z "${LIVE_MANIFEST}" ]
- then
- Chroot_exec "aptitude install --assume-yes ${LIVE_MANIFEST}"
- Chroot_exec "dpkg-query -W \*" | awk '$2 ~ /./ {print $1 " " $2 }' > "${LIVE_ROOT}"/filesystem.manifest-desktop
- fi
-
- # Clean apt packages cache
- rm -rf "${LIVE_CHROOT}"/var/cache/apt
- mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial
-
- if [ "${LIVE_FLAVOUR}" = "minimal" ] || [ "${LIVE_FLAVOUR}" = "mini" ]
- then
- rm -rf "${LIVE_CHROOT}"/var/lib/apt/lists/*
- rm -f "${LIVE_CHROOT}"/var/lib/dpkg/available-old
- rm -f "${LIVE_CHROOT}"/var/lib/dpkg/diversions-old
- rm -f "${LIVE_CHROOT}"/var/lib/dpkg/statoverride-old
- rm -f "${LIVE_CHROOT}"/var/lib/dpkg/status-old
- fi
+ lh_cleanapt
# Workaround binfmt-support /proc locking
umount "${LIVE_CHROOT}"/proc/sys/fs/binfmt_misc > /dev/null || true
@@ -244,15 +67,12 @@ EOF
# Unmount proc
umount "${LIVE_CHROOT}"/proc
- # Allow daemon starting
- rm "${LIVE_CHROOT}"/usr/sbin/policy-rc.d
-
# Deconfigure network
- Patch_network deapply
+ lh_patchnetwork deapply
# Deconfigure chroot
- Patch_runlevel deapply
- Patch_chroot deapply
+ lh_patchrunlevel deapply
+ lh_patchchroot deapply
# Touching stage file
touch "${LIVE_ROOT}"/.stage/chroot
diff --git a/src/scripts/21image.sh b/src/scripts/21image.sh
deleted file mode 100644
index 9fc4fe2..0000000
--- a/src/scripts/21image.sh
+++ /dev/null
@@ -1,372 +0,0 @@
-#!/bin/sh
-
-# make-live - utility to build Debian Live systems
-#
-# Copyright (C) 2006 Daniel Baumann <daniel@debian.org>
-# Copyright (C) 2006 Marco Amadori <marco.amadori@gmail.com>
-#
-# make-live comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
-# This is free software, and you are welcome to redistribute it
-# under certain conditions; see COPYING for details.
-
-Indices ()
-{
- case "${1}" in
- custom)
- # Configure custom sources.list
- case "${LIVE_DISTRIBUTION}" in
- oldstable|"${CODENAME_OLDSTABLE}"|stable|"${CODENAME_STABLE}"|testing|"${CODENAME_TESTING}")
- echo "deb ${LIVE_MIRROR} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > "${LIVE_CHROOT}"/etc/apt/sources.list
-
- if [ "${LIVE_SOURCE}" = "yes" ]
- then
- echo "deb-src ${LIVE_MIRROR} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- fi
-
- echo "deb ${LIVE_MIRROR_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
-
- if [ "${LIVE_SOURCE}" = "yes" ]
- then
- echo "deb-src ${LIVE_MIRROR_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- fi
- ;;
-
- unstable|"${CODENAME_UNSTABLE}")
- echo "deb ${LIVE_MIRROR} unstable ${LIVE_SECTIONS}" > "${LIVE_CHROOT}"/etc/apt/sources.list
-
- if [ "${LIVE_SOURCE}" = "yes" ]
- then
- echo "deb-src ${LIVE_MIRROR} unstable ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- fi
-
- if [ "${LIVE_DISTRIBUTION_EXPERIMENTAL}" = "yes" ]
- then
- echo "deb ${LIVE_MIRROR} experimental ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
-
- if [ "${LIVE_SOURCE}" = "yes" ]
- then
- echo "deb-src ${LIVE_MIRROR} experimental ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- fi
-
-cat > "${LIVE_CHROOT}"/etc/apt/preferences << EOF
-Package: *
-Pin: release a=experimental
-Pin-Priority: 999
-EOF
- fi
- ;;
- esac
- ;;
-
- default)
- # Configure default sources.list
- case "${LIVE_DISTRIBUTION}" in
- oldstable|"${CODENAME_OLDSTABLE}"|stable|"${CODENAME_STABLE}"|testing|"${CODENAME_TESTING}")
- echo "deb http://ftp.debian.org/debian/ ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > "${LIVE_CHROOT}"/etc/apt/sources.list
-
- if [ "${LIVE_SOURCE}" = "yes" ]
- then
- echo "deb-src http://ftp.debian.org/debian/ ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- fi
-
- echo "deb http://security.debian.org/ ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
-
- if [ "${LIVE_SOURCE}" = "yes" ]
- then
- echo "deb-src http://security.debian.org/ ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- fi
- ;;
-
- unstable|"${CODENAME_UNSTABLE}")
- echo "deb http://ftp.debian.org/debian/ unstable ${LIVE_SECTIONS}" > "${LIVE_CHROOT}"/etc/apt/sources.list
-
- if [ "${LIVE_SOURCE}" = "yes" ]
- then
- echo "deb-src http://ftp.debian.org/debian/ unstable ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- fi
-
- if [ "${LIVE_DISTRIBUTION_EXPERIMENTAL}" = "yes" ]
- then
- echo "deb http://ftp.debian.org/debian/ experimental ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
-
- if [ "${LIVE_SOURCE}" = "yes" ]
- then
- echo "deb-src http://ftp.debian.org/debian/ experimental ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- fi
- fi
- ;;
- esac
- ;;
- esac
-
- # Add custom repositories
- echo "" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "# Custom repositories" >> "${LIVE_CHROOT}"/etc/apt/sources.list
-
- for NAME in ${LIVE_REPOSITORIES}
- do
- eval REPOSITORY="$`echo LIVE_REPOSITORY_$NAME`"
- eval REPOSITORY_DISTRIBUTION="$`echo LIVE_REPOSITORY_DISTRIBUTION_$NAME`"
- eval REPOSITORY_SECTIONS="$`echo LIVE_REPOSITORY_SECTIONS_$NAME`"
-
- # Configure /etc/apt/sources.list
- if [ -n "${REPOSITORY_DISTRIBUTION}" ]
- then
- echo "deb ${REPOSITORY} ${REPOSITORY_DISTRIBUTION} ${REPOSITORY_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- else
- echo "deb ${REPOSITORY} ${LIVE_DISTRIBUTION} ${REPOSITORY_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- fi
- done
-
- # Update indices
- if [ "${2}" = "initial" ]
- then
- Chroot_exec "apt-get update"
- else
- Chroot_exec "aptitude update"
- fi
-
- if [ "${LIVE_DISTRIBUTION_EXPERIMENTAL}" = "yes" ]
- then
- # experimental is sometimes broken,
- # therefore this is intentionally kept interactive.
- Chroot_exec "aptitude upgrade" || return 0
- Chroot_exec "aptitude dist-upgrade" || return 0
- fi
-}
-
-Genrootfs ()
-{
- case "${LIVE_FILESYSTEM}" in
- ext2)
- DU_DIM="`du -ks ${LIVE_CHROOT} | cut -f1`"
- REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here...
-
- genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root="${LIVE_CHROOT}" "${LIVE_ROOT}"/binary/casper/filesystem.ext2
- ;;
-
- plain)
- cd "${LIVE_CHROOT}"
- find . | cpio -pumd "${LIVE_ROOT}"/binary/casper/filesystem.dir
- cd "${OLDPWD}"
- ;;
-
- squashfs)
- if [ -f "${LIVE_ROOT}"/binary/casper/filesystem.squashfs ]
- then
- rm "${LIVE_ROOT}"/binary/casper/filesystem.squashfs
- fi
-
- mksquashfs "${LIVE_CHROOT}" "${LIVE_ROOT}"/binary/casper/filesystem.squashfs
- ;;
- esac
-}
-
-Syslinux ()
-{
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
- then
- case "${1}" in
- iso)
- # Copy syslinux
- mkdir -p "${LIVE_ROOT}"/binary/isolinux
- cp "${LIVE_CHROOT}"/usr/lib/syslinux/isolinux.bin "${LIVE_ROOT}"/binary/isolinux
-
- # Install syslinux templates
- cp -r "${LIVE_TEMPLATES}"/syslinux/* \
- "${LIVE_ROOT}"/binary/isolinux
- rm -f "${LIVE_ROOT}"/binary/isolinux/pxelinux.cfg
-
- #if [ "${LIVE_TYPE}" = "Iso" ]
- #then
- mv "${LIVE_ROOT}"/binary/isolinux/isolinux.cfg.iso "${LIVE_ROOT}"/binary/isolinux/isolinux.cfg
- rm -f "${LIVE_ROOT}"/binary/isolinux/isolinux.cfg.usb
- #else
- # mv "${LIVE_ROOT}"/binary/isolinux/isolinux.cfg.usb "${LIVE_ROOT}"/binary/isolinux/isolinux.cfg
- # rm -f "${LIVE_ROOT}"/binary/isolinux/isolinux.cfg.iso
- #fi
-
- if [ -n "${LIVE_ISOLINUX_SPLASH}" ]; then
- cp "${LIVE_ISOLINUX_SPLASH}" "${LIVE_ROOT}/binary/isolinux/splash.rle"
- fi
-
- # Configure syslinux templates
- sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/binary/isolinux/isolinux.cfg
- sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" "${LIVE_ROOT}"/binary/isolinux/f1.txt
- sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/binary/isolinux/f10.txt
- ;;
-
- net)
- # Copy syslinux
- mkdir -p "${LIVE_ROOT}"/tftpboot
- cp "${LIVE_ROOT}"/chroot/usr/lib/syslinux/pxelinux.0 "${LIVE_ROOT}"/tftpboot
-
- # Install syslinux templates
- mkdir -p "${LIVE_ROOT}"/tftpboot/pxelinux.cfg
- cp -r "${LIVE_TEMPLATES}"/syslinux/* \
- "${LIVE_ROOT}"/tftpboot/pxelinux.cfg
- mv "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/pxelinux.cfg "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/default
- rm -f "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/isolinux.cfg.*
- sed -i -e 's#splash.rle#pxelinux.cfg/splash.rle#' "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/isolinux.txt
-
- if [ -n "${LIVE_ISOLINUX_SPLASH}" ]; then
- cp "${LIVE_ISOLINUX_SPLASH}" "${LIVE_ROOT}/tftpboot/pxelinux.cfg/splash.rle"
- fi
-
- # Configure syslinux templates
- sed -i -e "s/LIVE_SERVER_ADDRESS/${LIVE_SERVER_ADDRESS}/" -e "s#LIVE_SERVER_PATH#${LIVE_SERVER_PATH}#" -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/default
- sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f1.txt
- sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f10.txt
- ;;
- esac
- fi
-}
-
-Linuximage ()
-{
- # Removing initrd backup files
- rm -f "${LIVE_CHROOT}"/boot/initrd*bak*
-
- case "${1}" in
- iso)
- # Copy linux-image
- if [ "${LIVE_FLAVOUR}" = "minimal" ] || [ "${LIVE_FLAVOUR}" = "mini" ]
- then
- mv "${LIVE_CHROOT}"/boot/vmlinuz* "${LIVE_ROOT}"/binary/isolinux/vmlinuz
- mv "${LIVE_CHROOT}"/boot/initrd.img* "${LIVE_ROOT}"/binary/isolinux/initrd.gz
- rm -f "${LIVE_CHROOT}"/vmlinuz "${LIVE_CHROOT}"/initrd.img
- else
- cp "${LIVE_CHROOT}"/boot/vmlinuz* "${LIVE_ROOT}"/binary/isolinux/vmlinuz
- cp "${LIVE_CHROOT}"/boot/initrd.img* "${LIVE_ROOT}"/binary/isolinux/initrd.gz
- fi
- ;;
-
- net)
- # Copy linux-image
- if [ "${LIVE_FLAVOUR}" = "minimal" ] || [ "${LIVE_FLAVOUR}" = "mini" ]
- then
- mv "${LIVE_ROOT}"/chroot/boot/vmlinuz* "${LIVE_ROOT}"/tftpboot/vmlinuz
- mv "${LIVE_ROOT}"/chroot/boot/initrd.img* "${LIVE_ROOT}"/tftpboot/initrd.gz
- else
- cp "${LIVE_ROOT}"/chroot/boot/vmlinuz* "${LIVE_ROOT}"/tftpboot/vmlinuz
- cp "${LIVE_ROOT}"/chroot/boot/initrd.img-* "${LIVE_ROOT}"/tftpboot/initrd.gz
- fi
- ;;
- esac
-}
-
-Memtest ()
-{
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
- then
- case "$1" in
- iso)
- # Copy memtest
- cp "${LIVE_ROOT}"/chroot/boot/memtest86+.bin "${LIVE_ROOT}"/binary/isolinux/memtest
- ;;
-
- net)
- # Copy memtest
- cp "${LIVE_ROOT}"/chroot/boot/memtest86+.bin "${LIVE_ROOT}"/tftpboot/memtest
- ;;
- esac
- fi
-}
-
-Md5sum ()
-{
- # Calculating md5sums
- cd "${LIVE_ROOT}"/binary
- find . -type f -print0 | xargs -0 md5sum > "${LIVE_ROOT}"/md5sum.txt
- cd "${OLDPWD}"
-
- if [ -d "${LIVE_INCLUDE_IMAGE}" ]
- then
- cd "${LIVE_INCLUDE_IMAGE}"
- find . -type f -print0 | xargs -0 md5sum >> "${LIVE_ROOT}"/md5sum.txt
- cd "${OLDPWD}"
- fi
-
- mv "${LIVE_ROOT}"/md5sum.txt "${LIVE_ROOT}"/binary
-}
-
-Genisoimage ()
-{
- case "${1}" in
- binary)
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
- then
- # Create image
- ${GENISOIMAGE} -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_ROOT}"/"${LIVE_IMAGE}"binary.iso -r -J -l -V "${LIVE_DISK_VOLUME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table "${LIVE_ROOT}"/binary ${LIVE_INCLUDE_IMAGE}
- else
- echo "W: Bootloader on your architecture not yet supported (Continuing in 5 seconds)."
- sleep 5
-
- # Create image
- ${GENISOIMAGE} -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_ROOT}"/"${LIVE_IMAGE}"binary.iso -r -J -l -V "${LIVE_DISK_VOLUME}" "${LIVE_ROOT}"/binary ${LIVE_INCLUDE_IMAGE}
- fi
- ;;
-
- source)
- # Create image
- ${GENISOIMAGE} -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_ROOT}"/"${LIVE_IMAGE}"source.iso -r -J -l -V "${LIVE_DISK_VOLUME}" "${LIVE_ROOT}"/source
- ;;
- esac
-}
-
-Sources ()
-{
- # Download sources
- Chroot_exec "dpkg --get-selections" | awk '{ print $1 }' > "${LIVE_CHROOT}"/root/dpkg-selection.txt
- Chroot_exec "xargs --arg-file=/root/dpkg-selection.txt apt-get source --download-only"
- rm -f "${LIVE_CHROOT}"/root/dpkg-selection.txt
-
- # Sort sources
- for DSC in "${LIVE_CHROOT}"/*.dsc
- do
- SOURCE="`awk '/Source:/ { print $2; }' ${DSC}`"
-
- if [ "`echo ${SOURCE} | cut -b 1-3`" == "lib" ]
- then
- LETTER="`echo ${SOURCE} | cut -b 1-4`"
- else
- LETTER="`echo ${SOURCE} | cut -b 1`"
- fi
-
- # Install directory
- install -d -m 0755 "${LIVE_ROOT}"/source/"${LETTER}"/"${SOURCE}"
-
- # Move sources
- mv "${LIVE_CHROOT}"/"${SOURCE}"_* "${LIVE_ROOT}"/source/"${LETTER}"/"${SOURCE}"
- done
-}
-
-losetup_p ()
-{
- # Usage: losetup_p <image_filename> [partition_#]
- FILE=$1 ; MNT=$2 ; PART=$3
-
- FREELO=$(losetup -f)
- losetup $FREELO $FILE
-
- FDISK_OUT=$(fdisk -l -u "$FREELO" 2>&1)
- losetup -d $FREELO
-
- VDEV=$(echo "$FREELO"p"${PART:=1}")
-
- CYL=`echo "$FDISK_OUT" | sed -ne "s_^$VDEV[ *]*\([0-9]*\).*_\1_p"`
-
- START=$((CYL*512))
-
- FREELO=$(losetup -f)
- echo loop $FREELO at offset $START
-
- export FREELO
-
- if [ "${PART}" = "0" ]
- then
- losetup $FREELO "${FILE}"
- else
- losetup -o $START $FREELO "$FILE"
- fi
-}
diff --git a/src/scripts/22iso.sh b/src/scripts/22iso.sh
deleted file mode 100644
index c99b774..0000000
--- a/src/scripts/22iso.sh
+++ /dev/null
@@ -1,155 +0,0 @@
-#!/bin/sh
-
-# make-live - utility to build Debian Live systems
-#
-# Copyright (C) 2006 Daniel Baumann <daniel@debian.org>
-# Copyright (C) 2006 Marco Amadori <marco.amadori@gmail.com>
-#
-# make-live comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
-# This is free software, and you are welcome to redistribute it
-# under certain conditions; see COPYING for details.
-
-Iso ()
-{
- if [ ! -f "${LIVE_ROOT}"/.stage/image_binary ]
- then
- # Configure chroot
- Patch_chroot apply
- Patch_runlevel apply
-
- # Configure network
- Patch_network apply
-
- mkdir -p "${LIVE_ROOT}"/binary/casper
- for MANIFEST in "${LIVE_ROOT}"/filesystem.manifest*
- do
- if [ -e "${MANIFEST}" ]; then
- mv "${MANIFEST}" "${LIVE_ROOT}"/binary/casper/
- fi
- done
-
- # Remove indices
- rm -rf "${LIVE_CHROOT}"/var/cache/apt
- mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial
- rm -rf "${LIVE_CHROOT}"/var/lib/apt/lists
- mkdir -p "${LIVE_CHROOT}"/var/lib/apt/lists/partial
-
- # Switching package indices to default
- if [ "${LIVE_GENERIC_INDICES}" = "yes" ]
- then
- Indices default
- fi
-
- # Deconfigure network
- Patch_network deapply
-
- # Deconfigure chroot
- Patch_runlevel deapply
- Patch_chroot deapply
-
- # Generating rootfs image
- Genrootfs
-
- # Configure chroot
- Patch_chroot apply
- Patch_runlevel apply
-
- # Configure network
- Patch_network apply
-
- # Remove indices
- rm -rf "${LIVE_CHROOT}"/var/cache/apt
- mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial
- rm -rf "${LIVE_CHROOT}"/var/lib/apt/lists
- mkdir -p "${LIVE_CHROOT}"/var/lib/apt/lists/partial
-
- # Switching package indices to custom
- Indices custom
-
- # Install depends
- if [ -z "${KEEP_MEMTEST86}" ]
- then
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
- then
- Chroot_exec "aptitude install --assume-yes memtest86+"
- fi
- fi
-
- if [ -z "${KEEP_SYSLINUX}" ]
- then
- Chroot_exec "aptitude install --assume-yes syslinux"
- fi
-
- # Installing syslinux
- Syslinux iso
-
- # Installing linux-image
- Linuximage iso
-
- # Installing memtest
- Memtest iso
-
- # Remove depends
- if [ -z "${KEEP_MEMTEST86}" ]
- then
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
- then
- Chroot_exec "aptitude purge --assume-yes memtest86+"
- fi
- fi
-
- if [ -z "${KEEP_SYSLINUX}" ]
- then
- Chroot_exec "aptitude purge --assume-yes syslinux"
- fi
-
- # Deconfigure network
- Patch_network deapply
-
- # Deconfigure chroot
- Patch_runlevel deapply
- Patch_chroot deapply
-
- # Installing templates
- if [ "${LIVE_FLAVOUR}" != "minimal" ] || [ "${LIVE_FLAVOUR}" != "mini" ]
- then
- cp -r "${LIVE_TEMPLATES}"/iso/* "${LIVE_ROOT}"/binary
- cp -r "${LIVE_TEMPLATES}"/common/* "${LIVE_ROOT}"/binary
- fi
-
- # Calculating md5sums
- Md5sum
-
- # Creating image
- Genisoimage binary
-
- # Touching stage file
- touch "${LIVE_ROOT}"/.stage/image_binary
- fi
-
- if [ ! -f "${LIVE_ROOT}"/.stage/image_source ] && [ "${LIVE_SOURCE}" = "yes" ]
- then
- # Configure chroot
- Patch_chroot apply
- Patch_runlevel apply
-
- # Configure network
- Patch_network apply
-
- # Downloading sources
- Sources
-
- # Deconfigure network
- Patch_network deapply
-
- # Deconfigure chroot
- Patch_runlevel deapply
- Patch_chroot deapply
-
- # Creating image
- Genisoimage source
-
- # Touching stage file
- touch "${LIVE_ROOT}"/.stage/image_source
- fi
-}
diff --git a/src/scripts/23net.sh b/src/scripts/23net.sh
deleted file mode 100644
index ef837f4..0000000
--- a/src/scripts/23net.sh
+++ /dev/null
@@ -1,180 +0,0 @@
-#!/bin/sh
-
-# make-live - utility to build Debian Live systems
-#
-# Copyright (C) 2006 Daniel Baumann <daniel@debian.org>
-# Copyright (C) 2006 Marco Amadori <marco.amadori@gmail.com>
-#
-# make-live comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
-# This is free software, and you are welcome to redistribute it
-# under certain conditions; see COPYING for details.
-
-Net ()
-{
- if [ ! -f "${LIVE_ROOT}"/.stage/image_binary ]
- then
- # Configure chroot
- Patch_chroot apply
- Patch_runlevel apply
-
- # Configure network
- Patch_network apply
-
- mkdir -p "${LIVE_ROOT}"/binary/casper
- cp -r "${LIVE_TEMPLATES}"/common/* "${LIVE_ROOT}"/binary
-
- for MANIFEST in "${LIVE_ROOT}"/filesystem.manifest*
- do
- if [ -e "${MANIFEST}" ]; then
- mv "${MANIFEST}" "${LIVE_ROOT}"/binary/casper/
- fi
- done
-
- # Mount proc
- mount proc-live -t proc "${LIVE_CHROOT}"/proc
-
- # Installing smbfs
- Chroot_exec "aptitude install --assume-yes smbfs"
-
- # Unmount proc
- umount "${LIVE_CHROOT}"/proc
-
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
- then
- if [ ! -d "${LIVE_CHROOT}"/etc/initramfs-tools ]
- then
- mkdir "${LIVE_CHROOT}"/etc/initramfs-tools
- fi
-
- # Configuring initramfs for NFS
-cat >> "${LIVE_CHROOT}"/etc/initramfs-tools/initramfs.conf << EOF
-MODULES=netboot
-BOOT=nfs
-NFSROOT=auto
-EOF
- Chroot_exec "update-initramfs -tu"
- fi
-
- # Remove indices
- rm -rf "${LIVE_CHROOT}"/var/cache/apt
- mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial
- rm -rf "${LIVE_CHROOT}"/var/lib/apt/lists
- mkdir -p "${LIVE_CHROOT}"/var/lib/apt/lists/partial
-
- # Switching package indices to default
- if [ "${LIVE_GENERIC_INDICES}" = "yes" ]
- then
- Indices default
- fi
-
- # Deconfigure network
- Patch_network deapply
-
- # Deconfigure chroot
- Patch_runlevel deapply
- Patch_chroot deapply
-
- # Generating rootfs image
- Genrootfs
-
- # Configure chroot
- Patch_chroot apply
- Patch_runlevel apply
-
- # Configure network
- Patch_network apply
-
- # Remove indices
- rm -rf "${LIVE_CHROOT}"/var/cache/apt
- mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial
- rm -rf "${LIVE_CHROOT}"/var/lib/apt/lists
- mkdir -p "${LIVE_CHROOT}"/var/lib/apt/lists/partial
-
- # Switching package indices to custom
- Indices custom
-
- # Install depends
- if [ -z "${KEEP_MEMTEST86}" ]
- then
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
- then
- Patch_network apply
- Chroot_exec "aptitude install --assume-yes memtest86+"
- fi
- fi
-
- if [ -z "${KEEP_SYSLINUX}" ]
- then
- Patch_network apply
- Chroot_exec "aptitude install --assume-yes syslinux"
- fi
-
- # Installing syslinux
- Syslinux net
-
- # Installing linux-image
- Linuximage net
-
- # Installing memtest
- Memtest net
-
- # Remove depends
- if [ -z "${KEEP_SYSLINUX}" ]
- then
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
- then
- Chroot_exec "aptitude purge --assume-yes syslinux"
- fi
- fi
-
- if [ -z "${KEEP_SYSLINUX}" ]
- then
- Chroot_exec "aptitude purge --assume-yes syslinux"
- fi
-
- # Deconfigure network
- Patch_network deapply
-
- # Deconfigure chroot
- Patch_runlevel deapply
- Patch_chroot deapply
-
- # Creating tarball
- cd "${LIVE_ROOT}" && \
- mv binary "`basename ${LIVE_SERVER_PATH}`" && \
- cd .. && \
- tar cfz binary.tar.gz "`basename ${LIVE_ROOT}`/`basename ${LIVE_SERVER_PATH}`" "`basename ${LIVE_ROOT}`/tftpboot" && \
- mv binary.tar.gz "${LIVE_ROOT}" && \
- cd "${OLDPWD}" && \
- mv "`basename ${LIVE_SERVER_PATH}`" binary
-
- # Touching stage file
- touch "${LIVE_ROOT}"/.stage/image_binary
- fi
-
- if [ ! -f "${LIVE_ROOT}"/.stage/image_source ] && [ "${LIVE_SOURCE}" = "yes" ]
- then
- # Configure chroot
- Patch_chroot apply
- Patch_runlevel apply
-
- # Configure network
- Patch_network apply
-
- # Downloading sources
- Sources
-
- # Deconfigure network
- Patch_network deapply
-
- # Deconfigure chroot
- Patch_runlevel deapply
- Patch_chroot deapply
-
- # Creating tarball
- tar cfz source.tar.gz "${LIVE_ROOT}"/source
-
- # Touching stage file
- touch "${LIVE_ROOT}"/.stage/image_source
- fi
-}
diff --git a/src/scripts/24.usb.sh b/src/scripts/24.usb.sh
deleted file mode 100644
index 200ca35..0000000
--- a/src/scripts/24.usb.sh
+++ /dev/null
@@ -1,218 +0,0 @@
-#!/bin/sh
-
-# make-live - utility to build Debian Live systems
-#
-# Copyright (C) 2006 Daniel Baumann <daniel@debian.org>
-# Copyright (C) 2006 Marco Amadori <marco.amadori@gmail.com>
-#
-# make-live comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
-# This is free software, and you are welcome to redistribute it
-# under certain conditions; see COPYING for details.
-
-Usb ()
-{
- if [ ! -f "${LIVE_ROOT}"/.stage/image_binary ]
- then
- # Configure chroot
- Patch_chroot apply
- Patch_runlevel apply
-
- # Configure network
- Patch_network apply
-
- # Manifest
- mkdir -p "${LIVE_ROOT}"/binary/casper
- for MANIFEST in "${LIVE_ROOT}"/filesystem.manifest*
- do
- if [ -e "${MANIFEST}" ]; then
- mv "${MANIFEST}" "${LIVE_ROOT}"/binary/casper/
- fi
- done
-
- # Remove indices
- rm -rf "${LIVE_CHROOT}"/var/cache/apt
- mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial
- rm -rf "${LIVE_CHROOT}"/var/lib/apt/lists
- mkdir -p "${LIVE_CHROOT}"/var/lib/apt/lists/partial
-
- # Switching package indices to default
- if [ "${LIVE_GENERIC_INDICES}" = "yes" ]
- then
- Indices default
- fi
-
- # Deconfigure network
- Patch_network deapply
-
- # Deconfigure chroot
- Patch_runlevel deapply
- Patch_chroot deapply
-
- # Generating rootfs image
- Genrootfs
-
- # Mount proc
- mount proc-live -t proc "${LIVE_CHROOT}"/proc
-
- # Configure chroot
- Patch_chroot apply
- Patch_runlevel apply
-
- # Configure network
- Patch_network apply
-
- # Remove indices
- rm -rf "${LIVE_CHROOT}"/var/cache/apt
- mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial
- rm -rf "${LIVE_CHROOT}"/var/lib/apt/lists
- mkdir -p "${LIVE_CHROOT}"/var/lib/apt/lists/partial
-
- # Switching package indices to custom
- Indices custom
-
- # Install depends
- if [ -z "${KEEP_DOSFSTOOLS}" ]
- then
- Chroot_exec "aptitude install --assume-yes dosfstools"
- fi
-
- if [ -z "${KEEP_MEMTEST86}" ]
- then
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
- then
- Chroot_exec "aptitude install --assume-yes memtest86+"
- fi
- fi
-
- if [ -z "${KEEP_MTOOLS}" ]
- then
- Chroot_exec "aptitude install --assume-yes mtools"
- fi
-
- if [ -z "${KEEP_PARTED}" ]
- then
- Chroot_exec "aptitude install --assume-yes parted"
- fi
-
- if [ -z "${KEEP_SYSLINUX}" ]
- then
- Chroot_exec "aptitude install --assume-yes syslinux"
- fi
-
- # Installing syslinux
- Syslinux iso
-
- # Installing linux-image
- Linuximage iso
-
- # Installing memtest
- Memtest iso
-
- # Calculating md5sums
- Md5sum
-
- # Creating image
-
- # USB hacks
- mv "${LIVE_ROOT}"/binary/isolinux/isolinux.cfg "${LIVE_ROOT}"/binary/syslinux.cfg
- mv "${LIVE_ROOT}"/binary/isolinux/isolinux.bin "${LIVE_ROOT}"/binary/syslinux.bin
- mv "${LIVE_ROOT}"/binary/isolinux/* "${LIVE_ROOT}"/binary
- rmdir "${LIVE_ROOT}"/binary/isolinux/
-
- # Everything which comes here needs to be cleaned up,
- DU_DIM="`du -ms ${LIVE_ROOT}/binary | cut -f1`"
- REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here...
- dd if=/dev/zero of="${LIVE_ROOT}"/binary.img bs=1024k count=${REAL_DIM}
-
- echo "!!! The following error/warning messages can be ignored !!!"
- losetup_p "${LIVE_ROOT}"/binary.img 0
- set +e
- Chroot_exec "parted -s ${FREELO} mklabel msdos"
- Chroot_exec "parted -s ${FREELO} mkpartfs primary fat16 0.0 100%"
- Chroot_exec "parted -s ${FREELO} set 1 boot on"
- Chroot_exec "parted -s ${FREELO} set 1 lba off"
- set -e
- cat "${LIVE_CHROOT}"/usr/lib/syslinux/mbr.bin > ${FREELO}
- losetup -d ${FREELO}
-
- losetup_p "${LIVE_ROOT}"/binary.img 1
- Chroot_exec "mkfs.msdos -n DEBIAN_LIVE ${FREELO}"
- mkdir "${LIVE_ROOT}"/binary.tmp
- mount ${FREELO} "${LIVE_ROOT}"/binary.tmp
- cp -r "${LIVE_ROOT}"/binary/* "${LIVE_ROOT}"/binary.tmp
- umount "${LIVE_ROOT}"/binary.tmp
- rmdir "${LIVE_ROOT}"/binary.tmp
- Chroot_exec "syslinux ${FREELO}"
- losetup -d ${FREELO}
-
- echo "!!! The above error/warning messages can be ignored !!!"
-
- # Remove depends
- if [ -z "${KEEP_DOSFSTOOLS}" ]
- then
- Chroot_exec "aptitude purge --assume-yes dosfstools"
- fi
-
- if [ -z "${KEEP_MEMTEST86}" ]
- then
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
- then
- Chroot_exec "aptitude purge --assume-yes memtest86+"
- fi
- fi
-
- if [ -z "${KEEP_MTOOLS}" ]
- then
- Chroot_exec "aptitude purge --assume-yes mtools"
- fi
-
- if [ -z "${KEEP_PARTED}" ]
- then
- Chroot_exec "aptitude purge --assume-yes parted"
- fi
-
- if [ -z "${KEEP_SYSLINUX}" ]
- then
- Chroot_exec "aptitude purge --assume-yes syslinux"
- fi
-
- # Deconfigure network
- Patch_network deapply
-
- # Deconfigure chroot
- Patch_runlevel deapply
- Patch_chroot deapply
-
- # Unmount proc
- umount "${LIVE_CHROOT}"/proc
-
- # Touching stage file
- touch "${LIVE_ROOT}"/.stage/image_binary
- fi
-
- if [ ! -f "${LIVE_ROOT}"/.stage/image_source ] && [ "${LIVE_SOURCE}" = "yes" ]
- then
- # Configure chroot
- Patch_chroot apply
- Patch_runlevel apply
-
- # Configure network
- Patch_network apply
-
- # Downloading sources
- Sources
-
- # Deconfigure network
- Patch_network deapply
-
- # Deconfigure chroot
- Patch_runlevel deapply
- Patch_chroot deapply
-
- # Creating image
- tar cfz source.tar.gz "${LIVE_ROOT}"/source
-
- # Touching stage file
- touch "${LIVE_ROOT}"/.stage/image_source
- fi
-}