diff --git a/repos/gems/run/cpu_sampler_noux.run b/repos/gems/run/cpu_sampler_noux.run index 50ca49d87b..77887284e2 100644 --- a/repos/gems/run/cpu_sampler_noux.run +++ b/repos/gems/run/cpu_sampler_noux.run @@ -37,7 +37,7 @@ append_platform_drv_build_components build $build_components # write default vimrc file -set vimrc_fd [open "bin/vim/share/vim/vimrc" w] +set vimrc_fd [open "bin/vimrc" w] puts $vimrc_fd { set noloadplugins set hls @@ -47,14 +47,6 @@ set noswapfile set viminfo=} close $vimrc_fd -# strip all binaries prior archiving -exec sh -c "find bin/bash/ bin/vim/ bin/coreutils/ -type f | (xargs [cross_dev_prefix]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 . -exec tar cfv bin/vim.tar -h -C bin/vim . -exec tar cfv bin/diffutils.tar -h -C bin/diffutils . - create_boot_directory proc gpio_drv { } { if {[have_spec rpi] && [have_spec hw]} { return hw_gpio_drv } @@ -200,6 +192,7 @@ append config { + @@ -234,7 +227,7 @@ proc binary_name_cpu_sampler_platform_lib_so { } { set boot_modules { core ld.lib.so init timer noux terminal ram_fs log_terminal libc.lib.so libm.lib.so libc_noux.lib.so ncurses.lib.so posix.lib.so - bash.tar coreutils.tar diffutils.tar vim.tar + bash.tar coreutils.tar diffutils.tar vim.tar vimrc fs_log cpu_sampler cpu_sampler_platform.lib.so test-cpu_sampler } @@ -269,7 +262,3 @@ regexp $match_string $output all func run_genode_until "\\\[init -> terminal] \[0\]*$func" 90 [output_spawn_id] -exec rm bin/bash.tar -exec rm bin/coreutils.tar -exec rm bin/diffutils.tar -exec rm bin/vim.tar diff --git a/repos/gems/run/terminal_mux.run b/repos/gems/run/terminal_mux.run index 696e24457e..52112f194c 100644 --- a/repos/gems/run/terminal_mux.run +++ b/repos/gems/run/terminal_mux.run @@ -17,8 +17,6 @@ set build_components { build $build_components -exec tar cfv bin/vim.tar -h -C bin/vim . - create_boot_directory append config { @@ -161,5 +159,3 @@ append qemu_args " -serial file:kdb.log " append qemu_args " -serial mon:stdio" run_genode_until forever - -exec rm bin/vim.tar diff --git a/repos/ports/mk/gnu_build.mk b/repos/ports/mk/gnu_build.mk index cde021b4a4..062976df09 100644 --- a/repos/ports/mk/gnu_build.mk +++ b/repos/ports/mk/gnu_build.mk @@ -30,6 +30,15 @@ TARGET ?= $(lastword $(subst /, ,$(PRG_DIR))) PKG ?= $(TARGET) +# +# Select how to make the build result available at Genode's 'INSTALL_DIR'. +# By default, a single tar archive containing the results of the package's +# 'make install' rule is created. By setting the 'INSTALL_TREE' variable +# to a non-empty value, a symlink to the actual file tree is created. +# +INSTALL_TREE ?= +INSTALL_TAR_ARCHIVE ?= yes + LIBS += posix PWD = $(shell pwd) @@ -158,16 +167,45 @@ built.tag: env.sh Makefile INSTALL_TARGET ?= install-strip +# +# Install result of the build in an 'install/' directory local to the target's +# build directory +# installed.tag: built.tag @$(MSG_INST)$(TARGET) $(VERBOSE)source env.sh && $(MAKE) $(MAKE_ENV) $(MAKE_VERBOSE) $(INSTALL_TARGET) DESTDIR=$(PWD)/install MAN= >> stdout.log 2>> stderr.log - $(VERBOSE)rm -f $(INSTALL_DIR)/$(TARGET) - $(VERBOSE)ln -sf $(PWD)/install $(INSTALL_DIR)/$(TARGET) @touch $@ $(TARGET): installed.tag @touch $@ +# +# Trigger creation of symlinks to the build results at '/bin/' +# +ifneq ($(INSTALL_TAR_ARCHIVE),) +$(TARGET): installed_tar.tag +endif + +ifneq ($(INSTALL_TREE),) +$(TARGET): installed_tree.tag +endif + +# +# Install symlink to the install directory +# +installed_tree.tag: installed.tag + $(VERBOSE)rm -f $(INSTALL_DIR)/$(TARGET) + $(VERBOSE)ln -sf $(PWD)/install $(INSTALL_DIR)/$(TARGET) + +# +# Install symlink to the archived install directory, ready to by mounted +# via the VFS tar file system +# +installed_tar.tag: installed.tag + $(VERBOSE)tar cf $(TARGET).tar -h -C $(PWD)/install . + $(VERBOSE)rm -f $(INSTALL_DIR)/$(TARGET) + $(VERBOSE)ln -sf $(PWD)/$(TARGET).tar $(INSTALL_DIR)/$(TARGET).tar + # # The clean rule is expected to be executed within the 3rd-party build # directory. The check should prevent serious damage if this condition @@ -175,7 +213,7 @@ $(TARGET): installed.tag # ifeq ($(notdir $(PWD)),$(notdir $(PRG_DIR))) clean_dir: - $(VERBOSE)rm -rf $(PWD)/* $(PWD)/.* + $(VERBOSE)find $(PWD) -mindepth 1 -delete clean_prg_objects: clean_dir endif diff --git a/repos/ports/mk/noux.mk b/repos/ports/mk/noux.mk index e3114fddbe..0a2ef9151e 100644 --- a/repos/ports/mk/noux.mk +++ b/repos/ports/mk/noux.mk @@ -5,4 +5,3 @@ LIBS += libc_noux PKG_DIR ?= $(call select_from_ports,$(PKG))/src/noux-pkg/$(PKG) include $(GNU_BUILD_MK) - diff --git a/repos/ports/run/noux.run b/repos/ports/run/noux.run index 63eb4e0e97..6015234501 100644 --- a/repos/ports/run/noux.run +++ b/repos/ports/run/noux.run @@ -1,10 +1,6 @@ build { core init drivers/timer noux/minimal server/log_terminal lib/libc_noux noux-pkg/coreutils } -# strip coreutils binaries and create tar archive -exec sh -c "[cross_dev_prefix]strip bin/coreutils/bin/*" -exec tar cfv bin/coreutils.tar -h -C bin/coreutils . - create_boot_directory install_config { @@ -56,5 +52,3 @@ if {[have_spec x86_64]} { } run_genode_until {child "noux" exited with exit value 0.*\n} 30 - -exec rm bin/coreutils.tar diff --git a/repos/ports/run/noux_bash.run b/repos/ports/run/noux_bash.run index 78a08e5ad9..d253edb735 100644 --- a/repos/ports/run/noux_bash.run +++ b/repos/ports/run/noux_bash.run @@ -1,9 +1,3 @@ -# -# Uncomment the following line when working on the VIM source code. Otherwise, -# the package may get recompiled, yet it does not get reinstalled into 'bin/'. -# -#exec rm -rf noux-pkg/bash bin/bash - set build_components { core init drivers/timer noux/minimal lib/libc_noux drivers/framebuffer drivers/input @@ -31,8 +25,10 @@ append_platform_drv_build_components build $build_components +create_boot_directory + # write default vimrc file -set vimrc_fd [open "bin/vim/share/vim/vimrc" w] +set vimrc_fd [open bin/vimrc w] puts $vimrc_fd { set noloadplugins set hls @@ -42,17 +38,6 @@ set noswapfile set viminfo=} close $vimrc_fd -# strip all binaries prior archiving -exec sh -c "find bin/bash/ bin/vim/ bin/coreutils/ -type f | (xargs [cross_dev_prefix]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 . -exec tar cfv bin/vim.tar -h -C bin/vim . -exec tar cfv bin/diffutils.tar -h -C bin/diffutils . -exec tar cfv bin/less.tar -h -C bin/less . - -create_boot_directory - append config { @@ -88,6 +73,7 @@ append_if [have_spec sdl] config { + } append_platform_drv_config @@ -96,6 +82,7 @@ append_if [have_spec framebuffer] config { + } append_if [have_spec ps2] config { @@ -170,6 +157,7 @@ Hello world !! as a key to select the policy of 'ram_fs' --> + @@ -204,7 +192,7 @@ install_config $config set boot_modules { core init timer ld.lib.so noux terminal ram_fs libc.lib.so libm.lib.so libc_noux.lib.so ncurses.lib.so posix.lib.so - bash.tar coreutils.tar diffutils.tar less.tar vim.tar + bash.tar coreutils.tar diffutils.tar less.tar vim.tar vimrc } # platform-specific modules @@ -225,9 +213,3 @@ if {[have_spec x86_64]} { } run_genode_until forever - -exec rm bin/bash.tar -exec rm bin/coreutils.tar -exec rm bin/diffutils.tar -exec rm bin/less.tar -exec rm bin/vim.tar diff --git a/repos/ports/run/noux_gdb.inc b/repos/ports/run/noux_gdb.inc index 211c55c4f6..8a41268c75 100644 --- a/repos/ports/run/noux_gdb.inc +++ b/repos/ports/run/noux_gdb.inc @@ -15,15 +15,6 @@ proc noux_gdb_pkg_name { } { } -# -# Create a tar archive for GDB (stripped) -# -proc create_gdb_tar { } { - exec sh -c "find bin/[noux_gdb_pkg_name]/ -type f | (xargs [cross_dev_prefix]strip || true) 2>/dev/null" - exec tar cfhv bin/gdb.tar -C bin/[noux_gdb_pkg_name] . -} - - # # Create a tar archive for a Noux application and its shared libraries (unstripped) # diff --git a/repos/ports/run/noux_gdb.run b/repos/ports/run/noux_gdb.run index 3e9a5a08b9..9d1b0535ec 100644 --- a/repos/ports/run/noux_gdb.run +++ b/repos/ports/run/noux_gdb.run @@ -66,7 +66,6 @@ set gdb_target_binaries { } lappend gdb_target_binaries ${gdb_target_binary_name} -create_gdb_tar create_binary_and_source_tars ${gdb_target_binary_name} ${gdb_target_binaries} create_boot_directory @@ -250,4 +249,3 @@ append qemu_args " -m 256 " run_genode_until forever -exec rm bin/gdb.tar diff --git a/repos/ports/run/noux_net_lighttpd.run b/repos/ports/run/noux_net_lighttpd.run index 312f5240b0..249227d50e 100644 --- a/repos/ports/run/noux_net_lighttpd.run +++ b/repos/ports/run/noux_net_lighttpd.run @@ -29,7 +29,7 @@ append_platform_drv_build_components build $build_components -set vimrc_fd [open "bin/vim/share/vim/vimrc" w] +set vimrc_fd [open "bin/vimrc" w] puts $vimrc_fd { set noloadplugins set hls @@ -39,17 +39,6 @@ set noswapfile set viminfo=} close $vimrc_fd -# strip all binaries prior archiving -set find_args "" -foreach pkg $noux_pkgs { append find_args " bin/$pkg/" } -exec sh -c "find $find_args -type f | (xargs [cross_dev_prefix]strip || true) 2>/dev/null" - -# add bash as sh -exec cp bin/bash/bin/bash bin/bash/bin/sh - -foreach pkg $noux_pkgs { - exec tar cf bin/$pkg.tar -h -C bin/$pkg . } - # generate configuration for lighttpd proc lighttpd_config_path { } { return "[genode_dir]/repos/ports/contrib/lighttpd-1.4.31/doc/config" } @@ -169,10 +158,12 @@ foreach pkg $noux_pkgs { append config { + + @@ -207,7 +198,7 @@ set boot_modules { libc.lib.so libm.lib.so libc_noux.lib.so posix.lib.so lwip.lib.so ncurses.lib.so readline.lib.so zlib.lib.so libcrypto.lib.so libssl.lib.so - lighttpd.tar + lighttpd.tar vimrc } foreach pkg $noux_pkgs { @@ -222,10 +213,8 @@ 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 320 " -} +# bash.tar is really huge when built for x86_64 +if {[have_spec x86_64]} { append qemu_args " -m 320 " } append_if [have_spec x86] qemu_args " -net nic,model=e1000 " append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " @@ -234,5 +223,4 @@ append qemu_args " -net user -redir tcp:5555::80 " run_genode_until forever -#exec rm bin/bash.tar exec rm -rf bin/aux diff --git a/repos/ports/run/noux_net_netcat.run b/repos/ports/run/noux_net_netcat.run index 7900b951cb..08da8fab0b 100644 --- a/repos/ports/run/noux_net_netcat.run +++ b/repos/ports/run/noux_net_netcat.run @@ -27,8 +27,6 @@ append_platform_drv_build_components build $build_components -exec tar cfv bin/noux_netcat.tar -h -C bin/netcat . - # # The '/bin/etc/' directory is expected to contain the # files 'services', 'protocols', 'hosts', and 'resolv.conf'. @@ -41,7 +39,7 @@ foreach etc_file { services protocols hosts } { catch { exec wget -c -P bin/etc $freebsd_url/$etc_file } } } exec touch bin/etc/resolv.conf -exec tar rfv bin/noux_netcat.tar -h -C bin/ etc +exec tar rfv bin/netcat.tar -h -C bin/ etc create_boot_directory @@ -138,7 +136,7 @@ append config { - + @@ -166,7 +164,7 @@ install_config $config set boot_modules { core init timer tcp_terminal nic_bridge ld.lib.so noux_net libc.lib.so libm.lib.so libc_pipe.lib.so pthread.lib.so - libc_resolv.lib.so libc_noux.lib.so lwip.lib.so noux_netcat.tar posix.lib.so + libc_resolv.lib.so libc_noux.lib.so lwip.lib.so netcat.tar posix.lib.so } # platform-specific modules @@ -233,7 +231,6 @@ set output [exec cat $noux_output_file] puts "\noutput:\n$output\n" exec rm $noux_output_file -exec rm bin/noux_netcat.tar exec rm -r bin/etc if {![regexp {Hello Genode} $output dummy]} { diff --git a/repos/ports/run/noux_shell_script.run b/repos/ports/run/noux_shell_script.run index cd28ee6dbd..ac86da300a 100644 --- a/repos/ports/run/noux_shell_script.run +++ b/repos/ports/run/noux_shell_script.run @@ -21,17 +21,6 @@ append_platform_drv_build_components build $build_components -# strip all binaries prior archiving -set find_args "" -foreach pkg $noux_pkgs { append find_args " bin/$pkg/" } -exec sh -c "find $find_args -type f | (xargs [cross_dev_prefix]strip || true) 2>/dev/null" - -# create '/bin/sh' symlink -exec sh -c "ln -sf bash bin/bash/bin/sh" - -foreach pkg $noux_pkgs { - exec tar cfv bin/$pkg.tar -h -C bin/$pkg . } - create_boot_directory append config { @@ -134,6 +123,7 @@ foreach pkg $noux_pkgs { append config " " } append config { + @@ -160,8 +150,7 @@ set boot_modules { core init timer ld.lib.so noux terminal ram_fs posix.lib.so libc.lib.so libm.lib.so libc_noux.lib.so ncurses.lib.so } -foreach pkg $noux_pkgs { - lappend boot_modules "$pkg.tar" } +foreach pkg $noux_pkgs { lappend boot_modules "$pkg.tar" } # platform-specific modules lappend_if [have_spec linux] boot_modules fb_sdl @@ -176,5 +165,3 @@ build_boot_image $boot_modules append qemu_args " -m 300 " run_genode_until forever - -exec rm bin/bash.tar diff --git a/repos/ports/run/noux_terminal_fs.run b/repos/ports/run/noux_terminal_fs.run index 0e99e368d8..5922caeb2f 100644 --- a/repos/ports/run/noux_terminal_fs.run +++ b/repos/ports/run/noux_terminal_fs.run @@ -31,12 +31,6 @@ 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 { @@ -208,11 +202,7 @@ 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 " -} +# bash.tar is really huge when built for x86_64 +if {[have_spec x86_64]} { append qemu_args " -m 300 " } run_genode_until forever - -exec rm bin/bash.tar diff --git a/repos/ports/run/noux_tool_chain.inc b/repos/ports/run/noux_tool_chain.inc index fba81883de..c2daf6b1e3 100644 --- a/repos/ports/run/noux_tool_chain.inc +++ b/repos/ports/run/noux_tool_chain.inc @@ -67,7 +67,7 @@ foreach pkg $noux_pkgs { build $build_components # write default vimrc file -set vimrc_fd [open "bin/vim/share/vim/vimrc" w] +set vimrc_fd [open "bin/vimrc" w] puts $vimrc_fd { set noloadplugins set hls @@ -77,16 +77,6 @@ set noswapfile set viminfo=} close $vimrc_fd -# strip all binaries prior archiving -set find_args "" -foreach pkg $noux_pkgs { append find_args " bin/$pkg" } -exec sh -c "find $find_args -type f | (xargs [cross_dev_prefix]strip -g || true) 2>/dev/null" - -exec ln -sf bash bin/bash/bin/sh - -foreach pkg $noux_pkgs { - exec tar cfv bin/$pkg.tar -h -C bin/$pkg . } - exec tar cvf bin/genode.tar -C $genode_dir tool repos/base repos/$platform_base_dir repos/os repos/demo create_boot_directory @@ -217,6 +207,10 @@ append config { + + + + diff --git a/repos/ports/run/noux_tool_chain_auto.run b/repos/ports/run/noux_tool_chain_auto.run index f8b6015278..31e237c12d 100644 --- a/repos/ports/run/noux_tool_chain_auto.run +++ b/repos/ports/run/noux_tool_chain_auto.run @@ -69,7 +69,6 @@ run_genode_until {child /bin/bash exited with exit value 234} $tool_chain_timeou set time_end [ clock seconds ] # cleanup created tars -foreach pkg $noux_pkgs { exec rm -f bin/$pkg.tar } exec rm -f bin/genode.tar # print infos about run diff --git a/repos/ports/run/noux_trace_fs.run b/repos/ports/run/noux_trace_fs.run index 3d425ee8e0..2c972a6ccd 100644 --- a/repos/ports/run/noux_trace_fs.run +++ b/repos/ports/run/noux_trace_fs.run @@ -46,8 +46,10 @@ append_platform_drv_build_components build $build_components +create_boot_directory + # write default vimrc file -set vimrc_fd [open "bin/vim/share/vim/vimrc" w] +set vimrc_fd [open "bin/vimrc" w] puts $vimrc_fd { set noloadplugins set hls @@ -57,13 +59,6 @@ set noswapfile set viminfo=} close $vimrc_fd -# strip all binaries prior archiving -foreach pkg $noux_pkgs { - exec sh -c "find bin/$pkg -type f | (xargs [cross_dev_prefix]strip || true) 2>/dev/null" - exec tar cfv bin/$pkg.tar -h -C bin/$pkg . } - -create_boot_directory - append config { @@ -177,6 +172,8 @@ append config { + + diff --git a/repos/ports/run/noux_two_terminal_fs.run b/repos/ports/run/noux_two_terminal_fs.run index cab3ea5357..45881d6575 100644 --- a/repos/ports/run/noux_two_terminal_fs.run +++ b/repos/ports/run/noux_two_terminal_fs.run @@ -31,12 +31,6 @@ 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 { @@ -230,7 +224,7 @@ install_config $config 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 posix.lib.so - bash.tar coreutils.tar + bash.tar coreutils.tar vimrc } # platform-specific modules @@ -242,11 +236,7 @@ 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 " -} +# bash.tar is really huge when built for x86_64 +if {[have_spec x86_64]} { append qemu_args " -m 300 " } run_genode_until forever - -exec rm bin/bash.tar diff --git a/repos/ports/run/noux_uname.run b/repos/ports/run/noux_uname.run index c5b5923e27..c3017f0af6 100644 --- a/repos/ports/run/noux_uname.run +++ b/repos/ports/run/noux_uname.run @@ -1,10 +1,6 @@ build { core init drivers/timer noux/minimal lib/libc_noux noux-pkg/coreutils } -# strip coreutils binaries and create tar archive -exec sh -c "[cross_dev_prefix]strip bin/coreutils/bin/*" -exec tar cfv bin/coreutils.tar -h -C bin/coreutils . - create_boot_directory install_config { @@ -64,11 +60,7 @@ build_boot_image { append qemu_args " -nographic -serial mon:stdio " -if {[have_spec x86_64]} { - # coreutils.tar is really huge when built for x86_64 - append qemu_args " -m 300 " -} +# coreutils.tar is really huge when built for x86_64 +if {[have_spec x86_64]} { append qemu_args " -m 300 " } run_genode_until {child "noux" exited with exit value 0.*\n} 30 - -exec rm bin/coreutils.tar diff --git a/repos/ports/run/noux_vim.run b/repos/ports/run/noux_vim.run index c603780eed..e142cb9c49 100644 --- a/repos/ports/run/noux_vim.run +++ b/repos/ports/run/noux_vim.run @@ -17,8 +17,6 @@ append_platform_drv_build_components build $build_components -exec tar cfv bin/vim.tar -h -C bin/vim . - create_boot_directory append config { @@ -131,5 +129,3 @@ append_platform_drv_boot_modules build_boot_image $boot_modules run_genode_until forever - -exec rm bin/vim.tar diff --git a/repos/ports/run/vbox_share.inc b/repos/ports/run/vbox_share.inc index 6b47801511..8253767f76 100644 --- a/repos/ports/run/vbox_share.inc +++ b/repos/ports/run/vbox_share.inc @@ -266,8 +266,6 @@ append config_of_app { source ${genode_dir}/repos/ports/run/virtualbox_auto.inc -exec tar cfv bin/bash.tar -h -C bin/bash . -exec tar cfv bin/coreutils.tar -h -C bin/coreutils . exec cp ${genode_dir}/repos/ports/run/$vbox_file bin/. build_boot_image $boot_modules @@ -331,9 +329,7 @@ puts $noux_id "sha1sum to/test.bin" # Wait for output of bash shell until last SHA1 sum is calculated run_genode_until {[[:xdigit:]]+ to/test\.bin} 50 $spawn_id_list - # cleanup created files -foreach pkg {bash coreutils} { exec rm -f bin/$pkg.tar } exec rm -f bin/test.bin exec rm -f bin/template.bat exec rm -f bin/$vbox_file