From e2280a1650fa4ef39d9a0695690454641becc5dc Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Thu, 5 Nov 2015 11:08:05 +0100 Subject: [PATCH] noux: Run script with two bash shells using the same file system Related to #1765 Instructions: 1. Create a file in terminal one in the 'ram' directory ! echo "test" > ram/test 2. Second terminal ! tail -f ram/test 3. First terminal ! echo "Meaningless output" >> ram/test 4. Observe second terminal --- repos/ports/run/noux_two_terminal_fs.run | 253 +++++++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 repos/ports/run/noux_two_terminal_fs.run diff --git a/repos/ports/run/noux_two_terminal_fs.run b/repos/ports/run/noux_two_terminal_fs.run new file mode 100644 index 0000000000..187a773cf0 --- /dev/null +++ b/repos/ports/run/noux_two_terminal_fs.run @@ -0,0 +1,253 @@ +# +# \brief Test for the Noux terminal file system +# \author Christian Prochaska +# \date 2012-06-11 +# + +# +# The test shows two framebuffer terminals. The upper terminal runs an +# interatctive shell and the lower terminal can be accessed from the shell via +# /dev/terminal. +# +# Example for writing to the lower terminal: echo "test" > /dev/terminal +# Example for reading a line from the lower terminal: head -n 1 /dev/terminal +# + +set build_components { + core init drivers/timer noux lib/libc_noux + drivers/framebuffer drivers/input + server/terminal server/ram_fs server/nitpicker app/pointer + server/nit_fb +} + +# +# Build Noux packages only once +# +foreach pkg {bash coreutils} { + lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg } + +source ${genode_dir}/repos/base/run/platform_drv.inc +append_platform_drv_build_components + +build $build_components + +# strip all binaries prior archiving +exec sh -c "find bin/bash/ bin/coreutils/ -type f | (xargs strip || true) 2>/dev/null" + +exec tar cfv bin/bash.tar -h -C bin/bash . +exec tar cfv bin/coreutils.tar -h -C bin/coreutils . + +create_boot_directory + +append config { + + + + + + + + + + + + + + + + + + + + + } + +append_if [have_spec sdl] config { + + + + + + + } + +append_platform_drv_config + +append_if [have_spec framebuffer] config { + + + + } + +append_if [have_spec ps2] config { + + + + } + +append config { + + + + + + + + + + } +append_if [have_spec ps2] config { + } +append config { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} + +install_config $config + + +# +# Boot modules +# + +# generic modules +set boot_modules { + core init timer ld.lib.so noux terminal ram_fs nitpicker nit_fb pointer + libc.lib.so libm.lib.so libc_noux.lib.so + bash.tar coreutils.tar +} + +# platform-specific modules +lappend_if [have_spec linux] boot_modules fb_sdl +lappend_if [have_spec framebuffer] boot_modules fb_drv +lappend_if [have_spec ps2] boot_modules ps2_drv + +append_platform_drv_boot_modules + +build_boot_image $boot_modules + +if {[have_spec x86_64]} { + # bash.tar is really huge when built for x86_64 + append qemu_args " -m 300 " +} + +run_genode_until forever + +exec rm bin/bash.tar