From b6d3063ada5de5905630cac81bc30b51d7f69ba8 Mon Sep 17 00:00:00 2001
From: Norman Feske <norman.feske@genode-labs.com>
Date: Fri, 6 Mar 2020 10:50:16 +0100
Subject: [PATCH] Remove noux and cpu_sampler_noux from autopilot

Issue #3696
---
 repos/gems/run/cpu_sampler_noux.run | 226 ----------------------------
 repos/ports/run/noux.run            |  46 ------
 tool/autopilot.list                 |   2 -
 3 files changed, 274 deletions(-)
 delete mode 100644 repos/gems/run/cpu_sampler_noux.run
 delete mode 100644 repos/ports/run/noux.run

diff --git a/repos/gems/run/cpu_sampler_noux.run b/repos/gems/run/cpu_sampler_noux.run
deleted file mode 100644
index adbc50547e..0000000000
--- a/repos/gems/run/cpu_sampler_noux.run
+++ /dev/null
@@ -1,226 +0,0 @@
-if { ![have_spec foc] && ![have_spec nova] &&
-     ![have_spec okl4] && ![have_spec sel4] } {
-	puts "Run script is not supported on this platform"
-	exit 0
-}
-
-# there are no drivers_interactive packages for every platform yet
-if { ![have_spec pbxa9] && ![have_spec x86] } {
-	puts "Run script is not supported on this platform"
-	exit 0
-}
-
-create_boot_directory
-
-import_from_depot [depot_user]/src/[base_src] \
-                  [depot_user]/pkg/[drivers_interactive_pkg] \
-                  [depot_user]/pkg/terminal \
-                  [depot_user]/src/init \
-                  [depot_user]/src/noux \
-                  [depot_user]/src/posix \
-                  [depot_user]/src/ram_fs \
-                  [depot_user]/src/log_terminal \
-                  [depot_user]/src/ncurses \
-                  [depot_user]/src/bash-minimal \
-                  [depot_user]/src/vim-minimal \
-                  [depot_user]/src/coreutils-minimal
-
-
-set build_components { server/fs_log server/cpu_sampler test/cpu_sampler }
-
-if {[have_spec foc] || [have_spec nova]} {
-	lappend build_components lib/cpu_sampler_platform-$::env(KERNEL)
-} else {
-	lappend build_components lib/cpu_sampler_platform-generic
-}
-
-#
-# Build Noux packages only once
-#
-foreach pkg {diffutils} {
-	lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg }
-
-build $build_components
-
-# write default vimrc file
-set vimrc_fd [open "bin/vimrc" w]
-puts $vimrc_fd {
-set noloadplugins
-set hls
-set nocompatible
-set laststatus=2
-set noswapfile
-set viminfo=}
-close $vimrc_fd
-
-append config {
-	<config verbose="yes">
-		<parent-provides>
-			<service name="ROM"/>
-			<service name="LOG"/>
-			<service name="RM"/>
-			<service name="CPU"/>
-			<service name="PD"/>
-			<service name="IRQ"/>
-			<service name="IO_PORT"/>
-			<service name="IO_MEM"/>
-		</parent-provides>
-		<default-route>
-			<any-service> <parent/> <any-child/> </any-service>
-		</default-route>
-		<default caps="100"/>
-		<start name="timer">
-			<resource name="RAM" quantum="1M"/>
-			<provides><service name="Timer"/></provides>
-		</start>}
-
-append_if [get_cmd_switch --autopilot] config {
-	<start name="terminal">
-		<binary name="log_terminal"/>
-		<resource name="RAM" quantum="1M"/>
-		<provides><service name="Terminal"/></provides>
-	</start>}
-
-append_if [expr ![get_cmd_switch --autopilot]] config {
-	<start name="drivers" caps="1000">
-		<resource name="RAM" quantum="32M" constrain_phys="yes"/>
-		<binary name="init"/>
-		<route>
-			<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
-			<service name="Timer"> <child name="timer"/> </service>
-			<any-service> <parent/> </any-service>
-		</route>
-		<provides>
-			<service name="Input"/> <service name="Framebuffer"/>
-		</provides>
-	</start>
-
-	<start name="terminal">
-		<resource name="RAM" quantum="2M"/>
-		<provides><service name="Terminal"/></provides>
-		<route>
-			<service name="ROM" label="config"> <parent label="terminal.config"/> </service>
-			<any-service> <parent/> <any-child/> </any-service>
-		</route>
-	</start>}
-
-append config {
-	<start name="ram_fs">
-		<resource name="RAM" quantum="10M"/>
-		<provides><service name="File_system"/></provides>
-		<config>
-			<content>
-				<dir name="home">
-					<inline name=".bashrc"> }
-append_if [get_cmd_switch --autopilot] config {
-						FILE=/samples/cpu_sampler/samples/test-cpu_sampler/ep.*.log
-						while true; do if [ -e $FILE ]; then cat $FILE; fi; done }
-append_if [expr ![get_cmd_switch --autopilot]] config {
-						echo "The sample data will appear in the /samples directory" }
-append config {
-					</inline>
-				</dir>
-				<dir name="samples"/>
-				<dir name="tmp"/>
-			</content>
-			<!-- constrain sessions according to their labels -->
-			<policy label_prefix="fs_log"   root="/samples"    writeable="yes" />
-			<policy label="noux -> home"    root="/home"       writeable="yes" />
-			<policy label="noux -> samples" root="/samples" />
-			<policy label="noux -> tmp"     root="/tmp"        writeable="yes" />
-		</config>
-	</start>
-
-	<start name="fs_log">
-		<resource name="RAM" quantum="2M"/>
-		<provides><service name="LOG"/></provides>
-		<config>
-			<policy label="cpu_sampler" merge="true"/>
-		</config>
-	</start>
-
-	<start name="cpu_sampler">
-		<resource name="RAM" quantum="4M"/>
-		<provides>
-			<service name="CPU"/>
-		</provides>
-		<config sample_interval_ms="1000" sample_duration_s="10">
-			<policy label_prefix="test-cpu_sampler ->" />
-		</config>
-		<route>
-			<service name="LOG" label_prefix="samples"> <child name="fs_log"/> </service>
-			<any-service> <parent/> <any-child/> </any-service>
-		</route>
-	</start>
-
-	<start name="test-cpu_sampler">
-		<resource name="RAM" quantum="1M"/>
-		<config ld_verbose="yes"/>
-		<route>
-			<service name="CPU"> <child name="cpu_sampler"/> </service>
-			<any-service> <parent/> </any-service>
-		</route>
-	</start>
-
-	<start name="noux" caps="500">
-		<resource name="RAM" quantum="16M" />
-		<config>
-			<fstab>
-				<tar name="coreutils-minimal.tar" />
-				<tar name="vim-minimal.tar" />
-				<tar name="diffutils.tar" />
-				<tar name="bash-minimal.tar" />
-
-				<dir name="dev"> <zero/> <null/> </dir>
-
-				<dir name="home"> <fs label="home" /> </dir>
-				<dir name="samples"> <fs label="samples" /> </dir>
-				<dir name="tmp"> <fs label="tmp" /> </dir>
-				<dir name="share"> <dir name="vim"> <rom name="vimrc"/> </dir> </dir>
-			</fstab>
-			<start name="/bin/bash">
-				<env name="TERM" value="screen" />
-				<env name="HOME" value="/home" />
-			</start>
-		</config>
-		<route>
-			<service name="Terminal"> <child name="terminal"/> </service>
-			<any-service> <parent/> <any-child/> </any-service>
-		</route>
-	</start>
-</config> }
-
-install_config $config
-
-#
-# Boot modules
-#
-
-# evaluated by the run tool
-proc binary_name_cpu_sampler_platform_lib_so { } {
-	if {[have_spec foc] || [have_spec nova]} {
-		return "cpu_sampler_platform-$::env(KERNEL).lib.so"
-	} else {
-		return "cpu_sampler_platform-generic.lib.so"
-	}
-}
-
-build_boot_image {
-	diffutils.tar vimrc
-	fs_log cpu_sampler cpu_sampler_platform.lib.so test-cpu_sampler
-}
-
-if { ![get_cmd_switch --autopilot] } { run_genode_until forever }
-
-# autopilot test
-
-append qemu_args " -nographic "
-
-set match_string "Test started. func: 0x(\[0-9a-f\]+).*\n"
-
-run_genode_until "$match_string" 120
-
-regexp $match_string $output all func
-
-run_genode_until "\\\[init -> terminal] \[0\]*$func" 90 [output_spawn_id]
-
diff --git a/repos/ports/run/noux.run b/repos/ports/run/noux.run
deleted file mode 100644
index 74a4f28b7b..0000000000
--- a/repos/ports/run/noux.run
+++ /dev/null
@@ -1,46 +0,0 @@
-build { noux lib/libc_noux }
-
-create_boot_directory
-
-import_from_depot [depot_user]/src/[base_src] \
-                  [depot_user]/src/init \
-                  [depot_user]/src/coreutils \
-
-install_config {
-	<config verbose="yes">
-		<parent-provides>
-			<service name="ROM"/>
-			<service name="LOG"/>
-			<service name="RM"/>
-			<service name="CPU"/>
-			<service name="PD"/>
-			<service name="IRQ"/>
-			<service name="IO_MEM"/>
-			<service name="IO_PORT"/>
-		</parent-provides>
-		<default-route>
-			<any-service> <any-child/> <parent/> </any-service>
-		</default-route>
-		<default caps="100"/>
-		<start name="timer">
-			<resource name="RAM" quantum="1M"/>
-			<provides><service name="Timer"/></provides>
-		</start>
-		<start name="noux" caps="500">
-			<resource name="RAM" quantum="1G"/>
-			<config verbose="yes" stdin="/null" stdout="/log" stderr="/log">
-				<fstab> <null/> <log/> <tar name="coreutils.tar" /> </fstab>
-				<start name="/bin/ls"> <arg value="-Rla"/> </start>
-			</config>
-		</start>
-	</config>
-}
-
-build_boot_image {
-	noux libc.lib.so vfs.lib.so libm.lib.so
-	libc_noux.lib.so posix.lib.so
-}
-
-append qemu_args " -nographic -serial mon:stdio "
-
-run_genode_until {child "noux" exited with exit value 0.*\n} 30
diff --git a/tool/autopilot.list b/tool/autopilot.list
index 3b1bfe7aa6..96bc320585 100644
--- a/tool/autopilot.list
+++ b/tool/autopilot.list
@@ -1,7 +1,6 @@
 bomb
 cpu_quota
 cpu_sampler
-cpu_sampler_noux
 demo
 depot_autopilot
 depot_download
@@ -40,7 +39,6 @@ nic_router
 nic_router_flood
 nic_router_stress
 nic_router_uplinks
-noux
 noux_tool_chain_auto
 nvme
 ping