tool: support to set menuentry of GRUB

manually to self chosen value, by overwritting the tcl procedure
grub_menuentry, e.g.:

proc grub_menuentry { } { return "'My OS' --option_of_your_choice " }

Fix #5398
This commit is contained in:
Alexander Boettcher 2024-12-04 14:08:27 +01:00 committed by Christian Helmuth
parent 5665e8059a
commit 4da68e11b6
8 changed files with 23 additions and 8 deletions

View File

@ -10,6 +10,7 @@ proc core_link_address { } { return "0x01000000" }
proc boot_output { } { return "serial" } proc boot_output { } { return "serial" }
proc grub_menuentry { } { return "'Genode on L4/Fiasco'" }
## ##
# Populate boot directory with binaries on fiasco # Populate boot directory with binaries on fiasco
@ -66,7 +67,7 @@ proc run_boot_dir {binaries} {
# The core binary is part of the 'binaries' list but it must # The core binary is part of the 'binaries' list but it must
# appear right after 'sigma0' as boot module. Hence the special case. # appear right after 'sigma0' as boot module. Hence the special case.
# #
puts $fh "menuentry 'Genode on L4/Fiasco' {" puts $fh "menuentry [grub_menuentry] {"
puts $fh " insmod multiboot" puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender [boot_output]" puts $fh " multiboot /boot/bender [boot_output]"
puts $fh " module /boot/bootstrap -serial" puts $fh " module /boot/bootstrap -serial"

View File

@ -26,6 +26,8 @@ proc fiasco_serial_esc_arg { } { return "-serial_esc " }
proc boot_output { } { return "serial" } proc boot_output { } { return "serial" }
proc grub_menuentry { } { return "'Genode on Fiasco.OC'" }
## ##
# Reset the target system via the Fiasco.OC kernel debugger # Reset the target system via the Fiasco.OC kernel debugger
@ -117,7 +119,7 @@ proc run_boot_dir_x86 {binaries} {
# The core binary is part of the 'binaries' list but it must # The core binary is part of the 'binaries' list but it must
# appear right after 'sigma0' as boot module. Hence the special case. # appear right after 'sigma0' as boot module. Hence the special case.
# #
puts $fh "menuentry 'Genode on Fiasco.OC' {" puts $fh "menuentry [grub_menuentry] {"
puts $fh " insmod multiboot" puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender $options_bender" puts $fh " multiboot /boot/bender $options_bender"
puts $fh " module /boot/bootstrap" puts $fh " module /boot/bootstrap"

View File

@ -36,6 +36,8 @@ proc run_boot_string { } { return "\nkernel initialized" }
proc boot_output { } { return "serial" } proc boot_output { } { return "serial" }
proc grub_menuentry { } { return "'Genode on base-hw'" }
proc bootstrap_link_address { } { proc bootstrap_link_address { } {
@ -157,7 +159,7 @@ proc run_boot_dir {binaries} {
# #
set fh [create_header_grub2_config] set fh [create_header_grub2_config]
puts $fh "menuentry 'Genode on base-hw' {" puts $fh "menuentry [grub_menuentry] {"
puts $fh " insmod multiboot2" puts $fh " insmod multiboot2"
puts $fh " multiboot2 /boot/bender $options_bender" puts $fh " multiboot2 /boot/bender $options_bender"
puts $fh " module2 /boot/image-hw.elf.gz image-hw.elf" puts $fh " module2 /boot/image-hw.elf.gz image-hw.elf"

View File

@ -2,6 +2,7 @@ proc binary_name_ld_lib_so { } { return "ld-linux.lib.so" }
proc binary_name_core { } { return "core-linux" } proc binary_name_core { } { return "core-linux" }
proc binary_name_timer { } { return "linux_timer" } proc binary_name_timer { } { return "linux_timer" }
proc grub_menuentry { } { return "'Genode on Linux'" }
## ##
# Populate boot directory with binaries on Linux # Populate boot directory with binaries on Linux
@ -56,7 +57,7 @@ proc run_boot_dir {binaries} {
set fh [open "[run_dir]/boot/grub/grub.cfg" "WRONLY CREAT TRUNC"] set fh [open "[run_dir]/boot/grub/grub.cfg" "WRONLY CREAT TRUNC"]
puts $fh "set timeout=0" puts $fh "set timeout=0"
puts $fh "menuentry 'Genode on Linux' {" puts $fh "menuentry [grub_menuentry] {"
puts $fh " insmod linux" puts $fh " insmod linux"
puts $fh " linux /vmlinuz console=ttyS0,115200 amd_iommu=off intel_iommu=off" puts $fh " linux /vmlinuz console=ttyS0,115200 amd_iommu=off intel_iommu=off"
puts $fh " initrd /initrd" puts $fh " initrd /initrd"

View File

@ -35,6 +35,8 @@ proc kernel_output { } { return "serial" }
proc boot_output { } { return "serial" } proc boot_output { } { return "serial" }
proc grub_menuentry { } { return "'Genode on NOVA'" }
proc run_boot_string { } { proc run_boot_string { } {
return "\nHypervisor NOVA " return "\nHypervisor NOVA "
} }
@ -122,7 +124,7 @@ proc run_boot_dir {binaries} {
# #
set fh [create_header_grub2_config] set fh [create_header_grub2_config]
puts $fh "menuentry 'Genode on NOVA' {" puts $fh "menuentry [grub_menuentry] {"
puts $fh " insmod multiboot2" puts $fh " insmod multiboot2"
puts $fh " insmod gzio" puts $fh " insmod gzio"
puts $fh " multiboot2 /boot/bender $options_bender" puts $fh " multiboot2 /boot/bender $options_bender"

View File

@ -6,6 +6,8 @@ proc kernel_files { } { return okl4 }
proc boot_output { } { return "serial" } proc boot_output { } { return "serial" }
proc grub_menuentry { } { return "'Genode on OKL4'" }
## ##
# Get the base-okl4 repository # Get the base-okl4 repository
# #
@ -177,7 +179,7 @@ proc run_boot_dir {binaries} {
# The core binary is part of the 'binaries' list but it must # The core binary is part of the 'binaries' list but it must
# appear right after 'sigma0' as boot module. Hence the special case. # appear right after 'sigma0' as boot module. Hence the special case.
# #
puts $fh "menuentry 'Genode on OKL4' {" puts $fh "menuentry [grub_menuentry] {"
puts $fh " insmod multiboot" puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender [boot_output]" puts $fh " multiboot /boot/bender [boot_output]"
puts $fh " module /boot/image.elf" puts $fh " module /boot/image.elf"

View File

@ -9,6 +9,9 @@ proc core_link_address { } { return "0x02000000" }
proc boot_output { } { return "serial" } proc boot_output { } { return "serial" }
proc grub_menuentry { } { return "'Genode on L4ka::Pistachio'" }
## ##
# Populdate boot directory with binaries on pistachio # Populdate boot directory with binaries on pistachio
# #
@ -64,7 +67,7 @@ proc run_boot_dir {binaries} {
# The core binary is part of the 'binaries' list but it must # The core binary is part of the 'binaries' list but it must
# appear right after 'sigma0' as boot module. Hence the special case. # appear right after 'sigma0' as boot module. Hence the special case.
# #
puts $fh "menuentry 'Genode on L4ka::Pistachio' {" puts $fh "menuentry [grub_menuentry] {"
puts $fh " insmod multiboot" puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender [boot_output]" puts $fh " multiboot /boot/bender [boot_output]"
puts $fh " module /boot/kickstart" puts $fh " module /boot/kickstart"

View File

@ -12,6 +12,8 @@ proc kernel_files { } { return sel4 }
proc boot_output { } { return "serial" } proc boot_output { } { return "serial" }
proc grub_menuentry { } { return "'Genode on seL4'" }
proc run_boot_string { } { return "\nBooting all finished, dropped to user space" } proc run_boot_string { } { return "\nBooting all finished, dropped to user space" }
proc core_link_address { } { return "0x02000000" } proc core_link_address { } { return "0x02000000" }
@ -77,7 +79,7 @@ proc run_boot_dir {binaries} {
# #
set fh [create_header_grub2_config] set fh [create_header_grub2_config]
puts $fh "menuentry 'Genode on seL4' {" puts $fh "menuentry [grub_menuentry] {"
puts $fh " insmod multiboot2" puts $fh " insmod multiboot2"
puts $fh " multiboot2 /boot/bender $options_bender" puts $fh " multiboot2 /boot/bender $options_bender"
puts $fh " module2 /boot/sel4 sel4 disable_iommu" puts $fh " module2 /boot/sel4 sel4 disable_iommu"