Genode Packages collection https://git.sr.ht/~ehmry/genodepkgs/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

systemd-runner.dhall 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. let Genode = env:DHALL_GENODE
  2. let Prelude = Genode.Prelude
  3. let XML = Prelude.XML
  4. let Init = Genode.Init
  5. let Child = Init.Child
  6. let parentRoutes =
  7. Prelude.List.map Text Init.ServiceRoute.Type Init.ServiceRoute.parent
  8. in λ(params : { coreutils : Text, execStart : Text }) →
  9. Init::{
  10. , verbose = True
  11. , routes = parentRoutes [ "Timer", "Rtc", "File_system" ]
  12. , children = toMap
  13. { vfs =
  14. Child.flat
  15. Child.Attributes::{
  16. , binary = "vfs"
  17. , exitPropagate = True
  18. , provides = [ "File_system" ]
  19. , resources = Genode.Init.Resources::{
  20. , caps = 256
  21. , ram = Genode.units.MiB 8
  22. }
  23. , config = Init.Config::{
  24. , content =
  25. [ XML.element
  26. { name = "vfs"
  27. , attributes = XML.emptyAttributes
  28. , content =
  29. let dir =
  30. λ(name : Text) →
  31. λ(content : List XML.Type) →
  32. XML.element
  33. { name = "dir"
  34. , content
  35. , attributes = toMap { name }
  36. }
  37. let leaf =
  38. λ(name : Text) →
  39. XML.leaf
  40. { name, attributes = XML.emptyAttributes }
  41. in [ dir
  42. "dev"
  43. [ dir "pipes" [ leaf "pipe" ]
  44. , dir
  45. "sockets"
  46. [ XML.leaf
  47. { name = "fs"
  48. , attributes = toMap
  49. { label = "sockets" }
  50. }
  51. ]
  52. , leaf "log"
  53. , leaf "null"
  54. , leaf "rtc"
  55. , leaf "zero"
  56. ]
  57. , dir
  58. "etc"
  59. [ XML.element
  60. { name = "inline"
  61. , attributes = toMap
  62. { name = "ExecStart" }
  63. , content =
  64. [ XML.text params.execStart ]
  65. }
  66. ]
  67. , dir
  68. "usr"
  69. [ dir
  70. "bin"
  71. [ XML.leaf
  72. { name = "symlink"
  73. , attributes = toMap
  74. { name = "env"
  75. , target =
  76. "${params.coreutils}/bin/env"
  77. }
  78. }
  79. ]
  80. ]
  81. , dir "tmp" [ leaf "ram" ]
  82. , dir
  83. "nix"
  84. [ dir
  85. "store"
  86. [ XML.leaf
  87. { name = "fs"
  88. , attributes = toMap
  89. { label = "nix-store" }
  90. }
  91. ]
  92. ]
  93. ]
  94. }
  95. ]
  96. , policies =
  97. [ Init.Config.Policy::{
  98. , service = "File_system"
  99. , label = Init.LabelSelector.prefix "shell"
  100. , attributes = toMap { root = "/", writeable = "yes" }
  101. }
  102. ]
  103. }
  104. }
  105. , shell =
  106. Child.flat
  107. Child.Attributes::{
  108. , binary = "bash"
  109. , exitPropagate = True
  110. , resources = Genode.Init.Resources::{
  111. , caps = 256
  112. , ram = Genode.units.MiB 8
  113. }
  114. , config = Genode.Init.Config::{
  115. , content =
  116. [ XML.leaf
  117. { name = "libc"
  118. , attributes = toMap
  119. { stdin = "/dev/null"
  120. , stdout = "/dev/log"
  121. , stderr = "/dev/log"
  122. , pipe = "/dev/pipes"
  123. , rtc = "/dev/rtc"
  124. , socket = "/dev/sockets"
  125. }
  126. }
  127. , XML.element
  128. { name = "vfs"
  129. , attributes = XML.emptyAttributes
  130. , content =
  131. [ XML.leaf
  132. { name = "fs"
  133. , attributes = XML.emptyAttributes
  134. }
  135. ]
  136. }
  137. ]
  138. # Prelude.List.map
  139. Text
  140. XML.Type
  141. ( λ(x : Text) →
  142. XML.leaf
  143. { name = "arg"
  144. , attributes = toMap { value = x }
  145. }
  146. )
  147. [ "bash", "/etc/ExecStart" ]
  148. }
  149. }
  150. }
  151. }