summary refs log tree commit diff
path: root/pkgs/build-support/build-fhs-chrootenv
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2015-03-09 17:13:53 +0300
committerNikolay Amiantov <ab@fmap.me>2015-03-09 17:29:43 +0300
commite3ab3df26e418c8f964b57e990144572a86580d0 (patch)
tree798c98f8f1389290fdef6d6cabe99e7bfd4b0b64 /pkgs/build-support/build-fhs-chrootenv
parent4aba7639c898f66e91ee71f8ed6df1df14f2419d (diff)
downloadnixlib-e3ab3df26e418c8f964b57e990144572a86580d0.tar
nixlib-e3ab3df26e418c8f964b57e990144572a86580d0.tar.gz
nixlib-e3ab3df26e418c8f964b57e990144572a86580d0.tar.bz2
nixlib-e3ab3df26e418c8f964b57e990144572a86580d0.tar.lz
nixlib-e3ab3df26e418c8f964b57e990144572a86580d0.tar.xz
nixlib-e3ab3df26e418c8f964b57e990144572a86580d0.tar.zst
nixlib-e3ab3df26e418c8f964b57e990144572a86580d0.zip
chroot-env: ignore collisions and fix permissions
Diffstat (limited to 'pkgs/build-support/build-fhs-chrootenv')
-rw-r--r--pkgs/build-support/build-fhs-chrootenv/env.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/pkgs/build-support/build-fhs-chrootenv/env.nix b/pkgs/build-support/build-fhs-chrootenv/env.nix
index 19be38d1a01c..a50917a96cd2 100644
--- a/pkgs/build-support/build-fhs-chrootenv/env.nix
+++ b/pkgs/build-support/build-fhs-chrootenv/env.nix
@@ -81,11 +81,13 @@ let
   staticUsrProfileTarget = nixpkgs.buildEnv {
     name = "system-profile-target";
     paths = basePkgs ++ [ profilePkg ] ++ targetPaths;
+    ignoreCollisions = true;
   };
 
   staticUsrProfileMulti = nixpkgs.buildEnv {
     name = "system-profile-multi";
     paths = multiPaths;
+    ignoreCollisions = true;
   };
 
   linkProfile = profile: ''
@@ -129,7 +131,7 @@ let
     mkdir -m0755 lib
 
     # copy content of targetPaths
-    cp -rsf ${staticUsrProfileTarget}/lib/* lib/
+    cp -rsf ${staticUsrProfileTarget}/lib/* lib/ && chmod u+w -R lib/
   '';
 
   # setup /lib, /lib32 and /lib64
@@ -142,16 +144,16 @@ let
     cp -rsf ${staticUsrProfileTarget}/lib/32/* lib/
 
     # copy content of multiPaths (32bit libs)
-    [ -d ${staticUsrProfileMulti}/lib ] && cp -rsf ${staticUsrProfileMulti}/lib/* lib/
+    [ -d ${staticUsrProfileMulti}/lib ] && cp -rsf ${staticUsrProfileMulti}/lib/* lib/ && chmod u+w -R lib/
 
     # copy content of targetPaths (64bit libs)
-    cp -rsf ${staticUsrProfileTarget}/lib/* lib64/
+    cp -rsf ${staticUsrProfileTarget}/lib/* lib64/ && chmod u+w -R lib64/
 
     # most 64bit only libs put their stuff into /lib
     # some pkgs (like gcc_multi) put 32bit libs into and /lib 64bit libs into /lib64
     # by overwriting these we will hopefully catch all these cases
     # in the end /lib should only contain 32bit and /lib64 only 64bit libs
-    cp -rsf ${staticUsrProfileTarget}/lib64/* lib64/
+    cp -rsf ${staticUsrProfileTarget}/lib64/* lib64/ && chmod u+w -R lib64/
 
     # copy gcc libs (and may overwrite exitsting wrongly placed libs)
     cp -rsf ${chosenGcc.cc}/lib/*   lib/