From b66be2a549756ed8cd6a091d880626aa70e5f313 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 22 Apr 2015 15:49:23 +0300 Subject: [PATCH] fhs-userenv: move mounts map --- pkgs/build-support/build-fhs-userenv/chroot-user.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/build-fhs-userenv/chroot-user.rb b/pkgs/build-support/build-fhs-userenv/chroot-user.rb index 357a743c993..2fd6a47e132 100755 --- a/pkgs/build-support/build-fhs-userenv/chroot-user.rb +++ b/pkgs/build-support/build-fhs-userenv/chroot-user.rb @@ -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'