summaryrefslogtreecommitdiff
path: root/helpers/lh_bootstrap_cdebootstrap
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:04:48 +0200
committerDaniel Baumann <daniel@debian.org>2007-09-23 10:04:48 +0200
commit544384c28f648c04336b6bea17f5a05ab6045ca0 (patch)
tree4bbc1758ceaa46c5e81fe9d66ccdaacfec047ef8 /helpers/lh_bootstrap_cdebootstrap
parentf4383da69d4642521cb07f8f970d9c9c759b44ee (diff)
downloadvyos-live-build-544384c28f648c04336b6bea17f5a05ab6045ca0.tar.gz
vyos-live-build-544384c28f648c04336b6bea17f5a05ab6045ca0.zip
Adding live-helper 1.0~a3-1.
Diffstat (limited to 'helpers/lh_bootstrap_cdebootstrap')
-rwxr-xr-xhelpers/lh_bootstrap_cdebootstrap60
1 files changed, 39 insertions, 21 deletions
diff --git a/helpers/lh_bootstrap_cdebootstrap b/helpers/lh_bootstrap_cdebootstrap
index e4b83a2e7..b6ea6b910 100755
--- a/helpers/lh_bootstrap_cdebootstrap
+++ b/helpers/lh_bootstrap_cdebootstrap
@@ -1,6 +1,11 @@
#!/bin/sh
# lh_bootstrap_cdebootstrap(1) - bootstrap a Debian system with cdebootstrap(1)
+# 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 cdebootstrap(1)"
+HELP=""
+USAGE="${PROGRAM} [--force]"
+
+Arguments "${@}"
+
# Ensure that a system is built as root
lh_testroot
@@ -44,26 +56,26 @@ then
CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --suite-config=${LIVE_DISTRIBUTION_CONFIG}"
fi
-if [ "${LIVE_FLAVOUR}" = "mini" ] || [ "${LIVE_FLAVOUR}" = "minimal" ] || [ "${LIVE_FLAVOUR}" = "minimal-net" ]
+if [ "${LIVE_PACKAGES_LISTS}" != "minimal" ] && [ "${LIVE_PACKAGES_LISTS}" != "mini" ]
then
- CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --flavour=minimal"
-else
CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --flavour=standard"
+else
+ CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --flavour=minimal"
fi
if [ -x "/usr/bin/cdebootstrap" ]
then
- # Restore old cache
- if [ -d cache/bootstrap ]
- then
- mkdir -p chroot/var/cache/bootstrap
- cp cache/bootstrap/*.deb chroot/var/cache/bootstrap
- fi
-
if [ "${LH_CACHE}" = "enabled" ]
then
+ # Restore old cache
+ if [ -d cache/bootstrap ]
+ then
+ mkdir -p chroot/var/cache/bootstrap
+ cp cache/bootstrap/*.deb chroot/var/cache/bootstrap
+ fi
+
# Executing cdebootstrap (download-only)
- cdebootstrap ${CDEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_LOCAL}"
+ cdebootstrap ${CDEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BUILD}"
# Removing old cache
if [ -d cache/bootstrap ]
@@ -81,17 +93,23 @@ then
fi
# Executing cdebootstrap (regular run)
- cdebootstrap ${CDEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_LOCAL}"
+ cdebootstrap ${CDEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BUILD}"
+
+ # Remove cdebootstrap-helper-diverts (needed at least for minimal flavours)
+ if [ "${LIVE_BOOTSTRAP_FLAVOUR}" = "minimal" ] || [ "${LIVE_BOOTSTRAP_FLAVOUR}" = "mini" ]
+ then
+ Chroot "dpkg -P cdebootstrap-helper-diverts"
+ fi
+
+ # Removing bootstrap cache
+ if [ -d chroot/var/cache/bootstrap ]
+ then
+ rm -rf chroot/var/cache/bootstrap
+ fi
+
+ # Creating stage file
+ Create_stagefile .stage/bootstrap
else
echo "E: Can't process file /usr/bin/cdebootstrap (FIXME)"
exit 1
fi
-
-# Removing bootstrap cache
-if [ -d chroot/var/cache/bootstrap ]
-then
- rm -rf chroot/var/cache/bootstrap
-fi
-
-# Creating stage file
-Create_stagefile .stage/bootstrap