summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2022-07-27 12:11:54 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-02 11:29:57 +0100
commit0264aeedbf21e9e7a104243c11b3b57f00e38bda (patch)
treec0991c274f21168a448e8b14e97b880e650c15ad /scripts
parentc523549141e5c31edc75281f581d97867b7d251d (diff)
downloadopenembedded-core-0264aeedbf21e9e7a104243c11b3b57f00e38bda.tar.gz
wic/bootimg-efi: use cross objcopy when building unified kernel image
We can't rely on the host objcopy knowing how to process target binaries, so use the cross objcopy in the sysroot instead. Also construct the command argument-by-argument as the format expression was getting unwieldy. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-efi.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 0391aebdc8..a65a5b9780 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -326,21 +326,20 @@ class BootimgEFIPlugin(SourcePlugin):
exec_cmd(install_cmd)
staging_dir_host = get_bitbake_var("STAGING_DIR_HOST")
+ target_sys = get_bitbake_var("TARGET_SYS")
# https://www.freedesktop.org/software/systemd/man/systemd-stub.html
- objcopy_cmd = "objcopy \
- --add-section .osrel=%s --change-section-vma .osrel=0x20000 \
- --add-section .cmdline=%s --change-section-vma .cmdline=0x30000 \
- --add-section .linux=%s --change-section-vma .linux=0x2000000 \
- --add-section .initrd=%s --change-section-vma .initrd=0x3000000 \
- %s %s" % \
- ("%s/usr/lib/os-release" % staging_dir_host,
- cmdline.name,
- "%s/%s" % (staging_kernel_dir, kernel),
- initrd.name,
- efi_stub,
- "%s/EFI/Linux/linux.efi" % hdddir)
- exec_cmd(objcopy_cmd)
+ objcopy_cmd = "%s-objcopy" % target_sys
+ objcopy_cmd += " --add-section .osrel=%s/usr/lib/os-release" % staging_dir_host
+ objcopy_cmd += " --change-section-vma .osrel=0x20000"
+ objcopy_cmd += " --add-section .cmdline=%s" % cmdline.name
+ objcopy_cmd += " --change-section-vma .cmdline=0x30000"
+ objcopy_cmd += " --add-section .linux=%s/%s" % (staging_kernel_dir, kernel)
+ objcopy_cmd += " --change-section-vma .linux=0x2000000"
+ objcopy_cmd += " --add-section .initrd=%s" % initrd.name
+ objcopy_cmd += " --change-section-vma .initrd=0x3000000"
+ objcopy_cmd += " %s %s/EFI/Linux/linux.efi" % (efi_stub, hdddir)
+ exec_native_cmd(objcopy_cmd, native_sysroot)
else:
install_cmd = "install -m 0644 %s/%s %s/%s" % \
(staging_kernel_dir, kernel, hdddir, kernel)