mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 02:40:08 +00:00
parent
3b427824a7
commit
1d480e3329
@ -1,300 +0,0 @@
|
||||
#
|
||||
# Configuration variables for the platform-specific run scripts:
|
||||
# $platform - name of the platform passed to the 'create_builddir' script
|
||||
#
|
||||
|
||||
set verbose_mode "no"
|
||||
|
||||
#
|
||||
# The Linux version of Noux lacks the support for the fork system call. Hence,
|
||||
# the run script is expected to fail.
|
||||
#
|
||||
if {[have_spec linux]} {
|
||||
puts "Linux is unsupported."
|
||||
exit 0
|
||||
}
|
||||
|
||||
if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"]} {
|
||||
puts "\nRunning tool-chain auto test in autopilot on Qemu is not recommended."
|
||||
exit 0
|
||||
}
|
||||
|
||||
if {[have_spec pistachio] || [have_spec sel4] ||
|
||||
[expr [have_spec foc] && [have_spec imx7d_sabre]] } {
|
||||
puts "Platform is unsupported."
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
set use_usb_input [expr ![have_spec ps2] && ![have_spec sdl] && [have_spec usb]]
|
||||
|
||||
create_boot_directory
|
||||
|
||||
set build_components {
|
||||
core init timer noux lib/libc_noux
|
||||
server/log_terminal server/ram_fs
|
||||
test/libports/ncurses
|
||||
}
|
||||
|
||||
#
|
||||
# Disable syntax check for config file
|
||||
#
|
||||
# The syntax check fails because the content of the '.bash_profile' is
|
||||
# specified using an '<inline>' node but it is no valid XML. I.e., xmllint
|
||||
# complains about the sequence '&&'.
|
||||
#
|
||||
proc check_xml_with_schema {xml_file} { }
|
||||
|
||||
source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||
append_platform_drv_build_components
|
||||
|
||||
lappend_if $use_usb_input build_components drivers/usb
|
||||
|
||||
set cc_march ""
|
||||
set tool_chain_timeout 600
|
||||
|
||||
if {[have_spec arm]} {
|
||||
set binutils "binutils_arm"
|
||||
set gcc "gcc_arm"
|
||||
set tool_prefix "genode-arm-"
|
||||
|
||||
set noux_boot_timeout 350
|
||||
|
||||
if {[have_spec panda]} { set platform "panda" }
|
||||
if {[have_spec arndale]} { set platform "arndale" }
|
||||
if {[have_spec pbxa9]} { set platform "pbxa9" }
|
||||
if {[have_spec imx6q_sabrelite]} { set platform "imx6q_sabrelite" }
|
||||
if {[have_spec imx7d_sabre]} { set platform "imx7d_sabre" }
|
||||
|
||||
if {![info exists platform]} {
|
||||
puts "\n Run script is not supported on this platform. \n"
|
||||
exit 0
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if {[have_spec arm_64]} {
|
||||
set binutils "binutils_arm_64"
|
||||
set gcc "gcc_arm_64"
|
||||
set tool_prefix "genode-aarch64-"
|
||||
|
||||
set noux_boot_timeout 350
|
||||
set platform "arm_v8a"
|
||||
}
|
||||
|
||||
if {[have_spec x86]} {
|
||||
set binutils "binutils_x86"
|
||||
set gcc "gcc_x86"
|
||||
set tool_prefix "genode-x86-"
|
||||
|
||||
set noux_boot_timeout 100
|
||||
set platform "x86_64"
|
||||
}
|
||||
|
||||
#
|
||||
# Build Noux packages only once
|
||||
#
|
||||
set noux_pkgs "bash coreutils vim grep sed findutils make which $binutils $gcc tclsh"
|
||||
|
||||
foreach pkg $noux_pkgs {
|
||||
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
|
||||
|
||||
# write default .bash_profile file
|
||||
set bash_profile_fd [open bin/bash_profile w]
|
||||
puts $bash_profile_fd {
|
||||
cp /bin/make /usr/bin/
|
||||
cp /bin/echo /usr/bin/
|
||||
cp /bin/mkdir /usr/bin/
|
||||
cp /bin/tclsh /usr/bin/
|
||||
echo 'creating build directory...'
|
||||
mkdir -p "/home/build"
|
||||
cp -r /genode/depot /home/build
|
||||
}
|
||||
puts $bash_profile_fd "/genode/tool/depot/create DEPOT_DIR=/home/build/depot \
|
||||
test/bin/$platform/zlib CROSS_DEV_PREFIX=$tool_prefix && exit 234"
|
||||
close $bash_profile_fd
|
||||
|
||||
|
||||
exec mkdir -p [depot_dir]/test
|
||||
exec $genode_dir/tool/depot/create DEPOT_DIR=[depot_dir] test/src/zlib
|
||||
exec tar cvf bin/genode.tar -C $genode_dir tool repos/base \
|
||||
repos/libports/recipes/src/zlib \
|
||||
repos/libports/recipes/api
|
||||
exec tar rvf bin/genode.tar -C [depot_dir]/.. [file tail [depot_dir]]/test
|
||||
exec rm -rf [depot_dir]/test
|
||||
|
||||
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>
|
||||
|
||||
<start name="log_terminal">
|
||||
<resource name="RAM" quantum="2M"/>
|
||||
<provides><service name="Terminal"/></provides>
|
||||
<config/>
|
||||
</start>
|
||||
|
||||
<start name="ram_fs" caps="200">
|
||||
<resource name="RAM" quantum="124M"/>
|
||||
<provides><service name="File_system"/></provides>
|
||||
<config>
|
||||
<content>
|
||||
<dir name="home">
|
||||
<dir name="user">
|
||||
<rom name="bash_profile" as=".bash_profile"/>
|
||||
</dir>
|
||||
</dir>
|
||||
<dir name="tmp" />
|
||||
<dir name="usr">
|
||||
<dir name="bin" />
|
||||
</dir>
|
||||
</content>
|
||||
|
||||
<!-- constrain sessions according to their labels -->
|
||||
<policy label="noux -> root" root="/" />
|
||||
<policy label="noux -> home" root="/home/user" writeable="yes" />
|
||||
<policy label="noux -> tmp" root="/tmp" writeable="yes" />
|
||||
<policy label="noux -> usr" root="/usr" writeable="yes" />
|
||||
</config>
|
||||
</start>
|
||||
}
|
||||
|
||||
append config {
|
||||
<start name="noux" caps="2000">
|
||||
<resource name="RAM" quantum="1G" />
|
||||
}
|
||||
|
||||
if {![info exists verbose_mode]} {set verbose_mode "yes"}
|
||||
append config " <config verbose=\"$verbose_mode\">"
|
||||
|
||||
append config {
|
||||
<fstab>
|
||||
}
|
||||
|
||||
foreach pkg $noux_pkgs {
|
||||
append config " <tar name=\"$pkg.tar\" />" }
|
||||
|
||||
append config {
|
||||
|
||||
<dir name="genode">
|
||||
<tar name="genode.tar" />
|
||||
</dir>
|
||||
|
||||
<dir name="bin">
|
||||
} append config "
|
||||
<symlink name=\"nm\" target=\"${tool_prefix}nm\"/>
|
||||
" append config {
|
||||
<symlink name="sh" target="bash"/>
|
||||
</dir>
|
||||
|
||||
<dir name="share"> <dir name="vim"> <rom name="vimrc"/> </dir> </dir>
|
||||
|
||||
<dir name="dev">
|
||||
<null />
|
||||
</dir>
|
||||
|
||||
<dir name="home">
|
||||
<fs label="home" />
|
||||
</dir>
|
||||
|
||||
<dir name="tmp">
|
||||
<fs label="tmp" />
|
||||
</dir>
|
||||
|
||||
<dir name="usr">
|
||||
<fs label="usr" />
|
||||
</dir>
|
||||
</fstab>
|
||||
<start name="/bin/bash">
|
||||
<env name="TERM" value="screen" />
|
||||
<env name="HOME" value="/home" />
|
||||
<env name="PATH" value="/bin" />
|
||||
<arg value="--login" />
|
||||
</start>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
|
||||
install_config $config
|
||||
|
||||
|
||||
#
|
||||
# Boot modules
|
||||
#
|
||||
|
||||
# generic modules
|
||||
set boot_modules {
|
||||
core init timer ld.lib.so noux log_terminal ram_fs
|
||||
libc.lib.so vfs.lib.so libm.lib.so libc_noux.lib.so ncurses.lib.so stdcxx.lib.so
|
||||
pcre.lib.so posix.lib.so vimrc bash_profile
|
||||
}
|
||||
|
||||
append boot_modules { gmp.lib.so mpfr.lib.so mpc.lib.so }
|
||||
|
||||
foreach pkg $noux_pkgs {
|
||||
lappend boot_modules "$pkg.tar" }
|
||||
|
||||
append boot_modules { genode.tar }
|
||||
|
||||
build_boot_image $boot_modules
|
||||
|
||||
|
||||
append qemu_args " -nographic -m 768 "
|
||||
|
||||
# wait until Noux started
|
||||
run_genode_until {\[init -\> noux\].*--- noux started ---} $noux_boot_timeout
|
||||
set serial_id [output_spawn_id]
|
||||
|
||||
# start the measurement
|
||||
set time_start [ clock seconds ]
|
||||
run_genode_until {child /bin/bash exited with exit value 234} $tool_chain_timeout $serial_id
|
||||
|
||||
set time_end [ clock seconds ]
|
||||
|
||||
# cleanup created tars
|
||||
exec rm -f bin/genode.tar
|
||||
|
||||
# print infos about run
|
||||
set git_info "unknown"
|
||||
catch { set git_info [exec git --git-dir=$genode_dir/.git describe ] }
|
||||
|
||||
puts "Testing \" [ clock format $time_start -format "%Y-%m-%d %H:%M:%S"], commit: ($git_info)\" in : "
|
||||
puts "Testing \"all\" in printf.wv:"
|
||||
puts "! PERF: runtime [expr $time_end - $time_start ] seconds ok"
|
||||
|
||||
puts "Test succeeded"
|
||||
|
||||
# vi: set ft=tcl :
|
280
repos/ports/run/tool_chain_auto.run
Normal file
280
repos/ports/run/tool_chain_auto.run
Normal file
@ -0,0 +1,280 @@
|
||||
if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"]} {
|
||||
puts "\nRunning tool-chain auto test in autopilot on Qemu is not recommended."
|
||||
exit 0
|
||||
}
|
||||
|
||||
if {[have_spec pistachio] || [have_spec sel4] ||
|
||||
[expr [have_spec foc] && [have_spec imx7d_sabre]] } {
|
||||
puts "Platform is unsupported."
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
create_boot_directory
|
||||
|
||||
import_from_depot [depot_user]/src/[base_src] \
|
||||
[depot_user]/src/init \
|
||||
[depot_user]/src/posix \
|
||||
[depot_user]/src/bash \
|
||||
[depot_user]/src/coreutils \
|
||||
[depot_user]/src/findutils \
|
||||
[depot_user]/src/grep \
|
||||
[depot_user]/src/sed \
|
||||
[depot_user]/src/gnumake \
|
||||
[depot_user]/src/which \
|
||||
[depot_user]/src/tclsh \
|
||||
[depot_user]/src/vfs \
|
||||
[depot_user]/src/pcre \
|
||||
[depot_user]/src/vfs_pipe \
|
||||
[depot_user]/src/libc \
|
||||
[depot_user]/src/stdcxx \
|
||||
[depot_user]/src/fs_rom \
|
||||
[depot_user]/src/cached_fs_rom
|
||||
|
||||
|
||||
#
|
||||
# Disable syntax check for config file
|
||||
#
|
||||
# The syntax check fails because the content of the '.bash_profile' is
|
||||
# specified using an '<inline>' node but it is no valid XML. I.e., xmllint
|
||||
# complains about the sequence '&&'.
|
||||
#
|
||||
proc check_xml_with_schema {xml_file} { }
|
||||
|
||||
|
||||
set cc_march ""
|
||||
set tool_chain_timeout 600
|
||||
|
||||
if {[have_spec arm]} {
|
||||
set binutils "binutils_arm"
|
||||
set gcc "gcc_arm"
|
||||
set tool_prefix "genode-arm-"
|
||||
set boot_timeout 350
|
||||
set arch "arm_v7a"
|
||||
}
|
||||
|
||||
if {[have_spec arm_64]} {
|
||||
set binutils "binutils_arm_64"
|
||||
set gcc "gcc_arm_64"
|
||||
set tool_prefix "genode-aarch64-"
|
||||
set boot_timeout 350
|
||||
set arch "arm_v8a"
|
||||
}
|
||||
|
||||
if {[have_spec x86]} {
|
||||
set binutils "binutils_x86"
|
||||
set gcc "gcc_x86"
|
||||
set tool_prefix "genode-x86-"
|
||||
set boot_timeout 250
|
||||
set arch "x86_64"
|
||||
}
|
||||
|
||||
#
|
||||
# Build packages only once
|
||||
#
|
||||
set pkgs "$binutils $gcc"
|
||||
|
||||
foreach pkg $pkgs {
|
||||
lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg }
|
||||
|
||||
lappend build_components "lib/vfs/pipe"
|
||||
lappend build_components "server/vfs"
|
||||
|
||||
build $build_components
|
||||
|
||||
# write default .bash_profile file
|
||||
set bash_profile_fd [open bin/bash_profile w]
|
||||
puts $bash_profile_fd {
|
||||
echo 'creating build directory...'
|
||||
mkdir -p "/home/build"
|
||||
cp -r /genode/depot /home/build
|
||||
}
|
||||
puts $bash_profile_fd "/genode/tool/depot/create DEPOT_DIR=/home/build/depot \
|
||||
test/bin/$arch/zlib CROSS_DEV_PREFIX=$tool_prefix && exit 234"
|
||||
close $bash_profile_fd
|
||||
|
||||
|
||||
exec mkdir -p [depot_dir]/test
|
||||
exec $genode_dir/tool/depot/create DEPOT_DIR=[depot_dir] test/src/zlib
|
||||
exec tar cvf bin/genode.tar -C $genode_dir tool repos/base \
|
||||
repos/libports/recipes/src/zlib \
|
||||
repos/libports/recipes/api
|
||||
exec tar rvf bin/genode.tar -C [depot_dir]/.. [file tail [depot_dir]]/test
|
||||
exec rm -rf [depot_dir]/test
|
||||
|
||||
|
||||
proc mounted_tar_archives { } {
|
||||
global binutils gcc
|
||||
|
||||
set archives "bash coreutils grep sed findutils make which $binutils $gcc tclsh"
|
||||
|
||||
set result {}
|
||||
foreach archive $archives {
|
||||
append result "\t\t\t\t<tar name=\"$archive.tar\" />\n" }
|
||||
|
||||
return $result
|
||||
}
|
||||
|
||||
|
||||
proc prefixed_nm { } {
|
||||
global tool_prefix
|
||||
return "${tool_prefix}nm"
|
||||
}
|
||||
|
||||
|
||||
proc fs_rom_binary { } {
|
||||
|
||||
#
|
||||
# The cached_fs_rom server relies on managed dataspaces, which are not
|
||||
# fully available on all kernels.
|
||||
#
|
||||
if {[have_spec linux] || [have_spec fiasco] || [have_spec foc]} {
|
||||
return "fs_rom" }
|
||||
|
||||
return "cached_fs_rom"
|
||||
}
|
||||
|
||||
|
||||
install_config {
|
||||
<config verbose="yes">
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
<service name="LOG"/>
|
||||
<service name="RM"/>
|
||||
<service name="CPU"/>
|
||||
<service name="PD"/>
|
||||
<service name="IO_PORT"/>
|
||||
<service name="IO_MEM"/>
|
||||
<service name="IRQ"/>
|
||||
</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>
|
||||
|
||||
<start name="vfs" caps="200">
|
||||
<resource name="RAM" quantum="124M"/>
|
||||
<provides> <service name="File_system"/> </provides>
|
||||
<config>
|
||||
<vfs>
|
||||
} [mounted_tar_archives] {
|
||||
<dir name="dev">
|
||||
<zero/>
|
||||
<log/>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<inline name="rtc">2030-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="home">
|
||||
<ram/>
|
||||
<rom name=".bash_profile" label="bash_profile" binary="no"/>
|
||||
</dir>
|
||||
<dir name="genode"> <tar name="genode.tar"/> </dir>
|
||||
<dir name="tmp"> <ram/> </dir>
|
||||
<dir name="usr">
|
||||
<dir name="bin">
|
||||
<symlink name="make" target="/bin/make" />
|
||||
<symlink name="mkdir" target="/bin/mkdir"/>
|
||||
<symlink name="echo" target="/bin/echo" />
|
||||
<symlink name="tclsh" target="/bin/tclsh"/>
|
||||
</dir>
|
||||
</dir>
|
||||
|
||||
<dir name="bin">
|
||||
<symlink name="nm" target="} [prefixed_nm] {"/>
|
||||
<symlink name="sh" target="bash"/>
|
||||
</dir>
|
||||
</vfs>
|
||||
<default-policy root="/" writeable="yes"/>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
<start name="vfs_rom">
|
||||
<resource name="RAM" quantum="60M"/>
|
||||
<binary name="} [fs_rom_binary] {"/>
|
||||
<provides> <service name="ROM"/> </provides>
|
||||
<config/>
|
||||
<route>
|
||||
<service name="File_system"> <child name="vfs"/> </service>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="/bin/bash" caps="2000">
|
||||
<resource name="RAM" quantum="300M" />
|
||||
<config ld_verbose="yes">
|
||||
<libc stdin="/dev/null" stdout="/dev/log" stderr="/dev/log"
|
||||
rtc="/dev/rtc" pipe="/dev/pipe"/>
|
||||
<vfs>
|
||||
<fs buffer_size="2M"/>
|
||||
<dir name="dev"> <null/> </dir>
|
||||
</vfs>
|
||||
<env key="HOME" value="/home"/>
|
||||
<env key="PATH" value="/bin"/>
|
||||
<arg value="/bin/bash"/>
|
||||
<arg value="--login" />
|
||||
</config>
|
||||
<route>
|
||||
<service name="File_system"> <child name="vfs"/> </service>
|
||||
<service name="ROM" label_suffix=".lib.so"> <parent/> </service>
|
||||
<service name="ROM" label_last="/bin/bash"> <child name="vfs_rom"/> </service>
|
||||
<service name="ROM" label_prefix="/genode/tool"> <child name="vfs_rom"/> </service>
|
||||
<service name="ROM" label_prefix="/bin"> <child name="vfs_rom"/> </service>
|
||||
<service name="ROM" label_prefix="/usr/bin"> <child name="vfs_rom"/> </service>
|
||||
<service name="ROM" label_prefix="/libexec"> <child name="vfs_rom"/> </service>
|
||||
<service name="ROM" label_prefix="/x86_64-pc-elf"> <child name="vfs_rom"/> </service>
|
||||
<service name="ROM" label_prefix="/arm-none-eabi"> <child name="vfs_rom"/> </service>
|
||||
<service name="ROM" label_prefix="/aarch64-none-elf"> <child name="vfs_rom"/> </service>
|
||||
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
</config>}
|
||||
|
||||
|
||||
#
|
||||
# Boot modules
|
||||
#
|
||||
|
||||
append boot_modules { bash_profile genode.tar gmp.lib.so mpfr.lib.so mpc.lib.so }
|
||||
lappend boot_modules "$binutils.tar" "$gcc.tar"
|
||||
lappend boot_modules libc.lib.so vfs.lib.so vfs_pipe.lib.so vfs
|
||||
|
||||
build_boot_image $boot_modules
|
||||
|
||||
|
||||
append qemu_args " -nographic -m 768 "
|
||||
|
||||
# wait until Noux started
|
||||
run_genode_until {.*\[init -> vfs\] creating build directory\.\.\..*\n} $boot_timeout
|
||||
set run_id [output_spawn_id]
|
||||
|
||||
puts "--- start of time measurement ---"
|
||||
set time_start [ clock seconds ]
|
||||
|
||||
run_genode_until {.*"/bin/bash".* exited with exit value 234.*\n} $tool_chain_timeout $run_id
|
||||
|
||||
puts "--- end of time measurement ---"
|
||||
set time_end [ clock seconds ]
|
||||
|
||||
# cleanup created tars
|
||||
exec rm -f bin/genode.tar
|
||||
|
||||
# print infos about run
|
||||
set git_info "unknown"
|
||||
catch { set git_info [exec git --git-dir=$genode_dir/.git describe ] }
|
||||
|
||||
puts "Testing \" [ clock format $time_start -format "%Y-%m-%d %H:%M:%S"], commit: ($git_info)\" in : "
|
||||
puts "Testing \"all\" in printf.wv:"
|
||||
puts "! PERF: runtime [expr $time_end - $time_start ] seconds ok"
|
||||
|
||||
puts "Test succeeded"
|
||||
|
||||
# vi: set ft=tcl :
|
@ -39,7 +39,7 @@ nic_router
|
||||
nic_router_flood
|
||||
nic_router_stress
|
||||
nic_router_uplinks
|
||||
noux_tool_chain_auto
|
||||
tool_chain_auto
|
||||
nvme
|
||||
ping
|
||||
ping_nic_router
|
||||
|
Loading…
Reference in New Issue
Block a user