From dcd45785850cca537faaffdda6b004c697dc15d3 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 17 Apr 2024 11:18:15 +0200 Subject: [PATCH] run: rename hw boot/image.elf -> boot/image-hw.elf This disambiguates the boot images installed for base-hw from those installed for base-nova. Note that the image.elf file for other kernels (i.e., NOVA) is not named image-.elf at this point because this would prevent the update from a pre-24.04 Sculpt system to a later one as the grub.cfg is not touched by the old update mechanism. So after a system update, grub would keep loading the last installed image.elf. Issue #5182 --- tool/run/boot_dir/hw | 15 ++++++++------- tool/run/image/uboot | 2 +- tool/run/load/jtag | 2 +- tool/run/power_on/qemu | 2 +- tool/run/run | 5 +++-- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/tool/run/boot_dir/hw b/tool/run/boot_dir/hw index 014abe7b7f..7bccb18d75 100644 --- a/tool/run/boot_dir/hw +++ b/tool/run/boot_dir/hw @@ -1,6 +1,7 @@ proc binary_name_ld_lib_so { } { return "ld-hw.lib.so" } proc binary_name_core_a { } { return "core-hw.a" } proc binary_name_timer { } { return "hw_timer_drv" } +proc binary_name_image_elf { } { return "image-hw.elf" } proc run_boot_string { } { return "\nkernel initialized" } @@ -90,16 +91,16 @@ proc run_boot_dir {binaries} { # create core binary containing the boot modules build_core [run_dir]/genode/$core_obj $modules [run_dir]/genode/core.elf [core_link_address] exec [cross_dev_prefix]strip [run_dir]/genode/core.elf - build_core [run_dir]/genode/$bootstrap_obj { core.elf } [run_dir]/image.elf [bootstrap_link_address] + build_core [run_dir]/genode/$bootstrap_obj { core.elf } [run_dir]/image-hw.elf [bootstrap_link_address] # Save config part of the image.elf for easy inspection exec cp -f [run_dir]/genode/config [run_dir].config remove_genode_dir - exec [cross_dev_prefix]strip [run_dir]/image.elf + exec [cross_dev_prefix]strip [run_dir]/image-hw.elf exec mkdir -p [run_dir]/boot - exec mv [run_dir]/image.elf [run_dir]/boot/image.elf + exec mv [run_dir]/image-hw.elf [run_dir]/boot/image-hw.elf set options_bender "[boot_output] " @@ -107,7 +108,7 @@ proc run_boot_dir {binaries} { # # Compress Genode image, to be uncompressed by GRUB # - exec gzip -n [run_dir]/boot/image.elf + exec gzip -n [run_dir]/boot/image-hw.elf if {[have_include "image/disk"]} { install_disk_bootloader_to_run_dir @@ -130,7 +131,7 @@ proc run_boot_dir {binaries} { puts $fh "menuentry 'Genode on base-hw' {" puts $fh " insmod multiboot2" puts $fh " multiboot2 /boot/bender $options_bender" - puts $fh " module2 /boot/image.elf.gz image.elf" + puts $fh " module2 /boot/image-hw.elf.gz image-hw.elf" puts $fh "}" close $fh } @@ -150,7 +151,7 @@ proc run_boot_dir {binaries} { [load_tftp_base_dir][load_tftp_offset_dir] } } else { - exec {*}[load_tftp_inst_cmd] [pwd]/[run_dir]/boot/image.elf [load_tftp_base_dir][load_tftp_offset_dir] + exec {*}[load_tftp_inst_cmd] [pwd]/[run_dir]/boot/image-hw.elf [load_tftp_base_dir][load_tftp_offset_dir] } } @@ -165,7 +166,7 @@ proc run_boot_dir {binaries} { # set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"] puts $fh " exec /boot/bender $options_bender" - puts $fh " load /boot/image.elf" + puts $fh " load /boot/image-hw.elf" close $fh generate_tftp_config diff --git a/tool/run/image/uboot b/tool/run/image/uboot index 3eda213c84..8871bb759e 100644 --- a/tool/run/image/uboot +++ b/tool/run/image/uboot @@ -37,7 +37,7 @@ proc image_uboot_gzip_opt { } { # proc run_image { } { - set elf_img [file join [run_dir] boot image.elf] + set elf_img [file join [run_dir] boot [kernel_specific_binary image.elf]] # parse ELF entrypoint and load address set entrypoint [exec [cross_dev_prefix]readelf -h $elf_img | \ diff --git a/tool/run/load/jtag b/tool/run/load/jtag index ef4baaeec4..42171eb363 100644 --- a/tool/run/load/jtag +++ b/tool/run/load/jtag @@ -24,7 +24,7 @@ proc run_load { } { set debugger [load_jtag_debugger] set board [load_jtag_board] - set elf_img "[run_dir]/image.elf" + set elf_img "[run_dir]/[kernel_specific_binary image.elf]" # sleep a bit, board might need some time to come up sleep 8 diff --git a/tool/run/power_on/qemu b/tool/run/power_on/qemu index 687de98385..04c6034518 100644 --- a/tool/run/power_on/qemu +++ b/tool/run/power_on/qemu @@ -134,7 +134,7 @@ proc run_power_on { } { # on ARM/RISC-V, we supply the boot image as kernel if {[have_spec arm] || [have_spec arm_v8] || [have_spec riscv]} { - append qemu_args " -kernel [run_dir]/boot/image.elf " } + append qemu_args " -kernel [run_dir]/boot/[kernel_specific_binary image.elf] " } set board_qemu_args [board_qemu_args] diff --git a/tool/run/run b/tool/run/run index 5027d36a5b..48de66edbd 100755 --- a/tool/run/run +++ b/tool/run/run @@ -1142,8 +1142,9 @@ proc build_core_image { modules } { check_xml_syntax $file } # create core binary containing the boot modules - build_core [run_dir]/genode/$core_obj $modules [run_dir]/image.elf [core_link_address] - exec [cross_dev_prefix]strip [run_dir]/image.elf + set image_elf [run_dir]/[kernel_specific_binary image.elf] + build_core [run_dir]/genode/$core_obj $modules $image_elf [core_link_address] + exec [cross_dev_prefix]strip $image_elf # Save config part of the image.elf for easy inspection exec cp -f [run_dir]/genode/config [run_dir].config