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

Bug#789694: schroot: Please consider patch to fix it on hurd-i386



Package: schroot
Version: 1.6.10-1+b1
Severity: wishlist
User: debian-hurd@lists.debian.org
Usertags: hurd

Dear maintainer,

attached patch makes schroot working on hurd, has been being tested on
exodar porterbox since many months.
It works around #763932 bug.

More info in threads at
 https://lists.debian.org/debian-hurd/2014/09/msg00058.html
 https://lists.debian.org/debian-hurd/2015/05/msg00063.html

Thanks for considering.

-- 
G..e
diff --git a/etc/profile-templates/all/gnu/fstab b/etc/profile-templates/all/gnu/fstab
new file mode 100644
index 0000000..159c200
--- /dev/null
+++ b/etc/profile-templates/all/gnu/fstab
@@ -0,0 +1,3 @@
+/proc           /proc           none    bind            0       0
+/dev            /dev            none    bind            0       0
+/servers        /servers        none    bind            0       0
diff --git a/etc/profile-templates/default/gnu/fstab b/etc/profile-templates/default/gnu/fstab
new file mode 100644
index 0000000..e848dad
--- /dev/null
+++ b/etc/profile-templates/default/gnu/fstab
@@ -0,0 +1,11 @@
+/home           /home           none    bind            0       0
+/tmp            /tmp            none    bind            0       0
+
+# It may be desirable to have access to /run, especially if you wish
+# to run additional services in the chroot.  However, note that this
+# may potentially cause undesirable behaviour on upgrades, such as
+# killing services on the host.
+#/run            /run            none    bind            0       0
+#/run/lock       /run/lock       none    bind            0       0
+#/dev/shm        /dev/shm        none    bind            0       0
+#/run/shm        /run/shm        none    bind            0       0
diff --git a/etc/profile-templates/desktop/gnu/fstab b/etc/profile-templates/desktop/gnu/fstab
new file mode 100644
index 0000000..96f775a
--- /dev/null
+++ b/etc/profile-templates/desktop/gnu/fstab
@@ -0,0 +1,16 @@
+/home           /home           none    bind            0       0
+/tmp            /tmp            none    bind            0       0
+
+# If you use gdm3, uncomment this line to allow Xauth to work
+#/var/run/gdm3   /var/run/gdm3   none    bind            0       0
+# For PulseAudio and other desktop-related things
+/var/lib/dbus   /var/lib/dbus   none    bind            0       0
+
+# It may be desirable to have access to /run, especially if you wish
+# to run additional services in the chroot.  However, note that this
+# may potentially cause undesirable behaviour on upgrades, such as
+# killing services on the host.
+#/run            /run            none    bind            0       0
+#/run/lock       /run/lock       none    bind            0       0
+#/dev/shm        /dev/shm        none    bind            0       0
+#/run/shm        /run/shm        none    bind            0       0
diff --git a/etc/setup.d/10mount b/etc/setup.d/10mount
index 27c18d0..884c36a 100755
--- a/etc/setup.d/10mount
+++ b/etc/setup.d/10mount
@@ -224,6 +224,21 @@ if [ "$CHROOT_TYPE" = "directory" ] \
     elif [ $STAGE = "setup-stop" ]; then
 
         do_umount_all "$CHROOT_MOUNT_LOCATION"
+        #
+        # If CHROOT_TYPE is "file", _UNPACK_DIR is bindmounted on
+        # _MOUNT_LOCATION. Hurd does need to also bindmount /dev and
+        # /servers on respectively _MOUNT_LOCATION/dev and
+        # _MOUNT_LOCATION/servers, but due to #763932, currently
+        # bindmounts-on-bindmounts result mounted on first bindmount
+        # source device i.e. _UNPACK_DIR.
+        # Workaround also umounts filesystems under _UNPACK_DIR.
+        #
+        if [ "$CHROOT_TYPE" = "file" -a "$(uname -s)" = "GNU" ]; then
+            do_umount_all "${CHROOT_FILE_UNPACK_DIR}/${SESSION_ID}"
+            info "Unmounting ${CHROOT_FILE_UNPACK_DIR}/${SESSION_ID}/proc"
+            settrans -apg "${CHROOT_FILE_UNPACK_DIR}/${SESSION_ID}/proc" || exit 1
+        fi
+
         if [ "$CREATE_UNION" = "yes" ]; then
             do_umount_all "$CHROOT_UNION_UNDERLAY_DIRECTORY"
         fi

Reply to: