mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 11:55:24 +00:00
run: add support for IP power switch NETIO-230B
This commit is contained in:
parent
ed825c1d46
commit
138a37765f
@ -280,6 +280,15 @@ proc build_boot_image_arm {binaries} {
|
||||
build_boot_uimage
|
||||
|
||||
puts "\nboot image: [run_dir]/image.elf\n"
|
||||
|
||||
# set symbolic link to image.elf file in TFTP directory for PXE boot
|
||||
if {[info exists ::env(PXE_TFTP_DIR_BASE)] &&
|
||||
[info exists ::env(PXE_TFTP_DIR_OFFSET)]} {
|
||||
exec ln -sf "[pwd]/[run_dir]/image.elf" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
|
||||
if {[have_spec uboot]} {
|
||||
exec ln -sf "[pwd]/[run_dir]/uImage" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)/uImage"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -193,7 +193,19 @@ proc build_boot_image {binaries} {
|
||||
exec mkimage -A arm -O linux -T kernel -C gzip -a $load_addr \
|
||||
-e $entrypoint -d $bin_img.gz $uboot_img
|
||||
exec rm -rf $bin_img.gz
|
||||
|
||||
}
|
||||
|
||||
# set symbolic link to image.elf file in TFTP directory for PXE boot
|
||||
if {[info exists ::env(PXE_TFTP_DIR_BASE)] &&
|
||||
[info exists ::env(PXE_TFTP_DIR_OFFSET)]} {
|
||||
exec ln -sf "[pwd]/$elf_img" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
|
||||
|
||||
if {[regexp "uboot" $run_target]} {
|
||||
exec ln -sf "[pwd]/[run_dir]/uImage" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
|
||||
}
|
||||
}
|
||||
|
||||
# retrieve stand-alone core
|
||||
exec mv core/core.standalone bin/core
|
||||
}
|
||||
|
41
tool/run
41
tool/run
@ -266,6 +266,7 @@ set specs [get_cmd_arg --specs ""]
|
||||
set repositories [get_cmd_arg --repositories ""]
|
||||
set qemu_args [get_cmd_arg --qemu-args ""]
|
||||
set run_target [get_cmd_arg --target "qemu"]
|
||||
set serial_dev [get_cmd_arg --serial-dev "/dev/ttyUSB0"]
|
||||
|
||||
|
||||
|
||||
@ -611,18 +612,52 @@ proc spawn_amt { wait_for_re timeout_value} {
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# Reset test machine via IP power plug NETIO-230B from Koukaam
|
||||
#
|
||||
proc power_plug_reset { } {
|
||||
set server_ip "10.0.0.5"
|
||||
set user_name "admin"
|
||||
set password "admin"
|
||||
set power_port [get_cmd_arg --reset-port 1]
|
||||
|
||||
spawn telnet $server_ip 1234
|
||||
expect "KSHELL V1.3"
|
||||
send "login $user_name $password\n"
|
||||
expect "250 OK"
|
||||
send "port $power_port\n"
|
||||
expect -re {250 [0-9]+.*\n}
|
||||
regexp -all {[0-9]+} $expect_out(0,string) power_status
|
||||
if {!$power_status} {
|
||||
puts "port $power_port is off - switching it on"
|
||||
send "port $power_port 1\n"
|
||||
expect "250 OK"
|
||||
} else {
|
||||
puts "port $power_port is on - reset port"
|
||||
send "port $power_port int\n"
|
||||
expect "250 OK"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# Execute scenario expecting output via serial device
|
||||
#
|
||||
proc spawn_serial { wait_for_re timeout_value} {
|
||||
global spawn_id
|
||||
global serial_dev
|
||||
global run_target
|
||||
|
||||
if {$wait_for_re != "forever"} {
|
||||
if {$wait_for_re == "forever"} {
|
||||
set timeout -1
|
||||
} else {
|
||||
set timeout_value [expr $timeout_value + 30]
|
||||
}
|
||||
|
||||
set serial_dev [get_cmd_arg --serial-dev "/dev/ttyUSB0"]
|
||||
|
||||
if {[regexp "reset" $run_target]} {
|
||||
power_plug_reset
|
||||
}
|
||||
|
||||
spawn picocom -b 115200 $serial_dev
|
||||
set serial_spawn_id $spawn_id
|
||||
wait_for_output $wait_for_re $timeout_value $serial_spawn_id
|
||||
|
Loading…
x
Reference in New Issue
Block a user