diff options
author | He Zhe <zhe.he@windriver.com> | 2016-05-25 04:47:16 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-30 15:58:11 +0100 |
commit | 0437a59e3c298d40aaa96af09b80bff8fcbe292d (patch) | |
tree | 0f97feda6f977e4e4c837897313413347ee36273 /meta/classes/kernel-fitimage.bbclass | |
parent | 077377e912ce3eabd4978b4246272665f8304b66 (diff) | |
download | poky-0437a59e3c298d40aaa96af09b80bff8fcbe292d.tar.gz |
kernel: Add KERNEL_IMAGETYPES to build multi types kernel at one time
Add KERNEL_IMAGETYPES to support building packaging and installing
multi types of kernel images, such as zImage uImage, at one time.
KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE work as before.
(From OE-Core rev: 849b67b2e4820564b5e5c9bd4bb293c44351c5f3)
Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-fitimage.bbclass')
-rw-r--r-- | meta/classes/kernel-fitimage.bbclass | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass index 298eda2a23..9a3caf5535 100644 --- a/meta/classes/kernel-fitimage.bbclass +++ b/meta/classes/kernel-fitimage.bbclass | |||
@@ -1,8 +1,8 @@ | |||
1 | inherit kernel-uboot uboot-sign | 1 | inherit kernel-uboot uboot-sign |
2 | 2 | ||
3 | python __anonymous () { | 3 | python __anonymous () { |
4 | kerneltype = d.getVar('KERNEL_IMAGETYPE', True) | 4 | kerneltypes = d.getVar('KERNEL_IMAGETYPES', True) or "" |
5 | if kerneltype == 'fitImage': | 5 | if 'fitImage' in kerneltypes.split(): |
6 | depends = d.getVar("DEPENDS", True) | 6 | depends = d.getVar("DEPENDS", True) |
7 | depends = "%s u-boot-mkimage-native dtc-native" % depends | 7 | depends = "%s u-boot-mkimage-native dtc-native" % depends |
8 | d.setVar("DEPENDS", depends) | 8 | d.setVar("DEPENDS", depends) |
@@ -10,7 +10,9 @@ python __anonymous () { | |||
10 | # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal | 10 | # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal |
11 | # to kernel.bbclass . We have to override it, since we pack zImage | 11 | # to kernel.bbclass . We have to override it, since we pack zImage |
12 | # (at least for now) into the fitImage . | 12 | # (at least for now) into the fitImage . |
13 | d.setVar("KERNEL_IMAGETYPE_FOR_MAKE", "zImage") | 13 | typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE", True) or "" |
14 | if 'fitImage' in typeformake.split(): | ||
15 | d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', 'zImage')) | ||
14 | 16 | ||
15 | image = d.getVar('INITRAMFS_IMAGE', True) | 17 | image = d.getVar('INITRAMFS_IMAGE', True) |
16 | if image: | 18 | if image: |
@@ -187,7 +189,7 @@ EOF | |||
187 | } | 189 | } |
188 | 190 | ||
189 | do_assemble_fitimage() { | 191 | do_assemble_fitimage() { |
190 | if test "x${KERNEL_IMAGETYPE}" = "xfitImage" ; then | 192 | if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then |
191 | kernelcount=1 | 193 | kernelcount=1 |
192 | dtbcount="" | 194 | dtbcount="" |
193 | rm -f fit-image.its arch/${ARCH}/boot/fitImage | 195 | rm -f fit-image.its arch/${ARCH}/boot/fitImage |
@@ -265,14 +267,14 @@ addtask assemble_fitimage before do_install after do_compile | |||
265 | kernel_do_deploy[vardepsexclude] = "DATETIME" | 267 | kernel_do_deploy[vardepsexclude] = "DATETIME" |
266 | kernel_do_deploy_append() { | 268 | kernel_do_deploy_append() { |
267 | # Update deploy directory | 269 | # Update deploy directory |
268 | if test "x${KERNEL_IMAGETYPE}" = "xfitImage" ; then | 270 | if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then |
269 | cd ${B} | 271 | cd ${B} |
270 | echo "Copying fit-image.its source file..." | 272 | echo "Copying fit-image.its source file..." |
271 | its_base_name="${KERNEL_IMAGETYPE}-its-${PV}-${PR}-${MACHINE}-${DATETIME}" | 273 | its_base_name="fitImage-its-${PV}-${PR}-${MACHINE}-${DATETIME}" |
272 | its_symlink_name=${KERNEL_IMAGETYPE}-its-${MACHINE} | 274 | its_symlink_name=fitImage-its-${MACHINE} |
273 | install -m 0644 fit-image.its ${DEPLOYDIR}/${its_base_name}.its | 275 | install -m 0644 fit-image.its ${DEPLOYDIR}/${its_base_name}.its |
274 | linux_bin_base_name="${KERNEL_IMAGETYPE}-linux.bin-${PV}-${PR}-${MACHINE}-${DATETIME}" | 276 | linux_bin_base_name="fitImage-linux.bin-${PV}-${PR}-${MACHINE}-${DATETIME}" |
275 | linux_bin_symlink_name=${KERNEL_IMAGETYPE}-linux.bin-${MACHINE} | 277 | linux_bin_symlink_name=fitImage-linux.bin-${MACHINE} |
276 | install -m 0644 linux.bin ${DEPLOYDIR}/${linux_bin_base_name}.bin | 278 | install -m 0644 linux.bin ${DEPLOYDIR}/${linux_bin_base_name}.bin |
277 | 279 | ||
278 | cd ${DEPLOYDIR} | 280 | cd ${DEPLOYDIR} |