summaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/02defaults.sh63
-rw-r--r--src/scripts/11bootstrap.sh20
-rw-r--r--src/scripts/13hack.sh9
-rw-r--r--src/scripts/14chroot.sh10
-rw-r--r--src/scripts/21image.sh86
-rw-r--r--src/scripts/22iso.sh4
-rw-r--r--src/scripts/23net.sh4
7 files changed, 105 insertions, 91 deletions
diff --git a/src/scripts/02defaults.sh b/src/scripts/02defaults.sh
index dffa49018..f0ef328c5 100644
--- a/src/scripts/02defaults.sh
+++ b/src/scripts/02defaults.sh
@@ -54,33 +54,12 @@ Defaults ()
if [ -z "${LIVE_DISTRIBUTION}" ]
then
LIVE_DISTRIBUTION="testing"
- else
- case "${LIVE_DISTRIBUTION}" in
- "${CODENAME_OLDSTABLE}")
- LIVE_DISTRIBUTION="oldstable"
- ;;
-
- "${CODENAME_STABLE}")
- LIVE_DISTRIBUTION="stable"
- ;;
-
- "${CODENAME_TESTING}")
- LIVE_DISTRIBUTION="testing"
- ;;
-
- "${CODENAME_UNSTABLE}")
- LIVE_DISTRIBUTION="unstable"
- ;;
-
- experimental)
- LIVE_DISTRIBUTION="unstable"
- LIVE_DISTRIBUTION_EXPERIMENTAL="yes"
- ;;
+ fi
- *)
- LIVE_DISTRIBUTION="unstable"
- ;;
- esac
+ if [ "${LIVE_DISTRIBUTION}" = "experimental" ]
+ then
+ LIVE_DISTRIBUTION="unstable"
+ LIVE_DISTRIBUTION_EXPERIMENTAL="yes"
fi
# Set bootstrap flavour
@@ -161,6 +140,12 @@ Defaults ()
esac
fi
+ # 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}"
+ fi
+
# Set debian mirror
if [ -z "${LIVE_MIRROR}" ]
then
@@ -194,6 +179,32 @@ Defaults ()
fi
fi
+ # Set FTP proxy
+ if [ -z "${LIVE_PROXY_FTP}" ] && [ -n "${ftp_proxy}" ]
+ then
+ LIVE_PROXY_FTP="${ftp_proxy}"
+ export LIVE_PROXY_FTP
+ else
+ if [ -n "${LIVE_PROXY_FTP}" ] && [ "${LIVE_PROXY_FTP}" != "${ftp_proxy}" ]
+ then
+ ftp_proxy="${LIVE_PROXY_FTP}"
+ export ftp_proxy
+ fi
+ fi
+
+ # Set HTTP proxy
+ if [ -z "${LIVE_PROXY_HTTP}" ] && [ -n "${http_proxy}" ]
+ then
+ LIVE_PROXY_HTTP="${http_proxy}"
+ export LIVE_PROXY_HTTP
+ else
+ if [ -n "${LIVE_PROXY_HTTP}" ] && [ "${LIVE_PROXY_HTTP}" != "${http_proxy}" ]
+ then
+ http_proxy="${LIVE_PROXY_HTTP}"
+ export http_proxy
+ fi
+ fi
+
# Set debian sections
if [ -z "${LIVE_SECTION}" ]
then
diff --git a/src/scripts/11bootstrap.sh b/src/scripts/11bootstrap.sh
index f2f6c0ae7..9aee5ec96 100644
--- a/src/scripts/11bootstrap.sh
+++ b/src/scripts/11bootstrap.sh
@@ -13,25 +13,21 @@ Bootstrap ()
{
if [ ! -f "${LIVE_ROOT}"/.stage/bootstrap ]
then
- # Use proxy
- if [ -n "${LIVE_PROXY_FTP}" ] && [ -z "${ftp_proxy}" ]
- then
- export ftp_proxy="${LIVE_PROXY_FTP}"
- fi
-
- if [ -n "${LIVE_PROXY_HTTP}" ] && [ -z "${http_proxy}" ]
- then
- export http_proxy="${LIVE_PROXY_HTTP}"
- fi
-
# 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
- cdebootstrap --arch="${LIVE_ARCHITECTURE}" --flavour="${LIVE_FLAVOUR}" "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}"
+ cdebootstrap --arch="${LIVE_ARCHITECTURE}" --flavour="${LIVE_FLAVOUR}" ${SUITE_CONFIG} "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}"
+
+ # Remove unused packages
+ Chroot_exec "apt-get remove --purge --yes cdebootstrap-helper-diverts"
# Remove package cache
rm -rf "${LIVE_CHROOT}"/var/cache/bootstrap
diff --git a/src/scripts/13hack.sh b/src/scripts/13hack.sh
index bd3a33537..1f7b57a58 100644
--- a/src/scripts/13hack.sh
+++ b/src/scripts/13hack.sh
@@ -12,9 +12,12 @@
Hack_xorg ()
{
# xserver-xorg << 7.1
- if [ -f "${LIVE_CHROOT}/etc/X11/xorg.conf" ] && [ "${LIVE_DISTRIBUTION}" = "testing" ]
+ if [ -f "${LIVE_CHROOT}/etc/X11/xorg.conf" ]
then
- # Comment "BusID" line and set driver to "vesa"
- sed -i -e 's/\(^.*BusID.*\)/#\1/g' -e '/Section "Device"/,/EndSection/ s/\(.*Driver.*"\).*\(".*\)/\1vesa\2/g' "${LIVE_CHROOT}"/etc/X11/xorg.conf
+ if [ "${LIVE_DISTRIBUTION}" = "testing" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_TESTING}" ]
+ then
+ # Comment "BusID" line and set driver to "vesa"
+ sed -i -e 's/\(^.*BusID.*\)/#\1/g' -e '/Section "Device"/,/EndSection/ s/\(.*Driver.*"\).*\(".*\)/\1vesa\2/g' "${LIVE_CHROOT}"/etc/X11/xorg.conf
+ fi
fi
}
diff --git a/src/scripts/14chroot.sh b/src/scripts/14chroot.sh
index b65071213..5b226e1f9 100644
--- a/src/scripts/14chroot.sh
+++ b/src/scripts/14chroot.sh
@@ -34,7 +34,7 @@ Chroot ()
Indices custom
# Install secure apt
- if [ "${LIVE_DISTRIBUTION}" = "testing" ] || [ "${LIVE_DISTRIBUTION}" = "unstable" ]
+ if [ "${LIVE_DISTRIBUTION}" = "testing" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_TESTING}" ] || [ "${LIVE_DISTRIBUTION}" = "unstable" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_UNSTABLE}" ]
then
if [ "${LIVE_FLAVOUR}" != "minimal" ]
then
@@ -65,7 +65,7 @@ Chroot ()
Patch_linux apply
# Install linux-image, modules and casper
- Chroot_exec "apt-get install --yes --force-yes linux-image-2.6-${LIVE_KERNEL} squashfs-modules-2.6-${LIVE_KERNEL} unionfs-modules-2.6-${LIVE_KERNEL} casper"
+ Chroot_exec "apt-get install --yes --force-yes ${LIVE_KERNEL_PACKAGES} casper"
# Deconfigure linux-image
Patch_linux deapply
@@ -159,16 +159,10 @@ Chroot ()
Chroot_exec "dpkg-query -W \*" | awk '$2 ~ /./ {print $1 " " $2 }' > "${LIVE_ROOT}"/filesystem.manifest-desktop
fi
- # Remove unused packages
- Chroot_exec "apt-get remove --purge --yes cdebootstrap-helper-diverts"
-
# Clean apt packages cache
rm -rf "${LIVE_CHROOT}"/var/cache/apt
mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial
- # Remove cdebootstrap packages cache
- rm -rf "${LIVE_CHROOT}"/var/cache/bootstrap
-
# Unmount proc
umount "${LIVE_CHROOT}"/proc
diff --git a/src/scripts/21image.sh b/src/scripts/21image.sh
index 1bab3e1fa..57c3d9fcf 100644
--- a/src/scripts/21image.sh
+++ b/src/scripts/21image.sh
@@ -15,35 +15,38 @@ Indices ()
custom)
# Configure custom sources.list
case "${LIVE_DISTRIBUTION}" in
- oldstable)
- echo "deb ${LIVE_MIRROR} oldstable ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src ${LIVE_MIRROR} oldstable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb ${LIVE_MIRROR_SECURITY} oldstable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src ${LIVE_MIRROR_SECURITY} oldstable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- ;;
+ oldstable|"${CODENAME_OLDSTABLE}"|stable|"${CODENAME_STABLE}"|testing|"${CODENAME_TESTING}")
+ echo "deb ${LIVE_MIRROR} ${LIVE_DISTRIBUTION} ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
- stable)
- echo "deb ${LIVE_MIRROR} stable ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src ${LIVE_MIRROR} stable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb ${LIVE_MIRROR_SECURITY} stable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src ${LIVE_MIRROR_SECURITY} stable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- ;;
+ if [ "${LIVE_SOURCE}" = "yes" ]
+ then
+ echo "deb-src ${LIVE_MIRROR} ${LIVE_DISTRIBUTION} ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ fi
+
+ echo "deb ${LIVE_MIRROR_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- testing)
- echo "deb ${LIVE_MIRROR} testing ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src ${LIVE_MIRROR} testing ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb ${LIVE_MIRROR_SECURITY} testing/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src ${LIVE_MIRROR_SECURITY} testing/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ if [ "${LIVE_SOURCE}" = "yes" ]
+ then
+ echo "deb-src ${LIVE_MIRROR_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ fi
;;
- unstable)
+ unstable|"${CODENAME_UNSTABLE}")
echo "deb ${LIVE_MIRROR} unstable ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src ${LIVE_MIRROR} unstable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+
+ if [ "${LIVE_SOURCE}" = "yes" ]
+ then
+ echo "deb-src ${LIVE_MIRROR} unstable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ fi
if [ "${LIVE_DISTRIBUTION_EXPERIMENTAL}" = "yes" ]
then
echo "deb ${LIVE_MIRROR} experimental ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src ${LIVE_MIRROR} experimental ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+
+ if [ "${LIVE_SOURCE}" = "yes" ]
+ then
+ echo "deb-src ${LIVE_MIRROR} experimental ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ fi
cat > "${LIVE_CHROOT}"/etc/apt/preferences << EOF
Package: *
@@ -58,35 +61,38 @@ EOF
default)
# Configure default sources.list
case "${LIVE_DISTRIBUTION}" in
- oldstable)
- echo "deb http://ftp.debian.org/debian/ oldstable ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src http://ftp.debian.org/debian/ oldstable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb http://security.debian.org/ oldstable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src http://security.debian.org/ oldstable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- ;;
+ oldstable|"${CODENAME_OLDSTABLE}"|stable|"${CODENAME_STABLE}"|testing|"${CODENAME_TESTING}")
+ echo "deb http://ftp.debian.org/debian/ ${LIVE_DISTRIBUTION} ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
- stable)
- echo "deb http://ftp.debian.org/debian/ stable ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src http://ftp.debian.org/debian/ stable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb http://security.debian.org/ stable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src http://security.debian.org/ stable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- ;;
+ if [ "${LIVE_SOURCE}" = "yes" ]
+ then
+ echo "deb-src http://ftp.debian.org/debian/ ${LIVE_DISTRIBUTION} ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ fi
+
+ echo "deb http://security.debian.org/ ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- testing)
- echo "deb http://ftp.debian.org/debian/ testing ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src http://ftp.debian.org/debian/ testing ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb http://security.debian.org/ testing/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src http://security.debian.org/ testing/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ if [ "${LIVE_SOURCE}" = "yes" ]
+ then
+ echo "deb-src http://security.debian.org/ ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ fi
;;
- unstable)
+ unstable|"${CODENAME_UNSTABLE}")
echo "deb http://ftp.debian.org/debian/ unstable ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src http://ftp.debian.org/debian/ unstable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+
+ if [ "${LIVE_SOURCE}" = "yes" ]
+ then
+ echo "deb-src http://ftp.debian.org/debian/ unstable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ fi
if [ "${LIVE_DISTRIBUTION_EXPERIMENTAL}" = "yes" ]
then
echo "deb http://ftp.debian.org/debian/ experimental ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb-src http://ftp.debian.org/debian/ experimental ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+
+ if [ "${LIVE_SOURCE}" = "yes" ]
+ then
+ echo "deb-src http://ftp.debian.org/debian/ experimental ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ fi
fi
;;
esac
diff --git a/src/scripts/22iso.sh b/src/scripts/22iso.sh
index 508876847..6f60a5ffb 100644
--- a/src/scripts/22iso.sh
+++ b/src/scripts/22iso.sh
@@ -23,7 +23,9 @@ Iso ()
mkdir -p "${LIVE_ROOT}"/binary/casper
for MANIFEST in "${LIVE_ROOT}"/filesystem.manifest*
do
- mv "${MANIFEST}" "${LIVE_ROOT}"/binary/casper/
+ if [ -e "${MANIFEST}" ]; then
+ mv "${MANIFEST}" "${LIVE_ROOT}"/binary/casper/
+ fi
done
# Remove indices
diff --git a/src/scripts/23net.sh b/src/scripts/23net.sh
index 78a036157..3f973e008 100644
--- a/src/scripts/23net.sh
+++ b/src/scripts/23net.sh
@@ -25,7 +25,9 @@ Net ()
for MANIFEST in "${LIVE_ROOT}"/filesystem.manifest*
do
- mv "${MANIFEST}" "${LIVE_ROOT}"/binary/casper/
+ if [ -e "${MANIFEST}" ]; then
+ mv "${MANIFEST}" "${LIVE_ROOT}"/binary/casper/
+ fi
done
# Mount proc