diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-10 14:35:29 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-12 15:27:17 +0100 |
commit | fd1517e2b51a170f2427122c6b95396db251d827 (patch) | |
tree | dabfe3e631339c2fc99a9ee7febb0f9c128e325e /meta/classes-recipe/kernel-uboot.bbclass | |
parent | 10317912ee319ccf7f83605d438b5cbf9663f296 (diff) | |
download | poky-fd1517e2b51a170f2427122c6b95396db251d827.tar.gz |
classes: Update classes to match new bitbake class scope functionality
Move classes to classes-global or classes-recipe as appropriate to take
advantage of new bitbake functionality to check class scope/usage.
(From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe/kernel-uboot.bbclass')
-rw-r--r-- | meta/classes-recipe/kernel-uboot.bbclass | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/classes-recipe/kernel-uboot.bbclass b/meta/classes-recipe/kernel-uboot.bbclass new file mode 100644 index 0000000000..4aab02671e --- /dev/null +++ b/meta/classes-recipe/kernel-uboot.bbclass | |||
@@ -0,0 +1,49 @@ | |||
1 | # | ||
2 | # Copyright OpenEmbedded Contributors | ||
3 | # | ||
4 | # SPDX-License-Identifier: MIT | ||
5 | # | ||
6 | |||
7 | # fitImage kernel compression algorithm | ||
8 | FIT_KERNEL_COMP_ALG ?= "gzip" | ||
9 | FIT_KERNEL_COMP_ALG_EXTENSION ?= ".gz" | ||
10 | |||
11 | # Kernel image type passed to mkimage (i.e. kernel kernel_noload...) | ||
12 | UBOOT_MKIMAGE_KERNEL_TYPE ?= "kernel" | ||
13 | |||
14 | uboot_prep_kimage() { | ||
15 | if [ -e arch/${ARCH}/boot/compressed/vmlinux ]; then | ||
16 | vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux" | ||
17 | linux_suffix="" | ||
18 | linux_comp="none" | ||
19 | elif [ -e arch/${ARCH}/boot/vmlinuz.bin ]; then | ||
20 | rm -f linux.bin | ||
21 | cp -l arch/${ARCH}/boot/vmlinuz.bin linux.bin | ||
22 | vmlinux_path="" | ||
23 | linux_suffix="" | ||
24 | linux_comp="none" | ||
25 | else | ||
26 | vmlinux_path="vmlinux" | ||
27 | # Use vmlinux.initramfs for linux.bin when INITRAMFS_IMAGE_BUNDLE set | ||
28 | # As per the implementation in kernel.bbclass. | ||
29 | # See do_bundle_initramfs function | ||
30 | if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ] && [ -e vmlinux.initramfs ]; then | ||
31 | vmlinux_path="vmlinux.initramfs" | ||
32 | fi | ||
33 | linux_suffix="${FIT_KERNEL_COMP_ALG_EXTENSION}" | ||
34 | linux_comp="${FIT_KERNEL_COMP_ALG}" | ||
35 | fi | ||
36 | |||
37 | [ -n "${vmlinux_path}" ] && ${OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin | ||
38 | |||
39 | if [ "${linux_comp}" != "none" ] ; then | ||
40 | if [ "${linux_comp}" = "gzip" ] ; then | ||
41 | gzip -9 linux.bin | ||
42 | elif [ "${linux_comp}" = "lzo" ] ; then | ||
43 | lzop -9 linux.bin | ||
44 | fi | ||
45 | mv -f "linux.bin${linux_suffix}" linux.bin | ||
46 | fi | ||
47 | |||
48 | echo "${linux_comp}" | ||
49 | } | ||