kernel: differentiate board-specific components
Components like kernel, core, and bootstrap that are built for a specific board need to reside inside the same architectural dependent build directory. For instance there are sel4, foc, and hw kernel builds for imx6q_sabrelite and imx7d_sabre, which have to reside inside the same arm_v7 build directory. This commit names those components explicitely, and adapts the run-tool to it. Fix #3316
This commit is contained in:
committed by
Christian Helmuth
parent
c43267dbaa
commit
a1e70b9ba4
@@ -1,5 +1,5 @@
|
||||
proc binary_name_ld_lib_so { } { return "ld-foc.lib.so" }
|
||||
proc binary_name_core_o { } { return "core-foc.o" }
|
||||
proc binary_name_core_o { } { return "core-foc-[board].o" }
|
||||
proc binary_name_timer { } { return "foc_timer_drv" }
|
||||
|
||||
proc kernel_files { } { return { foc sigma0-foc bootstrap-foc } }
|
||||
@@ -39,10 +39,10 @@ proc reset_target { {spawn_id_arg -1} } {
|
||||
}
|
||||
|
||||
|
||||
proc l4_build_dir { } { return "[pwd]/var/libcache/syscall-foc/build" }
|
||||
proc l4_build_dir { } { return "[pwd]/var/libcache/syscall-foc/[board]-build" }
|
||||
|
||||
|
||||
proc kernel_binary { } { return "[pwd]/bin/foc" }
|
||||
proc kernel_binary { } { return "[pwd]/bin/foc-[board]" }
|
||||
|
||||
|
||||
proc l4_bin_dir { } {
|
||||
@@ -72,9 +72,9 @@ proc run_boot_dir_x86 {binaries} {
|
||||
if {[llength $targets]} { build $targets }
|
||||
|
||||
if {$kernel_arg != ""} {
|
||||
file copy -force [pwd]/bin/foc [run_dir]/genode/foc
|
||||
file copy -force [pwd]/bin/sigma0-foc [run_dir]/genode/sigma0-foc
|
||||
file copy -force [pwd]/bin/bootstrap-foc [run_dir]/genode/bootstrap-foc
|
||||
file copy -force [pwd]/bin/foc-[board] [run_dir]/genode/foc
|
||||
file copy -force [pwd]/bin/sigma0-foc-[board] [run_dir]/genode/sigma0-foc
|
||||
file copy -force [pwd]/bin/bootstrap-foc-[board] [run_dir]/genode/bootstrap-foc
|
||||
}
|
||||
|
||||
build_core_image $binaries
|
||||
|
||||
@@ -61,8 +61,8 @@ proc run_boot_dir {binaries} {
|
||||
if {[llength $build_args]} { build $build_args }
|
||||
|
||||
if {$ld_arg != ""} { file copy -force bin/ld-hw.lib.so [run_dir]/genode/ld.lib.so }
|
||||
if {$core_arg != ""} { file copy -force bin/core-hw.o [run_dir]/genode/core-hw.o }
|
||||
if {$bootstrap_arg != ""} { file copy -force bin/bootstrap-hw.o [run_dir]/genode/bootstrap-hw.o }
|
||||
if {$core_arg != ""} { file copy -force bin/core-hw-[board].o [run_dir]/genode/core-hw.o }
|
||||
if {$bootstrap_arg != ""} { file copy -force bin/bootstrap-hw-[board].o [run_dir]/genode/bootstrap-hw.o }
|
||||
|
||||
#
|
||||
# Copy specified modules to the run directory, excluding core.
|
||||
@@ -77,8 +77,8 @@ proc run_boot_dir {binaries} {
|
||||
set bootstrap_obj bootstrap-hw.o
|
||||
|
||||
# create core and bootstrap binary without modules for debugging
|
||||
if {[file exists debug/$core_obj]} {
|
||||
build_core debug/$core_obj {} [run_dir].core [core_link_address]
|
||||
if {[file exists debug/core-hw-[board].o]} {
|
||||
build_core debug/core-hw-[board].o {} [run_dir].core [core_link_address]
|
||||
build_core [run_dir]/genode/$bootstrap_obj {} [run_dir].bootstrap [bootstrap_link_address]
|
||||
}
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@ proc run_boot_string { } { return "\n\rBooting all finished, dropped to user s
|
||||
proc core_link_address { } { return "0x02000000" }
|
||||
|
||||
proc sel4_elfloader_dir { } {
|
||||
if {![file exists [pwd]/var/libcache/kernel-sel4/elfloader]} {
|
||||
build LIB=kernel-sel4
|
||||
if {![file exists [pwd]/var/libcache/kernel-sel4-[board]/elfloader]} {
|
||||
build LIB=kernel-sel4-[board]
|
||||
}
|
||||
return "[pwd]/var/libcache/kernel-sel4/elfloader"
|
||||
return "[pwd]/var/libcache/kernel-sel4-[board]/elfloader"
|
||||
}
|
||||
|
||||
##
|
||||
@@ -39,7 +39,7 @@ proc run_boot_dir {binaries} {
|
||||
if {[llength $targets]} { build $targets }
|
||||
|
||||
if {$kernel_arg != ""} {
|
||||
file copy -force [pwd]/bin/sel4 [run_dir]/genode/sel4
|
||||
file copy -force [pwd]/bin/sel4-[board] [run_dir]/genode/sel4
|
||||
}
|
||||
|
||||
build_core_image $binaries
|
||||
|
||||
14
tool/run/run
14
tool/run/run
@@ -499,6 +499,7 @@ set run_name [get_cmd_arg --name "noname"]
|
||||
set genode_dir [get_cmd_arg --genode-dir ""]
|
||||
set cross_dev_prefix [get_cmd_arg --cross-dev-prefix ""]
|
||||
set specs [get_cmd_arg --specs ""]
|
||||
set board_var [get_cmd_arg --board ""]
|
||||
set repositories [get_cmd_arg --repositories ""]
|
||||
|
||||
|
||||
@@ -815,6 +816,19 @@ proc terminal { } {
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# Return the board to build for
|
||||
#
|
||||
proc board { } {
|
||||
global board_var
|
||||
if {$board_var eq ""} {
|
||||
puts "Unknown platform no BOARD variable set"
|
||||
exit 0
|
||||
}
|
||||
return $board_var
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# Determine GDB executable installed at the host
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user