genode-ehmry/runtimes/noux-system/pkg.dhall -rw-r--r-- 3.3 KiB View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
let Genode = env:DHALL_GENODE

let Prelude = Genode.Prelude

let XML = Prelude.XML

let service = λ(s : Text) → { service = s, label = None Text }

let serviceLabel = λ(s : Text) → λ(l : Text) → { service = s, label = Some l }

let fsService = λ(label : Text) → serviceLabel "file_system" label

let Noux = Genode.Components.Noux

let Terminal = Genode.Components.Terminal

let terminal =
      Terminal.construct
      (   Terminal.defaults
        ⫽ { routes =
              { fontsFs =
                  Genode.Route.parent (Some "fonts")
              , nitpicker =
                  Genode.Route.parent (None Text)
              , timer =
                  Genode.Route.parent (None Text)
              }
          }
      )

let nouxBase =
      Noux.construct
      (   Noux.defaults
        ⫽ { config =
              XML.text
              ''
              <config>
              	<fstab>
              		<tar name="bash-minimal.tar" />
              		<tar name="coreutils-minimal.tar" />
              		<tar name="vim-minimal.tar" />
              		<dir name="dev"> <zero/> <null/> </dir>
              		<dir name="rw">     <fs label="target"/> </dir>
              		<dir name="report"> <fs label="report"/> </dir>
              		<dir name="config"> <fs label="config"/> </dir>
              		<dir name="tmp"> <ram /> </dir>
              	</fstab>
              	<start name="/bin/bash">
              		<env name="TERM" value="screen" />
              		<env name="PS1" value="noux:$PWD " />
              	</start>
              </config>
              ''
          , resources =
              { caps = 512, ram = Genode.units.MiB 64 }
          , routes =
              { timer = Genode.Route.parent (None Text) }
          }
      )

let parentFs =
        λ(label : Text)
      → Genode.ServiceRoute.parent "File_system" (Some label) (Some label)

let noux =
        nouxBase
      ⫽ { exitPropagate =
            True
        , routes =
              nouxBase.routes
            # [ Genode.ServiceRoute.child
                "Terminal"
                "terminal"
                (None Text)
                (None Text)
              , parentFs "target"
              , parentFs "config"
              , parentFs "report"
              ]
        }

let initConfig =
      Genode.Init.defaults ⫽ { verbose = True, children = [ terminal, noux ] }

in  { indexInfo =
        "Noux administration environment"
    , runtime =
          Genode.Runtime.defaults
        ⫽ { resources =
              Genode.Init.sumResources initConfig
          , requires =
              [ fsService "config"
              , fsService "report"
              , fsService "target"
              , fsService "fonts"
              , service "nitpicker"
              , serviceLabel "report" "clipboard"
              , serviceLabel "rom" "clipboard"
              ]
          , roms =
              [ "libc.lib.so"
              , "libm.lib.so"
              , "init"
              , "terminal"
              , "noux"
              , "libc_noux.lib.so"
              , "posix.lib.so"
              , "ncurses.lib.so"
              , "bash-minimal.tar"
              , "coreutils-minimal.tar"
              , "vim-minimal.tar"
              , "vfs.lib.so"
              ]
          , config =
              Genode.Init.toXML initConfig
          }
    }