set use_qemu [have_include "power_on/qemu"] # # Build # set build_components { core init drivers/timer drivers/usb_host drivers/usb_block server/report_rom test/blk/cli test/blk/bench } proc gpio_drv { } { if {[have_spec rpi] && [have_spec hw]} { return hw_gpio_drv } if {[have_spec rpi] && [have_spec foc]} { return foc_gpio_drv } return gpio_drv } lappend_if [have_spec gpio] build_components drivers/gpio source ${genode_dir}/repos/base/run/platform_drv.inc append_platform_drv_build_components build $build_components create_boot_directory # # Generate config # set config { } append_platform_drv_config append_if [have_spec gpio] config " " append config { } append config "" append config { } append_if [expr !$use_qemu] config { } append_if $use_qemu config { } append config { } install_config $config # # Boot modules # # generic modules set boot_modules { core init timer report_rom usb_block_drv test-blk-cli test-blk-bench ld.lib.so } append boot_modules [usb_host_drv_binary] lappend_if [have_spec gpio] boot_modules [gpio_drv] append_platform_drv_boot_modules build_boot_image $boot_modules # # 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} { puts "creating disk image:\n$cmd" catch { exec sh -c $cmd } } # # Qemu opts for EHCI # append qemu_args " -nographic -M pc -boot order=d " append qemu_args " -drive if=none,id=disk,file=$disk_image,format=raw " append qemu_args " -device usb-ehci,id=ehci -device usb-storage,bus=ehci.0,drive=disk " run_genode_until {.*child "test-usb" exited with exit value 0.*} 100