[pkg-fso-commits] [SCM] Various non-packaged files branch, master, updated. 683d0f8748bc33ec4f6ffeec09d6f1ed1540a046
Steffen Moeller
moeller at debian.org
Sat Aug 29 10:02:27 UTC 2009
The following commit has been merged in the master branch:
commit 683d0f8748bc33ec4f6ffeec09d6f1ed1540a046
Author: Steffen Moeller <moeller at debian.org>
Date: Sat Aug 29 12:00:52 2009 +0200
Added --bootstrapper option
The user can now select an alternative to cdebootstrap in
times like these that debootstrap would sound like an
interesting alternative.
diff --git a/install.sh b/install.sh
index 5f7c497..740c735 100755
--- a/install.sh
+++ b/install.sh
@@ -42,7 +42,10 @@ lc () {
# user variables
APT_OPTIONS=${APT_OPTIONS:- --yes}
APT_RECOMMENDS=${APT_RECOMMENDS:-false}
+BOOTSTRAPPER=${BOOTSTRAPPER:-debootstrap}
+CDEBOOTSTRAP_EXTRA_FLAGS=${CDEBOOTSTRAP_EXTRA_FLAGS:-}
DASH_BINSH=${DASH_BINSH:-true}
+DEBOOTSTRAP_EXTRA_FLAGS=${DEBOOTSTRAP_EXTRA_FLAGS:-}
DISPLAY_MANAGER=${DISPLAY_MANAGER:-nodm}
FSO_MIRROR=${FSO_MIRROR:-http://pkg-fso.alioth.debian.org/debian}
INST_DIR=${INST_DIR:-/mnt/debian}
@@ -60,7 +63,7 @@ SINGLE_PART=${SINGLE_PART:-$QI}
ZHONE=${ZHONE:-true}
# hardening for the case that a user uses capitals
-lc SD_PART1_FS SD_PART2_FS APT_RECOMMENDS QI QI_VERBOSE_BOOT FSO_DEVICE
+lc APT_RECOMMENDS BOOTSTRAPPER FSO_DEVICE QI QI_VERBOSE_BOOT SD_PART1_FS SD_PART2_FS
# device autodetection if the user has not set FSO_DEVICE
FSO_DEVICE_AUTODETECTED=`grep GTA /proc/cpuinfo | awk '{print $3}' | tr "[:upper:]" "[:lower:]"`
@@ -88,11 +91,19 @@ intern_no_partitioning=""
# cdebootstrap options
# with packages for a basic debian with network connectivity
+
+
CDEBOOTSTRAP_FLAVOUR=minimal
+DEBOOTSTRAP_VARIANT=minbase
CDEBOOTSTRAP_PACKAGE=$INST_MIRROR/pool/main/c/cdebootstrap/cdebootstrap-static_0.5.5_armel.deb
-CDEBOOTSTRAP_EXTRA_PACKAGES=ifupdown,dropbear,udev,procps,netbase,vim-tiny,module-init-tools,wget,openssh-client
-# This gets passed to cdebuildstrap. currently not used
-CDEBOOTSTRAP_EXCLUDE_PACKAGES=hello
+DEBOOTSTRAP_PACKAGE=$INST_MIRROR/pool/main/d/debootstrap/debootstrap_1.0.15_all.deb
+CDEBOOTSTRAP_EXTRA_PACKAGES=
+DEBOOTSTRAP_EXTRA_PACKAGES=install-info
+# This gets passed to boot strappers. currently not used
+BOOTSTRAP_EXCLUDE_PACKAGES=hello
+
+# Those packages should be installed with every Debian install, invariant of the bootstrapper used.
+DEBIAN_EXTRA_PACKAGES=ifupdown,dropbear,udev,procps,netbase,vim-tiny,module-init-tools,wget,openssh-client
# freesmartphone.org packages
# because of some apt-get bug, console-setup must be listed
@@ -245,8 +256,8 @@ DESCRIPTION
adapt to local preferences.
The individual stages are described below. The script uses
- cdebootstrap to prepare a directory to which it can chroot(8)
- and complete the configuration.
+ cdebootstrap or debootstrap to prepare a directory to which
+ it can chroot(8) and complete the configuration.
ENVIRONMENT
@@ -275,8 +286,18 @@ ENVIRONMENT
'$LOCALEPURGE').
APT_RECOMMENDS control if APT should install recommends by default
(set to '$APT_RECOMMENDS', possible values are false/true)
+ BOOTSTRAPPER determines the bootstrapper to use, should be set to
+ deboostrap or cdebootstrap - cdebootstrap is somewhat
+ faster and you may have to "opkg install perl", but it
+ seems to work less reliably (set to '$BOOTSTRAPPER').
+ CDEBOOTSTRAP_EXTRA_FLAGS
+ Parameters to be added to invocation of cdebootstrap,
+ only active if BOOTSTRAPPER is not set to debootstrap.
DASH_BINSH configure dash as default /bin/sh (set to '$DASH_BINSH',
possible values are true/false)
+ DEBOOTSTRAP_EXTRA_FLAGS
+ Parameters to be added to invocation of debootstrap,
+ only active if BOOTSTRAPPER is not set to cdebootstrap.
FSO_MIRROR the Debian freesmartphone.org repository (set to
'$FSO_MIRROR')
FSO_DEVICE the device the installation is being performed on
@@ -382,6 +403,8 @@ OPTIONS
sets the TASKS variable
--with-localepurge
will install the localepurge package
+ --bootstrapper (debootstrap|cdebootstrap)
+ sets the BOOTSTRAPPER variable
EXAMPLE
@@ -799,23 +822,59 @@ action_mount () {
action_debian () {
echo "Install a basic Debian system"
- echo " * Downloading cdebootstrap package '`basename $CDEBOOTSTRAP_PACKAGE`'"
- wget $CDEBOOTSTRAP_PACKAGE -O /tmp/cdebootstrap.deb
+ intern_bootstrapper_package=
+ if [ "cdebootstrap" = "$BOOTSTRAPPER" ]; then
+ intern_bootstrapper_package=$CDEBOOTSTRAP_PACKAGE
+ elif [ "debootstrap" = "$BOOTSTRAPPER" ]; then
+ intern_bootstrapper_package=$DEBOOTSTRAP_PACKAGE
+ else
+ echo "Unknown bootstrapper: '$BOOTSTRAPPER'"
+ exit 1
+ fi
+
+ echo " * Downloading bootstrapper package '`basename $intern_bootstrapper_package`'"
+
+ internal_localpackagename=/tmp/debootstrapOrCdebootstrap.deb
+ wget $intern_bootstrapper_package -O "$internal_localpackagename"
rm -f /tmp/data.tar.gz # FIXME: ar should just overwrite it
- ( cd /tmp && ar -x cdebootstrap.deb data.tar.gz )
+ ( cd /tmp && ar -x "$internal_localpackagename" data.tar.gz )
+ rm -f "$internal_localpackagename"
$TAR_APPLICATION -xz -C / -f /tmp/data.tar.gz
rm -f /tmp/data.tar.gz
- rm -f /tmp/cdebootstrap.deb
- echo " * Running cdebootstrap to install the system (might take a while)"
- CDEBOOTSTRAP_EXTRA_FLAGS=""
+ echo " * Running '$BOOTSTRAPPER' to install the system (might take a while)"
if [ -n "$VERBOSE" ]; then
- CDEBOOTSTRAP_EXTRA_FLAGS="$CDEBOOTSTRAP_EXTRA_FLAGS -v"
+ if [ "cdebootstrap" = "$BOOTSTRAPPER" ]; then
+ CDEBOOTSTRAP_EXTRA_FLAGS="$CDEBOOTSTRAP_EXTRA_FLAGS -v"
+ echo " CDEBOOTSTRAP_VARIANT='$CDEBOOTSTRAP_VARIANT'"
+ echo " CDEBOOTSTRAP_EXTRA_FLAGS='$CDEBOOTSTRAP_EXTRA_FLAGS'"
+ echo " CDEBOOTSTRAP_EXTRA_PACKAGES='$CDEBOOTSTRAP_EXTRA_PACKAGES'"
+ elif [ "debootstrap" = "$BOOTSTRAPPER" ]; then
+ DEBOOTSTRAP_EXTRA_FLAGS="$DEBOOTSTRAP_EXTRA_FLAGS --verbose"
+ echo " DEBOOTSTRAP_VARIANT='$DEBOOTSTRAP_VARIANT'"
+ echo " DEBOOTSTRAP_EXTRA_FLAGS='$DEBOOTSTRAP_EXTRA_FLAGS'"
+ echo " DEBOOTSTRAP_EXTRA_PACKAGES='$DEBOOTSTRAP_EXTRA_PACKAGES'"
+ fi
fi
- cdebootstrap-static $CDEBOOTSTRAP_EXTRA_FLAGS --allow-unauthenticated --flavour $CDEBOOTSTRAP_FLAVOUR \
- --exclude=$CDEBOOTSTRAP_EXCLUDE_PACKAGES sid "$INST_DIR" $INST_MIRROR
- # Bug #542955 (won't fix) directs us to use apt-get for versioned (direct or indirect) dependencies
- # The CDEBOOTSTRAP_EXTRA_PACKAGES are consequently installed in the action_apt
+
+ if [ "cdebootstrap" = "$BOOTSTRAPPER" ]; then
+ cdebootstrap $CDEBOOTSTRAP_EXTRA_FLAGS --allow-unauthenticated --flavour $CDEBOOTSTRAP_FLAVOUR \
+ --exclude=$BOOTSTRAP_EXCLUDE_PACKAGES \
+ --include=$CDEBOOTSTRAP_EXTRA_PACKAGES \
+ sid "$INST_DIR" $INST_MIRROR
+ elif [ "debootstrap" = "$BOOTSTRAPPER" ]; then
+ debootstrap --arch=armel $DEBOOTSTRAP_EXTRA_FLAGS --variant $DEBOOTSTRAP_VARIANT \
+ --exclude=$BOOTSTRAP_EXCLUDE_PACKAGES \
+ --include=$DEBOOTSTRAP_EXTRA_PACKAGES \
+ sid "$INST_DIR" $INST_MIRROR
+ else # redundant, but when things go wrong, then things go wrong, left as precaution
+ echo "Unknown bootstrapper: '$BOOTSTRAPPER'"
+ exit 1
+ fi
+
+ # Bug #542955 (won't fix) for cdebootstrap directs us to use apt-get for versioned
+ # (direct or indirect) dependencies. The DEBIAN_EXTRA_PACKAGES are consequently
+ # installed in the action_apt
echo "I: Basic Debian system installed - please also install apt"
}
@@ -867,7 +926,8 @@ __END__
chroot $INST_DIR apt-get $APT_OPTIONS install pkg-fso-keyring
echo " * Completing install of Debian basic packages to circumvent bug #542955"
- chroot "$INST_DIR" apt-get $APT_OPTIONS install $(echo $CDEBOOTSTRAP_EXTRA_PACKAGES | tr "," " ")
+
+ chroot "$INST_DIR" apt-get $APT_OPTIONS install $(echo $DEBIAN_EXTRA_PACKAGES | tr "," " ")
echo " * Cleaning APT cache"
chroot $INST_DIR apt-get clean
@@ -1466,6 +1526,10 @@ do
assignParametername="$i"
assignVariablename="APT_OPTIONS"
;;
+ "--bootstrapper")
+ assignParametername="$i"
+ assignVariablename="BOOTSTRAPPER"
+ ;;
"--hostname")
assignParametername="$i"
assignVariablename="HOSTNAME"
--
Various non-packaged files
More information about the pkg-fso-commits
mailing list