summaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
AgeCommit message (Collapse)Author
2017-07-30image: Convert vmdk/vdi/qcow2 to strict CONVERSION_CMD typesTom Rini
The vmdk/vdi/qcow2 IMAGE_FSTYPEs predate wic. As such, they provide some similar underlying functionality in order to produce a "disk" image that in turn can be converted into different formats that various hypervisor types work with. They do not however provide the ability for other disk image types to be converted into these same output types. Furthermore, they are less flexible than what wic does provide. This drops the old style vmdk/vdi/qcow2 types and re-introduces them under the CONVERSION_CMD framework. The equivalent of vmdk is now wic.vmdk and so forth for the other types. Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-25image: Fix "metadata is not deterministic" when chaining 2+ CONVERSION_CMDsTom Rini
When we have more than one CONVERSION_CMD being used, for example ext4.gz.sha256sum we will see errors about "metadata is not deterministic". This is because we do not have a stable order of intermediate files that will be removed in the generated shell command. We fix this by calling sorted() on the set of rm_tmp_images so that we will have a stable hash again. Cc: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-25image_types.bbclass: Make u-boot signed images more versatileTom Rini
With the introduction of chaining compression/conversion support we can convert the old image_types_uboot.bbclass code that did a hand-chaining of a set of ${filesystem}.${compression} into generic and arbitrary support to sign whatever the user wants to sign for their image. This, for the record, does remove setting a valid compression type in the record in favour of just saying none. This is not a generally useful feature in U-Boot and I believe being versatile in terms of being able to pass in arbitrary compressions is more important. Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-25image.bbclass: Correct chaining compression supportTom Rini
When chaining of compression/conversion types was added, we had a new way to handle doing things like "ext4.bz2.sha256sum" or "ext2.gz.u-boot". However, because the U-Boot image class isn't included normally, it wasn't properly converted at the time. After the support was added the "clean" argument that the .u-boot code uses no longer functions. The fix for this inadvertently broke chaining compression/conversion. First, correct the u-boot conversion code. Fixes: 46bc438374de ("image.bbclass: do exact match for rootfs type") Cc: Zhenhua Luo <zhenhua.luo@nxp.com> Cc: Richard Purdie <richard.purdie@linuxfoundation.org> Cc: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-06image.bbclass: create root symlinks in nativesdk target sysrootAmarnath Valluri
To match with the target image, the generated nativesdk's target sysroot also should have the root symlinks(/lib*, /bin/, /sbin). So, extended the 'create_merged_usr_symlinks' to reuse symlink creation part even for nativesdk using POPULATE_SDK_PRE_TARGET_COMMAND. Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-06image: create symlinks needed for merged /usrAmarnath Valluri
Prepare the symlinks required for merged /usr at the time of rootfs creation. The links created in rootfs are: /bin --> /usr/sbin /sbin --> /usr/sbin /lib --> /usr/lib /lib64 --> /usr/lib64 We cannot make these symlinks as part of 'base-files' or some other package. Because at rootfs creation, installation of the package(say kernel) that depends on these root folders/links fails, if package manager installs this package prior to base-files. These symbolic links in top level folder should be present as long as - kernel tools use /lib/{module,firmware} - shell scripts uses "#!/bin/sh" Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-28image.bbclass: use prependVarFlag for postfuncsEd Bartosh
It would be possible to achieve any order of calling functions if prefuncs are added with appendVarFlag and postfuncs with prependVarFlag. Then image_X.bbclass can add code with either pre/post-funcs or do_image_x_append or _prepend. The execution order would be: image_X prefuncs image prefuncs do_image_X_prepend from image_X.bbclass do_image_X from image.bbclass do_image_X_append from image_X.bbclass image postfuncs image_X postfuncs [YOCTO #11372] Thanks to Ola Nillsson for the idea. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-16meta: Drop further remnants of uclibc supportRichard Purdie
uclibc support was removed a while ago and musl works much better. Start to remove the various overrides and patches related to uclibc which are no longer needed. uclibc support in a layer would still be possible. I have strong reasons to believe nobody is still using uclibc since patches are missing and I doubt the metadata even parses anymore. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14image.bbclass: fix setting of vardeps flagEd Bartosh
Added leading space to vardeps to avoid flag value to be added to the existing value without a separator. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14image.bbclass: improve setup of flagsEd Bartosh
Replaced setVarFlag calls to appendVarFlag to allow modification of prefuncs, postfuncs and subimages flags in inherited image classes. [YOCTO #11372] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14image.bbclass: cleanup: add new variable "task"Ed Bartosh
Replaced repeated expression "do_image_%s" % t with a variable 'task' to simplify the code and increase readability. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-16image.bbclass: allow override of image LICENSEPascal Bach
Currently the LICENSE of every image is hard set to MIT. This allows this to be overriden in derived images. Signed-off-by: Pascal Bach <pascal.bach@siemens.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-05-16image.bbclass: Set ROOTFS_RO_UNNEEDED correctlyDavid Vincent
Use a weak assignment for ROOTFS_RO_UNNEEDED to let users define their own list overriding defaults. Signed-off-by: David Vincent <freesilicon@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-03-13run-postinsts: simplify the logic of whether to install it to imagesAlexander Kanavin
The logic is scattered all over the place, but amounts to "install, unless the rootfs is read only". Let's express that directly. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
2017-02-19image-container.bbclass: Add the "container" IMAGE_FSTYPESRandy Witt
The "container" fstype does very little other than pick tar.bz2 as the actual image type and disable installation of ROOTFS_BOOTSTRAP_INSTALL. [YOCTO #9502] Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-15image.bbclass: Use 'populate_sdk_base' for non-linux targetsNathan Rossi
When 'populate_sdk_ext' was first introduced in commit bf81d6bb7f6 it replaced the inheriting of 'populate_sdk_base'. For non-linux targets building the extensible SDK caused build errors, and the image class was changed to inherit 'populate_sdk' when targeting a non-linux SDK_OS (in commmit e471ce3464d). However inheriting 'populate_sdk' instead of 'populate_sdk_base' causes the SDK to always be built, this is not expected for the image class. This change makes the image class inherit 'populate_sdk_base' in the non-linux SDK_OS case so that it behaves the same as it is expected to behave where 'bitbake <image> -c populate_sdk' must be executed to generate the SDK deployables. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-15classes: Drop now unneeded update_data callsRichard Purdie
Now that the datastore works dynamically we don't need the update_data calls so we can just remove them. They're not actually done anything at all for a while. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-05image: rename image-wic -> image_types_wicEd Bartosh
Make name of the wic image type class consistent with existing naming scheme for image types. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-31image-wic: move wic code to image-wic.bbclassEd Bartosh
There is a lot of wic code in image.bbclass and image_types.bbclass Having all code separated in one file should make it more readable and easier to maintain. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-01-31wic: change location of .env filesEd Bartosh
Current location of .env files $STAGING_DIR/imagedata. It doesn't depend on machine and be rewritten by the builds for different machines. Changed location to $STAGING_DIR/$MACHINE/imagedata to avoid .env files to be rewritten. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-28gzip/pigz/expat/image: Simplify gzip-native/pigz-nativeRichard Purdie
With recipe specific sysroots, the gzip-replacement-native dance/class is obsolete, simplify the code accordingly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28image/kernelsrc/packagegroups/recipes: Remove uneeded noexec tasksRichard Purdie
We used to have issues removing tasks like do_fetch due to implications for targets like world and universe. These have now been resolved. Removing uneeded tasks has advantages compared to noexec since it means that accidentally left in dependencies are no longer needed/processed (e.g. do_patch depends on quilt-native). This cleans up a number of cases which local analysis highlighted as being unneeded leading to slightly cleaner task graphs. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26image/packagegroup/populate_sdk: Drop do_populate_sysroot task properlyRichard Purdie
Setting do_populate_sysroot as noexec means the code keeps thinking it can find a manifest file for it. It also complicates sstate installtion since the code would believe there is an sstate object there it should look for. Instead, delete the task. This causes sdk failures as the dependencies are wrong so fix those as well. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23image.bbclass: put .env files to ${STAGING_DIR}/imgdata/Ed Bartosh
As STAGING_DIR_TARGET started to point to a recipe specific sysroot wic is not able to add .env files when .wks file refers to multiple rootfs recipes. Used STAGING_DIR instead of STAGING_DIR_TARGET to make the directory with .env files the same for all recipes. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-01-23Switch to Recipe Specific SysrootsRichard Purdie
This patch is comparatively large and invasive. It does only do one thing, switching the system to build using recipe specific sysroots and where changes could be isolated from it, that has been done. With the current single sysroot approach, its possible for software to find things which aren't in their dependencies. This leads to a determinism problem and is a growing issue in several of the market segments where OE makes sense. The way to solve this problem for OE is to have seperate sysroots for each recipe and these will only contain the dependencies for that recipe. Its worth noting that this is not task specific sysroots and that OE's dependencies do vary enormously by task. This did result in some implementation challenges. There is nothing stopping the implementation of task specific sysroots at some later point based on this work but that as deemed a bridge too far right now. Implementation details: * Rather than installing the sysroot artefacts into a combined sysroots, they are now placed in TMPDIR/sysroot-components/PACKAGE_ARCH/PN. * WORKDIR/recipe-sysroot and WORKDIR/recipe-sysroot-native are built by hardlinking in files from the sysroot-component trees. These new directories are known as RECIPE_SYSROOT and RECIPE_SYSROOT_NATIVE. * This construction is primarily done by a new do_prepare_recipe_sysroot task which runs before do_configure and consists of a call to the extend_recipe_sysroot function. * Other tasks need things in the sysroot before/after this, e.g. do_patch needs quilt-native and do_package_write_deb needs dpkg-native. The code therefore inspects the dependencies for each task and adds extend_recipe_sysroot as a prefunc if it has populate_sysroot dependencies. * We have to do a search/replace 'fixme' operation on the files installed into the sysroot to change hardcoded paths into the correct ones. We create a fixmepath file in the component directory which lists the files which need this operation. * Some files have "postinstall" commands which need to run against them, e.g. gdk-pixbuf each time a new loader is added. These are handled by adding files in bindir with the name prefixed by "postinst-" and are run in each sysroot as its created if they're present. This did mean most sstate postinstalls have to be rewritten but there shouldn't be many of them. * Since a recipe can have multiple tasks and these tasks can run against each other at the same time we have to have a lock when we perform write operations against the sysroot. We also have to maintain manifests of what we install against a task checksum of the dependency. If the checksum changes, we remove its files and then add the new ones. * The autotools logic for filtering the view of m4 files is no longer needed (and was the model for the way extend_recipe_sysroot works). * For autotools, we used to build a combined m4 macros directory which had both the native and target m4 files. We can no longer do this so we use the target sysroot as the default and add the native sysroot as an extra backup include path. If we don't do this, we'd have to build target pkg-config before we could built anything using pkg-config for example (ditto gettext). Such dependencies would be painful so we haven't required that. * PKDDATA_DIR was moved out the sysroot and works as before using sstate to build a hybrid copy for each machine. The paths therefore changed, the behaviour did not. * The ccache class had to be reworked to function with rss. * The TCBOOTSTRAP sysroot for compiler bootstrap is no longer needed but the -initial data does have to be filtered out from the main recipe sysroots. Putting "-initial" in a normal recipe name therefore remains a bad idea. * The logic in insane needed tweaks to deal with the new path layout, as did the debug source file extraction code in package.bbclass. * The logic in sstate.bbclass had to be rewritten since it previously only performed search and replace on extracted sstate and we now need this to happen even if the compiled path was "correct". This in theory could cause a mild performance issue but since the sysroot data was the main data that needed this and we'd have to do it there regardless with rss, I've opted just to change the way the class for everything. The built output used to build the sstate output is now retained and installed rather than deleted. * The search and replace logic used in sstate objects also seemed weak/incorrect and didn't hold up against testing. This has been rewritten too. There are some assumptions made about paths, we save the 'proper' search and replace operations to fixmepath.cmd but then ignore this. What is here works but is a little hardcoded and an area for future improvement. * In order to work with eSDK we need a way to build something that looks like the old style sysroot. "bitbake build-sysroots" will construct such a sysroot based on everything in the components directory that matches the current MACHINE. It will allow transition of external tools and can built target or native variants or both. It also supports a clean task. I'd suggest not relying on this for anything other than transitional purposes though. To see XXX in that sysroot, you'd have to have built that in a previous bitbake invocation. * pseudo is run out of its components directory. This is fine as its statically linked. * The hacks for wayland to see allarch dependencies in the multilib case are no longer needed and can be dropped. * wic needed more extensive changes to work with rss and the fixes are in a separate commit series * Various oe-selftest tweaks were needed since tests did assume the location to binaries and the combined sysroot in several cases. * Most missing dependencies this work found have been sent out as separate patches as they were found but a few tweaks are still included here. * A late addition is that extend_recipe_sysroot became multilib aware and able to populate multilib sysroots. I had hoped not to have to add that complexity but the meta-environment recipe forced my hand. That implementation can probably be neater but this is on the list of things to cleanup later at this point. In summary, the impact people will likely see after this change: * Recipes may fail with missing dependencies, particularly native tools like gettext-native, glib-2.0-native and libxml2.0-native. Some hosts have these installed and will mask these errors * Any recipe/class using SSTATEPOSTINSTFUNCS will need that code rewriting into a postinst * There was a separate patch series dealing with roots postinst native dependency issues. Any postinst which expects native tools at rootfs time will need to mark that dependency with PACKAGE_WRITE_DEPS. There could well be other issues. This has been tested repeatedly against our autobuilders and oe-selftest and issues found have been fixed. We believe at least OE-Core is in good shape but that doesn't mean we've found all the issues. Also, the logging is a bit chatty at the moment. It does help if something goes wrong and goes to the task logfiles, not the console so I've intentionally left this like that for now. We can turn it down easily enough in due course. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19staging: Add dependency on virtual/binutils for strip binaryRichard Purdie
The staging code strips binaries and we need virtual/binutils for that. Add a specific dependency since the one from do_configure and others may not be enough to ensure the binaries are in our own sysroot. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16meta: remove True option to getVarFlag callsJoshua Lock
getVarFlag() now defaults to expanding by default, thus remove the True option from getVarFlag() calls with a regex search and replace. Search made with the following regex: getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.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-12-14classes/image: suppress log_check mechanism for warnings/errors logged ↵Paul Eggleton
through BitBake If you printed a warning through bb.warn() / bbwarn or an error through bb.error() / bberror, this was also being picked up by our log_check mechanism that was designed to pick up warnings and errors printed by other programs used during do_rootfs. This meant you saw not only the warning or error itself, you saw it a second time through log_check, which is a bit ugly. Use the just-added BB_TASK_LOGGER to access the logger and add a handler that we can use to find out if any warning or error we find in the logs is one we should ignore as it has already been printed. Fixes [YOCTO #8223]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-08image.bbclass: inherit image_types_uboot when neededRobert Yang
Fixed: MACHINE = "qemuarm" IMAGE_FSTYPES += "ext3.bz2.u-boot" [snip] No IMAGE_CMD defined for IMAGE_FSTYPES entry 'ext3.bz2.u-boot' - possibly invalid type name or missing support class [snip] This is because image_types_uboot is not inherited, inherit it when needed will fix the problem. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-10-15Remove RM_OLD_IMAGE, it's no longer usefulJoshua Lock
Since the move to put image deployment under sstate control in d54339d4b1a7e884de636f6325ca60409ebd95ff old images are automatically removed before a new image is deployed (the default behaviour of the sstate logic). RM_OLD_IMAGE is therefore no longer required to provide this behaviour, remove the variable and its users. Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-10-05image.bbclass: Make do_rootfs depend on PACKAGE_EXCLUDE_COMPLEMENTARYPeter Kjellerstedt
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-15image.bbclass: add IMAGE_DEVICE_TABLE to rootfs[vardeps]Andre McCurdy
IMAGE_DEVICE_TABLE and IMAGE_DEVICE_TABLES are both referenced by _create_devfs, therefore ensure that rootfs is rebuilt if changes are made to either variable. Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-14image.bbclass: also mask debugfs versions of masked imagesAndré Draszik
When IMAGE_GEN_DEBUGFS is enabled, and IMAGE_FSTYPES_DEBUGFS is left at its default (as suggested by local.conf.sample.extended), recipe parsing fails: bitbake kern-tools-native # or anything else for that matter ERROR: <poky.git>/meta/recipes-core/images/build-appliance-image_15.0.0.bb: No IMAGE_CMD defined for IMAGE_FSTYPES entry 'debugfs_vmdk' - possibly invalid type name or missing support class ERROR: Failed to parse recipe: <poky.git>/meta/recipes-core/images/build-appliance-image_15.0.0.bb Summary: There was 1 WARNING message shown. Summary: There were 2 ERROR messages shown, returning a non-zero exit code. i.e. bitbake doesn't even finish parsing... Since IMAGE_FSTYPES_DEBUGFS is based on IMAGE_FSTYPES, and since the build-appliance-image is setting IMAGE_FSTYPES to vmdk, image.bbclass/image_types.bbclass will be trying to build a debugfs_vmdk, causing the error, as this is not implemented. One solution to solving this problem could be as simple as adding a line IMAGE_FSTYPES_DEBUGFS_remove = "vmdk" to the build-appliance-image recipe, but that is very specific to the error encountered and carries the risk of the error being reintroduced in another recipe. Another solution could be to add 'debugfs_vmdk' to IMAGE_TYPES_MASKED in image-vm.bbclass, but again, this approach doesn't seem generic enough. None of the live and vm type images have an implementation for building a debugfs version, it doesn't seem to make sense to build debugfs versions of any of them anyway, and given IMAGE_TYPES_MASKED appears to be intended for those image types exclusively, it seems the right approach is to unconditionally also mask all debugfs_ flavours from IMAGE_TYPES_MASKED to achieve a generic solution. Do that so. Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-14image.bbclass: do not check size of the debugfs imageAndré Draszik
The debugfs is supposed to be used in addition to the normal image for debugging purposes, it doesn't make sense to artificially limit its maximum size. Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-14meta: cleanup d.getVar(var, 0)Robert Yang
Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-04image.bbclass: Put image_complete under sstate controlEd Bartosh
Adding image_complete task should make sstate machinery to generate manifest for deployed images and do final deployment to DEPLOY_DIR_IMAGE. Made sure IMGDEPLOYDIR doesn't contain images from past deployments to prevent them to be included into sstate manifests. Set stamp-extra-info flag for do_image_complete task. This flag is used in the name of sstate manifest. Setting it to predetermined value for image_complete should help to get correct manifest filenames when processing runQueueTask events. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-04image: Deploy images to IMGDEPLOYDIREd Bartosh
Changed deployment directory from DEPLOY_DIR_IMAGE to IMGDEPLOYDIR to make sstate machinery to do final deployment and generate manifest. Renamed variable deploy_dir to deploy_dir_image in selftest code to avoid confusion with DEPLOYDIR variable. Updated the code of rootfs.py:Rootfs class to use IMGDEPLOYDIR variable as it's now used as a new deployment destination. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-04image/populate_sdk_base: Add *DEPLOYDIR variablesEd Bartosh
This is a preparation for changing deployment directory for image and populate_sdk targets. Introduced new variables, IMGDEPLOYDIR and SDKDEPLOYDIR. Set it to current image/sdk deployment locations. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18image.bbclass: rename COMPRESS(ION) to CONVERSIONPatrick Ohly
With the enhanced functionality, the term "compression" is no longer accurate, because the mechanism also gets used for conversion operations that do not actually compress data. It is possible to remove this naming problem in a backward-compatible manner by including COMPRESSIONTYPES in CONVERSIONTYPES and checking for the old COMPRESS_CMD/DEPENDS as fallbacks. [YOCTO #9346] Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-20image: add do_image_qa task to run QA checks on the constructed imageJoshua Lock
This task runs all functions in IMAGE_QA_COMMANDS after the image construction has completed in order to validate the resulting image. Image sanity checks should either be Python functions which raise bb.build.FuncFailed on failure or shell functions with return a non-zero exit code. Python functions may instead raise an oe.utils.ImageQAFailed Exception which takes an extra argument, a description of the failure. python image_check_python_ok () { if True: raise bb.build.FuncFailed('This check always fails') else: bb.note("Nothing to see here") } image_check_shell_ok () { if true exit 1 else exit 0 fi } [YOCTO #9448] Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-07classes/image: implement progress support for do_rootfsPaul Eggleton
Use the new task progress functionality to report progress during do_rootfs. This is a little coarse and ideally we would have some progress within the installation section, but it's better than nothing. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15classes/image: don't chdir when creating symlinksRoss Burton
There's no need to chdir() when creating image symlinks, and using chdir() changes the state for future tasks. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-14image.bbclass: do exact match for rootfs typeZhenhua Luo
Do exact match for rootfs type, instead of pattern match, to avoid unexpected build error due to redundant rootfs type build. E.g. when building ext2.gz.u-boot, both .gz.u-boot and .u-boot are matched, the following build error will appear, actually .u-boot is not needed. | mkimage: Can't open .../core-image-minimal-<machine>-<yyyymmddhhmmss>.rootfs.ext2.gz: No such file or directory Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-12image/image_types.bbclass: fix fatal error during cpio debugfs creationAndré Draszik
If /init is just a symlink to /sbin/init, debugfs creation fails with the following error: ERROR: Error: The image creation script '<...>/debugfs.create_image.cpio' returned 1: touch: cannot touch '<...>/cpio_append/init': Permission denied WARNING: exit code 1 from a shell command. ERROR: Function failed: do_rootfs The reason is that IMAGE_CMD_cpio() is run twice on the same WORKDIR. The first run creates a symlink in WORKDIR/cpio_append/init to point to /sbin/init, while the 2nd run then tries to 'touch' that link, which will fail, of course since /sbin/init is not usually writable by non-root users. Fix this by providing knowledge to the IMAGE_CMD_xxx() scripts with regards to the fact that they are being executed in the context of debugfs creation. The IMAGE_CMD_cpio() can now be intelligent in the sense that it can avoid all additional symlink handling during the debugfs run. The symlinks do not need to be part of the debugfs, so we can skip that part altogether in that case. Signed-off-by: André Draszik <adraszik@tycoint.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-22image.bbclass: additional output in create_symlinksPatrick Ohly
When a symlink does not get created, it is useful for debugging to log what would have been created and why it was skipped. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-22image.bbclass: support duplicate compression typesPatrick Ohly
When a derived distro adds a certain type, say zip, to COMPRESSIONTYPES and later OE-core does the same, we end up with the type being listed twice, and that would have undesired effects (commands generated twice). So to support such loosely coupled extension, we de-duplicated the list of types first. Alternatively, such a situation could also be treated as error. But that seems unnecessary because typically commands for the same type will also do the same thing. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-11image: Fix IMAGE_FEATURES determinism issueRichard Purdie
remain_features uses a dict which means the order is not deterministic. This can lead to the task hash changing depending on the state of the memory at parse time. This is particularly noticeable under python v3. Since the dict is helpful in constructing the data, pass the data through sort() so the order is always deterministic. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-29image.bbclass: don't execute compression commands multiple timesAlexander D. Kanevskiy
In case of chained conversion methods are used via COMPRESS_CMD_* there is chance that some of steps would be executed multiple times. [YOCTO #9482] Signed-off-by: Alexander D. Kanevskiy <kad@kad.name> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-04-29image.bbclass: don't emit redundant IMAGE_CMD_xxx functionsAndre McCurdy
IMAGE_CMD_xxx commands are always inlined within do_image_xxx. When IMAGE_CMD_xxx is defined as a function (e.g. IMAGE_CMD_btrfs, IMAGE_CMD_cpio, etc), a redundant copy of the function will be emitted by default. Remove IMAGE_CMD_xxx 'func' flags to prevent that. Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>