buildFHSEnv: restrict pkgsi686Linux to x86_64-linux
This commit is contained in:
parent
40e4b45adc
commit
3c6e26b2ee
|
@ -64,7 +64,7 @@ let
|
||||||
|
|
||||||
ldconfig = writeShellScriptBin "ldconfig" ''
|
ldconfig = writeShellScriptBin "ldconfig" ''
|
||||||
# due to a glibc bug, 64-bit ldconfig complains about patchelf'd 32-bit libraries, so we're using 32-bit ldconfig
|
# due to a glibc bug, 64-bit ldconfig complains about patchelf'd 32-bit libraries, so we're using 32-bit ldconfig
|
||||||
exec ${pkgsi686Linux.glibc.bin}/bin/ldconfig -f /etc/ld.so.conf -C /etc/ld.so.cache "$@"
|
exec ${if stdenv.isx86_64 && stdenv.isLinux then pkgsi686Linux.glibc.bin else pkgs.glibc.bin}/bin/ldconfig -f /etc/ld.so.conf -C /etc/ld.so.cache "$@"
|
||||||
'';
|
'';
|
||||||
etcProfile = writeText "profile" ''
|
etcProfile = writeText "profile" ''
|
||||||
export PS1='${name}-chrootenv:\u@\h:\w\$ '
|
export PS1='${name}-chrootenv:\u@\h:\w\$ '
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{ lib
|
{ lib
|
||||||
|
, stdenv
|
||||||
, callPackage
|
, callPackage
|
||||||
, runCommandLocal
|
, runCommandLocal
|
||||||
, writeShellScript
|
, writeShellScript
|
||||||
|
@ -113,6 +114,7 @@ let
|
||||||
exec ${run} "$@"
|
exec ${run} "$@"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
indentLines = str: lib.concatLines (map (s: " " + s) (filter (s: s != "") (lib.splitString "\n" str)));
|
||||||
bwrapCmd = { initArgs ? "" }: ''
|
bwrapCmd = { initArgs ? "" }: ''
|
||||||
ignored=(/nix /dev /proc /etc)
|
ignored=(/nix /dev /proc /etc)
|
||||||
ro_mounts=()
|
ro_mounts=()
|
||||||
|
@ -202,11 +204,13 @@ let
|
||||||
--symlink /etc/ld.so.cache ${glibc}/etc/ld.so.cache \
|
--symlink /etc/ld.so.cache ${glibc}/etc/ld.so.cache \
|
||||||
--ro-bind ${glibc}/etc/rpc ${glibc}/etc/rpc \
|
--ro-bind ${glibc}/etc/rpc ${glibc}/etc/rpc \
|
||||||
--remount-ro ${glibc}/etc \
|
--remount-ro ${glibc}/etc \
|
||||||
|
'' + lib.optionalString (stdenv.isx86_64 && stdenv.isLinux) (indentLines ''
|
||||||
--tmpfs ${pkgsi686Linux.glibc}/etc \
|
--tmpfs ${pkgsi686Linux.glibc}/etc \
|
||||||
--symlink /etc/ld.so.conf ${pkgsi686Linux.glibc}/etc/ld.so.conf \
|
--symlink /etc/ld.so.conf ${pkgsi686Linux.glibc}/etc/ld.so.conf \
|
||||||
--symlink /etc/ld.so.cache ${pkgsi686Linux.glibc}/etc/ld.so.cache \
|
--symlink /etc/ld.so.cache ${pkgsi686Linux.glibc}/etc/ld.so.cache \
|
||||||
--ro-bind ${pkgsi686Linux.glibc}/etc/rpc ${pkgsi686Linux.glibc}/etc/rpc \
|
--ro-bind ${pkgsi686Linux.glibc}/etc/rpc ${pkgsi686Linux.glibc}/etc/rpc \
|
||||||
--remount-ro ${pkgsi686Linux.glibc}/etc \
|
--remount-ro ${pkgsi686Linux.glibc}/etc \
|
||||||
|
'') + ''
|
||||||
"''${ro_mounts[@]}"
|
"''${ro_mounts[@]}"
|
||||||
"''${symlinks[@]}"
|
"''${symlinks[@]}"
|
||||||
"''${auto_mounts[@]}"
|
"''${auto_mounts[@]}"
|
||||||
|
|
Loading…
Reference in a new issue