[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)



Package: debootstrap
Version: 1.0.10
Tags: patch

Hello,

right now, cross-debootstrapping a hurd-i386 system (from i386, e.g.)
fails (silently) in first stage after extracting packages.

This is because debootstrap runs setup_devices in first stage, and we
cannot setup the Hurd translators at this point when running
GNU/Linux because the necessary tools and kernel support is not
available[1].

Would it be possible to move the setup_devices call to second stage, at
least when ARCH=hurd-i386?  I assume setting up the devices is required
for Linux arches when using --foreign, so that a boot into the new
system will have a /dev tree and might fail otherwise.

We modified the hurd package so that it can boot fine after just being
unpacked without the need for having translators/devices setup, i.e. the
debootstrap --foreign case.

I've attached a patch which works for my case, though it might not be
the most elegant solution.


thanks,

Michael

[1] There has been a Linux kernel patch which adds support in ext2 for
passive Hurd translators as extended attributes, making them
readable/writable via f{get,set}xattr, but this one is out-of-tree
--- /usr/share/debootstrap/scripts/sid	2008-07-02 17:44:35.000000000 +0200
+++ sid	2008-09-12 20:37:49.000000000 +0200
@@ -50,10 +50,12 @@
         cp "$TARGET/usr/bin/md5sum.textutils" "$TARGET/usr/bin/md5sum"
     fi
 
-    if doing_variant fakechroot; then 
-        setup_devices_fakechroot
-    else
-        setup_devices
+    if [ "$ARCH" != "hurd-i386" ]; then
+        if doing_variant fakechroot; then 
+            setup_devices_fakechroot
+        else
+            setup_devices
+        fi
     fi
 
     x_feign_install () {
@@ -79,6 +81,14 @@
 }
 
 second_stage_install () {
+    if [ "$ARCH" = "hurd-i386" ]; then
+        if doing_variant fakechroot; then
+            setup_devices_fakechroot
+        else
+            setup_devices
+        fi
+    fi
+
     x_core_install () {
 	smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
     }

Reply to: