mirror of
https://github.com/mirage/qubes-mirage-firewall.git
synced 2024-12-28 08:39:34 -05:00
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:
parent
1134b64f5e
commit
0230cfaf1e
@ -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"
|
||||
|
@ -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:
|
||||
|
@ -13,3 +13,4 @@ let main =
|
||||
|
||||
let () =
|
||||
register "qubes-firewall" [main $ default_clock]
|
||||
~argv:no_argv
|
||||
|
14
unikernel.ml
14
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
|
||||
|
@ -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 () ->
|
||||
|
Loading…
Reference in New Issue
Block a user