diff --git a/tool/run/boot_dir/fiasco b/tool/run/boot_dir/fiasco index 5194df806a..fd3bfa02f9 100644 --- a/tool/run/boot_dir/fiasco +++ b/tool/run/boot_dir/fiasco @@ -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" diff --git a/tool/run/boot_dir/foc b/tool/run/boot_dir/foc index a24dd15662..9c8726e34e 100644 --- a/tool/run/boot_dir/foc +++ b/tool/run/boot_dir/foc @@ -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" diff --git a/tool/run/boot_dir/hw b/tool/run/boot_dir/hw index 8d44c8dd2c..c65beb5fab 100644 --- a/tool/run/boot_dir/hw +++ b/tool/run/boot_dir/hw @@ -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" diff --git a/tool/run/boot_dir/nova b/tool/run/boot_dir/nova index 02eefa8501..95b7b81f2b 100644 --- a/tool/run/boot_dir/nova +++ b/tool/run/boot_dir/nova @@ -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" diff --git a/tool/run/boot_dir/okl4 b/tool/run/boot_dir/okl4 index f9b81548a0..bdaa926a59 100644 --- a/tool/run/boot_dir/okl4 +++ b/tool/run/boot_dir/okl4 @@ -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" diff --git a/tool/run/boot_dir/pistachio b/tool/run/boot_dir/pistachio index ee6f47cc25..5507841eec 100644 --- a/tool/run/boot_dir/pistachio +++ b/tool/run/boot_dir/pistachio @@ -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" diff --git a/tool/run/boot_dir/sel4 b/tool/run/boot_dir/sel4 index 08ffaebb1f..4b945250e8 100644 --- a/tool/run/boot_dir/sel4 +++ b/tool/run/boot_dir/sel4 @@ -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" diff --git a/tool/run/grub2.inc b/tool/run/grub2.inc index 787bf2a530..42d05b74ff 100644 --- a/tool/run/grub2.inc +++ b/tool/run/grub2.inc @@ -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 +}