[pbuilder] 03/03: Add a USESYSFS option (defaulting to yes) to mount a sysfs filesystem in /sys

Mattia Rizzolo mattia at debian.org
Sat Jun 4 17:27:47 UTC 2016


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

mattia pushed a commit to branch master
in repository pbuilder.

commit f0841d9d315471b0710fe261fe338da14a3d1bda
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Sat Jun 4 17:22:37 2016 +0000

    Add a USESYSFS option (defaulting to yes) to mount a sysfs filesystem in /sys
    
    This currently works only on linux.
    
    The default on yes bit might be a bit tricky for those people already
    bind-mounting /sys to workaround this deficiency, as they will have a double
    mounted /sys.  Hopefully they won't notice.
    
    This commit also removes a chunk coming from commit 19e1e507 which would unmount
    /sys in kfreebsd system: to me it doesn't make any sense as it's not mounted by
    pbuilder itself, so whatever mounts it on those systems should also take care of
    the unmount.
    
    Closes: #773767
---
 pbuilder-modules | 8 +++++++-
 pbuilderrc       | 3 ++-
 pbuilderrc.5     | 8 ++++++++
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/pbuilder-modules b/pbuilder-modules
index faca38a..5b505c5 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -248,7 +248,7 @@ function umountproc () {
         fi
         umount_one "proc"
     fi
-    if [ "$DEB_BUILD_ARCH_OS" = "kfreebsd" ]; then
+    if [ "$DEB_BUILD_ARCH_OS" = "linux" ] && [ "$USESYSFS" = "yes" ]; then
         umount_one "sys"
     fi
     if [ "$DEB_BUILD_ARCH_OS" = "hurd" ]; then
@@ -301,6 +301,12 @@ function mountproc () {
         mount -t devfs /dev "$BUILDPLACE/dev"
         mounted[${#mounted[@]}]="$BUILDPLACE/dev"
     fi
+    if [ "$DEB_BUILD_ARCH_OS" = "linux" ] && [ "$USESYSFS" = "yes" ]; then
+        log.i "mounting /sys filesystem"
+        mkdir -p "$BUILDPLACE/sys" || true
+        mount -t sysfs -o nosuid,nodev,noexec sysfs "$BUILDPLACE/sys"
+        mounted[${#mounted[@]}]="$BUILDPLACE/sys"
+    fi
     if [ "$DEB_BUILD_ARCH_OS" = "linux" ] && [ "$USERUNSHM" = "yes" ]; then
         log.i "mounting /run/shm filesystem"
         mkdir -p "$BUILDPLACE/run/shm" || true
diff --git a/pbuilderrc b/pbuilderrc
index 1a7f0cd..c99118c 100644
--- a/pbuilderrc
+++ b/pbuilderrc
@@ -23,10 +23,11 @@ MIRRORSITE=http://httpredir.debian.org/debian
 #OTHERMIRROR="deb http://www.home.com/updates/ ./"
 #export http_proxy=http://your-proxy:8080/
 USEPROC=yes
+USEDEVFS=no
 USEDEVPTS=yes
+USESYSFS=yes
 USENETWORK=no
 USERUNSHM=yes
-USEDEVFS=no
 BUILDRESULT=/var/cache/pbuilder/result/
 
 # specifying the distribution forces the distribution on "pbuilder update"
diff --git a/pbuilderrc.5 b/pbuilderrc.5
index a25ac93..f2ab71e 100644
--- a/pbuilderrc.5
+++ b/pbuilderrc.5
@@ -409,6 +409,14 @@ are many software which fail miserably when there is no
 .B /dev/pts
 being mounted.
 .TP
+.BI "USESYSFS=" "yes"
+Whether to mount a sysfs in
+.B /sys
+or not.  Has no effect on non-Linux hosts, where sysfs is not available.
+It is usually a good idea, since there are several software which require
+.B /sys
+being populated.
+.TP
 .BI "USENETWORK=" "no"
 Specify
 .B yes

-- 
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