Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/libstore/unix/build/linux-derivation-builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,15 @@ struct ChrootLinuxDerivationBuilder : ChrootDerivationBuilder, LinuxDerivationBu
sandboxGid(),
settings.sandboxBuildDir));

/* Write /etc/group to prevent build failures
on systems with unprivileged_userns_clone=0. */
writeFile(
chrootRootDir / "etc" / "group",
fmt("root:x:0:\n",
"nixbld:!:%1%:\n",
"nogroup:x:65534:\n",
sandboxGid()));

/* Save the mount- and user namespace of the child. We have to do this
*before* the child does a chroot. */
auto sandboxPath = thisProcPath / "ns";
Expand Down
Loading