tool/run: move binaries to boot directory

Issue #2778
This commit is contained in:
Alexander Boettcher 2018-05-02 18:26:59 +02:00 committed by Christian Helmuth
parent 25f2c44874
commit de9d1afa99
8 changed files with 84 additions and 63 deletions

View File

@ -38,11 +38,14 @@ proc run_boot_dir {binaries} {
# Move kernel files to distinct location within the boot directory so that
# we can remove [run_dir]/genode after the core image has been built.
#
file copy -force [run_dir]/genode/fiasco [run_dir]/kernel
file copy -force [run_dir]/genode/sigma0-fiasco [run_dir]/sigma0
file copy -force [run_dir]/genode/bootstrap-fiasco [run_dir]/bootstrap
exec mkdir -p [run_dir]/boot
file copy -force [run_dir]/genode/fiasco [run_dir]/boot/kernel
file copy -force [run_dir]/genode/sigma0-fiasco [run_dir]/boot/sigma0
file copy -force [run_dir]/genode/bootstrap-fiasco [run_dir]/boot/bootstrap
exec rm -r [run_dir]/genode
exec mv [run_dir]/image.elf [run_dir]/boot/image.elf
if {[have_include "image/iso"] || [have_include "image/disk"]} {
if {[have_include "image/disk"]} {
@ -65,10 +68,10 @@ proc run_boot_dir {binaries} {
puts $fh "menuentry 'Genode on L4/Fiasco' {"
puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender"
puts $fh " module /bootstrap -serial"
puts $fh " module /kernel -serial -jdb_cmd=JH [fiasco_serial_esc_arg]"
puts $fh " module /sigma0"
puts $fh " module /image.elf"
puts $fh " module /boot/bootstrap -serial"
puts $fh " module /boot/kernel -serial -jdb_cmd=JH [fiasco_serial_esc_arg]"
puts $fh " module /boot/sigma0"
puts $fh " module /boot/image.elf"
puts $fh "}"
close $fh
}
@ -86,10 +89,10 @@ proc run_boot_dir {binaries} {
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
puts $fh " exec /boot/bender"
puts $fh " load /bootstrap -serial"
puts $fh " load /kernel -serial -serial_esc -jdb_cmd=JH"
puts $fh " load /sigma0"
puts $fh " load /image.elf"
puts $fh " load /boot/bootstrap -serial"
puts $fh " load /boot/kernel -serial -serial_esc -jdb_cmd=JH"
puts $fh " load /boot/sigma0"
puts $fh " load /boot/image.elf"
close $fh
generate_tftp_config

View File

@ -81,11 +81,14 @@ proc run_boot_dir_x86 {binaries} {
# Move kernel files to distinct location within the boot directory so that
# we can remove [run_dir]/genode after the core image has been built.
#
file copy -force [run_dir]/genode/foc [run_dir]/kernel
file copy -force [run_dir]/genode/sigma0-foc [run_dir]/sigma0
file copy -force [run_dir]/genode/bootstrap-foc [run_dir]/bootstrap
exec mkdir -p [run_dir]/boot
file copy -force [run_dir]/genode/foc [run_dir]/boot/kernel
file copy -force [run_dir]/genode/sigma0-foc [run_dir]/boot/sigma0
file copy -force [run_dir]/genode/bootstrap-foc [run_dir]/boot/bootstrap
exec rm -r [run_dir]/genode
exec mv [run_dir]/image.elf [run_dir]/boot/image.elf
if {[have_include "image/iso"] || [have_include "image/disk"]} {
if {[have_include "image/disk"]} {
@ -108,10 +111,10 @@ proc run_boot_dir_x86 {binaries} {
puts $fh "menuentry 'Genode on Fiasco.OC' {"
puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender"
puts $fh " module /bootstrap"
puts $fh " module /kernel [fiasco_serial_esc_arg]"
puts $fh " module /sigma0"
puts $fh " module /image.elf"
puts $fh " module /boot/bootstrap"
puts $fh " module /boot/kernel [fiasco_serial_esc_arg]"
puts $fh " module /boot/sigma0"
puts $fh " module /boot/image.elf"
puts $fh "}"
close $fh
}
@ -132,10 +135,10 @@ proc run_boot_dir_x86 {binaries} {
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
puts $fh " exec /boot/bender"
puts $fh " load /bootstrap"
puts $fh " load /kernel -serial_esc"
puts $fh " load /sigma0"
puts $fh " load /image.elf"
puts $fh " load /boot/bootstrap"
puts $fh " load /boot/kernel -serial_esc"
puts $fh " load /boot/sigma0"
puts $fh " load /boot/image.elf"
close $fh
generate_tftp_config
@ -180,9 +183,10 @@ proc run_boot_dir_arm { binaries } {
exit -4
}
exec cp [run_dir]/image.elf [run_dir]/core.elf
exec cp [l4_bin_dir]/bootstrap.elf [run_dir]/image.elf
run_image [run_dir]/image.elf
exec mkdir -p [run_dir]/boot
exec mv [run_dir]/image.elf [run_dir]/boot/core.elf
exec cp [l4_bin_dir]/bootstrap.elf [run_dir]/boot/image.elf
run_image [run_dir]/boot/image.elf
puts "\nboot image: [run_dir]/image.elf\n"
@ -192,7 +196,7 @@ proc run_boot_dir_arm { binaries } {
set tftp_offset_dir [load_tftp_offset_dir]
exec mkdir -p $tftp_base_dir$tftp_offset_dir
exec ln -sf [pwd]/[run_dir]/image.elf $tftp_base_dir$tftp_offset_dir
exec ln -sf [pwd]/[run_dir]/boot/image.elf $tftp_base_dir$tftp_offset_dir
if {[have_include "image/uboot"]} {
exec ln -sf [pwd]/[run_dir]/uImage $tftp_base_dir$tftp_offset_dir/uImage
}

View File

@ -97,11 +97,14 @@ proc run_boot_dir {binaries} {
exec rm -fr [run_dir]/genode
exec [cross_dev_prefix]strip [run_dir]/image.elf
exec mkdir -p [run_dir]/boot
exec mv [run_dir]/image.elf [run_dir]/boot/image.elf
if {[have_include "image/iso"] || [have_include "image/disk"] || [have_include image/uefi]} {
#
# Compress Genode image, to be uncompressed by GRUB
#
exec gzip [run_dir]/image.elf
exec gzip [run_dir]/boot/image.elf
set serial_bender_opt ""
@ -136,16 +139,16 @@ proc run_boot_dir {binaries} {
puts $fh "menuentry 'Genode on base-hw' {"
puts $fh " insmod multiboot2"
puts $fh " multiboot2 /boot/bender $serial_bender_opt"
puts $fh " module2 /image.elf.gz image.elf"
puts $fh " module2 /boot/image.elf.gz image.elf"
puts $fh "}"
close $fh
}
run_image [run_dir]/image.elf
run_image [run_dir]/boot/image.elf
# set symbolic link to image.elf file in TFTP directory for PXE boot
if {[have_spec arm] && [have_include "load/tftp"]} {
exec ln -sf [run_dir]/image.elf [load_tftp_base_dir][load_tftp_offset_dir]
exec ln -sf [run_dir]/boot/image.elf [load_tftp_base_dir][load_tftp_offset_dir]
if {[have_include "image/uboot"]} {
exec ln -sf [pwd]/[run_dir]/uImage [load_tftp_base_dir][load_tftp_offset_dir]
@ -168,7 +171,7 @@ proc run_boot_dir {binaries} {
puts $fh " load /image.bin.gz"
} else {
puts $fh " exec /boot/bender"
puts $fh " load /image.elf"
puts $fh " load /boot/image.elf"
}
close $fh
@ -187,7 +190,7 @@ proc run_boot_dir {binaries} {
} else {
install_pxe_bootloader_to_run_dir
puts $fh "kernel boot/bender"
puts $fh "module image.elf"
puts $fh "module boot/image.elf"
}
puts $fh "boot"
close $fh

View File

@ -50,16 +50,19 @@ proc run_boot_dir {binaries} {
#
build_core_image $binaries
exec [cross_dev_prefix]objcopy -O elf32-i386 [run_dir]/genode/hypervisor [run_dir]/hypervisor
exec [cross_dev_prefix]strip [run_dir]/hypervisor
exec mkdir -p [run_dir]/boot
exec [cross_dev_prefix]objcopy -O elf32-i386 [run_dir]/genode/hypervisor [run_dir]/boot/hypervisor
exec [cross_dev_prefix]strip [run_dir]/boot/hypervisor
exec rm -rf [run_dir]/genode
exec mv [run_dir]/image.elf [run_dir]/boot/image.elf
if {[have_include "image/iso"] || [have_include "image/disk"] || [have_include image/uefi]} {
#
# Compress Genode image, to be uncompressed by GRUB
#
exec gzip [run_dir]/image.elf
exec gzip [run_dir]/boot/image.elf
set serial_bender_opt ""
@ -95,8 +98,8 @@ proc run_boot_dir {binaries} {
puts $fh " insmod multiboot2"
puts $fh " insmod gzio"
puts $fh " multiboot2 /boot/bender $serial_bender_opt"
puts $fh " module2 /hypervisor hypervisor iommu serial novpid novga"
puts $fh " module2 /image.elf.gz image.elf"
puts $fh " module2 /boot/hypervisor hypervisor iommu serial novpid novga"
puts $fh " module2 /boot/image.elf.gz image.elf"
puts $fh "}"
close $fh
}
@ -117,8 +120,8 @@ proc run_boot_dir {binaries} {
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
puts $fh " exec /boot/bender"
puts $fh " load /hypervisor iommu serial novpid novga"
puts $fh " load /image.elf"
puts $fh " load /boot/hypervisor iommu serial novpid novga"
puts $fh " load /boot/image.elf"
close $fh
generate_tftp_config

View File

@ -147,6 +147,9 @@ proc run_boot_dir {binaries} {
#
exec rm -rf [run_dir]/genode
exec mkdir -p [run_dir]/boot
exec mv [run_dir]/image.elf [run_dir]/boot/image.elf
if {[have_include "image/iso"] || [have_include "image/disk"]} {
if {[have_include "image/disk"]} {
@ -169,7 +172,7 @@ proc run_boot_dir {binaries} {
puts $fh "menuentry 'Genode on OKL4' {"
puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender"
puts $fh " module /image.elf"
puts $fh " module /boot/image.elf"
puts $fh "}"
close $fh
}
@ -192,7 +195,7 @@ proc run_boot_dir {binaries} {
# load okl4 at 256M to avoid overwritting binary, adjust by need
puts $fh " addr 0x10000000"
puts $fh " exec /boot/bender"
puts $fh " load /image.elf"
puts $fh " load /boot/image.elf"
close $fh
generate_tftp_config

View File

@ -37,12 +37,14 @@ proc run_boot_dir {binaries} {
# Move kernel files to distinct location within the boot directory so that
# we can remove [run_dir]/genode after the core image has been built.
#
exec mkdir -p [run_dir]/pistachio
file copy -force [run_dir]/genode/pistachio [run_dir]/kernel
file copy -force [run_dir]/genode/sigma0-pistachio [run_dir]/sigma0
file copy -force [run_dir]/genode/kickstart-pistachio [run_dir]/kickstart
exec mkdir -p [run_dir]/boot
file copy -force [run_dir]/genode/pistachio [run_dir]/boot/kernel
file copy -force [run_dir]/genode/sigma0-pistachio [run_dir]/boot/sigma0
file copy -force [run_dir]/genode/kickstart-pistachio [run_dir]/boot/kickstart
exec rm -r [run_dir]/genode
exec mv [run_dir]/image.elf [run_dir]/boot/image.elf
if {[have_include "image/iso"] || [have_include "image/disk"]} {
if {[have_include "image/disk"]} {
@ -65,10 +67,10 @@ proc run_boot_dir {binaries} {
puts $fh "menuentry 'Genode on L4ka::Pistachio' {"
puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender"
puts $fh " module /kickstart"
puts $fh " module /kernel"
puts $fh " module /sigma0"
puts $fh " module /image.elf"
puts $fh " module /boot/kickstart"
puts $fh " module /boot/kernel"
puts $fh " module /boot/sigma0"
puts $fh " module /boot/image.elf"
puts $fh "}"
close $fh
}
@ -89,10 +91,10 @@ proc run_boot_dir {binaries} {
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
puts $fh " exec /boot/bender"
puts $fh " load /kickstart"
puts $fh " load /kernel"
puts $fh " load /sigma0"
puts $fh " load /image.elf"
puts $fh " load /boot/kickstart"
puts $fh " load /boot/kernel"
puts $fh " load /boot/sigma0"
puts $fh " load /boot/image.elf"
close $fh
generate_tftp_config

View File

@ -42,9 +42,12 @@ proc run_boot_dir {binaries} {
# Move kernel files to distinct location within the boot directory so that
# we can remove [run_dir]/genode after the core image has been built.
#
file copy -force [run_dir]/genode/sel4 [run_dir]/sel4
exec mkdir -p [run_dir]/boot
file copy -force [run_dir]/genode/sel4 [run_dir]/boot/sel4
exec rm -r [run_dir]/genode
exec mv [run_dir]/image.elf [run_dir]/boot/image.elf
if {[have_include "image/iso"] || [have_include "image/disk"] || [have_include image/uefi]} {
set serial_bender_opt ""
@ -79,8 +82,8 @@ proc run_boot_dir {binaries} {
puts $fh "menuentry 'Genode on seL4' {"
puts $fh " insmod multiboot2"
puts $fh " multiboot2 /boot/bender phys_max=256M $serial_bender_opt"
puts $fh " module2 /sel4 sel4 disable_iommu"
puts $fh " module2 /image.elf image.elf"
puts $fh " module2 /boot/sel4 sel4 disable_iommu"
puts $fh " module2 /boot/image.elf image.elf"
puts $fh "}"
close $fh
}
@ -94,19 +97,19 @@ proc run_boot_dir {binaries} {
exit 1
}
# keep Genode image.elf as genode.elf
exec mv [run_dir]/image.elf [run_dir]/genode.elf
exec mv [run_dir]/boot/image.elf [run_dir]/boot/genode.elf
# call seL4 elfloader tool to generate image.elf bootable by uboot with 'bootelf' command
set ::env(PLAT) imx6
set ::env(TOOLPREFIX) [cross_dev_prefix]
exec [sel4_elfloader_dir]/gen_boot_image.sh [run_dir]/sel4 [run_dir]/genode.elf [run_dir]/image.elf
exec [sel4_elfloader_dir]/gen_boot_image.sh [run_dir]/boot/sel4 [run_dir]/boot/genode.elf [run_dir]/boot/image.elf
}
run_image [run_dir]/image.elf
run_image [run_dir]/boot/image.elf
# set symbolic link to image.elf file in TFTP directory for PXE boot
if {[have_spec arm] && [have_include "load/tftp"]} {
exec ln -sf [pwd]/[run_dir]/image.elf [load_tftp_base_dir][load_tftp_offset_dir]
exec ln -sf [pwd]/[run_dir]/boot/image.elf [load_tftp_base_dir][load_tftp_offset_dir]
if {[have_include "image/uboot"]} {
exec ln -sf [pwd]/[run_dir]/uImage [load_tftp_base_dir][load_tftp_offset_dir]
@ -124,8 +127,8 @@ proc run_boot_dir {binaries} {
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
puts $fh " exec /boot/bender phys_max=256M"
puts $fh " load /sel4 disable_iommu"
puts $fh " load /image.elf"
puts $fh " load /boot/sel4 disable_iommu"
puts $fh " load /boot/image.elf"
close $fh
generate_tftp_config

View File

@ -134,7 +134,7 @@ proc run_power_on { } {
}
# on ARM, we supply the boot image as kernel
if {[have_spec arm]} { append qemu_args " -kernel [run_dir]/image.elf " }
if {[have_spec arm]} { append qemu_args " -kernel [run_dir]/boot/image.elf " }
eval spawn $qemu $qemu_args
set qemu_spawn_id $spawn_id