summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-fitimage.bbclass
AgeCommit message (Collapse)Author
2019-02-28kernel-fitimage: Replace tabs with spaces in pythonAlex Kiernan
Fix: WARNING: python should use 4 spaces indentation, but found tabs in kernel-fitimage.bbclass, line 33 Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-26kernel-fitimage.bbclass: Introduce a way to provide external dtbManjukumar Matha
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 Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-18kernel-fitimage.bbclass: Fix the dependency issue while generating ↵Manjukumar Matha
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 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>
2018-12-08uboot-sign.bbclass: fix signature and deploymentRobert Yang
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> 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>
2018-12-08kernel-fitimage: Replace tabs with spaces in pythonAlex Kiernan
Fix: WARNING: python should use 4 spaces indentation, but found tabs in kernel-fitimage.bbclass, line 24 Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-23u-boot: Add mkenvimage toolAlexey Brodkin
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". 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>
2018-09-22kernel-fitimage: Fix dangling symlink to image tree sourceAlex Kiernan
When deploying the its file, the target of the symlink is missing the its extension, add it here. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-08-21kernel*.bbclass: rename *_SYMLINK_NAME variables to *_LINK_NAME and ↵Martin Jansa
*_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) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-21kernel-artifact-names, kernel-fitimage: add KERNEL_FIT_BASE_NAME, ↵Martin Jansa
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 Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-05kernel-fitimage: add support for ext2.gz initramfs filesChunrong Guo
Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-07-03kernel-fitimage: Make DTB key insertion optionalAlex Kiernan
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. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-06-18kernel-fitimage: Add DTBO support for configurationsAlex Kiernan
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. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18kernel-fitimage: Allow setting of DTB/DTBO relocation addressAlex Kiernan
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. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-09kernel-fitimage.bbclass: Fix 64 bit ENTRYPOINTVineeth Chowdary Karumanchi
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. 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>
2018-01-04kernel-fitimage.bbclass: Fix bad image type replacement for microblazeManjukumar Matha
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 Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-02kernel-fitimage: Fix bad image type replacement for aarch64Thomas Perrot
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 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>
2017-09-25kernel-fitimage: support MIPS (compressed)André Draszik
On MIPS, the compressed kernel image target is vmlinuz.bin Signed-off-by: André Draszik <adraszik@tycoint.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-25kernel-fitimage: unbreak UBOOT_ENTRYSYMBOL supportAndré Draszik
- 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. Signed-off-by: André Draszik <adraszik@tycoint.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-25kernel-fitimage: sanitize dtb section name (unbreak MIPS)André Draszik
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 /) Signed-off-by: André Draszik <adraszik@tycoint.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-03-31kernel.bbclass: introduce INITRAMFS_IMAGE_NAMEMing Liu
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. 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>
2017-03-27classes: Replace "if test" file tests with POSIX file testsRobert P. J. Day
In entire meta/classes/ directory, replace shell tests of the form "if test -? ..." with POSIX tests of the form "if [ -? ... Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-21kernel-fitimage: dtb sections named by their filenames and one config ↵Florian Wickert
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. Signed-off-by: Florian Wickert <fw@javox-solutions.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-03-17classes: Fix "U-boot", use proper spelling of "U-Boot".Robert P. J. Day
U-Boot people are amazingly pedantic in their insistence on proper spelling of "U-Boot", so humour them. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-23kernel-fitimage: Use compressed ramdisks in FIT images if availableRick Altherr
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. Signed-off-by: Rick Altherr <raltherr@google.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-19kernel-fitimage.bbclass: Check value of UBOOT_SIGN_ENABLENathan Rossi
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. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-19kernel-fitimage.bbclass: Don't assume KERNEL_IMAGETYPE == fitImageNathan Rossi
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. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-19kernel-fitimage.bbclass: Allow unset load/entry addresses for ramdisksNathan Rossi
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. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16meta: remove True option to getVar callsJoshua Lock
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\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-10kernel-fitimage: Add x86 supportGeorge McCollister
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 Signed-off-by: George McCollister <george.mccollister@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-10kernel-fitimage: add initramfs supportGeorge McCollister
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. Signed-off-by: George McCollister <george.mccollister@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-10kernel-fitimage.bbclass: do_assemble_fitimage(): cd to $BAndrew Bradford
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 Signed-off-by: Andrew Bradford <andrew.bradford@kodakalaris.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-30kernel: Add KERNEL_IMAGETYPES to build multi types kernel at one timeHe Zhe
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. Signed-off-by: He Zhe <zhe.he@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-20kernel: fitimage: Repair misuse of shell test commandMarek Vasut
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 . 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>
2016-05-06kernel: fitimage: basic support for fitimage signatureYannick Gicquel
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. Signed-off-by: Yannick Gicquel <yannick.gicquel@iot.bzh> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06kernel: fitimage: support device tree compiler optionsYannick Gicquel
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" Signed-off-by: Yannick Gicquel <yannick.gicquel@iot.bzh> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-18kernel: fitimage: Fix do_deploy taskhash mismatchMarek Vasut
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. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-11classes: Fix do_rootfs referencesRichard Purdie
After the separation of do_rootfs, some rootfs references need changing to image_complete. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-26kernel: Add basic fitImage supportMarek Vasut
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. 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>