From 93fa3e16bba3ee3ea870ffe3d036189c15859e36 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sat, 19 Sep 2020 12:41:39 +0200 Subject: [PATCH] tor package overrides Patch libc to add missing symbols --- overlay/default.nix | 5 ++ packages/genodelabs/libc.patch | 38 +++++++++++ tests/default.nix | 2 +- tests/rsync.dhall | 121 --------------------------------- tests/tor.nix | 30 ++++++++ 5 files changed, 74 insertions(+), 122 deletions(-) delete mode 100644 tests/rsync.dhall create mode 100644 tests/tor.nix diff --git a/overlay/default.nix b/overlay/default.nix index a3c3665..805b05c 100644 --- a/overlay/default.nix +++ b/overlay/default.nix @@ -96,6 +96,8 @@ in { solo5-tools = callPackage ./solo5-tools { }; + tor = overrideHost tor { torsocks = "/dev/null"; }; + tup = prev.tup.overrideAttrs (attrs: { setupHook = ./tup/setup-hook.sh; }); zlib = overrideHostAttrs zlib (attrs: { @@ -106,4 +108,7 @@ in { popd ''; }); + + zstd = overrideHostAttrs zstd + (attrs: { outputs = builtins.filter (o: o != "man") attrs.outputs; }); } diff --git a/packages/genodelabs/libc.patch b/packages/genodelabs/libc.patch index 08e5544..fad1f81 100644 --- a/packages/genodelabs/libc.patch +++ b/packages/genodelabs/libc.patch @@ -85,3 +85,41 @@ index 150640ddf3..e511897600 100644 DUMMY(int , -1, getpriority, (int, int)) DUMMY(int , -1, getrusage, (int, rusage *)) DUMMY_SILENT(uid_t , 0, getuid, (void)) +commit 59f4ca28368f94dc3e94ac4a1b1ce275fd4f747f +Author: Emery Hemingway +Date: Sat Sep 19 10:50:10 2020 +0200 + + libc: build RFC2553 Interface Identification API + +diff --git a/repos/libports/lib/mk/libc-net.mk b/repos/libports/lib/mk/libc-net.mk +index 3fb1e946fe..2a615ba043 100644 +--- a/repos/libports/lib/mk/libc-net.mk ++++ b/repos/libports/lib/mk/libc-net.mk +@@ -21,6 +21,9 @@ SRC_C += vars.c + # b64_ntop + SRC_C += base64.c + ++# RFC 2553 ++SRC_C += if_indextoname.c if_nameindex.c if_nametoindex.c ++ + # suppress "warning: ‘strncpy’ specified bound depends on the length of the source argument" + CC_OPT_getaddrinfo := -Wno-stringop-overflow + +commit 481b5b6a92dde0ba6c129da3bf1dcade9f5c350f +Author: Emery Hemingway +Date: Sat Sep 19 12:04:22 2020 +0200 + + libc: build readpassphrase.c + +diff --git a/repos/libports/lib/mk/libc-gen.inc b/repos/libports/lib/mk/libc-gen.inc +index ab0ce929aa..1c7f84e800 100644 +--- a/repos/libports/lib/mk/libc-gen.inc ++++ b/repos/libports/lib/mk/libc-gen.inc +@@ -40,7 +40,6 @@ FILTER_OUT_C += \ + getentropy.c \ + getutxent.c \ + pututxline.c \ +- readpassphrase.c \ + scandir_b.c \ + sem_new.c \ + signal.c \ diff --git a/tests/default.nix b/tests/default.nix index 1a49ee8..671114d 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -9,7 +9,7 @@ let }; testFiles = - map callTest [ ./log.nix ./posix.nix ./vmm_arm.nix ./vmm_x86.nix ./x86.nix ] + map callTest [ ./log.nix ./posix.nix ./tor.nix ./vmm_arm.nix ./vmm_x86.nix ./x86.nix ] ++ (callTest ./solo5); testPkgs = genodepkgs; diff --git a/tests/rsync.dhall b/tests/rsync.dhall deleted file mode 100644 index afa7373..0000000 --- a/tests/rsync.dhall +++ /dev/null @@ -1,121 +0,0 @@ -let Test = ./test.dhall ? env:DHALL_GENODE_TEST - -let Genode = Test.Genode - -let Prelude = Genode.Prelude - -let XML = Prelude.XML - -let Init = Genode.Init - -let Child = Init.Child - -in λ(params : { bash : Text, coreutils : Text, script : Text }) → - let init = - Init::{ - , verbose = True - , routes = - [ Init.ServiceRoute.parent "Timer" - , Init.ServiceRoute.parent "Rtc" - ] - , children = toMap - { vfs = - Child.flat - Child.Attributes::{ - , binary = "vfs" - , config = Init.Config::{ - , content = - [ Prelude.XML.text - '' - - - - - - - - '' - ] - , defaultPolicy = Some Init.Config.DefaultPolicy::{ - , attributes = toMap { root = "/", writeable = "yes" } - } - } - , provides = [ "File_system" ] - , resources = Genode.Init.Resources::{ - , caps = 256 - , ram = Genode.units.MiB 8 - } - , routes = - Prelude.List.map - Text - Init.ServiceRoute.Type - Init.ServiceRoute.parent - [ "File_system", "Rtc" ] - } - , store_rom = - Child.flat - Child.Attributes::{ - , binary = "cached_fs_rom" - , provides = [ "ROM" ] - , resources = Init.Resources::{ - , caps = 256 - , ram = Genode.units.MiB 4 - } - , routes = - [ Init.ServiceRoute.parentLabel - "File_system" - (None Text) - (Some "nix") - ] - } - , shell = - Child.flat - Child.Attributes::{ - , binary = "bash" - , config = Genode.Init.Config::{ - , content = - [ Prelude.XML.text - '' - - - '' - ] - # Prelude.List.map - Text - XML.Type - ( λ(x : Text) → - XML.leaf - { name = "arg" - , attributes = toMap { value = x } - } - ) - [ "bash", params.script ] - } - , exitPropagate = True - , resources = Genode.Init.Resources::{ - , caps = 1024 - , ram = Genode.units.MiB 32 - } - , routes = - [ Init.ServiceRoute.child "File_system" "vfs" - , { service = - { name = "ROM" - , label = - Init.LabelSelector.Type.Partial - { prefix = Some "/nix/store/" - , suffix = None Text - } - } - , route = - Init.Route.Type.Child - { name = "store_rom" - , label = None Text - , diag = None Bool - } - } - ] - } - } - } - - in Test::{ children = Test.initToChildren init } diff --git a/tests/tor.nix b/tests/tor.nix new file mode 100644 index 0000000..5a4909e --- /dev/null +++ b/tests/tor.nix @@ -0,0 +1,30 @@ +{ pkgs, legacyPackages, ... }: +with pkgs; + +let + inherit (legacyPackages) bash coreutils; + script = with legacyPackages; + writeTextFile { + name = "rsync.sh"; + text = '' + export PATH=${ + lib.makeSearchPathOutput "bin" "bin" + (with legacyPackages; [ bash coreutils tor ]) + } + set -v + tor --version + tor + ''; + }; +in rec { + name = "tor"; + machine = { + config = '' + ${ + ./posix.dhall + } { bash = \"${bash}\", coreutils = \"${coreutils}\", script = \"${script}\" }''; + inputs = map pkgs.genodeSources.depot [ "libc" "posix" "vfs_pipe" "vfs" ] + ++ [ bash legacyPackages.zlib ]; + extraPaths = [ script ] ++ (with legacyPackages; [ coreutils tor ]); + }; +} -- 2.45.2