summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-fitimage.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* kernel-fitimage: fix devicetree reproducibilityAlex Kiernan2020-02-141-1/+1
| | | | | | | | | | | Ensure that the order of dtb/dtbo files in the generated fitimage is reproducible. Fixes: 71bfa9838cbf ("kernel-fitimage: Handle overlays in EXTERNAL_KERNEL_DEVICETREE") (From OE-Core rev: 9e4a91b63dd8e0c1708da2ac7de461b35fb0b011) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: Handle overlays in EXTERNAL_KERNEL_DEVICETREEAlex Kiernan2020-02-131-3/+2
| | | | | | | | | | | When using EXTERNAL_KERNEL_DEVICETREE, collect DTB overlays too (*.dtbo) as well as iterating down into sub-directories so using the behaviour for naming which matches KERNEL_DEVICETREE. (From OE-Core rev: 169ebd59f11845a3a5a7157719217ccf0844e448) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: introduce FIT_SIGN_ALGRichard Leitner2019-10-311-1/+5
| | | | | | | | | | | make fitImage configuration signature algorithm selectable with FIT_SIGN_ALG. (From OE-Core rev: e24b27a2b49e97cec6153f2d642d17a901b8ba12) Signed-off-by: Richard Leitner <richard.leitner@skidata.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: Cope with non-standard kernel deploy subdirectoryMike Crowe2019-10-231-9/+9
| | | | | | | | | | | | | | | | kernel.bbclass installs non-standard kernels (where KERNEL_PACKAGE_NAME is not "kernel") in a subdirectory of ${DEPLOYDIR}. To achieve this kernel_do_deploy sets the deployDir shell variable to ${DEPLOYDIR} for the standard kernel or ${DEPLOYDIR}/${KERNEL_DEPLOYSUBDIR} for non-standard kernels. kernel-fitimage.bbclass's kernel_do_deploy_append ought to do the same and can do so by using the same shell variable. (From OE-Core rev: d324b22d32eaea9e4337c963c8b1a33b0ba6a2dd) Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel.fitimage.bbclass: remove ramdisk_ctypeHeiko Schocher2019-09-271-20/+1
| | | | | | | | | | | | | | | | | | | | | | | set in the ramdisk node the compression property always to "none", as U-Boot nowadays since commit: b1307f884a91 ("fit: Support compression for non-kernel components (e.g. FDT)") decompress non kernel components. Setting compression to the used comression algorithm now, will end in fail of your kernel boot with the ramdisk. This issue is fixed since commit: bddd98573465 ("fit: Do not automatically decompress ramdisk images") which now prints a warning in U-Boot, instead of decompressing the ramdisk, but we should setup compression property correct. (From OE-Core rev: f963a51544a9a7b1abbaa87c95b3c0279847d697) Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: introduce FIT_HASH_ALGAyoub Zaki2019-06-191-5/+8
| | | | | | | | | | sanitize fitImage hash algorithm selection with FIT_HASH_ALG switch default hash algorithm from sha1 to sha256 (From OE-Core rev: 8c9d5d59cb1575fac17c461090937df4cbb3d3b5) Signed-off-by: Ayoub Zaki <ayoub.zaki@embexus.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: uboot-sign: Check UBOOT_DTB_BINARY before adding depsAlex Kiernan2019-06-121-1/+1
| | | | | | | | | | | | Since UBOOT_DTB_BINARY empty means we don't need to inject signatures into the U-Boot DTB, we can remove the dependencies between consumers of these two classes and resolve a circular dependency between u-boot and kernel. (From OE-Core rev: c6b49cb75285e71909d1f9e4bf636f186941b519) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: support RISC-VMichael Scott2019-04-121-0/+2
| | | | | | | | | | | | | | | Support RISC-V kernel image, using the "Image" target. This change allows RISC-V support for fitImage via the following flow: OpenSBI -> u-boot (as payload) -> Linux kernel (as fitImage with ramdisk and dtb). This was tested using QEMU RISC-V 64-bit. (From OE-Core rev: 35d0842c637b7d7ce0ab01f43b594c19a964872f) Signed-off-by: Michael Scott <mike@foundries.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: Replace tabs with spaces in pythonAlex Kiernan2019-02-281-1/+1
| | | | | | | | | | | Fix: WARNING: python should use 4 spaces indentation, but found tabs in kernel-fitimage.bbclass, line 33 (From OE-Core rev: 00716a795f10e223150b0f9b214d185d654f4cc1) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage.bbclass: Introduce a way to provide external dtbManjukumar Matha2019-02-261-1/+19
| | | | | | | | | | | | | | | | | Currently kernel-fitimage gets the dtb from KERNEL_DEVICETREE, however there are instances when the DTB file can be generated using other recipes, provide a way to include the DTB instead of inkernel device tree. Add support for external device tree during the creation of fitimage. If virtual/dtb is set using PREFERRED_PROVIDER_virtual/dtb = "devicetree", which inherits the devicetree.bbclass then use the path provided in EXTERNAL_KERNEL_DEVICETREE else use KERNEL_DEVICETREE during fitimage process (From OE-Core rev: 084f4de4dbaf9821516fc0254d35f4fb04311d27) Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage.bbclass: Fix the dependency issue while generating ↵Manjukumar Matha2019-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | fitimage_initramfs When building fitimage_initramfs, the correct depedency is to build after do_bundle_initramfs. We can run into the following dependency issue DEBUG: Python function extend_recipe_sysroot finished DEBUG: Executing shell function do_assemble_fitimage_initramfs aarch64-xilinx-linux-objcopy: 'vmlinux': No such file This happens because initramfs renames vmlinux to vmlinux.bak while generating vmlinux.initramfs, there is a chance that fitimage_initramfs can also start during this process and create the above issue. This patch resolve the dependency issue by running fitimage_initramfs task after do_bundle_initramfs (From OE-Core rev: 8f0bece39a634fce5bd882cbd9e289ea905a0b17) Signed-off-by: Varalaxmi Bingi<varalaxm@xilinx.com> Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uboot-sign.bbclass: fix signature and deploymentRobert Yang2018-12-081-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed: MACHINE = "beaglebone-yocto" KERNEL_CLASSES += "kernel-fitimage" KERNEL_IMAGETYPE_beaglebone-yocto = "fitImage" UBOOT_MACHINE_beaglebone-yocto = "am335x_boneblack_vboot_config" UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000" UBOOT_SIGN_KEYDIR = "${TOPDIR}/conf" UBOOT_SIGN_KEYNAME = "dev" UBOOT_SIGN_ENABLE = "1" IMAGE_INSTALL_remove = "kernel-image-zimage" $ cd conf $ openssl genrsa -F4 -out dev.key 2048 $ openssl req -batch -new -x509 -key dev.key -out dev.crt $ cd ../ $ bitbake u-boot linux-yocto $ grep signature tmp/deploy/images/beaglebone-yocto/*.dtb Binary file tmp/deploy/images/beaglebone-yocto/u-boot-beaglebone-yocto-2018.07-r0.dtb matches Binary file tmp/deploy/images/beaglebone-yocto/u-boot-beaglebone-yocto.dtb matches Binary file tmp/deploy/images/beaglebone-yocto/u-boot.dtb matches And there would be no signature info when rebuild from sstate: $ bitbake u-boot linux-yocto -cclean $ bitbake u-boot linux-yocto $ grep signature tmp/deploy/images/beaglebone-yocto/*.dtb No result This s because kernel directly edit ${DEPLOY_DIR_IMAGE}/u-boot.dtb, (Note, it is global ${DEPLOY_DIR_IMAGE}, not recipe's DEPLOYDIR), so that the modified info is not in sstate, and would be lost when rebuild from sstate. There are other problems in previouse code: - The u-boot.dtb is provided by u-boot, but edited by kernel during signing, so it should be deployed by kernel rather than u-boot. - The u-boot.do_concat_dtb directly install files to global ${DEPLOY_DIR_IMAGE}, this is incorrect, the ${DEPLOY_DIR_IMAGE} should be installed by do_deploy. - It seems that it assumes do_deploy depends on do_install according the comments, but they have no relationships: # do_concat_dtb is scheduled _before_ do_install as it overwrite the # u-boot.bin in both DEPLOYDIR and DEPLOY_IMAGE_DIR. - The do_concat_dtb should be run after do_compile, but it doesn't have this dependency. Make u-boot install u-boot.dtb to ${datadir}, kernel copies u-boot.dtb from ${STAGING_DATADIR} to ${B} and deploy it can fix the problem. [YOCTO #12112] Reported-by: Christian Andersen <c.andersen@kostal.com> (From OE-Core rev: 493f70cfb177f1d452a13329647a38642bf2b161) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: Replace tabs with spaces in pythonAlex Kiernan2018-12-081-3/+3
| | | | | | | | | | | Fix: WARNING: python should use 4 spaces indentation, but found tabs in kernel-fitimage.bbclass, line 24 (From OE-Core rev: 4ec42465e9df8cef20a97be11243726aa7dfb8c1) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* u-boot: Add mkenvimage toolAlexey Brodkin2018-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This utility is used for creation of images containing usable in run-time U-Boot environment. As of today this utility is added per-board like here [1] for Intel Edison board. [1] http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/tree/meta-intel-edison-bsp/recipes-bsp/u-boot/u-boot-tools_2014.04.bb Given there're quite some U-Boot tools that we may want to add later this recipe name switch from "u-boot-mkimage" to generic "u-boot-tools" still for compatibility we provide "u-boot-mkimage" with help of PROVIDES as well as proposed "u-boot-mkenvimage". (From OE-Core rev: 314885b16e5d26d27d46a4bfb0d581b27a03b8fe) Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Richard Purdie <richard.purdie@linuxfoundation.org> Cc: Otavio Salvador <otavio@ossystems.com.br> Cc: Martin Jansa <martin.jansa@gmail.com> Cc: Ross Burton <ross.burton@intel.com> Cc: Marek Vasut <marex@denx.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: Fix dangling symlink to image tree sourceAlex Kiernan2018-09-221-1/+1
| | | | | | | | | | | When deploying the its file, the target of the symlink is missing the its extension, add it here. (From OE-Core rev: df72761760d453b2dfc7cc2fa1344bb016df9712) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel*.bbclass: rename *_SYMLINK_NAME variables to *_LINK_NAME and ↵Martin Jansa2018-08-211-8/+8
| | | | | | | | | | | | | | *_BASE_NAME to *_NAME * for consistency with IMAGE_NAME and IMAGE_LINK_NAME and to avoid confusion with IMAGE_BASENAME (which is the actual name of the artifact, e.g. PN while KERNEL_IMAGE_BASE_NAME was only the version suffix) (From OE-Core rev: f952c8e08b4798aa0f8bf764cfd70bda0eae9b8b) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-artifact-names, kernel-fitimage: add KERNEL_FIT_BASE_NAME, ↵Martin Jansa2018-08-211-22/+12
| | | | | | | | | | | | | KERNEL_FIT_SYMLINK_NAME variables * use the same naming scheme for fitImage files like all other deployed artifacts * remove unnecessary cd to DEPLOYDIR * remove unnecessary cd to B (From OE-Core rev: fd69f8b2d7dd950cee9e820ef91ea90521c95ace) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: add support for ext2.gz initramfs filesChunrong Guo2018-07-051-1/+1
| | | | | | | | (From OE-Core rev: e2e0c91c2c8229d9ed0958de98b5a9b14c6805d1) Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: Make DTB key insertion optionalAlex Kiernan2018-07-041-1/+1
| | | | | | | | | | | | If UBOOT_DTB_BINARY is empty, then don't try inserting the U-Boot signing keys into the DTB. In this configuration the keys are expected to be already present in U-Boot's DTB. (From OE-Core rev: a0d74767f7bd18c853df6b0be162363076d8f965) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: Add DTBO support for configurationsAlex Kiernan2018-06-181-10/+32
| | | | | | | | | | | When generating overlay DTB configuration sections, U-Boot doesn't want the kernel specified again as we already have that in our base DTB. Add support for this to allow bootm to process overlay configuration sections. (From OE-Core rev: c0db9776beb4f519079a554a733353c368739dcf) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: Allow setting of DTB/DTBO relocation addressAlex Kiernan2018-06-181-0/+10
| | | | | | | | | | | Introduce UBOOT_DTB_LOADADDRESS and UBOOT_DTBO_LOADADDRESS so that you can set where U-Boot loads full and overlay DTBs. This is required when using bootm's overlay support to construct the final DTB. (From OE-Core rev: 05d2230db1d7379494814407fc0d79d7e755d89e) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage.bbclass: Fix 64 bit ENTRYPOINTVineeth Chowdary Karumanchi2018-02-151-1/+1
| | | | | | | | | | | | | 64 bit entry point should be passed in 2 literals ( "0x1 0x00008000" ).ENTRYPOINT is assigned with first half only and erroring out as 'command not found' for the second half. Adding quotes while assignment fixes the issue. (From OE-Core rev: e886c9c5e1a8ab28388a2e8bbb936ad5eea78615) Signed-off-by: Vineeth Chowdary Karumanchi <vineethchowz.chowdary@xilinx.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage.bbclass: Fix bad image type replacement for microblazeManjukumar Matha2018-01-041-0/+2
| | | | | | | | | | | When using kernel-fitimage class with microblaze, the image type has to be linux.bin not zImage. This patch fixes the bad image type replacement for microblaze (From OE-Core rev: 4e0903e2f71658d595ccb1fa9dddf0f73b373f7e) Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: Fix bad image type replacement for aarch64Thomas Perrot2018-01-021-2/+5
| | | | | | | | | | | | | When using kernel-fitimage class with aarch64, the image type has to be Image not zImage. This patch fixes the bad image type replacement for aarch64 (From OE-Core rev: d14adead5861007ac7e95c32396491f907ab9f8f) Signed-off-by: Thomas Perrot <thomas.perrot@tupi.fr> Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: support MIPS (compressed)André Draszik2017-09-251-1/+3
| | | | | | | | | | On MIPS, the compressed kernel image target is vmlinuz.bin (From OE-Core rev: 74d97569aa4e0f82e094a539dec302076103affa) Signed-off-by: André Draszik <adraszik@tycoint.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: unbreak UBOOT_ENTRYSYMBOL supportAndré Draszik2017-09-251-2/+2
| | | | | | | | | | | | | | | | - vmlinux is located in ${B}, not ${S}. - parsing of nm output got broken completely in commit b406a89935f148779569fa3770776e009dd51f13 ("kernel-fitimage: add initramfs support"), commit ec755d2524fcbd9dfded23a576f25c990d405a6c in yocto While at it, make awk exit on match to save a few CPU cycles. (From OE-Core rev: 9d2ec9c046c4a9c6a842d28133d40639f5a65297) Signed-off-by: André Draszik <adraszik@tycoint.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: sanitize dtb section name (unbreak MIPS)André Draszik2017-09-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | We can't build fitImages for MIPS any more: | Error: fit-image.its:21.27-28 syntax error | FATAL ERROR: Unable to parse input tree | uboot-mkimage: Can't read arch/mips/boot/fitImage.tmp: Invalid argument Since commit cd2ed7f80b555add07795cc0cbaee866e6c193a3 ("kernel-fitimage: dtb sections named by their filenames and one config section for each dtb"), commit 1ec405ef5df82884c8997878bbe6c66d924b5127 in yocto, dtb sections are named by the DTB filename, but the filename can legally be in a subdirectory below arch/$arch/boot/dts/, and on MIPS all DTBs are actually in a subdirectory. If so, mkimage fails with the above error message. Unbreak this by replacing the offending character (directory separator /) (From OE-Core rev: 335fc50cf54e47db4e3d5c35a9846484faf0270f) Signed-off-by: André Draszik <adraszik@tycoint.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel.bbclass: introduce INITRAMFS_IMAGE_NAMEMing Liu2017-04-011-5/+5
| | | | | | | | | | | | | | It defaults to ${INITRAMFS_IMAGE}-${MACHINE} if INITRAMFS_IMAGE is not empty. This allows the end users to be able to override the initramfs image name with a customized value. (From OE-Core rev: e788fb2b894852f71b1c545abde71b45b9f230dc) Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Replace "if test" file tests with POSIX file testsuninative-1.6Robert P. J. Day2017-03-271-5/+5
| | | | | | | | | | In entire meta/classes/ directory, replace shell tests of the form "if test -? ..." with POSIX tests of the form "if [ -? ... (From OE-Core rev: 78928016f4cf38cf6751cb089200bf950d07ae93) Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: dtb sections named by their filenames and one config ↵Florian Wickert2017-03-221-7/+21
| | | | | | | | | | | | | section for each dtb Before this, dtb sections were named by their position index in KERNEL_DEVICETREE. Also there was only one item in the config section, so only the first dtb was seen by the bootloader. This patch adds a config section for each dtb named by the dtb filename. This is what bootloaders usually know about the machine they run on. (From OE-Core rev: cd2ed7f80b555add07795cc0cbaee866e6c193a3) Signed-off-by: Florian Wickert <fw@javox-solutions.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Fix "U-boot", use proper spelling of "U-Boot".Robert P. J. Day2017-03-171-1/+1
| | | | | | | | | | | U-Boot people are amazingly pedantic in their insistence on proper spelling of "U-Boot", so humour them. (From OE-Core rev: f346a9bdc372ec477bafcda358f9339ff4e4c79d) Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: Use compressed ramdisks in FIT images if availableRick Altherr2017-01-231-4/+30
| | | | | | | | | | | | | kernel-fitimage:fitimage_assemble() was calling copy_initramfs from kernel.bbclass which decompresses the initramfs cpio. Assume that if INITRAMFS_FSTYPES includes a compressed cpio, that is what it desired in the FIT image. (From OE-Core rev: 842ad404b36e00c89f615a3f7db4a2d30062effa) Signed-off-by: Rick Altherr <raltherr@google.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage.bbclass: Check value of UBOOT_SIGN_ENABLENathan Rossi2017-01-191-1/+1
| | | | | | | | | | | Check the value of UBOOT_SIGN_ENABLE, as it is defaulted to "0" which for matches as True in python due to being a non-empty string. (From OE-Core rev: 35ebe793f2d933366863d17fb807b3d39f594334) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage.bbclass: Don't assume KERNEL_IMAGETYPE == fitImageNathan Rossi2017-01-191-4/+4
| | | | | | | | | | | | | | The name of the output image for a fitImage that contains a ramdisk should match the same as for the fitImage that does not contain a ramdisk. As such it should not be assumed that KERNEL_IMAGETYPE is "fitImage". This change explicitly sets the name of the output ramdisk/initramfs to start with fitImage as does the non-ramdisk output. (From OE-Core rev: 81caed2b7071ffc9ed8077d7d76952f2a2a4713d) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage.bbclass: Allow unset load/entry addresses for ramdisksNathan Rossi2017-01-191-2/+11
| | | | | | | | | | | | Allow the load and entry addresses to remain unset if the UBOOT_RD_* variables are also unset for ramdisk entries in the image tree. This allows for U-Boot to decide dynamically where to load the ramdisk. (From OE-Core rev: 941b6ce3b297ed83f1c05dd76bfeefbf93482e6f) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVar callsJoshua Lock2016-12-161-7/+7
| | | | | | | | | | | | | getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: Add x86 supportGeorge McCollister2016-08-101-30/+82
| | | | | | | | | | | | | | | | For x86, bzImage must be built instead of zImage. Include setup.bin (which is required to boot the kernel) in the fitimage and always use a load/boot address of 0x00090000. For details see: http://git.denx.de/?p=u-boot.git;a=blob;f=doc/uImage.FIT/x86-fit-boot.txt (From OE-Core rev: 1a65d11d4b8f056fdf22c31a92d1e58dec6d89f6) Signed-off-by: George McCollister <george.mccollister@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: add initramfs supportGeorge McCollister2016-08-101-96/+189
| | | | | | | | | | | | | | | | | | If INITRAMFS_IMAGE is set, build an additional fitImage containing the initramfs. Copy the additional fitImage and the source (*.its) file, used to create it to DEPLOYDIR. The fitImage containing the initramfs must be built before do_deploy and after do_install to avoid circular dependencies. UBOOT_RD_LOADADDRESS - Specifies the load address used by u-boot for the initramfs. UBOOT_RD_ENTRYPOINT - Specifies the entry point used by u-boot for the initramfs. (From OE-Core rev: b406a89935f148779569fa3770776e009dd51f13) Signed-off-by: George McCollister <george.mccollister@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage.bbclass: do_assemble_fitimage(): cd to $BAndrew Bradford2016-08-101-0/+1
| | | | | | | | | | | | | | | | | | | | Prior to assembling the fitimage, ensure that $B is the cwd due to bitbake commit 67a7b8b021badc17d8fdf447c250e79d291e75f7 "build: don't use $B as the default cwd for functions". Without this change, do_assemble_fitimage() fails like: Log data follows: | DEBUG: Executing shell function do_assemble_fitimage | arm-ka-linux-gnueabi-objcopy: 'vmlinux': No such file | WARNING: exit code 1 from a shell command. | ERROR: Function failed: do_assemble_fitimage (From OE-Core rev: 42d50e8f5f3a98e50a0f50473ebc83dc6347b634) Signed-off-by: Andrew Bradford <andrew.bradford@kodakalaris.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel: Add KERNEL_IMAGETYPES to build multi types kernel at one timeHe Zhe2016-05-301-9/+11
| | | | | | | | | | | | | 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>
* kernel: fitimage: Repair misuse of shell test commandMarek Vasut2016-05-201-1/+1
| | | | | | | | | | | | | | | | | The kernel fitImage must be amended with signature if and only if UBOOT_SIGN_ENABLE = 1 . In the current case, the UBOOT_SIGN_ENABLE could be either 0 (default) or 1 , which test -n always correctly interprets as non-empty string, thus always true. This does not match the logic above though, so replace the test with check which passes only for UBOOT_SIGN_ENABLE = 1 . (From OE-Core rev: 158cbd737f9f6c2de756506caf919a0a3d0a05b9) Signed-off-by: Marek Vasut <marex@denx.de> Cc: Yannick Gicquel <yannick.gicquel@iot.bzh> Cc: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel: fitimage: basic support for fitimage signatureYannick Gicquel2016-05-061-2/+43
| | | | | | | | | | | | | | | | | | | This is an initial support of fitImage signature to enable U-Boot verified boot. This feature is implemented by adding a signature tag to the configuration section of the generated fit-image.its file. When a UBOOT_SIGN_ENABLE variable is set to "1", the signature procedure is activated and performs a second call to mkimage to sign the fitImage file and to include the public key in the deployed U-Boot device tree blob. (This implementation depends on the use of CONFIG_OF_SEPARATE in U-Boot.) As the U-Boot device tree blob is appended in the deploy dir, a dependency on 'u-boot:do_deploy' is added when the feature is activated. (From OE-Core rev: 38d675f568ed67505896f20dd9738ce80feece08) Signed-off-by: Yannick Gicquel <yannick.gicquel@iot.bzh> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel: fitimage: support device tree compiler optionsYannick Gicquel2016-05-061-1/+7
| | | | | | | | | | | | | This introduces a new variable to set the device tree compiler options while calling mkimage ('-D' option). By default, this variable is not set but it can be defined in a configuration file, as following example: UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000" (From OE-Core rev: 9a3f541da305c75418c2eec75ade902717a01b69) Signed-off-by: Yannick Gicquel <yannick.gicquel@iot.bzh> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel: fitimage: Fix do_deploy taskhash mismatchMarek Vasut2016-04-181-0/+1
| | | | | | | | | | | | | | | | | | The kernel_do_deploy_append() uses DATETIME variable , so the taskhash of the kernel_do_deploy() function changes if fitImage is used. The buildsystem will complain accordingly: ERROR: linux-yocto-4.4.3+gitAUTOINC+bcc6509084_1a72cec834-r0 do_deploy: Taskhash mismatch 49a5899a6895dcebd311dcb59870f370 verses 37c8dd3aae44134492a876f21c1b641b for /Yocto/poky/meta/recipes-kernel/linux/linux-yocto_4.4.bb.do_deploy ERROR: Taskhash mismatch 49a5899a6895dcebd311dcb59870f370 verses 37c8dd3aae44134492a876f21c1b641b for /Yocto/poky/meta/recipes-kernel/linux/linux-yocto_4.4.bb.do_deploy Fix this by excluding the DATETIME variable from the checksum. (From OE-Core rev: 42ed25f693a4898f517c9ffc7920e5d994ac692d) Signed-off-by: Marek Vasut <marex@denx.de> Cc: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Fix do_rootfs referencesRichard Purdie2016-01-111-1/+1
| | | | | | | | | After the separation of do_rootfs, some rootfs references need changing to image_complete. (From OE-Core rev: 59a5f596ca29b1eb8283706e3c60fbb39f9c2c23) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel: Add basic fitImage supportMarek Vasut2015-05-261-0/+234
This patch adds support for generating a kernel fitImage, which is a a successor to the uImage format. Unlike uImage, which could only contain the kernel image itself, the fitImage can contain all kinds of artifacts, like the kernel image, device tree blobs, initramfs images, binary firmwares etc. Furthermore, the fitImage supports different kinds of checksums, not only CRC32 like the uImage did. Last, but not least, fitImage supports signatures such that either the whole image or it's parts can be signed and then in turn can be verified by the bootloader. So far we only add support for wrapping the kernel image and DTB into the fitImage. The fitImage uses the sha1 checksum, which is the default. (From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4) Signed-off-by: Marek Vasut <marex@denx.de> Cc: Richard Purdie <richard.purdie@linuxfoundation.org> Cc: Koen Kooi <koen@dominion.thruhere.net> Cc: Paul Eggleton <paul.eggleton@linux.intel.com> Cc: Ross Burton <ross.burton@intel.com> Cc: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>