#
# Set to true in case the driver needs to be debugged to
# pull in the locally build binaries rather than the ones
# from the depot.
#
set debug_driver false
#
# Configure wireless lan
#
proc wifi_ssid { } {
return $::env(GENODE_WIFI_SSID)
}
proc wifi_psk { } {
return $::env(GENODE_WIFI_PSK)
}
proc wifi_wpa { } {
if {![info exists ::env(GENODE_WIFI_WPA)]} {
return WPA2
}
return $::env(GENODE_WIFI_WPA)
}
#
# wifi-driver config generator (supporting a network list)
#
# You may script your tests with this function in the dynamic_rom config below.
# The syntax for the networks parameter is
#
# { ssid protection passphrase explicit_scan }
#
# Example dynamic_rom config:
#
# {
# } [wifi_config 30 5 no [list "net1 WPA2 net1_psk no" "net2 WPA2 net2_psk no"]] {
#
#
# } [wifi_config 30 5 no [list "net1 WPA2 net1_psk no" "net2 WPA2 net2_psk yes"]] {
# }
set wifi_verbose false
set wifi_verbose_state false
proc wifi_config { connected_scan_interval scan_interval rfkill networks } {
global wifi_verbose
global wifi_verbose_state
set config "\n"
foreach n $networks {
append config " \n"
}
append config "\n"
return $config
}
#
# Restrict platforms
#
assert_spec x86
#
# Build
#
create_boot_directory
import_from_depot [depot_user]/pkg/pc_wifi \
[depot_user]/raw/pc_wifi_firmware
set build_components {
core init timer
app/pci_decode
driver/acpi
driver/platform
driver/rtc
server/report_rom
server/dynamic_rom
server/nic_router
test/lwip/http_srv
lib/vfs_lwip
}
append_if $debug_driver build_components {
driver/wifi
lib/pc_wifi
lib/vfs_jitterentropy
}
build $build_components
#
# Generate config
#
append config {
} [wifi_config 30 5 no {}] {
} [wifi_config 30 5 no [list "[wifi_ssid] [wifi_wpa] [wifi_psk] yes"]] {
} [wifi_config 30 5 yes [list "[wifi_ssid] [wifi_wpa] [wifi_psk] yes"]] {
} [wifi_config 30 5 no [list "[wifi_ssid] [wifi_wpa] [wifi_psk] yes"]] {
}
install_config $config
#
# Provide dummy 'wifi.lib.so' shared-object for
# boot-module assembly
#
if {$debug_driver} {
exec rm bin/wifi.lib.so
exec echo dummy > bin/wifi.lib.so
}
#
# Boot modules
#
build_boot_image [build_artifacts]
run_genode_until forever
# vi: set ft=tcl :