3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #108072 from matthewbauer/fix-binfmt-activation

nixos/binfmt.nix: fix running commands in binfmt
This commit is contained in:
Matthew Bauer 2021-01-20 16:31:53 -06:00 committed by GitHub
commit da9fc7b068
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,8 +20,14 @@ let
optionalString fixBinary "F";
in ":${name}:${type}:${offset'}:${magicOrExtension}:${mask'}:${interpreter}:${flags}";
activationSnippet = name: { interpreter, ... }:
"ln -sf ${interpreter} /run/binfmt/${name}";
activationSnippet = name: { interpreter, ... }: ''
rm -f /run/binfmt/${name}
cat > /run/binfmt/${name} << 'EOF'
#!/usr/bin/env sh
exec -- ${interpreter} "$@"
EOF
chmod +x /run/binfmt/${name}
'';
getEmulator = system: (lib.systems.elaborate { inherit system; }).emulator pkgs;