diff --git a/repos/gems/run/mirage_pretty.run b/repos/gems/run/mirage_pretty.run index a3dd841bc..1def0cb20 100644 --- a/repos/gems/run/mirage_pretty.run +++ b/repos/gems/run/mirage_pretty.run @@ -156,9 +156,14 @@ lappend_if [have_spec gpio] boot_modules [gpio_drv] build_boot_image $boot_modules -append qemu_args " -net user" +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + if [have_spec cadence_gem] { return cadence_gem } + return nic_model_missing +} -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " +append qemu_args " -netdev user,id=net0 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " run_genode_until forever diff --git a/repos/gems/run/ssh_terminal.run b/repos/gems/run/ssh_terminal.run index cf180d5cf..538e78286 100644 --- a/repos/gems/run/ssh_terminal.run +++ b/repos/gems/run/ssh_terminal.run @@ -161,9 +161,14 @@ build_boot_image $boot_modules append qemu_args " -m 512 -nographic " -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + return nic_model_missing +} -append qemu_args " -net user -redir tcp:5555::22 " +append qemu_args " -netdev user,id=net0,hostfwd=tcp::5555-:22 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " set lxip_match_string "ipaddr=(\[0-9\]+\.\[0-9\]+\.\[0-9\]+\.\[0-9\]+).*\n" diff --git a/repos/gems/run/tcp_terminal.run b/repos/gems/run/tcp_terminal.run index 105881f50..a8ebff2a9 100644 --- a/repos/gems/run/tcp_terminal.run +++ b/repos/gems/run/tcp_terminal.run @@ -90,7 +90,7 @@ install_config $config set boot_modules { core ld.lib.so init timer nic_drv - libc.lib.so vfs.lib.so lwip_legacy.lib.so libc_pipe.lib.so + libc.lib.so vfs.lib.so libc_pipe.lib.so tcp_terminal test-terminal_echo vfs_lwip.lib.so @@ -106,12 +106,16 @@ build_boot_image $boot_modules # # qemu config -append qemu_args " -nographic " +append qemu_args " -nographic " -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + return nic_model_missing +} -append qemu_args " -net user -redir tcp:5555::8888 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " +append qemu_args " -netdev user,id=net0,hostfwd=tcp::5555-:8888 " run_genode_until forever diff --git a/repos/libports/run/fetchurl.inc b/repos/libports/run/fetchurl.inc index d1c6b2a2a..17dfe7eca 100644 --- a/repos/libports/run/fetchurl.inc +++ b/repos/libports/run/fetchurl.inc @@ -126,8 +126,16 @@ lappend_if [have_spec gpio] boot_modules [gpio_drv] build_boot_image $boot_modules -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " -append qemu_args " -nographic -net user" +append qemu_args " -nographic " + +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + if [have_spec cadence_gem] { return cadence_gem } + return nic_model_missing +} + +append qemu_args " -netdev user,id=net0 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " run_genode_until {child "fetchurl" exited with exit value 0} 120 diff --git a/repos/libports/run/lwip.run b/repos/libports/run/lwip.run index 7c30bc1bd..85a0cd6af 100644 --- a/repos/libports/run/lwip.run +++ b/repos/libports/run/lwip.run @@ -7,7 +7,7 @@ # the HTTP server is up, a HTTP request to the server is performed using # 'lynx'. The response is validated against a known pattern. # -# The test uses qemu's "-net user" option, redirecting Genode's port 80 to the +# The test uses qemu's "-netdev user" option, redirecting Genode's port 80 to the # host's port 5555. Consequently, it cannot be executed on non-qemu test # environments (i.e., the test won't work with the Linux version of Genode). # @@ -148,10 +148,15 @@ build_boot_image $boot_modules # qemu config append qemu_args " -nographic " -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + if [have_spec cadence_gem] { return cadence_gem } + return nic_model_missing +} -append qemu_args " -net user -redir tcp:5555::80 " +append qemu_args " -netdev user,id=net0,hostfwd=tcp::5555-:80 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " run_genode_until {.*lwIP Nic interface up.*\n} 30 diff --git a/repos/libports/run/mirage_net.run b/repos/libports/run/mirage_net.run index 3388c7c91..46ed0dfdd 100644 --- a/repos/libports/run/mirage_net.run +++ b/repos/libports/run/mirage_net.run @@ -109,9 +109,16 @@ lappend_if [have_spec gpio] boot_modules [gpio_drv] build_boot_image $boot_modules -append qemu_args " -nographic -net user" +append qemu_args " -nographic " -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + if [have_spec cadence_gem] { return cadence_gem } + return nic_model_missing +} + +append qemu_args " -netdev user,id=net0 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " run_genode_until forever diff --git a/repos/libports/run/nic_bridge.run b/repos/libports/run/nic_bridge.run index b02d6b2b4..30d91f8b5 100644 --- a/repos/libports/run/nic_bridge.run +++ b/repos/libports/run/nic_bridge.run @@ -168,10 +168,15 @@ build_boot_image $boot_modules append qemu_args " -nographic " -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + if [have_spec cadence_gem] { return cadence_gem } + return nic_model_missing +} -append qemu_args " -net user " +append qemu_args " -netdev user,id=net0 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " append done_string {.*?\[server_1 -> lwip] rcv .\[32mETH.\[0m 02:02:02:02:42:00} append done_string {.*?\[server_2 -> lwip] rcv .\[32mETH.\[0m 02:02:02:02:23:00} diff --git a/repos/libports/run/nic_bridge_lighttpd.run b/repos/libports/run/nic_bridge_lighttpd.run index 06756de42..6ff16e3e8 100644 --- a/repos/libports/run/nic_bridge_lighttpd.run +++ b/repos/libports/run/nic_bridge_lighttpd.run @@ -155,11 +155,16 @@ append_platform_drv_boot_modules build_boot_image $boot_modules - -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " - -append qemu_args " -net user " append qemu_args " -nographic -serial mon:stdio " +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + if [have_spec cadence_gem] { return cadence_gem } + return nic_model_missing +} + +append qemu_args " -netdev user,id=net0 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " + run_genode_until forever diff --git a/repos/os/run/nic_router_flood.run b/repos/os/run/nic_router_flood.run index 08c0a358f..a0192d75f 100644 --- a/repos/os/run/nic_router_flood.run +++ b/repos/os/run/nic_router_flood.run @@ -244,10 +244,17 @@ append_platform_drv_boot_modules build_boot_image $boot_modules -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " +append qemu_args " -nographic " -append qemu_args " -net user -nographic " +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + if [have_spec cadence_gem] { return cadence_gem } + return nic_model_missing +} + +append qemu_args " -netdev user,id=net0 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " ######################### diff --git a/repos/os/run/ping.run b/repos/os/run/ping.run index 49543d68e..f0b2c06da 100644 --- a/repos/os/run/ping.run +++ b/repos/os/run/ping.run @@ -150,10 +150,17 @@ append_platform_drv_boot_modules build_boot_image $boot_modules -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " +append qemu_args " -nographic " -append qemu_args " -net user -nographic " +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + if [have_spec cadence_gem] { return cadence_gem } + return nic_model_missing +} + +append qemu_args " -netdev user,id=net0 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " set done_string ".*\"ping_1\" exited with exit value 0.*\n" diff --git a/repos/os/run/ping_nic_router.run b/repos/os/run/ping_nic_router.run index 3c1fcc443..196682972 100644 --- a/repos/os/run/ping_nic_router.run +++ b/repos/os/run/ping_nic_router.run @@ -266,10 +266,17 @@ append_platform_drv_boot_modules build_boot_image $boot_modules -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " +append qemu_args " -nographic " -append qemu_args " -net user -nographic " +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + if [have_spec cadence_gem] { return cadence_gem } + return nic_model_missing +} + +append qemu_args " -netdev user,id=net0 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " set done_string "" for {set i 0} {$i < 3} {incr i 1} { diff --git a/repos/ports/run/arora.run b/repos/ports/run/arora.run index 53f676463..9eac03cfe 100644 --- a/repos/ports/run/arora.run +++ b/repos/ports/run/arora.run @@ -156,9 +156,14 @@ append boot_modules { build_boot_image $boot_modules -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + if [have_spec cadence_gem] { return cadence_gem } + return nic_model_missing +} -append qemu_args " -net user " +append qemu_args " -netdev user,id=net0 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " run_genode_until forever diff --git a/repos/ports/run/genode_org.run b/repos/ports/run/genode_org.run index e8e12461a..a58bd535f 100644 --- a/repos/ports/run/genode_org.run +++ b/repos/ports/run/genode_org.run @@ -165,6 +165,7 @@ set boot_modules { core init timer ld.lib.so libc.lib.so libm.lib.so posix.lib.so vfs.lib.so vfs_lwip.lib.so zlib.lib.so + libcrypto.lib.so libssl.lib.so lighttpd genode_org.tar } @@ -177,10 +178,14 @@ append_platform_drv_boot_modules build_boot_image $boot_modules -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + return nic_model_missing +} -append qemu_args " -net user -redir tcp:5555::80 " +append qemu_args " -netdev user,id=net0,hostfwd=tcp::5555-:80 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " append qemu_args " -nographic -serial mon:stdio " run_genode_until forever diff --git a/repos/ports/run/lighttpd.run b/repos/ports/run/lighttpd.run index 3026385d5..657681085 100644 --- a/repos/ports/run/lighttpd.run +++ b/repos/ports/run/lighttpd.run @@ -121,10 +121,14 @@ append_platform_drv_boot_modules build_boot_image $boot_modules -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + return nic_model_missing +} -append qemu_args " -net user -redir tcp:5555::80 " +append qemu_args " -netdev user,id=net0,hostfwd=tcp::5555-:80 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " append qemu_args " -nographic -serial mon:stdio " append xen_args { sdl=0\; vif=\["model=e1000,mac=02:00:00:00:01:01,bridge=xenbr0"\] } diff --git a/repos/ports/run/netperf.inc b/repos/ports/run/netperf.inc index ad81e2613..47c97f0df 100644 --- a/repos/ports/run/netperf.inc +++ b/repos/ports/run/netperf.inc @@ -380,10 +380,14 @@ build_boot_image $boot_modules # qemu config append qemu_args " -nographic " -append_if [have_spec x86] qemu_args " -net nic,model=e1000 " -append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " +proc qemu_nic_model {} { + if [have_spec x86] { return e1000 } + if [have_spec lan9118] { return lan9118 } + return nic_model_missing +} -append qemu_args " -net user -redir tcp:12865::12865 -redir tcp:49153::49153 " +append qemu_args " -netdev user,id=net0,hostfwd=tcp::12865-:12865,hostfwd=tcp::49153-:49153 " +append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " set force_ports "" if $use_nic_router { diff --git a/tool/run/power_on/qemu b/tool/run/power_on/qemu index e5d4130af..11caec476 100644 --- a/tool/run/power_on/qemu +++ b/tool/run/power_on/qemu @@ -101,9 +101,6 @@ proc run_power_on { } { if {[have_spec vpb926]} { append qemu_args " -M versatilepb -m 128 " } if {[have_spec zynq_qemu]} { append qemu_args " -M xilinx-zynq-a9 -cpu cortex-a9 -m 256 " } - # add devices for specific platforms - if {[have_spec zynq] && [have_spec cadence_gem]} { append qemu_args " -net nic,model=cadence_gem" } - # on x86, we support booting via pxe or iso/disk image if {[have_spec x86]} { if {![regexp -- {-m} $qemu_args dummy]} {