From ea2584e2fb5227f13e24a50ddaa2896cdb7809a8 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Fri, 3 Mar 2023 11:37:38 +0100 Subject: [PATCH] Fix usb_block.run and add to autopilot.list --- repos/os/run/usb_block.run | 22 +++++++++++++++++----- tool/autopilot.list | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/repos/os/run/usb_block.run b/repos/os/run/usb_block.run index 425a86ae2e..2ac0baeed4 100644 --- a/repos/os/run/usb_block.run +++ b/repos/os/run/usb_block.run @@ -1,4 +1,14 @@ -set use_qemu [have_include "power_on/qemu"] +if {![have_board pc]} { + puts "\nRun script is not supported on this platform.\n"; + exit 0 +} + +if {[get_cmd_switch --autopilot] && ![have_include "power_on/qemu"]} { + puts "\nAutopilot run is not supported on this platform\n" + exit 0 +} + +proc usb_device_label {} { return "usb-1-2" } create_boot_directory import_from_depot [depot_user]/src/[base_src] \ @@ -9,7 +19,7 @@ import_from_depot [depot_user]/src/[base_src] \ build { app/block_tester } -install_config { +append config { @@ -58,7 +68,7 @@ install_config { - + @@ -81,20 +91,22 @@ install_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 { block_tester } +build_boot_image [build_artifacts] # # Execute test case # set disk_image "bin/test.img" set cmd "dd if=/dev/zero of=$disk_image bs=1M count=16" -if {$use_qemu} { +if {[have_include "power_on/qemu"]} { puts "creating disk image:\n$cmd" catch { exec sh -c $cmd } } diff --git a/tool/autopilot.list b/tool/autopilot.list index 66106e20a8..051dc6be15 100644 --- a/tool/autopilot.list +++ b/tool/autopilot.list @@ -74,6 +74,7 @@ timeout_smp timer_accuracy tool_chain_auto tz_vmm +usb_block usb_hid_raw usb_hid_reconnect vbox5_genode_usb_hid_raw