diff options
author | Ross Burton <ross.burton@arm.com> | 2022-07-27 12:11:54 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-02 11:29:59 +0100 |
commit | c9db415375b4f2a145486052fb89adbe3d6a9ec1 (patch) | |
tree | 6fd3daf513e2f4fd5ca426a6b66d6be533a26afa /scripts | |
parent | 195ea43f8f7276b652a27d9c4591f05c4553d304 (diff) | |
download | poky-c9db415375b4f2a145486052fb89adbe3d6a9ec1.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.
(From OE-Core rev: 0264aeedbf21e9e7a104243c11b3b57f00e38bda)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/wic/plugins/source/bootimg-efi.py | 25 |
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): | |||
326 | exec_cmd(install_cmd) | 326 | exec_cmd(install_cmd) |
327 | 327 | ||
328 | staging_dir_host = get_bitbake_var("STAGING_DIR_HOST") | 328 | staging_dir_host = get_bitbake_var("STAGING_DIR_HOST") |
329 | target_sys = get_bitbake_var("TARGET_SYS") | ||
329 | 330 | ||
330 | # https://www.freedesktop.org/software/systemd/man/systemd-stub.html | 331 | # https://www.freedesktop.org/software/systemd/man/systemd-stub.html |
331 | objcopy_cmd = "objcopy \ | 332 | objcopy_cmd = "%s-objcopy" % target_sys |
332 | --add-section .osrel=%s --change-section-vma .osrel=0x20000 \ | 333 | objcopy_cmd += " --add-section .osrel=%s/usr/lib/os-release" % staging_dir_host |
333 | --add-section .cmdline=%s --change-section-vma .cmdline=0x30000 \ | 334 | objcopy_cmd += " --change-section-vma .osrel=0x20000" |
334 | --add-section .linux=%s --change-section-vma .linux=0x2000000 \ | 335 | objcopy_cmd += " --add-section .cmdline=%s" % cmdline.name |
335 | --add-section .initrd=%s --change-section-vma .initrd=0x3000000 \ | 336 | objcopy_cmd += " --change-section-vma .cmdline=0x30000" |
336 | %s %s" % \ | 337 | objcopy_cmd += " --add-section .linux=%s/%s" % (staging_kernel_dir, kernel) |
337 | ("%s/usr/lib/os-release" % staging_dir_host, | 338 | objcopy_cmd += " --change-section-vma .linux=0x2000000" |
338 | cmdline.name, | 339 | objcopy_cmd += " --add-section .initrd=%s" % initrd.name |
339 | "%s/%s" % (staging_kernel_dir, kernel), | 340 | objcopy_cmd += " --change-section-vma .initrd=0x3000000" |
340 | initrd.name, | 341 | objcopy_cmd += " %s %s/EFI/Linux/linux.efi" % (efi_stub, hdddir) |
341 | efi_stub, | 342 | exec_native_cmd(objcopy_cmd, native_sysroot) |
342 | "%s/EFI/Linux/linux.efi" % hdddir) | ||
343 | exec_cmd(objcopy_cmd) | ||
344 | else: | 343 | else: |
345 | install_cmd = "install -m 0644 %s/%s %s/%s" % \ | 344 | install_cmd = "install -m 0644 %s/%s %s/%s" % \ |
346 | (staging_kernel_dir, kernel, hdddir, kernel) | 345 | (staging_kernel_dir, kernel, hdddir, kernel) |