fix fs init
This commit is contained in:
parent
4bbd16d3d3
commit
26a089d480
2 changed files with 10 additions and 14 deletions
|
|
@ -13,6 +13,11 @@ type entry = Mfat.entry = {
|
|||
size: int32;
|
||||
}
|
||||
|
||||
let create blk =
|
||||
match Fat.create blk with
|
||||
| Error (`Msg e) -> Fmt.failwith "FAT file system failure: %s." e
|
||||
| Ok fs -> fs
|
||||
|
||||
type t = Mkernel.Block.t Mfat.t
|
||||
|
||||
module type FS = sig
|
||||
|
|
|
|||
19
src/mte.ml
19
src/mte.ml
|
|
@ -73,12 +73,13 @@ let () =
|
|||
let rng () = Mirage_crypto_rng_mkernel.initialize (module RNG) in
|
||||
Mkernel.map rng Mkernel.[]
|
||||
in
|
||||
let storage = Mkernel.storage ~name:"storage" in
|
||||
let storage = Mkernel.block "storage" in
|
||||
let service =
|
||||
let ipv4 = Ipaddr.V4.Prefix.of_string_exn "10.0.0.2/24" in
|
||||
Mnet.stack ~name:"service" ipv4
|
||||
in
|
||||
Mkernel.(run [ rng; storage; service ]) @@ fun rng fs (stack, tcp, udp) () ->
|
||||
Mkernel.(run [ rng; storage; service ])
|
||||
@@ fun rng storage (stack, tcp, udp) () ->
|
||||
let@ () = fun () -> Mirage_crypto_rng_mkernel.kill rng in
|
||||
let@ () = fun () -> Mnet.kill stack in
|
||||
let hed, he = Mnet_happy_eyeballs.create tcp in
|
||||
|
|
@ -88,20 +89,10 @@ let () =
|
|||
let@ () = fun () -> Mnet_dns.Transport.kill t in
|
||||
Caqti_miou.Switch.run @@ fun sw ->
|
||||
(* -- *)
|
||||
let fs = Fat.create storage in
|
||||
let env = Env.{ sw; stack; tcp; dns; fs } in
|
||||
let devices = Vifu.Devices.[ Global.db_conn; Global.keys ] in
|
||||
let cfg = Vifu.Config.v Config.Exchange.port in
|
||||
Vifu.run ~cfg ~devices tcp routes env
|
||||
|
||||
(*
|
||||
Miou_unix.run @@ fun () ->
|
||||
Caqti_miou.Switch.run @@ fun caqti_switch ->
|
||||
let env : Devices.env =
|
||||
{ caqti_switch; db_uri= Config.Exchangedb_postgres.config }
|
||||
in
|
||||
let devices = Vifu.Devices.[ Devices.db_connection; Devices.keys ] in
|
||||
let middlewares = Vifu.Middlewares.[] in
|
||||
Logs.info (fun m ->
|
||||
m ~tags:(Util.Log_reporter.detail "...") "Starting MTE server");
|
||||
Vifu.run ~cfg ~devices ~middlewares routes env
|
||||
*)
|
||||
Vifu.run ~cfg ~devices tcp routes env
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue