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.
This commit is contained in:
Thomas Leonard 2016-04-30 13:35:24 +01:00
parent 1134b64f5e
commit 0230cfaf1e
5 changed files with 3 additions and 17 deletions

View File

@ -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"

View File

@ -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:

View File

@ -13,3 +13,4 @@ let main =
let () =
register "qubes-firewall" [main $ default_clock]
~argv:no_argv

View File

@ -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

View File

@ -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 () ->