[pbuilder] 01/04: pbuilder-modules: Use /run/shm as the real tmpfs on kfreebsd

James Clarke jrtc27 at moszumanska.debian.org
Fri Aug 25 18:20:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

jrtc27 pushed a commit to branch master
in repository pbuilder.

commit 7e699c469dec3b3b5b6b866c747c27f263d0202e
Author: James Clarke <jrtc27 at debian.org>
Date:   Fri Feb 3 15:53:53 2017 +0000

    pbuilder-modules: Use /run/shm as the real tmpfs on kfreebsd
    
    /dev is always a devfs, which does not allow mkdir, but allows symlinks.
---
 pbuilder-modules | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/pbuilder-modules b/pbuilder-modules
index b602ed3..73e38fe 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -291,8 +291,12 @@ function umountproc () {
     if [ "$DEB_BUILD_ARCH_OS" = "kfreebsd" ] || [ "$USEDEVFS" = "yes" ]; then
         umount_one "dev"
     fi
-    if [ "$DEB_BUILD_ARCH_OS" != "hurd" ] && [ "$USESHM" = "yes" ]; then
-        umount_one "dev/shm"
+    if [ "$USESHM" = "yes" ]; then
+        if [ "$DEB_BUILD_ARCH_OS" = "kfreebsd" ]; then
+            umount_one "run/shm"
+        elif [ "$DEB_BUILD_ARCH_OS" != "hurd" ]; then
+            umount_one "dev/shm"
+        fi
     fi
     if [ "$USEPROC" = "yes" ]; then
         if [ "$DEB_BUILD_ARCH_OS" = "linux" ] && [ -e "$BUILDPLACE/proc/sys/fs/binfmt_misc/status" ]; then
@@ -328,6 +332,7 @@ function umountproc () {
 function mountproc () {
     local -a mounted
     local mnt mntpoint
+    local primary_shm secondary_shm
     if [ "$USEPROC" = "yes" ]; then
         log.i "mounting /proc filesystem"
         mkdir -p "$BUILDPLACE/proc"
@@ -372,19 +377,26 @@ function mountproc () {
     fi
     if [ "$USESHM" = "yes" ]; then
         log.i "creating /{dev,run}/shm"
-        rm -df "$BUILDPLACE/dev/shm" "$BUILDPLACE/run/shm"
-        mkdir -p "$BUILDPLACE/dev/shm"
-        chmod 1777 "$BUILDPLACE/dev/shm"
-        # old releases might not have /run.  We create it nonetheless, can't harm
-        mkdir -p "$BUILDPLACE/run"
-        ln -s /dev/shm "$BUILDPLACE/run/shm"
+        if [ "$DEB_BUILD_ARCH_OS" = "kfreebsd" ]; then
+            primary_shm="run/shm"
+            secondary_shm="dev/shm"
+        else
+            primary_shm="dev/shm"
+            secondary_shm="run/shm"
+            # old releases might not have /run.  We create it nonetheless, can't harm
+            mkdir -p "$BUILDPLACE/run"
+        fi
+        rm -df "$BUILDPLACE/$primary_shm" "$BUILDPLACE/$secondary_shm"
+        mkdir -p "$BUILDPLACE/$primary_shm"
+        chmod 1777 "$BUILDPLACE/$primary_shm"
+        ln -s "/$primary_shm" "$BUILDPLACE/$secondary_shm"
         # /dev gets bind-mounted on hurd. In theory this is before that, but
         # debootstrap will already have mounted it during chroot creation.
         # This seems to cause /hurd/tmpfs to crash, but we can just use the
         # host's /dev/shm.
         if [ "$DEB_BUILD_ARCH_OS" != "hurd" ]; then
-            mount -t tmpfs tmpfs "$BUILDPLACE/dev/shm"
-            mounted[${#mounted[@]}]="$BUILDPLACE/dev/shm"
+            mount -t tmpfs tmpfs "$BUILDPLACE/$primary_shm"
+            mounted[${#mounted[@]}]="$BUILDPLACE/$primary_shm"
         fi
     fi
     if [ "$DEB_BUILD_ARCH_OS" = "linux" ] && [ "$USEDEVPTS" = "yes" ]; then

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pbuilder/pbuilder.git



More information about the Pbuilder-maint mailing list