build-fhs-userenv: move /tmp handling to bash part

This commit is contained in:
Nikolay Amiantov 2015-08-24 01:59:20 +03:00
parent ec27ba44d0
commit f1187c5b14
2 changed files with 3 additions and 7 deletions

View File

@ -14,10 +14,6 @@ mounts = [ ['/nix/store', nil],
['/root', nil],
]
# Create directories
mkdirs = ['tmp',
]
# Propagate environment variables
envvars = [ 'TERM',
'DISPLAY',
@ -100,9 +96,6 @@ if $cpid == 0
write_file '/proc/self/uid_map', "#{uid} #{uid} 1"
write_file '/proc/self/gid_map', "#{gid} #{gid} 1"
# Do mkdirs
mkdirs.each { |x| FileUtils.mkdir_p "#{root}/#{x}" }
# Do rbind mounts.
mounts.each do |x|
to = "#{root}/#{x[1]}"

View File

@ -10,6 +10,9 @@ let
'';
init = writeText "init" ''
# Make /tmp directory
mkdir -m 1777 /tmp
# Expose sockets in /tmp
for i in /host-tmp/.*-unix; do
ln -s "$i" "/tmp/$(basename "$i")"