run: introduce have_board helper function

The new helper function returns a boolean value analoque to 'have_spec' if the
BOARD variable corresponds to the given value. It shall replace [have_spec <board>]
declarations in run-scripts.

Ref #3971
This commit is contained in:
Stefan Kalkowski
2021-01-07 19:15:55 +01:00
committed by Norman Feske
parent 6cfaac182a
commit 5a123e37c9
5 changed files with 17 additions and 15 deletions

View File

@@ -31,7 +31,7 @@ proc run_boot_dir {binaries} {
# Save config part of the image.elf for easy inspection
exec cp -f [run_dir]/genode/config [run_dir].config
if {[board] == "pc"} {
if {[have_board pc]} {
build_initrd $binaries

View File

@@ -44,9 +44,7 @@ proc append_qemu_nic_args { { extra_netdev_args "" } } {
# XXX should by removed in favor of [have_include "exec/qemu"]
#
proc is_qemu_available { } {
if {[expr [have_spec linux] && {"[board]"} == {"linux"}]} { return false }
if {[have_spec rpi]} {
if {[have_board rpi] || [have_board linux]} {
puts stderr "skipping execution because platform is not supported by qemu"
return false
}

View File

@@ -835,6 +835,10 @@ proc board { } {
return $board_var
}
##
# Return whether the board equals to the given string
#
proc have_board {board} { global board_var; return [expr {$board_var} eq {$board}] }
##
# Determine GDB executable installed at the host