From b2bc5912c82b57e23a98ed0e2d758b6982a663c1 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 4 May 2023 16:18:04 +0200 Subject: [PATCH] os: use [build_artifacts] in run scripts Issue #4860 --- repos/os/run/ahci_block.run | 7 +- repos/os/run/block_request_stream.run | 6 +- repos/os/run/block_tester.run | 8 +- repos/os/run/bomb.run | 22 ++--- repos/os/run/cache.run | 18 +--- repos/os/run/cpu_balancer.run | 48 +++++---- repos/os/run/cpu_bench.run | 4 +- repos/os/run/demo.run | 2 +- repos/os/run/event_filter.run | 116 ++++++++++------------ repos/os/run/fb_bench.run | 2 +- repos/os/run/framebuffer.run | 3 +- repos/os/run/i2c_mcp9808.run | 8 +- repos/os/run/init_smp.run | 96 +++++++++--------- repos/os/run/loader.run | 2 +- repos/os/run/log_core.run | 55 ++++++----- repos/os/run/lx_fs_import.run | 17 ++-- repos/os/run/mixer.run | 40 ++------ repos/os/run/nic_dump.run | 3 +- repos/os/run/nic_router_dhcp.inc | 13 +-- repos/os/run/nic_router_disable_arp.run | 7 +- repos/os/run/nic_router_flood.run | 2 +- repos/os/run/nic_stress.inc | 13 +-- repos/os/run/nvme.run | 14 +-- repos/os/run/ping.run | 3 +- repos/os/run/ping_nic_router.run | 3 +- repos/os/run/platform_drv.run | 2 +- repos/os/run/pointer.run | 38 +------ repos/os/run/rom_to_file.run | 26 +---- repos/os/run/rtc.run | 125 ++++++++++++++---------- repos/os/run/sd_card.run | 4 +- repos/os/run/sd_card_bench.run | 4 +- repos/os/run/smbios_decoder.run | 9 +- repos/os/run/tar_rom.run | 4 +- repos/os/run/test.run | 6 +- repos/os/run/timeout.run | 8 +- repos/os/run/tz_vmm.run | 4 +- repos/os/run/uart.run | 39 ++------ repos/os/run/usb_block.run | 5 +- repos/os/run/vfs_block.run | 8 +- repos/os/run/vmm_arm.run | 7 +- repos/os/run/vmm_x86.run | 16 +-- 41 files changed, 327 insertions(+), 490 deletions(-) diff --git a/repos/os/run/ahci_block.run b/repos/os/run/ahci_block.run index fb537f9084..8616c5af84 100644 --- a/repos/os/run/ahci_block.run +++ b/repos/os/run/ahci_block.run @@ -2,7 +2,7 @@ assert_spec x86 create_boot_directory build { - core init timer + core init timer lib/ld drivers/platform drivers/acpi drivers/ahci @@ -154,10 +154,7 @@ install_config { # # Boot modules # -build_boot_image { - core ld.lib.so init timer - pci_decode platform_drv report_rom acpi_drv - ahci_drv report_rom block_tester } +build_boot_image [build_artifacts] append qemu_args " -nographic -device ahci,id=ahci -boot d " append qemu_args " -drive id=disk,file=bin/ext2.raw,format=raw,if=none -device ide-hd,drive=disk,bus=ahci.0 " diff --git a/repos/os/run/block_request_stream.run b/repos/os/run/block_request_stream.run index 44130eb556..5048659888 100644 --- a/repos/os/run/block_request_stream.run +++ b/repos/os/run/block_request_stream.run @@ -1,4 +1,4 @@ -build { core init timer test/block_request_stream app/block_tester } +build { core init timer lib/ld test/block_request_stream app/block_tester } create_boot_directory @@ -57,9 +57,7 @@ install_config { } - -build_boot_image { core init timer block_tester test-block_request_stream ld.lib.so } - +build_boot_image [build_artifacts] append qemu_args " -nographic " diff --git a/repos/os/run/block_tester.run b/repos/os/run/block_tester.run index d1ad2c19b3..6f0ee14092 100644 --- a/repos/os/run/block_tester.run +++ b/repos/os/run/block_tester.run @@ -9,7 +9,7 @@ set sgdisk [installed_command sgdisk] create_boot_directory build { - core init timer + core init timer lib/ld server/lx_block server/report_rom app/block_tester @@ -276,11 +276,7 @@ install_config { create_disk_image 0 create_disk_image 1 -build_boot_image { - core init timer block_tester report_rom - ld.lib.so part_block - block0.raw block1.raw lx_block -} +build_boot_image [list {*}[build_artifacts] block0.raw block1.raw] run_genode_until {.*--- all tests finished ---.*\n} 360 set serial_id [output_spawn_id] diff --git a/repos/os/run/bomb.run b/repos/os/run/bomb.run index f30bb2849b..6c9b1b8d33 100644 --- a/repos/os/run/bomb.run +++ b/repos/os/run/bomb.run @@ -1,4 +1,4 @@ -build "core init test/bomb timer" +build { core init lib/ld test/bomb timer } set timeout 240 set rounds 20 @@ -27,7 +27,9 @@ if {[have_spec pistachio]} { # prevent hitting the socket-descriptor limit on Linux if {[have_spec linux]} { set generations 4 } -set config { +create_boot_directory + +install_config { @@ -52,20 +54,12 @@ set config { - } - -append config " - " - -append config { + + } -create_boot_directory - -install_config $config - -build_boot_image "core ld.lib.so init bomb timer" +build_boot_image [build_artifacts] run_genode_until {.*Done\. Going to sleep.*} $timeout diff --git a/repos/os/run/cache.run b/repos/os/run/cache.run index 936b024b24..66d5730d7f 100644 --- a/repos/os/run/cache.run +++ b/repos/os/run/cache.run @@ -1,16 +1,8 @@ -# -# \brief Simple cache benchmark -# \author Johannes Schlatow -# - - -set build_components { core init test/cache } - -build $build_components +build { core init lib/ld test/cache } create_boot_directory -set config { +install_config { @@ -29,10 +21,6 @@ set config { } -install_config $config - -set boot_modules { core ld.lib.so init test-cache } - -build_boot_image $boot_modules +build_boot_image [build_artifacts] run_genode_until "done.*\n" 300 diff --git a/repos/os/run/cpu_balancer.run b/repos/os/run/cpu_balancer.run index 2e13f40d80..5add4f1d65 100644 --- a/repos/os/run/cpu_balancer.run +++ b/repos/os/run/cpu_balancer.run @@ -1,4 +1,7 @@ -build "core init timer server/cpu_balancer app/cpu_burner app/top server/dynamic_rom" +build { + core init timer lib/ld + server/cpu_balancer app/cpu_burner app/top server/dynamic_rom +} if {![have_include "power_on/qemu"]} { puts "Run script is not supported on this platform" @@ -15,12 +18,32 @@ set cpu_height 1 set report_config "yes" set use_trace "yes" +proc report_rom_start_node { } { + + global report_config + + if {$report_config != "yes"} { + return { } } + + return { + + + + + + + + + + } +} + create_boot_directory import_from_depot [depot_user]/src/report_rom \ [depot_user]/src/shim -append config { +install_config { @@ -46,20 +69,10 @@ append config { - } + -append_if [expr $report_config eq "yes"] config { - - - - - - - - - } + } [report_rom_start_node] { -append config { @@ -104,9 +117,8 @@ append config { - } + -append config { @@ -157,9 +169,7 @@ append config { --> } -install_config $config - -build_boot_image { core ld.lib.so init timer cpu_balancer cpu_burner top dynamic_rom } +build_boot_image [build_artifacts] append qemu_args " -nographic" append qemu_args " -smp [expr $cpu_width * $cpu_height],cores=$cpu_width,threads=$cpu_height" diff --git a/repos/os/run/cpu_bench.run b/repos/os/run/cpu_bench.run index 098de816b6..2560d023dc 100644 --- a/repos/os/run/cpu_bench.run +++ b/repos/os/run/cpu_bench.run @@ -10,7 +10,7 @@ if {[have_board linux]} { exit 0 } -build "core init timer test/cpu_bench" +build { core init timer lib/ld test/cpu_bench } create_boot_directory @@ -32,7 +32,7 @@ install_config { } -build_boot_image { core init cpu_bench ld.lib.so } +build_boot_image [build_artifacts] append qemu_args " -nographic " diff --git a/repos/os/run/demo.run b/repos/os/run/demo.run index 41a84c118a..27ca7fc3fd 100644 --- a/repos/os/run/demo.run +++ b/repos/os/run/demo.run @@ -214,7 +214,7 @@ puts $launchpad_config_fd { } close $launchpad_config_fd -build_boot_image { status_bar testnit launchpad.config } +build_boot_image [list {*}[build_artifacts] launchpad.config] if {[get_cmd_switch --autopilot]} { run_genode_until {\[init -> scout\] png is.*\n} 40 diff --git a/repos/os/run/event_filter.run b/repos/os/run/event_filter.run index 08872ccfdc..0d5f8c25dd 100644 --- a/repos/os/run/event_filter.run +++ b/repos/os/run/event_filter.run @@ -1,34 +1,55 @@ -proc test_char_repeat { } { - - # the character-repeat test is too timing sensitive to run reliably on - # Qemu - if {[have_include "power_on/qemu"]} { return 0 } - - # the legacy PIT timer driver is too inaccurate to produce stable results - # for the character-repeat test - if {[binary_name_timer] == "pit_timer_drv"} { return 0 } - - return 1 -} - -# -# Build -# - -set build_components { - core init timer +build { + core init timer lib/ld server/report_rom server/event_filter test/event_filter } -build $build_components - create_boot_directory -# -# Generate config -# +proc test_step_char_repeat { } { -append config { + # the character-repeat test is too timing sensitive to run reliably on + # Qemu + if {[have_include "power_on/qemu"]} { + return { } } + + # the legacy PIT timer driver is too inaccurate to produce stable results + # for the character-repeat test + if {[binary_name_timer] == "pit_timer_drv"} { + return { } } + + return { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } +} + +install_config { @@ -201,40 +222,10 @@ append config { - } + -append_if [test_char_repeat] config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - } - -append config { + } [test_step_char_repeat] { @@ -583,20 +574,13 @@ append config { } -install_config $config -# -# Boot modules -# - -set boot_modules { core ld.lib.so init timer report_rom - event_filter test-event_filter } - -build_boot_image $boot_modules +build_boot_image [build_artifacts] append qemu_args " -nographic " run_genode_until {.*child "test-event_filter" exited with exit value 0.*} 60 + grep_output {mapped event} unify_output {\t} { } compare_output_to { diff --git a/repos/os/run/fb_bench.run b/repos/os/run/fb_bench.run index 65a907520a..debf4d4a39 100644 --- a/repos/os/run/fb_bench.run +++ b/repos/os/run/fb_bench.run @@ -94,7 +94,7 @@ set fd [open [run_dir]/genode/focus w] puts $fd " \" domain=\"default\"/>" close $fd -build_boot_image { test-fb_bench } +build_boot_image [build_artifacts] # disable QEMU graphic to enable testing on our machines without SDL and X append qemu_args "-nographic " diff --git a/repos/os/run/framebuffer.run b/repos/os/run/framebuffer.run index 26433ab207..d729d8e324 100644 --- a/repos/os/run/framebuffer.run +++ b/repos/os/run/framebuffer.run @@ -1,4 +1,5 @@ create_boot_directory + import_from_depot [depot_user]/src/[base_src] \ [depot_user]/pkg/[drivers_interactive_pkg] \ [depot_user]/src/init @@ -53,6 +54,6 @@ install_config { } -build_boot_image { event_dump test-framebuffer } +build_boot_image [build_artifacts] run_genode_until forever diff --git a/repos/os/run/i2c_mcp9808.run b/repos/os/run/i2c_mcp9808.run index 1ff7ac5f16..caa95845b4 100644 --- a/repos/os/run/i2c_mcp9808.run +++ b/repos/os/run/i2c_mcp9808.run @@ -78,11 +78,7 @@ install_config { } file copy [select_from_repositories board/[board]/devices] [run_dir]/genode/devices -build_boot_image { - core - timer - imx8q_evk_i2c_drv - i2c_mcp9808 -} + +build_boot_image [build_artifacts] run_genode_until forever diff --git a/repos/os/run/init_smp.run b/repos/os/run/init_smp.run index 75d4a77656..d158d10629 100644 --- a/repos/os/run/init_smp.run +++ b/repos/os/run/init_smp.run @@ -1,4 +1,4 @@ -build "core init test/bomb timer" +build { core init lib/ld test/bomb timer } set timeout 60 set rounds 10 @@ -28,40 +28,14 @@ if { [get_cmd_switch --autopilot] } { create_boot_directory -set config { -} +proc per_cpu_start_node { i } { -append config " - " + global init_ram rounds generations children sleep demand -append config { - - - - - - - - - - - - - - - - - - } - - -for { set i 0} { $i < ${cpus} } { incr i} { - - append config " - - - " - append config { + return [join [list { + + + @@ -80,31 +54,59 @@ for { set i 0} { $i < ${cpus} } { incr i} { - + - } - -append config " - " - -append config { + + - } + }] ""] } -append config { +proc cpu_start_nodes { cpus } { + + set result { } + for { set i 0} { $i < $cpus } { incr i } { + append result [per_cpu_start_node $i] } + + return $result +} + + +install_config { + + + + + + + + + + + + + + + + + + + + + + + + } [cpu_start_nodes $cpus] { + } -install_config $config - -build_boot_image "core ld.lib.so init bomb timer" +build_boot_image [build_artifacts] append qemu_args " -m [expr 128 + $init_ram*$cpus]M -nographic -smp $cpus" - if { [get_cmd_switch --autopilot] } { run_genode_until {bomb started} 20 diff --git a/repos/os/run/loader.run b/repos/os/run/loader.run index 4209778aca..3b5ba4fad0 100644 --- a/repos/os/run/loader.run +++ b/repos/os/run/loader.run @@ -69,5 +69,5 @@ install_config { } -build_boot_image { testnit loader test-loader } +build_boot_image [build_artifacts] run_genode_until forever diff --git a/repos/os/run/log_core.run b/repos/os/run/log_core.run index 7436584b3b..08164a2189 100644 --- a/repos/os/run/log_core.run +++ b/repos/os/run/log_core.run @@ -16,11 +16,36 @@ if {[have_spec nova]} { proc kernel_output { } { return "novga logmem" } } -build { core init timer server/file_terminal server/terminal_log app/log_core } +build { + core init timer lib/ld + server/file_terminal server/terminal_log app/log_core +} create_boot_directory -append config { +proc kernel_start_node { } { + + if {![have_spec nova]} { + return { } } + + return { + + + + + + + + + + + + + + } +} + +install_config { @@ -77,33 +102,13 @@ append config { - } + -append_if [have_spec nova] config { - - - - - - - - - - - - - - } + } [kernel_start_node] { -append config { } -install_config $config - -build_boot_image { - core init timer ld.lib.so vfs.lib.so libc.lib.so - file_terminal terminal_log log_core -} +build_boot_image [build_artifacts] append qemu_args " -nographic " diff --git a/repos/os/run/lx_fs_import.run b/repos/os/run/lx_fs_import.run index 13a73b26e1..81ce056d78 100644 --- a/repos/os/run/lx_fs_import.run +++ b/repos/os/run/lx_fs_import.run @@ -1,22 +1,21 @@ assert_spec linux -set depot_archives { } -set build_components { } -set boot_modules { } - lappend depot_archives [depot_user]/src/[base_src] lappend depot_archives [depot_user]/src/init lappend depot_archives [depot_user]/src/vfs lappend depot_archives [depot_user]/src/vfs_import +set build_components { } + if { [get_cmd_switch --autopilot] } { lappend depot_archives [depot_user]/src/lx_fs } else { lappend build_components server/lx_fs - lappend boot_modules lx_fs } -set config { +create_boot_directory + +install_config { @@ -43,7 +42,6 @@ set config { - @@ -88,16 +86,13 @@ set config { } -create_boot_directory -install_config $config - import_from_depot $depot_archives if { [llength $build_components] > 0 } { build $build_components } -build_boot_image $boot_modules +build_boot_image [build_artifacts] ## Create files before genode is run exec mkdir -p [run_dir]/genode/test-existing-file diff --git a/repos/os/run/mixer.run b/repos/os/run/mixer.run index 490dbdcfad..f239a43192 100644 --- a/repos/os/run/mixer.run +++ b/repos/os/run/mixer.run @@ -1,17 +1,13 @@ -# -# Build -# - if {[have_include "power_on/qemu"]} { puts "\nTest running on Qemu is not supported.\n" exit 0 } -# generic components -set build_components { - core init timer +build { + core init timer lib/ld drivers/audio drivers/platform + drivers/acpi server/mixer server/dynamic_rom server/report_rom @@ -19,15 +15,9 @@ set build_components { test/audio_out } -build $build_components create_boot_directory - -# -# Config -# - -set config { +install_config { @@ -121,7 +111,6 @@ set config { - @@ -208,9 +197,8 @@ set config { - } - -install_config $config + +} if {[expr ![file exists bin/client1.f32] || ![file exists bin/client2.f32]]} { puts "" @@ -220,20 +208,8 @@ if {[expr ![file exists bin/client1.f32] || ![file exists bin/client2.f32]]} { exit 1 } +build_boot_image [list {*}[build_artifacts] client1.f32 client2.f32] -# -# Boot modules -# - -# generic modules -append boot_modules { - core ld.lib.so init timer - report_rom dynamic_rom - platform_drv acpi_drv pci_decode - pci_audio_drv test-audio_out - mixer client1.f32 client2.f32 -} - -build_boot_image $boot_modules append qemu_args " -nographic" + run_genode_until forever diff --git a/repos/os/run/nic_dump.run b/repos/os/run/nic_dump.run index 315195a083..2e0176610e 100644 --- a/repos/os/run/nic_dump.run +++ b/repos/os/run/nic_dump.run @@ -280,7 +280,8 @@ append config { } install_config $config -build_boot_image { ping nic_dump } + +build_boot_image [build_artifacts] append qemu_args " -nographic " append_qemu_nic_args diff --git a/repos/os/run/nic_router_dhcp.inc b/repos/os/run/nic_router_dhcp.inc index 61dcc2b2f0..acb1bca4e6 100644 --- a/repos/os/run/nic_router_dhcp.inc +++ b/repos/os/run/nic_router_dhcp.inc @@ -265,18 +265,7 @@ append config { install_config $config -set boot_modules { - - init - dynamic_rom - nic_router - test-nic_router_dhcp-client -} - -lappend_if [nic_router_2_managed] boot_modules test-nic_router_dhcp-manager -lappend_if [nic_router_2_managed] boot_modules report_rom - -build_boot_image $boot_modules +build_boot_image [build_artifacts] append qemu_args " -nographic " append_qemu_nic_args diff --git a/repos/os/run/nic_router_disable_arp.run b/repos/os/run/nic_router_disable_arp.run index 23890b73f6..0d1a052ccc 100644 --- a/repos/os/run/nic_router_disable_arp.run +++ b/repos/os/run/nic_router_disable_arp.run @@ -17,8 +17,7 @@ import_from_depot [depot_user]/src/[base_src] \ build { app/ping server/nic_router init } -append config { - +install_config { @@ -91,9 +90,7 @@ append config { } -install_config $config - -build_boot_image { ping nic_router init } +build_boot_image [build_artifacts] append qemu_args " -nographic " append_qemu_nic_args diff --git a/repos/os/run/nic_router_flood.run b/repos/os/run/nic_router_flood.run index 6f67f12247..aa0cc7ff6e 100644 --- a/repos/os/run/nic_router_flood.run +++ b/repos/os/run/nic_router_flood.run @@ -205,7 +205,7 @@ install_config { } -build_boot_image { test-net_flood ping nic_router dynamic_rom } +build_boot_image [build_artifacts] append qemu_args " -nographic " append_qemu_nic_args diff --git a/repos/os/run/nic_stress.inc b/repos/os/run/nic_stress.inc index 50833753bc..ec7fccf2e4 100644 --- a/repos/os/run/nic_stress.inc +++ b/repos/os/run/nic_stress.inc @@ -1,5 +1,5 @@ append build_components { - core init timer + core init timer lib/ld server/nic_router test/nic_stress } @@ -157,16 +157,7 @@ append config { install_config $config -append boot_modules { - core init timer - nic_router - test-nic_stress - ld.lib.so -} - -append_if [string equal $type "nic_bridge"] boot_modules { nic_bridge } - -build_boot_image $boot_modules +build_boot_image [build_artifacts] append qemu_args " -nographic " diff --git a/repos/os/run/nvme.run b/repos/os/run/nvme.run index 8cbc2f89ce..756d67b503 100644 --- a/repos/os/run/nvme.run +++ b/repos/os/run/nvme.run @@ -47,7 +47,7 @@ proc writeable { } { # Build # set build_components { - core init timer + core init timer lib/ld server/report_rom app/pci_decode drivers/acpi @@ -243,17 +243,7 @@ append config { install_config $config -# -# Boot modules -# - -set boot_modules { - core init timer nvme_drv - pci_decode platform_drv report_rom acpi_drv - ld.lib.so block_tester -} - -build_boot_image $boot_modules +build_boot_image [build_artifacts] append qemu_args " -nographic " append qemu_args " -drive id=nvme0,file=bin/nvme.raw,format=raw,if=none " diff --git a/repos/os/run/ping.run b/repos/os/run/ping.run index 2caac903c1..57bade3d18 100644 --- a/repos/os/run/ping.run +++ b/repos/os/run/ping.run @@ -188,7 +188,8 @@ append config { } install_config $config -build_boot_image { ping } + +build_boot_image [build_artifacts] append qemu_args " -nographic " append_qemu_nic_args diff --git a/repos/os/run/ping_nic_router.run b/repos/os/run/ping_nic_router.run index b447ada897..897935cf4e 100644 --- a/repos/os/run/ping_nic_router.run +++ b/repos/os/run/ping_nic_router.run @@ -225,7 +225,8 @@ append config { } install_config $config -build_boot_image { ping } + +build_boot_image [build_artifacts] append qemu_args " -nographic " append_qemu_nic_args diff --git a/repos/os/run/platform_drv.run b/repos/os/run/platform_drv.run index 3fdfaf45f2..5bd225b2a4 100644 --- a/repos/os/run/platform_drv.run +++ b/repos/os/run/platform_drv.run @@ -113,7 +113,7 @@ install_config { } -build_boot_image { test-platform_drv } +build_boot_image [build_artifacts] append qemu_args "-nographic " diff --git a/repos/os/run/pointer.run b/repos/os/run/pointer.run index 502d8d8a3f..eac92e7ffa 100644 --- a/repos/os/run/pointer.run +++ b/repos/os/run/pointer.run @@ -1,13 +1,7 @@ -# -# Build -# -# for ldso debugging: -# - assert_spec linux -set build_components { - core init timer +build { + core init timer lib/ld drivers/framebuffer server/report_rom server/dynamic_rom @@ -17,15 +11,9 @@ set build_components { test/nitpicker } -build $build_components - create_boot_directory -# -# Generate config -# - -set config { +install_config { @@ -274,25 +262,7 @@ set config { } -install_config $config - -# -# Boot modules -# - -# generic modules -set boot_modules { - init ld.lib.so timer - fb_sdl - report_rom dynamic_rom - nitpicker - pointer - test-pointer - testnit -} - -# "lsort -unique" removes duplicates but core must be first -build_boot_image "core [lsort -unique $boot_modules]" +build_boot_image [build_artifacts] run_genode_until forever diff --git a/repos/os/run/rom_to_file.run b/repos/os/run/rom_to_file.run index c67487a2b5..d8c9aa33fe 100644 --- a/repos/os/run/rom_to_file.run +++ b/repos/os/run/rom_to_file.run @@ -1,21 +1,9 @@ assert_spec linux -# -# Build -# - -build { core init timer - server/dynamic_rom - app/rom_to_file - server/lx_fs -} +build { core init timer lib/ld server/dynamic_rom app/rom_to_file server/lx_fs } create_boot_directory -# -# Generate config -# - install_config { @@ -65,19 +53,9 @@ install_config { } -# -# Boot image -# - exec mkdir -p bin/fs_test -build_boot_image { core ld.lib.so init timer - dynamic_rom - rom_to_file - lx_fs - fs_test - vfs.lib.so -} +build_boot_image [list {*}[build_artifacts] fs_test] append qemu_args " -nographic " diff --git a/repos/os/run/rtc.run b/repos/os/run/rtc.run index 7cff2ac6f1..2e330325fc 100644 --- a/repos/os/run/rtc.run +++ b/repos/os/run/rtc.run @@ -2,25 +2,72 @@ create_boot_directory -set depot_pkgs "[depot_user]/src/[base_src] [depot_user]/src/init [depot_user]/src/report_rom" +proc rtc_src { } { -if [have_board linux] { - lappend depot_pkgs [depot_user]/src/linux_rtc_drv -} else { - if [have_board pc] { - lappend depot_pkgs [depot_user]/src/rtc_drv - } else { - lappend depot_pkgs [depot_user]/src/dummy_rtc_drv + if {[have_board linux]} { return "linux_rtc_drv" } + if {[have_board pc]} { return "rtc_drv" } + + return "dummy_rtc_drv" +} + +import_from_depot [depot_user]/src/[base_src] \ + [depot_user]/src/init \ + [depot_user]/src/report_rom \ + [depot_user]/src/[rtc_src] + +proc rtc_driver_start_attributes { } { + + if {[have_board linux]} { return { name="linux_rtc_drv" ld="no" } } + if {[have_board pc]} { return { name="rtc_drv" } } + + return { name="dummy_rtc_drv" } +} + +# RTC setting tested on Qemu only +proc test_update { } { return [have_include power_on/qemu] } + +proc test_rtc_config { } { + + if {![test_update]} { + return { } } + + return { + } } -puts $depot_pkgs -import_from_depot $depot_pkgs +proc additional_start_nodes_for_update_test { } { -# RTC setting tested on Qemu only -set test_update [have_include power_on/qemu] + if {![test_update]} { + return { } } -set config { + return { + + + + + + + } +} + +proc rtc_driver_config_and_route { } { + + if {![test_update]} { + return { } } + + return { + + + + + + + } +} + +install_config { @@ -36,53 +83,31 @@ set config { + - } -append_if $test_update config { - - - - - - - } -append_if [have_board linux] config { - } -append_if [have_board pc] config { - } -append_if [expr ![have_board pc] && ![have_board linux]] config { - } -append config { - - } -append_if $test_update config { - - - - - - - } -append config { + + + + + } [rtc_driver_config_and_route] { + + - } -append_if $test_update config { - } -append config { + + } [test_rtc_config] { + + } [additional_start_nodes_for_update_test] { + } -install_config $config +build { test/rtc } -set build_components { test/rtc } -set boot_modules { test-rtc } - -build $build_components -build_boot_image $boot_modules +build_boot_image [build_artifacts] append qemu_args " -nographic " diff --git a/repos/os/run/sd_card.run b/repos/os/run/sd_card.run index e996f5b06e..6e8a58f1d6 100644 --- a/repos/os/run/sd_card.run +++ b/repos/os/run/sd_card.run @@ -51,7 +51,7 @@ install_config { - + service name="LOG"> @@ -68,7 +68,7 @@ install_config { } -build_boot_image { pl180_sd_card_drv block_tester } +build_boot_image [build_artifacts] set disk_image "bin/sd_card.img" if { [file exists $disk_image] == 0 } then { diff --git a/repos/os/run/sd_card_bench.run b/repos/os/run/sd_card_bench.run index 32932a7d58..9222295089 100644 --- a/repos/os/run/sd_card_bench.run +++ b/repos/os/run/sd_card_bench.run @@ -78,8 +78,10 @@ install_config { } file copy [select_from_repositories board/[board]/devices] [run_dir]/genode/devices + build { drivers/sd_card } -build_boot_image [sd_card_drv] + +build_boot_image [build_artifacts] # diff --git a/repos/os/run/smbios_decoder.run b/repos/os/run/smbios_decoder.run index 2a7af2a374..5ce2788f88 100644 --- a/repos/os/run/smbios_decoder.run +++ b/repos/os/run/smbios_decoder.run @@ -5,7 +5,8 @@ if {![have_board pc] || [expr ![have_spec nova] && ![have_spec hw]] } { exit 0 } -build { app/smbios_decoder core init timer drivers/acpi server/report_rom } +build { core init timer lib/ld drivers/acpi server/report_rom app/smbios_decoder } + create_boot_directory install_config { @@ -72,11 +73,7 @@ install_config { } -build_boot_image { - report_rom acpi_drv - core init timer ld.lib.so - smbios_decoder -} +build_boot_image [build_artifacts] append qemu_args " -nographic" diff --git a/repos/os/run/tar_rom.run b/repos/os/run/tar_rom.run index 36db3e8786..6d884d63e8 100644 --- a/repos/os/run/tar_rom.run +++ b/repos/os/run/tar_rom.run @@ -18,7 +18,7 @@ # if {[have_spec linux]} { puts "Run script does not support Linux"; exit 0 } -build "core init timer test/timer server/tar_rom" +build { core init timer lib/ld test/timer server/tar_rom } create_boot_directory @@ -75,7 +75,7 @@ install_config { exec sh -c "cd bin; tar cfh archive.tar test-timer" -build_boot_image "core ld.lib.so init timer tar_rom archive.tar" +build_boot_image [list {*}[build_artifacts] archive.tar] append qemu_args "-nographic " diff --git a/repos/os/run/test.run b/repos/os/run/test.run index 98e649575e..a08890c5f5 100644 --- a/repos/os/run/test.run +++ b/repos/os/run/test.run @@ -243,7 +243,7 @@ foreach rom [content_rom_modules] { # Build # -lappend build_targets core init timer +lappend build_targets core init timer lib/ld # strip duplications set sorted_build_targets [lsort -unique $build_targets] @@ -305,9 +305,7 @@ install_config { } -lappend boot_modules core ld.lib.so init timer - -build_boot_image [lsort -unique $boot_modules] +build_boot_image [build_artifacts] ## diff --git a/repos/os/run/timeout.run b/repos/os/run/timeout.run index ad6afb56ca..188117de2f 100644 --- a/repos/os/run/timeout.run +++ b/repos/os/run/timeout.run @@ -78,7 +78,7 @@ proc precise_ref_time { } { return true } -build "core init drivers/platform timer test/timeout" +build { core init lib/ld drivers/platform timer test/timeout } # # Boot image @@ -86,7 +86,7 @@ build "core init drivers/platform timer test/timeout" create_boot_directory -append config { +install_config { @@ -117,9 +117,7 @@ append config { } -install_config $config - -build_boot_image "core ld.lib.so init timer test-timeout" +build_boot_image [build_artifacts] # # Execution diff --git a/repos/os/run/tz_vmm.run b/repos/os/run/tz_vmm.run index c9836e8210..e4d1ed04ee 100644 --- a/repos/os/run/tz_vmm.run +++ b/repos/os/run/tz_vmm.run @@ -13,7 +13,7 @@ if {![have_board imx53_qsb_tz]} { exit 0 } -build { core init server/tz_vmm } +build { core init lib/ld server/tz_vmm } create_boot_directory @@ -63,7 +63,7 @@ exec >& /dev/null wget -O initrd.gz.md5 $initrd_uri.md5 exec md5sum -c initrd.gz.md5 cd .. -build_boot_image { core ld.lib.so init linux imx53_qsb_tz_vmm initrd.gz } +build_boot_image [list {*}[build_artifacts] linux initrd.gz] # execute and wait for console run_genode_until {.*\/ #.*} 220 diff --git a/repos/os/run/uart.run b/repos/os/run/uart.run index 9bdd832f94..76f51a27b5 100644 --- a/repos/os/run/uart.run +++ b/repos/os/run/uart.run @@ -1,25 +1,13 @@ -# -# Build -# - -assert_spec pbxa9 - -# generic components -set build_components { - core init timer - drivers/uart - test/uart +if { ![have_board pbxa9] } { + puts "Platform is unsupported." + exit 0 } -build $build_components +build { core init timer lib/ld drivers/uart test/uart } + create_boot_directory - -# -# Config -# - -set config { +install_config { @@ -35,7 +23,6 @@ set config { - @@ -62,20 +49,8 @@ set config { } -install_config $config +build_boot_image [build_artifacts] - -# -# Boot modules -# - -# generic modules -set boot_modules { - core ld.lib.so init - timer pbxa9_uart_drv test-uart -} - -build_boot_image $boot_modules append qemu_args " -display none -serial stdio" append qemu_args " -serial file:/tmp/serial1" append qemu_args " -serial file:/tmp/serial2" diff --git a/repos/os/run/usb_block.run b/repos/os/run/usb_block.run index 2ac0baeed4..9da4d960e5 100644 --- a/repos/os/run/usb_block.run +++ b/repos/os/run/usb_block.run @@ -19,7 +19,7 @@ import_from_depot [depot_user]/src/[base_src] \ build { app/block_tester } -append config { +install_config { @@ -91,14 +91,13 @@ append config { } -install_config $config - # # Define USB host controller config # set fd [open [run_dir]/genode/usb_host_drv.config w] puts $fd { } close $fd + build_boot_image [build_artifacts] # diff --git a/repos/os/run/vfs_block.run b/repos/os/run/vfs_block.run index 3622c80882..65c9ca9d6c 100644 --- a/repos/os/run/vfs_block.run +++ b/repos/os/run/vfs_block.run @@ -1,6 +1,7 @@ create_boot_directory + build { - core init timer + core init timer lib/ld server/vfs server/vfs_block app/block_tester @@ -105,9 +106,6 @@ install_config { } -build_boot_image { - core init timer vfs vfs_block block_tester - ld.lib.so vfs.lib.so vfs_import.lib.so -} +build_boot_image [build_artifacts] run_genode_until {.*child "block_tester" exited with exit value 0.*\n} 60 diff --git a/repos/os/run/vmm_arm.run b/repos/os/run/vmm_arm.run index d80052352a..569d34eb2c 100644 --- a/repos/os/run/vmm_arm.run +++ b/repos/os/run/vmm_arm.run @@ -229,12 +229,7 @@ if { [have_spec arm_64] } { catch { exec [installed_command dd] if=/dev/zero of=bin/block.img bs=1M count=0 seek=64 } exec [installed_command mkfs.vfat] bin/block.img -build_boot_image { - test-terminal_expect_send - linux - initrd - block.img -} +build_boot_image [list {*}[build_artifacts] linux initrd block.img] # # Execute test case diff --git a/repos/os/run/vmm_x86.run b/repos/os/run/vmm_x86.run index 7541cf6685..9ec1101ae0 100644 --- a/repos/os/run/vmm_x86.run +++ b/repos/os/run/vmm_x86.run @@ -28,12 +28,8 @@ if { [get_cmd_switch --autopilot] } { # ia32_tsc_aux with rdtscp set test_rdtscp [have_spec nova] -set build_components { - core init - timer - test/vmm_x86 -} -build $build_components +build { core init timer lib/ld test/vmm_x86 } + create_boot_directory install_config { @@ -65,12 +61,6 @@ install_config { } -set boot_modules { - core ld.lib.so init - timer - test-vmm_x86 -} - # # Generate artificial platform info to allow for executing the scenario on # base-linux @@ -94,7 +84,7 @@ if {[have_spec linux]} { close $fd } -build_boot_image $boot_modules +build_boot_image [build_artifacts] append qemu_args " -cpu phenom -smp 2" append qemu_args " -nographic "