summaryrefslogtreecommitdiff
path: root/helpers/lh_bootstrap_debootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/lh_bootstrap_debootstrap')
-rwxr-xr-xhelpers/lh_bootstrap_debootstrap42
1 files changed, 27 insertions, 15 deletions
diff --git a/helpers/lh_bootstrap_debootstrap b/helpers/lh_bootstrap_debootstrap
index 8ff83af..ab7ac6b 100755
--- a/helpers/lh_bootstrap_debootstrap
+++ b/helpers/lh_bootstrap_debootstrap
@@ -1,6 +1,11 @@
#!/bin/sh
# lh_bootstrap_debootstrap(1) - bootstrap a Debian system with debootstrap(8)
+# Copyright (C) 2006-2007 Daniel Baumann <daniel@debian.org>
+#
+# live-helper 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.
set -e
@@ -10,6 +15,13 @@ do
. ${FUNCTION}
done
+# Set static variables
+DESCRIPTION="bootstrap a Debian system with debootstrap(8)"
+HELP=""
+USAGE="${PROGRAM} [--force]"
+
+Arguments "${@}"
+
# Ensure that a system is built as root
lh_testroot
@@ -46,17 +58,17 @@ fi
if [ -x "/usr/sbin/debootstrap" ]
then
- # Restore old cache
- if [ -d cache/bootstrap ]
- then
- mkdir -p chroot/var/cache/apt/archives
- cp cache/bootstrap/*.deb chroot/var/cache/apt/archives
- fi
-
if [ "${LH_CACHE}" = "enabled" ]
then
+ # Restore old cache
+ if [ -d cache/bootstrap ]
+ then
+ mkdir -p chroot/var/cache/apt/archives
+ cp cache/bootstrap/*.deb chroot/var/cache/apt/archives
+ fi
+
# Executing debootstrap (download-only)
- debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_LOCAL}" "${LIVE_DEBOOTSTRAP_SCRIPT}"
+ debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BUILD}" "${LIVE_DEBOOTSTRAP_SCRIPT}"
# Removing old cache
if [ -d cache/bootstrap ]
@@ -74,14 +86,14 @@ then
fi
# Executing debootstrap (regular run)
- debootstrap ${DEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_LOCAL}" "${LIVE_DEBOOTSTRAP_SCRIPT}"
+ debootstrap ${DEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BUILD}" "${LIVE_DEBOOTSTRAP_SCRIPT}"
+
+ # Removing bootstrap cache
+ rm -rf chroot/var/cache/apt/archives/*.deb
+
+ # Creating stage file
+ Create_stagefile .stage/bootstrap
else
echo "E: Can't process file /usr/bin/debootstrap (FIXME)"
exit 1
fi
-
-# Removing bootstrap cache
-rm -rf chroot/var/cache/apt/archives/*.deb
-
-# Creating stage file
-Create_stagefile .stage/bootstrap