2
0

fixup nixos modules

This commit is contained in:
Ehmry - 2020-05-22 16:34:24 +05:30
parent 8858917eac
commit 8b5d35eef3
3 changed files with 143 additions and 43 deletions

View File

@ -52,6 +52,8 @@ let
imageInputs = map pkgs'.genodeSources.depot [ imageInputs = map pkgs'.genodeSources.depot [
"acpi_drv" "acpi_drv"
"ahci_drv" "ahci_drv"
"chroot"
"cached_fs_rom"
"init" "init"
"input_filter" "input_filter"
"ipxe_nic_drv" "ipxe_nic_drv"
@ -71,7 +73,7 @@ let
"terminal" "terminal"
"terminal_log" "terminal_log"
"vbox5" "vbox5"
"vesa_drv" "intel_fb_drv"
"vfs" "vfs"
"vfs_ttf" "vfs_ttf"
] ++ [ pkgs'.base-nova pkgs'.block_router ]; ] ++ [ pkgs'.base-nova pkgs'.block_router ];

View File

@ -125,6 +125,17 @@ let toVbox =
, attributes = toMap { name = "dev" } , attributes = toMap { name = "dev" }
, content = [ tag "log", tag "rtc" ] , content = [ tag "log", tag "rtc" ]
} }
, XML.element
{ name = "dir"
, attributes = toMap { name = "nix" }
, content =
[ XML.leaf
{ name = "fs"
, attributes = toMap
{ writeable = "no", label = "nix" }
}
]
}
, XML.leaf , XML.leaf
{ name = "fs" { name = "fs"
, attributes = toMap { writeable = "yes" } , attributes = toMap { writeable = "yes" }

View File

@ -78,52 +78,62 @@ let rootInit =
, config = Init.Config::{ , config = Init.Config::{
, attributes = toMap { system = "yes" } , attributes = toMap { system = "yes" }
, content = , content =
[ XML.text let PciPolicy/Type =
'' { labelSuffix : Text, pciClass : Text }
<report pci="yes"/>
<policy label_suffix="ps2_drv"> in [ XML.text
<device name="PS2"/> ''
</policy> <report pci="yes"/>
<policy label_suffix="vesa_fb_drv"> <policy label_suffix="ps2_drv">
<pci class="VGA"/> <device name="PS2"/>
</policy> </policy>
<policy label_suffix="ahci_drv"> <policy label_suffix="intel_fb_drv">
<pci class="AHCI"/> <pci class="VGA"/>
</policy> <pci bus="0" device="0" function="0"/>
<policy label_suffix="nvme_drv"> <pci class="ISABRIDGE"/>
<pci class="NVME"/> </policy>
</policy> <policy label_suffix="audio">
<policy label_suffix="usb_drv"> <pci class="AUDIO"/>
<pci class="USB"/> <pci class="HDAUDIO"/>
</policy> </policy>
<policy label_suffix="intel_fb_drv"> <policy label="acpica"/>
<pci class="VGA"/> ''
<pci bus="0" device="0" function="0"/> ]
<pci class="ISABRIDGE"/> # Prelude.List.map
</policy> PciPolicy/Type
<policy label_suffix="wifi_drv"> XML.Type
<pci class="WIFI"/> ( λ(policy : PciPolicy/Type)
</policy> → XML.element
<policy label_suffix="nic_drv"> { name = "policy"
<pci class="ETHERNET"/> , attributes = toMap
</policy> { label_suffix = policy.labelSuffix }
<policy label_suffix="audio"> , content =
<pci class="AUDIO"/> [ XML.leaf
<pci class="HDAUDIO"/> { name = "pci"
</policy> , attributes = toMap
<policy label="acpica"/> { class = policy.pciClass }
'' }
] ]
}
)
[ { labelSuffix = "ahci_drv"
, pciClass = "AHCI"
}
, { labelSuffix = "nic_drv"
, pciClass = "ETHERNET"
}
, { labelSuffix = "usb_drv", pciClass = "USB" }
]
} }
} }
, framebuffer = , framebuffer =
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
, binary = "vesa_fb_drv" , binary = "intel_fb_drv"
, provides = [ "Framebuffer" ] , provides = [ "Framebuffer" ]
, resources = Init.Resources::{ , resources = Init.Resources::{
, caps = 256 , caps = 256
, ram = Genode.units.MiB 16 , ram = Genode.units.MiB 48
} }
, routes = , routes =
[ ServiceRoute.parent "IO_MEM" [ ServiceRoute.parent "IO_MEM"
@ -132,7 +142,7 @@ let rootInit =
"Platform" "Platform"
"platform_drv" "platform_drv"
(None Text) (None Text)
(Some "vesa_fb_drv") (Some "intel_fb_drv")
] ]
} }
, input_filter = , input_filter =
@ -462,8 +472,28 @@ let rootInit =
] ]
} }
, XML.leaf , XML.leaf
{ name = "default-policy" { name = "policy"
, attributes = toMap { root = "/", writeable = "yes" } , attributes = toMap
{ label_prefix = "chroot"
, root = "/"
, writeable = "yes"
}
}
, XML.leaf
{ name = "policy"
, attributes = toMap
{ label_last = "nix"
, root = "/nix"
, writeable = "no"
}
}
, XML.leaf
{ name = "policy"
, attributes = toMap
{ label = "store_rom"
, root = "/nix/store"
, writeable = "no"
}
} }
] ]
} }
@ -474,6 +504,25 @@ let rootInit =
} }
, routes = [ ServiceRoute.child "Block" "block_router" ] , routes = [ ServiceRoute.child "Block" "block_router" ]
} }
, store_rom =
Child.flat
Child.Attributes::{
, binary = "cached_fs_rom"
, provides = [ "ROM" ]
, resources = Init.Resources::{
, ram =
let TODO_paramater = Genode.units.MiB 64
in TODO_paramater
}
, routes =
[ Init.ServiceRoute.childLabel
"File_system"
"file_system"
(None Text)
(Some "store_rom")
]
}
, nic_drv = , nic_drv =
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
@ -491,8 +540,46 @@ let rootInit =
(Some "nic_drv") (Some "nic_drv")
] ]
} }
, chroot =
Child.flat
Child.Attributes::{
, binary = "chroot"
, config = Init.Config::{
, content =
[ XML.leaf
{ name = "default-policy"
, attributes = toMap { writeable = "yes" }
}
]
}
, provides = [ "File_system" ]
, routes = [ ServiceRoute.child "File_system" "file_system" ]
}
, guests = , guests =
Init.toChild Init::{ children = guests } Init.Attributes::{=} Init.toChild
Init::{ children = guests, verbose = True }
Init.Attributes::{
, routes =
[ ServiceRoute.parent "VM"
, ServiceRoute.parent "Nitpicker"
, { service =
{ name = "File_system"
, label = Init.LabelSelector.Type.Last "nix"
}
, route =
Init.Route.Type.Child
{ name = "file_system", label = Some "nix" }
}
, ServiceRoute.child "File_system" "chroot"
, ServiceRoute.child "Nic" "nic_drv"
, ServiceRoute.child "Rtc" "rtc"
, ServiceRoute.child "Report" "pointer"
, ServiceRoute.parentLabel
"ROM"
(Some "platform_info")
(Some "platform_info")
]
}
} }
} }