2014-02-12 12:53:42 +00:00
|
|
|
assert_spec nova
|
|
|
|
|
2015-01-08 21:09:08 +00:00
|
|
|
if {[have_include "power_on/qemu"]} {
|
2014-07-10 06:35:23 +00:00
|
|
|
puts "\nRun script does not support Qemu.\n"
|
2014-02-12 12:53:42 +00:00
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2014-05-28 12:48:33 +00:00
|
|
|
append build_components {
|
2014-02-12 12:53:42 +00:00
|
|
|
core init virtualbox
|
|
|
|
server/part_blk
|
|
|
|
server/rump_fs
|
|
|
|
drivers/ahci
|
|
|
|
drivers/framebuffer
|
|
|
|
drivers/timer
|
|
|
|
}
|
|
|
|
|
2015-02-22 18:04:55 +00:00
|
|
|
lappend_if [expr $use_ps2] build_components drivers/input
|
|
|
|
lappend_if [expr $use_usb] build_components drivers/usb
|
2014-09-23 11:01:47 +00:00
|
|
|
lappend_if [have_spec acpi] build_components drivers/acpi
|
|
|
|
lappend_if [have_spec pci] build_components drivers/pci
|
|
|
|
lappend_if [have_spec x86] build_components drivers/rtc
|
|
|
|
lappend_if [expr $use_ram_fs] build_components server/ram_fs
|
2014-02-12 12:53:42 +00:00
|
|
|
|
|
|
|
build $build_components
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
set config {
|
2014-07-02 10:11:20 +00:00
|
|
|
<config verbose="yes" prio_levels="4">
|
2014-02-12 12:53:42 +00:00
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="RAM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="CAP"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="SIGNAL"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
2015-03-30 16:00:43 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
2014-02-12 12:53:42 +00:00
|
|
|
</default-route>
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
2014-07-02 10:11:20 +00:00
|
|
|
<start name="ahci" priority="-1">
|
2015-05-08 17:45:38 +00:00
|
|
|
<binary name="ahci_drv" />
|
2014-02-12 12:53:42 +00:00
|
|
|
<resource name="RAM" quantum="10M" />
|
|
|
|
<provides><service name="Block" /></provides>
|
2015-05-08 17:45:38 +00:00
|
|
|
<config>
|
|
|
|
<policy label="part_blk" device="0" />
|
|
|
|
</config>
|
2014-02-12 12:53:42 +00:00
|
|
|
<route>
|
|
|
|
<service name="IRQ"><child name="acpi" /></service>
|
|
|
|
<any-service> <parent /> <any-child /></any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
2014-07-02 10:11:20 +00:00
|
|
|
<start name="part_blk" priority="-1">
|
2014-02-12 12:53:42 +00:00
|
|
|
<resource name="RAM" quantum="10M" />
|
|
|
|
<provides><service name="Block" /></provides>
|
|
|
|
<route>
|
|
|
|
<any-service><child name="ahci"/> <parent/><any-child/></any-service>
|
|
|
|
</route>
|
|
|
|
<config>
|
|
|
|
<policy label="rump_fs" partition="4"/>
|
|
|
|
</config>
|
|
|
|
</start>
|
2014-07-02 10:11:20 +00:00
|
|
|
<start name="rump_fs" priority="-1">
|
2014-03-10 11:07:49 +00:00
|
|
|
<resource name="RAM" quantum="32M" />
|
2014-02-12 12:53:42 +00:00
|
|
|
<provides><service name="File_system"/></provides>
|
|
|
|
<config fs="ext2fs"><policy label="" root="/" writeable="yes"/></config>
|
|
|
|
<route>
|
|
|
|
<any-service><child name="part_blk"/> <parent/><any-child/></any-service>
|
|
|
|
</route>
|
2014-05-23 07:26:57 +00:00
|
|
|
</start>}
|
2014-02-12 12:53:42 +00:00
|
|
|
|
2014-09-23 11:01:47 +00:00
|
|
|
append_if [expr $use_ram_fs] config {
|
|
|
|
<start name="ram_fs" priority="-1">
|
|
|
|
<resource name="RAM" quantum="512M" />
|
|
|
|
<provides><service name="File_system"/></provides>
|
|
|
|
<config>
|
|
|
|
<content>
|
2015-02-19 10:59:31 +00:00
|
|
|
<dir name="ram"> }
|
|
|
|
append_if [expr $use_ram_fs] config "<rom name=\"${overlay_image}\"/>"
|
|
|
|
append_if [expr $use_ram_fs] config {
|
2014-09-23 11:01:47 +00:00
|
|
|
</dir>
|
|
|
|
</content>
|
|
|
|
<!-- constrain sessions according to their labels -->
|
|
|
|
<policy label="vbox -> from_ram_fs" root="/ram" writeable="yes" />
|
|
|
|
</config>
|
|
|
|
</start>}
|
|
|
|
|
2014-02-12 12:53:42 +00:00
|
|
|
append_if [have_spec acpi] config {
|
2014-07-02 10:11:20 +00:00
|
|
|
<start name="acpi" priority="-1">
|
2015-02-22 18:04:55 +00:00
|
|
|
<resource name="RAM" quantum="12M" constrain_phys="yes"/>
|
2014-02-12 12:53:42 +00:00
|
|
|
<binary name="acpi_drv"/>
|
|
|
|
<provides>
|
|
|
|
<service name="PCI"/>
|
|
|
|
<service name="IRQ" />
|
|
|
|
</provides>
|
2015-04-24 14:10:04 +00:00
|
|
|
<config>
|
|
|
|
<policy label="acpi_drv"> <pci class="ALL"/> </policy>
|
|
|
|
<policy label="ahci"> <pci class="AHCI"/> </policy>
|
|
|
|
<policy label="nic_drv"> <pci class="ETHERNET"/> </policy>
|
|
|
|
<policy label="ps2_drv"> <device name="PS2"/> </policy>
|
|
|
|
<policy label="usb_drv"> <pci class="USB"/> </policy>
|
|
|
|
<policy label="fb_drv"> <pci class="VGA"/> </policy>
|
|
|
|
</config>
|
2014-02-12 12:53:42 +00:00
|
|
|
<route>
|
|
|
|
<service name="PCI"> <any-child /> </service>
|
|
|
|
<any-service> <parent/> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>}
|
|
|
|
|
|
|
|
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
|
2014-07-02 10:11:20 +00:00
|
|
|
<start name="pci_drv" priority="-1">
|
2015-02-09 13:57:04 +00:00
|
|
|
<resource name="RAM" quantum="2M" constrain_phys="yes"/>
|
2014-02-12 12:53:42 +00:00
|
|
|
<provides> <service name="PCI"/> </provides>
|
2015-04-24 14:10:04 +00:00
|
|
|
<config>
|
|
|
|
<policy label="ahci"> <pci class="AHCI"/> </policy>
|
|
|
|
<policy label="nic_drv"> <pci class="ETHERNET"/> </policy>
|
|
|
|
<policy label="ps2_drv"> <device name="PS2"/> </policy>
|
|
|
|
<policy label="usb_drv"> <pci class="USB"/> </policy>
|
|
|
|
<policy label="fb_drv"> <pci class="VGA"/> </policy>
|
|
|
|
</config>
|
2014-05-23 07:26:57 +00:00
|
|
|
</start>}
|
2014-02-12 12:53:42 +00:00
|
|
|
|
2015-02-22 18:04:55 +00:00
|
|
|
append_if [expr $use_ps2] config {
|
2014-07-02 10:11:20 +00:00
|
|
|
<start name="ps2_drv" priority="-1">
|
2014-02-12 12:53:42 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Input"/></provides>
|
2015-02-22 18:04:55 +00:00
|
|
|
<route>
|
|
|
|
<service name="IRQ"><child name="acpi" /></service>
|
|
|
|
<any-service> <parent /> <any-child /></any-service>
|
|
|
|
</route>
|
2014-05-23 07:26:57 +00:00
|
|
|
</start>}
|
2014-02-12 12:53:42 +00:00
|
|
|
|
2015-02-22 18:04:55 +00:00
|
|
|
append_if [expr $use_usb] config {
|
|
|
|
<start name="usb_drv" priority="-1">
|
2015-05-08 17:19:05 +00:00
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Input"/>
|
|
|
|
<service name="Usb" />
|
|
|
|
</provides>
|
2015-02-22 18:04:55 +00:00
|
|
|
<config uhci="yes" ehci="yes" xhci="yes">
|
|
|
|
<hid/>
|
2015-05-08 17:19:05 +00:00
|
|
|
<raw>
|
|
|
|
<report devices="yes"/>
|
|
|
|
</raw>
|
2015-02-22 18:04:55 +00:00
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="IRQ"><child name="acpi" /></service>
|
|
|
|
<any-service> <parent /> <any-child /></any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
}
|
|
|
|
|
2014-02-12 12:53:42 +00:00
|
|
|
append_if [have_spec framebuffer] config {
|
2014-07-02 10:11:20 +00:00
|
|
|
<start name="fb_drv" priority="-1">
|
2014-02-12 12:53:42 +00:00
|
|
|
<resource name="RAM" quantum="6M"/>
|
|
|
|
<provides><service name="Framebuffer"/></provides>
|
2015-03-30 16:00:43 +00:00
|
|
|
<config buffered="yes" />
|
2014-02-12 12:53:42 +00:00
|
|
|
</start>}
|
|
|
|
|
2014-05-23 07:26:57 +00:00
|
|
|
append_if [have_spec x86] config {
|
2014-07-02 10:11:20 +00:00
|
|
|
<start name="rtc_drv" priority="-1">
|
2014-05-23 07:26:57 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Rtc"/>
|
|
|
|
</provides>
|
|
|
|
</start>}
|
|
|
|
|
2014-02-12 12:53:42 +00:00
|
|
|
append config $config_of_app
|
|
|
|
|
|
|
|
append config {
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
2014-05-28 12:48:33 +00:00
|
|
|
append boot_modules {
|
2014-02-12 12:53:42 +00:00
|
|
|
core init timer
|
2015-05-08 17:45:38 +00:00
|
|
|
part_blk ahci_drv
|
2014-05-23 07:26:57 +00:00
|
|
|
ld.lib.so libc.lib.so libm.lib.so pthread.lib.so
|
|
|
|
libc_lock_pipe.lib.so libc_terminal.lib.so
|
2014-09-23 11:01:47 +00:00
|
|
|
libiconv.lib.so stdcxx.lib.so
|
2014-02-12 12:53:42 +00:00
|
|
|
rump.lib.so rump_fs.lib.so rump_fs
|
2014-09-23 11:01:47 +00:00
|
|
|
virtualbox
|
2014-02-12 12:53:42 +00:00
|
|
|
}
|
|
|
|
|
2014-09-23 11:01:47 +00:00
|
|
|
lappend_if [expr $use_ram_fs] boot_modules ram_fs
|
2015-02-19 10:59:31 +00:00
|
|
|
lappend_if [expr $use_ram_fs] boot_modules ${overlay_image}
|
2014-09-23 11:01:47 +00:00
|
|
|
|
2014-02-12 12:53:42 +00:00
|
|
|
# platform-specific modules
|
2015-02-22 18:04:55 +00:00
|
|
|
lappend_if [expr $use_ps2] boot_modules ps2_drv
|
|
|
|
lappend_if [expr $use_usb] boot_modules usb_drv
|
2014-02-12 12:53:42 +00:00
|
|
|
lappend_if [have_spec acpi] boot_modules acpi_drv
|
|
|
|
lappend_if [have_spec pci] boot_modules pci_drv
|
|
|
|
lappend_if [have_spec framebuffer] boot_modules fb_drv
|
|
|
|
lappend_if [have_spec nova] boot_modules pci_device_pd
|
2014-05-23 07:26:57 +00:00
|
|
|
lappend_if [have_spec x86] boot_modules rtc_drv
|