# HG changeset patch # User Paul Boddie # Date 1371337283 -7200 # Node ID 75fcdce9e2a9ff56932a20bff070c04bbf7c534b # Parent a38896d768ca944973518c4f047172a2685fb9cb Added tentative support for multistrap usage. diff -r a38896d768ca -r 75fcdce9e2a9 user-setup --- a/user-setup Sun Jun 16 01:00:18 2013 +0200 +++ b/user-setup Sun Jun 16 01:01:23 2013 +0200 @@ -22,12 +22,12 @@ . /etc/default/userinstall else echo "No defaults found for userinstall." 1>&2 - exit 1 + exit 1 fi if [ "$1" = "--help" ]; then - cat 1>&2 < ] + cat 1>&2 < ] ] ] [ ] Examples: @@ -35,11 +35,25 @@ user-setup file:///tmp/$USERINSTALL_CODENAME/ user-setup http://ftp.xx.debian.org/debian/ user-setup --root http://ftp.xx.debian.org/debian/ +user-setup --root --multistrap http://ftp.xx.debian.org/debian/ EOF - exit 1 + exit 1 elif [ "$1" = '--root' ]; then AS_ROOT="$1" - shift 1 + shift 1 + if [ "$1" = '--multistrap' ]; then + USE_MULTISTRAP="$1" + shift 1 + if [ "$1" = '-f' ]; then + MULTISTRAP_CONFIG="$2" + shift 2 + elif [ ! -e "userinstall-multistrap" ]; then + MULTISTRAP_CONFIG="userinstall-multistrap" + else + echo "Any existing multistrap configuration file must be specified using the -f option." 1>&2 + exit 1 + fi + fi fi if [ ! "$PACKAGEROOT" ] || [ "$PACKAGEROOT" = '/' ]; then @@ -50,14 +64,48 @@ MIRROR="$1" PATH=$PATH${PATH:+:}/usr/sbin:/sbin -if [ "$AS_ROOT" ]; then +# For multistrap, make a configuration file and use it to invoke multistrap. + +if [ "$USE_MULTISTRAP" ]; then + if [ ! -e "$MULTISTRAP_CONFIG" ]; then + DEBIAN_ARCH=`dpkg-architecture -qDEB_BUILD_ARCH` + cat > "$MULTISTRAP_CONFIG" <&2 <&2 <