注:I看起来这是一个突出的问题:http://lists.xenproject.org/archives/html/mirageos-devel/2016-02/msg00076.html和https://github.com/mirage/mirage-bootvar-xen/issues/17
我试图从AWS中运行的海市蜃楼骨架中得到"hello“的例子。我正在使用海市蜃楼存储库中的"ec2.sh“脚本,当它运行时,我会收到一个错误。
我配置、构建、然后部署和运行,如下所示:
> cd ../mirage-skeleton/hello/
> mirage configure --xen
> gmake
> ec2.sh -k mir-console.xen
> ec2-run-instances --region us-west-1 ami-dc96e5bc在EC2控制台的系统日志中,在引导消息之后,我得到以下错误:
Xen Minimal OS!
Initialising timer interface
Initialising console ... done.
getenv(OCAMLRUNPARAM) -> null
getenv(CAMLRUNPARAM) -> null
getenv(PATH) -> null
Unsupported function lseek called in Mini-OS kernel
Unsupported function lseek called in Mini-OS kernel
Unsupported function lseek called in Mini-OS kernel
getenv(OCAMLRUNPARAM) -> null
getenv(CAMLRUNPARAM) -> null
getenv(TMPDIR) -> null
getenv(TEMP) -> null
Fatal error: exception Failure("Malformed boot parameter \"ro\"")
Raised at file "src/core/lwt.ml", line 789, characters 22-23
Called from file "lib/main.ml", line 58, characters 10-20
Called from file "main.ml", line 52, characters 5-10
Mirage exiting with status 2
Do_exit called!这些是我安装的海市蜃楼库的版本:
mirage 2.7.0 The MirageOS library operating system
mirage-bootvar-xen 0.3.1 Library for reading MirageOS unikernel boo
mirage-clock-xen 1.1 A Mirage-compatible Clock library for Xen
mirage-conduit 2.2.0 Virtual package for the MirageOS Conduit t
mirage-console 2.1.3 A Mirage-compatible Console library for Xe
mirage-dns 2.5.0 Virtual package for the MirageOS DNS trans
mirage-entropy-xen 0.3.0 MirageOS entropy device
mirage-http 2.5.1 MirageOS HTTP client and server driver
mirage-net-xen 1.5.0 Ethernet network device driver for MirageO
mirage-profile 0.6.1 Collect profiling information
mirage-types 2.6.0 Module type definitions for Mirage-compati
mirage-types-lwt 2.6.0 Lwt module type definitions for Mirage-com
mirage-vnetif 0.1.0 Virtual network interface and software swi
mirage-xen 2.3.3 MirageOS library for Xen
mirage-xen-minios 0.8.0 Xen MiniOS guest operating system library
mirage-xen-ocaml 2.3.4 MirageOS headers for the OCaml runtime
mirage-xen-posix 2.3.4 MirageOS library for posix headers作为参考,对于"hello“示例,config.ml文件是:
open Mirage
let key =
let doc = Key.Arg.info ~doc:"How to say hello." ["hello"] in
Key.(create "hello" Arg.(opt string "Hello World!" doc))
let main =
foreign
~keys:[Key.abstract key]
"Unikernel.Main" (console @-> job)
let () =
register "console" [main $ default_console]而unikernel.ml是
open Lwt
module Main (C: V1_LWT.CONSOLE) = struct
let start c =
for_lwt i = 0 to 4 do
C.log c (Key_gen.hello ()) ;
lwt () = OS.Time.sleep 1.0 in
return ()
done
end我读到了一些关于引导/内核参数是MirageOS最新版本中的一个新特性的文章。我需要在config.ml中修改什么来解释这个问题吗?
我要补充的是,这个示例在Xen中确实在本地工作:
> sudo xl create -c console.xl
Xen Minimal OS!
Initialising timer interface
Initialising console ... done.
getenv(OCAMLRUNPARAM) -> null
getenv(CAMLRUNPARAM) -> null
getenv(PATH) -> null
Unsupported function lseek called in Mini-OS kernel
Unsupported function lseek called in Mini-OS kernel
Unsupported function lseek called in Mini-OS kernel
getenv(OCAMLRUNPARAM) -> null
getenv(CAMLRUNPARAM) -> null
getenv(TMPDIR) -> null
getenv(TEMP) -> null
Hello World!
Hello World!
Hello World!
Hello World!
Hello World!
Parsing config from console.xl发布于 2016-03-11 21:03:24
正如我所提到的,这似乎是一个悬而未决的问题。对我起作用的是遵循页面底部的建议,https://github.com/mirage/mirage/issues/493,也就是把opam钉到海市蜃楼的分支https://github.com/talex5/mirage-bootvar-xen/tree/qubes上。
我遇到了一些问题,只是试图克隆和签出qubes分支,所以我最终下载了zip并使用了它。
> opam pin add mirage-bootvar-xen <location of unzipped repository>https://stackoverflow.com/questions/35928373
复制相似问题