tool/grub2: factor out common part

to avoid divergence

Issue #4741
This commit is contained in:
Alexander Boettcher 2023-01-27 08:20:58 +01:00 committed by Christian Helmuth
parent c3843cd0d6
commit 208547e3af
8 changed files with 47 additions and 41 deletions

View File

@ -57,13 +57,13 @@ proc run_boot_dir {binaries} {
}
#
# Generate GRUB config file
# Generate GRUB2 config file
#
set fh [create_header_grub2_config]
# The core binary is part of the 'binaries' list but it must
# appear right after 'sigma0' as boot module. Hence the special case.
#
set fh [open "[run_dir]/boot/grub/grub.cfg" "WRONLY CREAT TRUNC"]
puts $fh "set timeout=0"
puts $fh "menuentry 'Genode on L4/Fiasco' {"
puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender"

View File

@ -101,13 +101,13 @@ proc run_boot_dir_x86 {binaries} {
}
#
# Generate grub config file
# Generate GRUB2 config file
#
set fh [create_header_grub2_config]
# The core binary is part of the 'binaries' list but it must
# appear right after 'sigma0' as boot module. Hence the special case.
#
set fh [open "[run_dir]/boot/grub/grub.cfg" "WRONLY CREAT TRUNC"]
puts $fh "set timeout=0"
puts $fh "menuentry 'Genode on Fiasco.OC' {"
puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender"

View File

@ -123,10 +123,8 @@ proc run_boot_dir {binaries} {
#
# Generate GRUB2 config file
#
set fh [open "[run_dir]/boot/grub/grub.cfg" "WRONLY CREAT TRUNC"]
puts $fh "set timeout=0"
# tell grub2 to prefer 32bit framebuffer resolution
puts $fh "set gfxpayload=\"0x0x32\""
set fh [create_header_grub2_config]
puts $fh "menuentry 'Genode on base-hw' {"
puts $fh " insmod multiboot2"
puts $fh " multiboot2 /boot/bender $serial_bender_opt"

View File

@ -124,27 +124,7 @@ proc run_boot_dir {binaries} {
#
# Generate GRUB2 config file
#
set fh [open "[run_dir]/boot/grub/grub.cfg" "WRONLY CREAT TRUNC"]
# If timeout != 0 is used a font is required in graphic mode
puts $fh "loadfont /boot/font.pf2"
puts $fh "set timeout=0"
# choose best graphic mode
# uncomment line to get vga console working in hypervisor
puts $fh "set gfxpayload=auto"
if {[have_include image/uefi]} {
puts $fh "insmod gfxterm"
puts $fh "terminal_output gfxterm"
puts $fh "insmod gfxterm_background"
puts $fh "insmod png"
puts $fh "background_image -m center /boot/boot.png"
}
# set this to get text console instead of graphical console
# puts $fh "terminal_input console"
# puts $fh "terminal_output console"
set fh [create_header_grub2_config]
puts $fh "menuentry 'Genode on NOVA' {"
puts $fh " insmod multiboot2"

View File

@ -169,13 +169,13 @@ proc run_boot_dir {binaries} {
}
#
# Generate GRUB config file
# Generate GRUB2 config file
#
set fh [create_header_grub2_config]
# The core binary is part of the 'binaries' list but it must
# appear right after 'sigma0' as boot module. Hence the special case.
#
set fh [open "[run_dir]/boot/grub/grub.cfg" "WRONLY CREAT TRUNC"]
puts $fh "set timeout=0"
puts $fh "menuentry 'Genode on OKL4' {"
puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender"

View File

@ -56,13 +56,13 @@ proc run_boot_dir {binaries} {
}
#
# Generate GRUB config file
# Generate GRUB2 config file
#
set fh [create_header_grub2_config]
# The core binary is part of the 'binaries' list but it must
# appear right after 'sigma0' as boot module. Hence the special case.
#
set fh [open "[run_dir]/boot/grub/grub.cfg" "WRONLY CREAT TRUNC"]
puts $fh "set timeout=0"
puts $fh "menuentry 'Genode on L4ka::Pistachio' {"
puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender"

View File

@ -73,10 +73,8 @@ proc run_boot_dir {binaries} {
#
# Generate GRUB2 config file
#
set fh [open "[run_dir]/boot/grub/grub.cfg" "WRONLY CREAT TRUNC"]
puts $fh "set timeout=0"
# tell grub2 to prefer 32bit framebuffer resolution
puts $fh "set gfxpayload=\"0x0x32\""
set fh [create_header_grub2_config]
puts $fh "menuentry 'Genode on seL4' {"
puts $fh " insmod multiboot2"
puts $fh " multiboot2 /boot/bender phys_max=256M $serial_bender_opt"

View File

@ -18,3 +18,33 @@ proc get_grub2_dir { } {
return $grub2_path
}
proc create_header_grub2_config { } {
#
# Generate GRUB2 config file
#
set fh [open "[run_dir]/boot/grub/grub.cfg" "WRONLY CREAT TRUNC"]
# If timeout != 0 is used a font is required in graphic mode
puts $fh "loadfont /boot/font.pf2"
puts $fh "set timeout=0"
# choose best graphic mode
# uncomment line to get vga console working in hypervisor
puts $fh "set gfxpayload=auto"
if {[have_include image/uefi]} {
puts $fh "insmod gfxterm"
puts $fh "terminal_output gfxterm"
puts $fh "insmod gfxterm_background"
puts $fh "insmod png"
puts $fh "background_image -m center /boot/boot.png"
}
# set this to get text console instead of graphical console
# puts $fh "terminal_input console"
# puts $fh "terminal_output console"
return $fh
}