package: debootstrap
severity: normal
tags: patch

Hi,

the attached patch does the following:

1. in setup_devices, if /bin/settrans exists, it calls
setup_hurd_devices rather than extracting devices.tar.gz.  Note that
this means cross-debootstrapping the Hurd from Linux will fail for now
as in that case devices.tar.gz will get extracted and no translators are
setup upon reboot.

2. adds setup_hurd_devices (ported from Marcus Brinkmann's
native-install script), which sets up $TARGET/dev and $TARGET/servers
appropriate for hurd-i386.

3. makes setup_proc a no-op if /proc does not exist (as setup_proc is
run in second stage I guess that's alright).  Maybe that should be
changed to check for $ARCH = "hurd-i386" directly?  Alternatively, the
sid script could be changed to just skip setup_proc on hurd-i386.


cheers,

Michael
--- debootstrap-0.3.1/functions 2005-06-13 16:29:56.000000000 +0200
+++ debootstrap-0.3.1/functions.new     2005-06-15 20:50:26.000000000 +0200
@@ -732,26 +732,48 @@
 }
 
 setup_proc () {
-  on_exit "umount $TARGET/dev/pts"
-  on_exit "umount $TARGET/dev/shm"
-  on_exit "umount $TARGET/proc/bus/usb"
-  on_exit "umount $TARGET/proc"
-  umount $TARGET/proc 2>/dev/null || true
-  in_target mount -t proc proc /proc
+  if [ -e /proc ]; then
+    on_exit "umount $TARGET/dev/pts"
+    on_exit "umount $TARGET/dev/shm"
+    on_exit "umount $TARGET/proc/bus/usb"
+    on_exit "umount $TARGET/proc"
+    umount $TARGET/proc 2>/dev/null || true
+    in_target mount -t proc proc /proc
+  fi
 }
 
 setup_devices () {
-  if [ -e $DEVICES_TARGZ ]; then
-    (cd "$TARGET"; zcat $DEVICES_TARGZ | tar -xf -)
+  if [ -e /bin/settrans ]; then
+    setup_hurd_devices
   else
-    if [ -e /dev/.devfsd ]; then
-      in_target mount -t devfs devfs /dev
+    if [ -e $DEVICES_TARGZ ]; then
+      (cd "$TARGET"; zcat $DEVICES_TARGZ | tar -xf -)
     else
-      error 1 NODEVTGZ "no %s. cannot create devices" "$DEVICES_TARGZ"
+      if [ -e /dev/.devfsd ]; then
+        in_target mount -t devfs devfs /dev
+      else
+        error 1 NODEVTGZ "no %s. cannot create devices" "$DEVICES_TARGZ"
+      fi
     fi
   fi
 }
 
+setup_hurd_devices () {
+  mkdir -p $TARGET/servers/socket
+  /bin/settrans -cfk $TARGET/servers/socket/1 /hurd/pflocal
+  /bin/settrans -cf $TARGET/servers/socket/2 /hurd/pfinet
+  /bin/settrans -cfk $TARGET/servers/exec /hurd/exec
+  /bin/settrans -cf $TARGET/servers/crash-suspend /hurd/crash --suspend
+  /bin/settrans -cf $TARGET/servers/crash-kill /hurd/crash --kill
+  /bin/settrans -cf $TARGET/servers/crash-dump-core /hurd/crash --dump-core
+  /bin/settrans -cf $TARGET/servers/password /hurd/password
+  /bin/settrans -cf $TARGET/servers/default-pager /hurd/proxy-defpager
+  ln -fs crash-kill $TARGET/servers/crash
+  ln -fs 1 $TARGET/servers/socket/local
+  ln -fs 2 $TARGET/servers/socket/inet
+  (cd $TARGET/dev; /sbin/MAKEDEV fd std ptyp ptyq vcs tty1 tty2 tty3 tty4 tty5 
tty6)
+}
+
 setup_dselect_method () {
   case "$1" in
     "apt")

Reply via email to