[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#498731: debootstrap: Move setup_devices to second_stage (or hurd-i386 fails)



On Friday 19 February 2010, Michael Banck wrote:
> I will NMU debootstrap in the next days with the proposed patch if I
> don't hear anything back.

I think I'd prefer the attached patch as it makes the exception much 
clearer. Also, this patch will work for all hurd-* arches and not just 
hurd-i386 (which is more consistent with existing code).

For the fakechroot case I don't see how it would make any difference when 
the symlink is created, so I've left that in first stage for all arches.

If you could test the patch (and no one else objects) I'll make sure it 
gets included in the next upload.

Cheers,
FJP

diff --git a/packages/debootstrap/functions b/packages/debootstrap/functions
index 14f86ff..ff80a84 100644
--- a/packages/debootstrap/functions
+++ b/packages/debootstrap/functions
@@ -943,11 +943,16 @@ setup_proc_fakechroot () {
 }
 
 setup_devices () {
+	if doing_variant fakechroot; then
+		setup_devices_fakechroot
+		return 0
+	fi
+
 	case "$ARCH" in
+	    hurd-*)
+		: ;; # delayed until second stage
 	    kfreebsd-*)
 		in_target mount -t devfs devfs /dev ;;
-	    hurd-*)
-		setup_devices_hurd ;;
 	    *)
 		if [ -e "$DEVICES_TARGZ" ]; then
 			zcat "$DEVICES_TARGZ" | (cd "$TARGET"; tar -xf -)
diff --git a/packages/debootstrap/scripts/sid b/packages/debootstrap/scripts/sid
index 42c4785..e11e902 100644
--- a/packages/debootstrap/scripts/sid
+++ b/packages/debootstrap/scripts/sid
@@ -51,11 +51,7 @@ first_stage_install () {
 		cp "$TARGET/usr/bin/md5sum.textutils" "$TARGET/usr/bin/md5sum"
 	fi
 
-	if doing_variant fakechroot; then
-		setup_devices_fakechroot
-	else
-		setup_devices
-	fi
+	setup_devices
 
 	x_feign_install () {
 		local pkg="$1"
@@ -76,6 +72,11 @@ Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
 }
 
 second_stage_install () {
+	case "$ARCH" in
+	    hurd-*)
+		setup_devices_hurd ;;
+	esac
+
 	x_core_install () {
 		smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
 	}

Reply to: