[pbuilder] 02/02: pbuilder-modules: Use /run/shm as the real tmpfs on kfreebsd
James Clarke
jrtc27 at moszumanska.debian.org
Fri Feb 3 16:01:40 UTC 2017
This is an automated email from the git hooks/post-receive script.
jrtc27 pushed a commit to branch kbsd-shm
in repository pbuilder.
commit 5474722ae7570edd4d12eb990e96fa5236edd501
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 | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/pbuilder-modules b/pbuilder-modules
index 8703042..bac0c42 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -281,8 +281,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
@@ -318,6 +322,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"
@@ -362,19 +367,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"
+ if [ "$DEB_BUILD_ARCH_OS" = "kfreebsd" ]; then
+ primary_shm="run/shm"
+ secondary_shm="dev/shm"
+ else
+ primary_shm="dev/shm"
+ secondary_shm="run/shm"
+ fi
+ rm -df "$BUILDPLACE/$primary_shm" "$BUILDPLACE/$secondary_shm"
+ mkdir -p "$BUILDPLACE/$primary_shm"
+ chmod 1777 "$BUILDPLACE/$primary_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"
+ mkdir -p "$BUILDPLACE/$(dirname "$secondary_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