From e3ab3df26e418c8f964b57e990144572a86580d0 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Mon, 9 Mar 2015 17:13:53 +0300 Subject: [PATCH] chroot-env: ignore collisions and fix permissions --- pkgs/build-support/build-fhs-chrootenv/env.nix | 10 ++++++---- 1 file 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/