summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@debian.org>2007-10-16 18:48:53 (GMT)
committerOtavio Salvador <otavio@debian.org>2007-10-16 18:48:53 (GMT)
commitfdbc5419ac4d46d91a11e17d37f8f4acb8b85a9f (patch)
tree0d9fa88081f8dadba60729f7932bf23e103e27bd
parent293e4ef5ae32931b708e315bd936eaaa512b4b00 (diff)
downloaddebootstrap-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
-rw-r--r--debian/changelog8
-rwxr-xr-xdebootstrap23
-rw-r--r--debootstrap.84
3 files changed, 33 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 199483d..6583f8d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+debootstrap (1.0.4) UNRELEASED; urgency=low
+
+ [ Neil Williams ]
+ * Add --second-stage-target option that allows embedded to to test an
+ installation in a chroot on the device (closes: #445157).
+
+ -- Otavio Salvador <otavio@debian.org> Tue, 16 Oct 2007 16:47:55 -0200
+
debootstrap (1.0.3) unstable; urgency=low
* Ignore errors when unmounting filesystems, to avoid stopping at the
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
diff --git a/debootstrap.8 b/debootstrap.8
index d4d8242..86b8860 100644
--- a/debootstrap.8
+++ b/debootstrap.8
@@ -92,6 +92,10 @@ installed as /debootstrap/debootstrap in the target filesystem.
Complete the bootstrapping process. Other arguments are generally not
needed.
.IP
+.IP "\fB\-\-second\-stage\-target DIR\fP"
+Run second stage in a subdirectory instead of root. (can be used to create
+a foreign chroot) (requires --second-stage)
+.IP
.IP "\fB\-\-keep\-debootstrap\-dir\fP"
Don't delete the /debootstrap directory in the target after completing the
installation.