diff options
author | Benedikt Morbach <benedikt.morbach@googlemail.com> | 2020-10-30 19:22:04 +0100 |
---|---|---|
committer | Luigi Sartor Piucco <luigipiucco@gmail.com> | 2021-02-22 14:35:44 -0300 |
commit | d5cbb650e18728eaf6fe5004ae8d591feac13435 (patch) | |
tree | a2f60ec1e0fe5691ecc020e3de268f6209ea2d9d /pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix | |
parent | df4761d45082d94f6a469bbcab71cee1e31719da (diff) | |
download | nixpkgs-d5cbb650e18728eaf6fe5004ae8d591feac13435.tar nixpkgs-d5cbb650e18728eaf6fe5004ae8d591feac13435.tar.gz nixpkgs-d5cbb650e18728eaf6fe5004ae8d591feac13435.tar.bz2 nixpkgs-d5cbb650e18728eaf6fe5004ae8d591feac13435.tar.lz nixpkgs-d5cbb650e18728eaf6fe5004ae8d591feac13435.tar.xz nixpkgs-d5cbb650e18728eaf6fe5004ae8d591feac13435.tar.zst nixpkgs-d5cbb650e18728eaf6fe5004ae8d591feac13435.zip |
fhs-userenv-bubblewrap: add ld.so.conf/cache to fhs
Diffstat (limited to 'pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix')
-rw-r--r-- | pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix b/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix index dd945678e6f..2f99f9f761c 100644 --- a/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix +++ b/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix @@ -1,4 +1,6 @@ -{ lib, callPackage, runCommandLocal, writeShellScriptBin, coreutils, bubblewrap }: +{ lib, callPackage, runCommandLocal, writeShellScriptBin, glibc, coreutils, bubblewrap }: + +let buildFHSEnv = callPackage ./env.nix { }; in args @ { name @@ -60,8 +62,27 @@ let in concatStringsSep "\n " (map (file: "--ro-bind-try /etc/${file} /etc/${file}") files); + # Create this on the fly instead of linking from /nix + # The container might have to modify it and re-run ldconfig if there are + # issues running some binary with LD_LIBRARY_PATH + createLdConfCache = '' + cat > /etc/ld.so.conf <<EOF + /lib + /lib/x86_64-linux-gnu + /lib64 + /usr/lib + /usr/lib/x86_64-linux-gnu + /usr/lib64 + /lib/i386-linux-gnu + /lib32 + /usr/lib/i386-linux-gnu + /usr/lib32 + EOF + ldconfig &> /dev/null + ''; init = run: writeShellScriptBin "${name}-init" '' source /etc/profile + ${createLdConfCache} exec ${run} "$@" ''; @@ -117,6 +138,11 @@ let ${lib.optionalString unshareCgroup "--unshare-cgroup"} --die-with-parent --ro-bind /nix /nix + --tmpfs ${glibc}/etc \ + --symlink /etc/ld.so.conf ${glibc}/etc/ld.so.conf \ + --symlink /etc/ld.so.cache ${glibc}/etc/ld.so.cache \ + --ro-bind ${glibc}/etc/rpc ${glibc}/etc/rpc \ + --remount-ro ${glibc}/etc \ ${etcBindFlags} "''${ro_mounts[@]}" "''${symlinks[@]}" |