diff options
author | Stefano Stabellini | 2022-03-22 13:15:13 -0700 |
---|---|---|
committer | Stefano Stabellini | 2022-03-24 17:52:51 -0700 |
commit | 60f2a6d5af3a36dcb28768a18f61ade70cbf21b5 (patch) | |
tree | 7e4267113253ddb5d8a7fdeb4cd66833f634dc52 /scripts | |
parent | 3fa89f8f985318e919911b494e32a15c9448a725 (diff) |
If bootm, generate a u-boot Legacy uImage to boot
If BOOT_CMD is specified as "bootm" it requires a uImage to boot.
Automatically generate a $XEN.ub binary using mkimage and specifying the
right loading address.
Also remove "u-boot legacy uImage" from the allowed Xen binary types
because we cannot easily check that the uImage was built with the right
address.
Note that "ARM OpenFirmware" is the type returned by certain versions of
"file" utility for a Xen arm32 binary.
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Reviewed-by: Ayan Kumar Halder <ayankuma@xilinx.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/uboot-script-gen | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index 6705184..aee45ec 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -237,7 +237,7 @@ function check_file_type() # since some executables aren't recongnized if [ "$type" = "executable" ] then - type="executable\|data\|u-boot legacy uImage" + type="executable\|data\|ARM OpenFirmware" # file in older distros (ex: RHEL 7.4) just output data for device # tree blobs elif [ "$type" = "Device Tree Blob" ] @@ -387,6 +387,21 @@ function linux_config() fi } +generate_uboot_images() +{ + local arch=$(file -L $XEN | grep "ARM") + + if test "$arch" + then + arch=arm + else + arch=arm64 + fi + + mkimage -A $arch -T kernel -C none -a $memaddr -e $memaddr -d $XEN "$XEN".ub + XEN="$XEN".ub +} + xen_file_loading() { check_compressed_file_type $DOM0_KERNEL "executable" @@ -448,6 +463,12 @@ xen_file_loading() # secure boot on uboot expects the last PE image loaded to be the # signed secureboot image used check_compressed_file_type $XEN "executable" + + if test "$BOOT_CMD" = "bootm" + then + generate_uboot_images + fi + kernel_addr=$memaddr kernel_path=$XEN load_file "$XEN" "host_kernel" |