3

注意:我看起来这是一个突出的问题: http: //lists.xenproject.org/archives/html/mirageos-devel/2016-02/msg00076.htmlhttps://github.com/mirage/mirage-bootvar -xen/问题/17

我正在尝试从在 AWS 中运行的 mirage-skeleton 获取“hello”示例。我正在使用 mirage 存储库中的“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 库的版本:

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
4

1 回答 1

1

正如我所提到的,这似乎是一个悬而未决的问题。对我有用的是遵循页面底部的建议https://github.com/mirage/mirage/issues/493将 opam 固定到 mirage-bootvar-xen 的分支https://github .com/talex5/mirage-bootvar-xen/tree/qubes

我在尝试克隆和签出 qubes 分支时遇到了一些问题,所以我最终下载了 zip 并使用了它。

> opam pin add mirage-bootvar-xen <location of unzipped repository>
于 2016-03-11T21:03:24.100 回答