aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 6c3f94a76..e927a65f0 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -3173,11 +3173,12 @@ void DerivationGoal::runChild()
if (mount("none", (chrootRootDir + "/proc").c_str(), "proc", 0, 0) == -1)
throw SysError("mounting /proc");
- /* Mount sysfs on /sys. FIXME: only in user namespace
- builds. */
- createDirs(chrootRootDir + "/sys");
- if (mount("none", (chrootRootDir + "/sys").c_str(), "sysfs", 0, 0) == -1)
- throw SysError("mounting /sys");
+ /* Mount sysfs on /sys. */
+ if (useUidRange) {
+ createDirs(chrootRootDir + "/sys");
+ if (mount("none", (chrootRootDir + "/sys").c_str(), "sysfs", 0, 0) == -1)
+ throw SysError("mounting /sys");
+ }
/* Mount a new tmpfs on /dev/shm to ensure that whatever
the builder puts in /dev/shm is cleaned up automatically. */