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

Bug#768102: debootstrap: start bind-mounting /proc on Hurd and add nobindmount variant



Hello,

Gabriele Giacone, on Wed 05 Nov 2014 00:58:25 +0100, wrote:
> attached patch is pretty hurd-specific:
> 
>  - disconnect (orphan) TARGET/proc passive translator and start
>    bind-mounting /proc along with /servers and /dev.
>  - add "nobindmount" variant to create chroots without bind-mounting
>    any filesystem. Main use case is chroot for subhurds [0].

I'm currently having a look at all this, and I am considering applying
the attached patch instead. The scratchbox variant does not call
setup_proc, which I believe is what you'd want for a subhurd.

We just need to wait a bit for the just-uploaded 0.7.git20160214-2 hurd
package (which drops setting up /proc in setup-translators, now that
sysvinit mounts it at boot, which should avoid the schroot issues).

Samuel
diff --git a/functions b/functions
index be4919f..3b8473d 100644
--- a/functions
+++ b/functions
@@ -1021,6 +1021,13 @@ setup_proc () {
 		fi
 		;;
 	    hurd*)
+		# firmlink $TARGET/{dev,servers,proc} to the system ones.
+		umount_on_exit /dev
+		umount_on_exit /servers
+		umount_on_exit /proc
+		settrans -a $TARGET/dev /hurd/firmlink /dev
+		settrans -a $TARGET/servers /hurd/firmlink /servers
+	        settrans -a $TARGET/proc /hurd/firmlink /proc
 		;;
 	    *)
 		umount_on_exit /dev/pts
@@ -1058,7 +1065,9 @@ setup_devices () {
 	    freebsd)
 		mount -t devfs devfs $TARGET/dev ;;
 	    hurd*)
-		setup_devices_hurd ;;
+	        # Use the setup-translators of the hurd package
+	        in_target /usr/lib/hurd/setup-translators -k
+		;;
 	    *)
 		if true; then
 			setup_devices_simple
@@ -1088,14 +1097,6 @@ setup_devices_simple () {
 	ln -s /proc/self/fd/2 $TARGET/dev/stderr
 }
 
-setup_devices_hurd () {
-	# Use the setup-translators of the hurd package, and firmlink
-	# $TARGET/{dev,servers} to the system ones.
-	in_target /usr/lib/hurd/setup-translators -k
-	settrans -a $TARGET/dev /hurd/firmlink /dev
-	settrans -a $TARGET/servers /hurd/firmlink /servers
-}
-
 setup_devices_fakechroot () {
 	rm -rf "$TARGET/dev"
 	ln -s /dev "$TARGET"

Reply to: