2016-12-09 22:09:17 +00:00
|
|
|
proc binary_name_ld_lib_so { } { return "ld-linux.lib.so" }
|
2024-05-30 13:46:57 +00:00
|
|
|
proc binary_name_core { } { return "core-linux" }
|
|
|
|
proc binary_name_timer { } { return "linux_timer" }
|
2016-12-09 22:09:17 +00:00
|
|
|
|
|
|
|
|
2015-01-08 21:08:48 +00:00
|
|
|
##
|
|
|
|
# Populate boot directory with binaries on Linux
|
|
|
|
#
|
|
|
|
proc run_boot_dir {binaries} {
|
2016-12-09 22:09:17 +00:00
|
|
|
|
2019-08-21 10:13:43 +00:00
|
|
|
set missing_boot_modules { }
|
2015-01-08 21:08:48 +00:00
|
|
|
foreach binary $binaries {
|
2022-09-01 11:12:13 +00:00
|
|
|
|
2017-08-11 21:11:43 +00:00
|
|
|
set src_binary_path "[pwd]/bin/[kernel_specific_binary $binary]"
|
2022-09-01 11:12:13 +00:00
|
|
|
|
|
|
|
set dst_binary "[kernel_specific_binary $binary]"
|
|
|
|
if {$dst_binary == "core-linux"} { set dst_binary "core" }
|
|
|
|
if {$dst_binary == "ld-linux.lib.so"} { set dst_binary "ld.lib.so" }
|
2024-05-30 13:46:57 +00:00
|
|
|
if {$dst_binary == "linux_timer"} { set dst_binary "timer" }
|
2022-09-01 11:12:13 +00:00
|
|
|
|
2019-08-21 10:13:43 +00:00
|
|
|
if {[file exists $src_binary_path]} {
|
2022-09-01 11:12:13 +00:00
|
|
|
exec ln -sf $src_binary_path [run_dir]/genode/$dst_binary
|
2019-08-21 10:13:43 +00:00
|
|
|
} else {
|
2022-09-01 11:12:13 +00:00
|
|
|
lappend missing_boot_modules $binary
|
2019-08-21 10:13:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if {[llength $missing_boot_modules]} {
|
|
|
|
puts stderr "Missing boot modules: $missing_boot_modules"
|
|
|
|
exit -1
|
|
|
|
}
|
2017-04-03 13:39:36 +00:00
|
|
|
|
|
|
|
# check syntax of all boot modules named *.config
|
|
|
|
foreach file [glob -nocomplain [run_dir]/genode/*.config] {
|
|
|
|
check_xml_syntax $file }
|
2019-02-27 13:17:03 +00:00
|
|
|
|
|
|
|
# Save config part of the image.elf for easy inspection
|
|
|
|
exec cp -f [run_dir]/genode/config [run_dir].config
|
2017-10-20 12:11:44 +00:00
|
|
|
|
2022-02-08 15:18:36 +00:00
|
|
|
if {[have_board pc]} {
|
2017-10-20 12:11:44 +00:00
|
|
|
|
2022-02-08 15:18:36 +00:00
|
|
|
build_initrd $binaries
|
2017-10-20 12:11:44 +00:00
|
|
|
|
2022-02-08 15:18:36 +00:00
|
|
|
copy_file [genode_dir]/tool/boot/vmlinuz [run_dir]/vmlinuz
|
2017-10-20 12:11:44 +00:00
|
|
|
|
2022-02-08 15:18:36 +00:00
|
|
|
if {[have_include "image/iso"]} {
|
|
|
|
install_iso_bootloader_to_run_dir
|
|
|
|
}
|
2017-10-20 12:11:44 +00:00
|
|
|
|
2022-02-08 15:18:36 +00:00
|
|
|
if {[have_include "image/uefi"]} {
|
2017-10-20 12:11:44 +00:00
|
|
|
|
2022-02-08 15:18:36 +00:00
|
|
|
exec mkdir -p [run_dir]/efi/boot
|
|
|
|
exec cp [get_grub2_dir]/boot/grub2/grub2_32.efi [run_dir]/efi/boot/bootia32.efi
|
|
|
|
exec cp [get_grub2_dir]/boot/grub2/grub2_64.efi [run_dir]/efi/boot/bootx64.efi
|
|
|
|
exec mkdir -p [run_dir]/boot/grub
|
|
|
|
}
|
2017-10-20 12:11:44 +00:00
|
|
|
|
2022-02-08 15:18:36 +00:00
|
|
|
set fh [open "[run_dir]/boot/grub/grub.cfg" "WRONLY CREAT TRUNC"]
|
|
|
|
puts $fh "set timeout=0"
|
|
|
|
puts $fh "menuentry 'Genode on Linux' {"
|
|
|
|
puts $fh " insmod linux"
|
|
|
|
puts $fh " linux /vmlinuz console=ttyS0,115200 amd_iommu=off intel_iommu=off"
|
|
|
|
puts $fh " initrd /initrd"
|
|
|
|
puts $fh "}"
|
|
|
|
close $fh
|
2017-10-20 12:11:44 +00:00
|
|
|
|
2022-02-08 15:18:36 +00:00
|
|
|
run_image
|
|
|
|
}
|
2015-01-08 21:08:48 +00:00
|
|
|
}
|
2017-03-29 14:04:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
# Base source archive within depot
|
|
|
|
#
|
|
|
|
proc base_src { } { return base-linux }
|