fhs-userenv: move mounts map

This commit is contained in:
Nikolay Amiantov 2015-04-22 15:49:23 +03:00
parent 97931361d7
commit b66be2a549

View File

@ -11,7 +11,7 @@ mounts = [ ['/nix/store', nil],
['/var', nil],
['/run', nil],
['/root', nil],
].map! { |x| [ x[0], x[1].nil? ? x[0].sub(/^\/*/, '') : x[1] ] }
]
# Create directories
mkdirs = ['tmp',
@ -68,6 +68,9 @@ abort "Usage: chrootenv swdir program args..." unless ARGV.length >= 2
swdir = Pathname.new ARGV[0]
execp = ARGV.drop 1
# Set destination paths for mounts
mounts.map! { |x| [x[0], x[1].nil? ? x[0].sub(/^\/*/, '') : x[1]] }
# Create temporary directory for root and chdir
root = Dir.mktmpdir 'chrootenv'