mirror of
https://git.yoctoproject.org/poky
synced 2026-09-13 09:49:32 +02:00
kernel-fitimage.bbclass: remove it
The integration of the FIT image-related build steps into the kernel recipe has proven to be not very good. The new implementation with kernel-fit-image.bbclass fixes some design issues: * sstate does not work well when a fitImage contains an initramfs. The kernel is rebuilt from scratch if the build runs from an empty TMPDIR. * A fitImage kernel is not available as a package, but all other kernel image types are. * The task dependencies in the kernel are very complex and difficult to debug if something goes wrong. As a separate, downstream recipe, this is now much easier. The long storry about this issue is here: [YOCTO #12912] (From OE-Core rev: deb6bc3bea30dadabdb580a7a58a3b2e277af400) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
18861ef0eb
commit
1d8c78c8cd
@@ -57,48 +57,3 @@ uboot_prep_kimage() {
|
||||
|
||||
printf "$linux_comp" > "$output_dir/linux_comp"
|
||||
}
|
||||
|
||||
def uboot_prep_kimage_py(d):
|
||||
import subprocess
|
||||
|
||||
arch = d.getVar('ARCH')
|
||||
initramfs_image_bundle = d.getVar('INITRAMFS_IMAGE_BUNDLE')
|
||||
fit_kernel_comp_alg = d.getVar('FIT_KERNEL_COMP_ALG') or 'gzip'
|
||||
fit_kernel_comp_alg_extension = d.getVar('FIT_KERNEL_COMP_ALG_EXTENSION') or '.gz'
|
||||
kernel_objcopy = d.getVar('KERNEL_OBJCOPY')
|
||||
|
||||
vmlinux_path = ""
|
||||
linux_suffix = ""
|
||||
linux_comp = "none"
|
||||
|
||||
if os.path.exists(f'arch/{arch}/boot/compressed/vmlinux'):
|
||||
vmlinux_path = f'arch/{arch}/boot/compressed/vmlinux'
|
||||
elif os.path.exists(f'arch/{arch}/boot/vmlinuz.bin'):
|
||||
if os.path.exists('linux.bin'):
|
||||
os.remove('linux.bin')
|
||||
os.link(f'arch/{arch}/boot/vmlinuz.bin', 'linux.bin')
|
||||
else:
|
||||
vmlinux_path = 'vmlinux'
|
||||
# Use vmlinux.initramfs for linux.bin when INITRAMFS_IMAGE_BUNDLE set
|
||||
# As per the implementation in kernel.bbclass.
|
||||
# See do_bundle_initramfs function
|
||||
if initramfs_image_bundle == '1' and os.path.exists('vmlinux.initramfs'):
|
||||
vmlinux_path = 'vmlinux.initramfs'
|
||||
linux_suffix = fit_kernel_comp_alg_extension
|
||||
linux_comp = fit_kernel_comp_alg
|
||||
|
||||
if vmlinux_path:
|
||||
subprocess.run([kernel_objcopy.strip(), '-O', 'binary', '-R', '.note', '-R', '.comment', '-S', os.path.abspath(vmlinux_path), 'linux.bin'], check=True)
|
||||
# if ret.returncode != 0:
|
||||
# bb.fatal(f"Error: stderr: {ret.stderr.decode('utf-8')} stdout: {ret.stdout.decode('utf-8')}, vmlinux_path: {os.path.abspath(vmlinux_path)}, pwd: {os.getcwd()}, args: {ret.args}")
|
||||
|
||||
if linux_comp != "none":
|
||||
if linux_comp == "gzip":
|
||||
subprocess.run(['gzip', '-9', 'linux.bin'], check=True)
|
||||
elif linux_comp == "lzo":
|
||||
subprocess.run(['lzop', '-9', 'linux.bin'], check=True)
|
||||
elif linux_comp == "lzma":
|
||||
subprocess.run(['xz', '--format=lzma', '-f', '-6', 'linux.bin'], check=True)
|
||||
os.rename(f'linux.bin{linux_suffix}', 'linux.bin')
|
||||
|
||||
return linux_comp
|
||||
|
||||
Reference in New Issue
Block a user