diff options
author | Otavio Salvador <otavio@debian.org> | 2007-10-16 18:48:53 (GMT) |
---|---|---|
committer | Otavio Salvador <otavio@debian.org> | 2007-10-16 18:48:53 (GMT) |
commit | fdbc5419ac4d46d91a11e17d37f8f4acb8b85a9f (patch) | |
tree | 0d9fa88081f8dadba60729f7932bf23e103e27bd /debootstrap | |
parent | 293e4ef5ae32931b708e315bd936eaaa512b4b00 (diff) | |
download | debootstrap-fdbc5419ac4d46d91a11e17d37f8f4acb8b85a9f.zip debootstrap-fdbc5419ac4d46d91a11e17d37f8f4acb8b85a9f.tar.gz debootstrap-fdbc5419ac4d46d91a11e17d37f8f4acb8b85a9f.tar.bz2 |
Add --second-stage-target option that allows embedded to to test an installation in a chroot on the device (closes: #445157).
r49793
Diffstat (limited to 'debootstrap')
-rwxr-xr-x | debootstrap | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/debootstrap b/debootstrap index ec9dfa0..8ba7769 100755 --- a/debootstrap +++ b/debootstrap @@ -87,7 +87,10 @@ usage() --unpack-tarball T acquire .debs from a tarball instead of http --make-tarball T download .debs and create a tarball (tgz format) - + --second-stage-target DIR + Run second stage in a subdirectory instead of root + (can be used to create a foreign chroot) + (requires --second-stage) --boot-floppies used for internal purposes by boot-floppies --debian-installer used for internal purposes by debian-installer EOF @@ -142,6 +145,18 @@ if [ $# != 0 ] ; then SECOND_STAGE_ONLY=true shift ;; + --second-stage-target) + if [ "$SECOND_STAGE_ONLY" = "true" ] ; then + if [ -n "$2" ] ; then + CHROOTDIR="$2" + shift 2 + else + error 1 NEEDARG "option requires an argument: %s" "$1" + fi + else + error 1 NEEDARG "%s only applies in the second stage" "$1" + fi + ;; --print-debs) WHAT_TO_DO="finddebs printdebs kill_target" shift @@ -242,7 +257,11 @@ if [ "$SECOND_STAGE_ONLY" = "true" ]; then VARIANT=$(cat $DEBOOTSTRAP_DIR/variant) SUPPORTED_VARIANTS="$VARIANT" fi - TARGET=/ + if [ "$CHROOTDIR" = "" ]; then + TARGET=/ + else + TARGET=$CHROOTDIR + fi SCRIPT=$DEBOOTSTRAP_DIR/suite-script else if [ "$1" = "" -o "$2" = "" ]; then |