Skip to content

Commit

Permalink
Merge pull request #80680 from samueldr/fix/71157
Browse files Browse the repository at this point in the history
runInLinuxVM: Ensure tools requiring /etc/passwd work
  • Loading branch information
samueldr committed Feb 23, 2020
2 parents 2c12bb3 + 687e219 commit 972678e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/build-support/vm/default.nix
Expand Up @@ -126,6 +126,10 @@ rec {
mkdir -p /fs/etc
ln -sf /proc/mounts /fs/etc/mtab
echo "127.0.0.1 localhost" > /fs/etc/hosts
# Ensures tools requiring /etc/passwd will work (e.g. nix)
if [ ! -e /fs/etc/passwd ]; then
echo "root:x:0:0:System administrator:/root:/bin/sh" > /fs/etc/passwd
fi
echo "starting stage 2 ($command)"
exec switch_root /fs $command $out
Expand Down

0 comments on commit 972678e

Please sign in to comment.