tool: support to use graphical grub2

This commit is contained in:
Alexander Boettcher
2018-05-23 00:43:43 +02:00
committed by Christian Helmuth
parent a6aa4863f3
commit 4979221152
5 changed files with 32 additions and 3 deletions

BIN
tool/boot/boot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@@ -69,6 +69,11 @@ proc run_boot_dir {binaries} {
if {[have_include "image/disk"]} {
exec mkdir -p [run_dir]/boot/grub
exec cp [genode_dir]/tool/boot/bender [run_dir]/boot/bender
exec cp [genode_dir]/tool/boot/boot.png [run_dir]/boot/boot.png
if {[file exists /boot/grub/unicode.pf2]} {
# needed in graphical menu with non-scrampled characters
# exec cp /boot/grub/unicode.pf2 [run_dir]/boot/grub/unicode.pf2
}
}
if {[have_include "image/iso"]} {
@@ -84,6 +89,12 @@ proc run_boot_dir {binaries} {
exec mkdir -p [run_dir]/boot/grub
exec cp [genode_dir]/tool/boot/bender [run_dir]/boot/bender
exec cp [genode_dir]/tool/boot/boot.png [run_dir]/boot/boot.png
if {[file exists /boot/grub/unicode.pf2]} {
# needed in graphical menu with non-scrampled characters
# exec cp /boot/grub/unicode.pf2 [run_dir]/boot/grub/unicode.pf2
}
set serial_bender_opt "serial_fallback"
}
@@ -91,9 +102,26 @@ 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 and gfxterm, enable and add unicode.pf2 (see above)
# puts $fh "loadfont /boot/grub/unicode.pf2"
puts $fh "set timeout=0"
# tell grub2 to prefer 32bit framebuffer resolution
puts $fh "set gfxpayload=\"0x0x32\""
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"
puts $fh "menuentry 'Genode on NOVA' {"
puts $fh " insmod multiboot2"
puts $fh " insmod gzio"

View File

@@ -32,7 +32,7 @@ proc run_image { {unused ""} } {
if {[image_disk_size] > 0} {
set disk_size_kb [expr [image_disk_size] * 1024 * 1024]
} else {
set disk_size_kb [expr ($size_run + 256 + 128) / 32 * 32]
set disk_size_kb [expr ($size_run + 512) / 32 * 32]
}
# setup partition with content
@@ -75,6 +75,7 @@ proc run_image { {unused ""} } {
# create partition table entry pointing to the content
catch { exec parted -a none [run_dir].img -- mkpart Fix GENODE ext2 [expr $first_sector]s ${last_sector}s }
exec parted [run_dir].img -s 'name 3 GENODE'
# create hybrid MBR
exec echo -e "r\no\nh\n1\nn\n\ny\nn\no\nw\ny\n" | gdisk [run_dir].img