From 0230cfaf1ee678613d28c5baa124709faa32fe02 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sat, 30 Apr 2016 13:35:24 +0100 Subject: [PATCH] Updates for mirage 2.9.0 - Unpin bootvar and use register ~argv:no_argv` instead. - Use new name for uplink device ("0", not "tap0"). - Don't configure logging - mirage does that for us now. --- .travis.yml | 2 +- README.md | 1 - config.ml | 1 + unikernel.ml | 14 -------------- uplink.ml | 2 +- 5 files changed, 3 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc21f03..9842928 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,4 +20,4 @@ addons: - time - libxen-dev env: - - FORK_USER=talex5 FORK_BRANCH=unikernel OCAML_VERSION=4.02 MIRAGE_BACKEND=xen PINS="mirage-nat:https://github.com/talex5/mirage-nat.git#simplify-checksum mirage-bootvar-xen:https://github.com/talex5/mirage-bootvar-xen.git#qubes" + - FORK_USER=talex5 FORK_BRANCH=unikernel OCAML_VERSION=4.02 MIRAGE_BACKEND=xen PINS="mirage-nat:https://github.com/talex5/mirage-nat.git#simplify-checksum" diff --git a/README.md b/README.md index 5079e3a..a62ed36 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ To build (tested by creating a fresh Fedora 23 AppVM in Qubes): 2. Install mirage, pinning a few unreleased features we need: opam pin add -y mirage-nat 'https://github.com/talex5/mirage-nat.git#simplify-checksum' - opam pin add -y mirage-bootvar-xen 'https://github.com/talex5/mirage-bootvar-xen.git#qubes' opam install mirage 3. Build mirage-firewall: diff --git a/config.ml b/config.ml index eecc4bf..e2be6f3 100644 --- a/config.ml +++ b/config.ml @@ -13,3 +13,4 @@ let main = let () = register "qubes-firewall" [main $ default_clock] + ~argv:no_argv diff --git a/unikernel.ml b/unikernel.ml index c644971..d64274f 100644 --- a/unikernel.ml +++ b/unikernel.ml @@ -7,14 +7,7 @@ open Qubes let src = Logs.Src.create "unikernel" ~doc:"Main unikernel code" module Log = (val Logs.src_log src : Logs.LOG) -(* Configure logging *) -let () = - let open Logs in - (* Set default log level *) - set_level (Some Logs.Info) - module Main (Clock : V1.CLOCK) = struct - module Logs_reporter = Mirage_logs.Make(Clock) module Uplink = Uplink.Make(Clock) (* Set up networking and listen for incoming packets. *) @@ -54,16 +47,9 @@ module Main (Clock : V1.CLOCK) = struct ) ) - (* Control which of the messages that reach the reporter are logged to the console. - The rest will be displayed only if an error occurs. - Note: use the regular [Logs] configuration settings to determine which messages - reach the reporter in the first place. *) - let console_threshold _ = Logs.Info - (* Main unikernel entry point (called from auto-generated main.ml). *) let start () = let start_time = Clock.time () in - Logs_reporter.(create ~ring_size:20 ~console_threshold () |> run) @@ fun () -> (* Start qrexec agent, GUI agent and QubesDB agent in parallel *) let qrexec = RExec.connect ~domid:0 () in let gui = GUI.connect ~domid:0 () in diff --git a/uplink.ml b/uplink.ml index 2d5785c..711b5f5 100644 --- a/uplink.ml +++ b/uplink.ml @@ -47,7 +47,7 @@ module Make(Clock : V1.CLOCK) = struct let connect config = let ip = config.Dao.uplink_our_ip in - Netif.connect "tap0" >>= or_fail "Can't connect uplink device" >>= fun net -> + Netif.connect "0" >>= or_fail "Can't connect uplink device" >>= fun net -> Eth.connect net >>= or_fail "Can't make Ethernet device for tap" >>= fun eth -> Arp.connect eth >>= or_fail "Can't add ARP" >>= fun arp -> Arp.add_ip arp ip >>= fun () ->