Revert "add config.environment.ld-linux"

This reverts commit af665d822a, see
https://github.com/NixOS/nixpkgs/pull/78798#issuecomment-580059834 for
the reasons in a similar PR.
This commit is contained in:
Eelco Dolstra 2020-02-02 15:29:49 +01:00
parent 5495cb91eb
commit 26aba55951
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -162,16 +162,6 @@ in
<literal>/usr/bin/env</literal>.
'';
};
environment.ld-linux = mkOption {
default = false;
type = types.bool;
visible = false;
description = ''
Install symlink to ld-linux(8) system-wide to allow running unmodified ELF binaries.
It might be useful to run games or executables distributed inside jar files.
'';
};
};
@ -208,27 +198,6 @@ in
rmdir --ignore-fail-on-non-empty /usr/bin /usr
'';
system.activationScripts.ld-linux =
concatStrings (
mapAttrsToList
(target: source:
if config.environment.ld-linux then ''
mkdir -m 0755 -p $(dirname ${target})
ln -sfn ${escapeShellArg source} ${target}.tmp
mv -f ${target}.tmp ${target} # atomically replace
'' else ''
rm -f ${target}
rmdir --ignore-fail-on-non-empty $(dirname ${target})
'')
{
"i686-linux" ."/lib/ld-linux.so.2" = "${pkgs.glibc.out}/lib/ld-linux.so.2";
"x86_64-linux" ."/lib/ld-linux.so.2" = "${pkgs.pkgsi686Linux.glibc.out}/lib/ld-linux.so.2";
"x86_64-linux" ."/lib64/ld-linux-x86-64.so.2" = "${pkgs.glibc.out}/lib64/ld-linux-x86-64.so.2";
"aarch64-linux"."/lib/ld-linux-aarch64.so.1" = "${pkgs.glibc.out}/lib/ld-linux-aarch64.so.1";
"armv7l-linux" ."/lib/ld-linux-armhf.so.3" = "${pkgs.glibc.out}/lib/ld-linux-armhf.so.3";
}.${pkgs.stdenv.system} or {}
);
system.activationScripts.specialfs =
''
specialMount() {