From 26ae52971b21e14c6c81af3b8aa0211bc3553dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 6 Sep 2016 14:33:53 +0100 Subject: Excise all devices.tar.gz code Since bug #571136 was fixed the --second-stage doesn't even use the devices tarball so we can remove all its related cruft. The README has been updated to show when real root access is required and give an example of a foreign debootstrap which works with fakeroot. --- .gitignore | 1 - Makefile | 25 ------------------------- README | 18 ++++++++++++++---- debian/changelog | 7 +++++++ debootstrap | 3 --- functions | 8 +------- 6 files changed, 22 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index 8b3512f..8b13789 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -devices.tar.gz diff --git a/Makefile b/Makefile index 1020cbc..55f229d 100644 --- a/Makefile +++ b/Makefile @@ -2,17 +2,9 @@ VERSION := $(shell sed 's/.*(\(.*\)).*/\1/; q' debian/changelog) DATE := $(shell sed -n '/^ -- /{s/.*> \(.*\)/\1/p;q;}' debian/changelog) -MAKEDEV ?= /sbin/MAKEDEV - -ifeq ($(shell uname),Linux) -all: devices.tar.gz -else all: -endif clean: - rm -f devices.tar.gz - rm -rf dev DSDIR=$(DESTDIR)/usr/share/debootstrap install: @@ -25,20 +17,3 @@ install: sed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)/usr/sbin/debootstrap chown root:root $(DESTDIR)/usr/sbin/debootstrap chmod 0755 $(DESTDIR)/usr/sbin/debootstrap - -ifeq ($(shell uname),Linux) - install -o root -g root -m 0644 devices.tar.gz $(DSDIR)/ -endif - -devices.tar.gz: - rm -rf dev - mkdir -p dev - chown 0:0 dev - chmod 755 dev - (cd dev && $(MAKEDEV) std ptmx fd consoleonly) - tar --mtime="$(DATE)" -cf - dev | gzip -9n >devices.tar.gz - @if [ "$$(tar tvf devices.tar.gz | wc -l)" -lt 2 ]; then \ - echo " ** devices.tar.gz is empty!" >&2; \ - exit 1; \ - fi - rm -rf dev diff --git a/README b/README index 5c08e15..af30a75 100644 --- a/README +++ b/README @@ -18,11 +18,21 @@ First, get the source. * Or by visiting and downloading the tar.gz file -Then as root, in the debootstrap source directory: +Then in the debootstrap source directory: -make devices.tar.gz -export DEBOOTSTRAP_DIR=`pwd` -debootstrap sid sid + export DEBOOTSTRAP_DIR=`pwd` + sudo ./debootstrap stable my-stable-dir + +If you are running a multi-stage boot strap (for example for a QEMU +rootfs) you don't even need root: + + export DEBOOTSTRAP_DIR=`pwd` + fakeroot ./debootstrap --foreign --arch=armhf testing my-testing-dir http://httpredir.debian.org/debian + +Of course you will need to execute the second stage as root to finish the bootstrap: + + (on foreign hardware) + /debootstrap/debootstrap --second-stage Future diff --git a/debian/changelog b/debian/changelog index 46b4974..7eef7f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debootstrap (1.0.82) UNRELEASED; urgency=medium + + [ Alex Bennée ] + * Excise all devices.tar.gz code. Closes: #830869 + + -- Steve McIntyre <93sam@debian.org> Tue, 06 Sep 2016 14:20:12 +0200 + debootstrap (1.0.81) unstable; urgency=medium [ Luca Falavigna ] diff --git a/debootstrap b/debootstrap index 2a959bb..4cea268 100755 --- a/debootstrap +++ b/debootstrap @@ -18,8 +18,6 @@ if [ -z "$DEBOOTSTRAP_DIR" ]; then fi fi -DEVICES_TARGZ=$DEBOOTSTRAP_DIR/devices.tar.gz - . $DEBOOTSTRAP_DIR/functions exec 4>&1 @@ -635,7 +633,6 @@ if am_doing_phase first_stage; then if ! am_doing_phase second_stage; then cp "$0" "$TARGET/debootstrap/debootstrap" cp $DEBOOTSTRAP_DIR/functions "$TARGET/debootstrap/functions" - cp $DEBOOTSTRAP_DIR/devices.tar.gz "$TARGET/debootstrap/devices.tar.gz" cp $SCRIPT "$TARGET/debootstrap/suite-script" echo "$ARCH" >"$TARGET/debootstrap/arch" echo "$SUITE" >"$TARGET/debootstrap/suite" diff --git a/functions b/functions index 031721f..67701ee 100644 --- a/functions +++ b/functions @@ -1065,13 +1065,7 @@ setup_devices () { hurd*) ;; *) - if true; then - setup_devices_simple - elif [ -e "$DEVICES_TARGZ" ]; then - zcat "$DEVICES_TARGZ" | (cd "$TARGET"; tar -xf -) - else - error 1 NODEVTGZ "no %s. cannot create devices" "$DEVICES_TARGZ" - fi + setup_devices_simple ;; esac } -- cgit v0.12