forked from security/hakurei
nix: cross-platform syscall wrapper
Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
14
flake.nix
14
flake.nix
@@ -185,15 +185,21 @@
|
||||
'';
|
||||
};
|
||||
|
||||
generateSyscallTable = pkgs.mkShell {
|
||||
# this should be made cross-platform via nix
|
||||
generateSyscallTable =
|
||||
let
|
||||
GOARCH = {
|
||||
x86_64-linux = "amd64";
|
||||
aarch64-linux = "arm64";
|
||||
};
|
||||
in
|
||||
pkgs.mkShell {
|
||||
shellHook = "exec ${pkgs.writeShellScript "generate-syscall-table" ''
|
||||
set -e
|
||||
${pkgs.perl}/bin/perl \
|
||||
sandbox/seccomp/mksysnum_linux.pl \
|
||||
container/seccomp/mksysnum_linux.pl \
|
||||
${pkgs.linuxHeaders}/include/asm/unistd_64.h | \
|
||||
${pkgs.go}/bin/gofmt > \
|
||||
sandbox/seccomp/syscall_linux_amd64.go
|
||||
container/seccomp/syscall_linux_${GOARCH.${system}}.go
|
||||
''}";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user