summaryrefslogtreecommitdiffstats
path: root/meta/classes/image_types.bbclass
AgeCommit message (Collapse)Author
2019-07-27image_types.bbclass: make gzipped images rsyncableDiego Rondini
Both gzip and pigz implement the --rsyncable option, allowing small changes to images to save a lot of data when they are transferred using rsync. This patch enables --rsyncable by default. Signed-off-by: Diego Rondini <diego.rondini@kynetics.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-26image_types: Remove remnants of hdddirectDaniel Ammann
hdddirect was removed in commit 929ba563f1bc7195c4981b8e139c432b2cc388ea. Signed-off-by: Daniel Ammann <daniel.ammann@bytesatwork.ch> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-30Revert "image_types: use pigz to create .gz files"Anuj Mittal
This reverts commit a559ffab30b7b45849ace023808c1fb20811d43d. This is not needed now that pigz has been marked as a drop-in replacement. Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-16Set XZ_COMPRESSION_LEVEL to -9Adrian Bunk
It is consistent with other compressors also using their best compression. xz is currently the option that offers best compression, using settings even lower than the default is surprising and makes it harder to choose the best available compression. For anyone who cares about compression time using a different option like gzip or bzip2 is the logical choice. For decompression, better compressed is actually faster to decompress. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-12image_types.bbclass: fix a race between the ubi and ubifs FSTYPESHongxu Jia
The ubi, ubifs and multiubi FSTYPES calls `mkfs.ubifs' to create UBIFS images. In do_image_ubi, $vname is empty, the name of UBIFS image conflicts with the one in do_image_ubifs, and it's a race risk. [do_image_ubi] mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubifs ${mkubifs_args} [do_image_ubi] [do_image_ubifs] mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ubifs ${MKUBIFS_ARGS} [do_image_ubifs] In do_image_multiubi, $vname is not empty, the UBIFS image name does not conflict with others. So do not call mkfs.ubifs in do_image_ubi and depend on do_image_ubifs to create UBIFS images. The fix does not affect do_image_multiubi which still call mkfs.ubifs to create multiple UBIFS images and symlinks. [YOCTO #13272] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-28qemu: split the native version into usermode and system partsAlexander Kanavin
The rationale is to streamline the overall build. The system parts are only needed to run target images, and so can be built towards the end of the build process. At the same time, the system parts may need gtk+-native and mesa-native which add significantly to the build time. On the other hand, the usermode parts have almost no dependencies and can be built quickly. They are needed at recipes build time to run target binaries, and so are required quite early in the typical build process. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-14image_types.bbclass: Set memory usage limit and CPU threads for xzKhem Raj
when building with opkg backend and huge packages e.g. chromium/llvm all going in parallel, memory pressure causes xz to catapult with do_package_write_ipk: Failed to create package, opkg-build failed with: xz: (stdin): Cannot allocate memory since there are many tasks going on in parallel, xz adds to memory pressure and it wants it all, put an upper limit for memory xz can use We add a variable XZ_MAXRAM with 30% of RAM limit and can be customized if builders have more memory one can set it like XZ_DEFAULTS = "-M 0 -T 0" Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-12image_types: add base64 conversionSilvio Fricke
Sometimes it is useful to have a base64 representation of an image. Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-01image_types: use cpio-native to build cpio imagesRoss Burton
As per the previous commit, upstream cpio has a bug which means it crashes on append. If the image being built has already had testimage ran then cpio-native will be in the sysroot. It's also possible that some distributions are shipping this broken CVE patch too. Now that our cpio-native is fixed, until we can be sure that the host cpio isn't broken depend on cpio-native if building a cpio image. [ YOCTO #13042 ] Signed-off-by: Ross Burton <ross.burton@intel.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-10-20image_types: Fix a shell syntax error in do_image_ubiRichard Purdie
| DEBUG: Executing shell function do_image_ubi | /home/pokybuild/yocto-worker/nightly-oe-selftest/build/build-st-31289/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/temp/run.do_image_ubi.7928: 123: [: missing ] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-13image_types: use pigz to create .gz filesRoss Burton
Since pigz is no longer a drop-in replacement for gzip (oe-core 1624b7b) the image creation has been using gzip instead of pigz, despite still depending on pigz-native. Fix this by invoking pigz explicitly. Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-03-20image_types.bbclass: Rename lz4_legacy to lz4Maxin B. John
LZ4 format currently used by the Linux kernel is the 'legacy' format. In order to avoid creating an image that can't be used as a compressed initial ramdisk with Linux kernel, rename lz4_legacy to lz4. [YOCTO #12461] [YOCTO #12149] Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-02-06image_types: tar with --numeric-ownerMax Krummenacher
If --numeric-owner is neither used when creating or extracting the archive containing the rootfs then tar tries to change the numeric uid/gid of the files based on user/group names of the host used to extract the archive. Create the archive with --numeric-owner to remove the burden of having to use --numeric-owner when extracting. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-29meta: don't use deprecated functions from utils.bbclassRoss Burton
These functions were moved to meta/lib/oe in 2010 and the base_* functions in utils.bbclass were intended to be a short-term compatibility layer. They're still used in a few places, so update the callers to use the new functions. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-23image_types: add support for modern f2fs flash filesystemSaul Wold
The f2fs filesystem is a newer flash filesystem that is available in meta-filesystems. This needs a minimum sized blank space to operate in correctly. The f2fs has overprovision functionality and when building smaller filesystems, you actually need more space, therefore under 500M (or so) double the amount of space needed in order to handle the overprovision functions in f2fs. Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-04image_types.bbclass: use stat to get sparse file's sizeRobert Yang
The "ls -s sparse_file"'s result is 0, use stat to replace of it. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-02image_types: Remove ELF typeSaul Wold
As warned in a proir commit, it's time to remove the elf image type, it is not long used anywhere (that I am aware of) and the mkelfimage tool has been removed from the upstream coreboot code base. Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-12-18image_types: btrfs use sparse file creationSaul Wold
This will speed up file creation and still allow the btrfs tools to create a full btrfs image. This is similar to what we do for ext234 FS types. Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-21image_types: Add debugging code to ext4 fs creationSaul Wold
We have seen a small number of issues with ROOTFS_SIZE not getting computed correctly, resulting in a failure in the mke2fs processing and populating the resulting new filesystem. This information should help us to reproduce [YOCTO #12304] Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-06image_types: Fix bmaptool support for RSSTom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via /usr/bin/env rather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed. Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-12image_types: support lz4 compressed squashfsEnrico Scholz
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-30image_types.bbclass: improve reproducibility of .gz filesJuro Bystricky
When compressing with "gzip", do not save the time stamp in the compressed file metadata. Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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-30image_types.bbclass: ignore tar exit code 1Ed Bartosh
tar exists with 1 and produces warning "file changed as we read it" if content is changed while tar archives it. Even hardlinking content causes tar to fail this way as it changes file ctime. Other tasks running in parallel with do_image_tar may need to hardlink rootfs content in order to change it, e.g. do_image_wic does this to update etc/fstab. Ignored tar exit code 1 to be able to hardlink rootfs content while do_rootfs_tar is tarring it. [RP: Removed bashism] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.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-21image_types: use initrd from pre-sstate directoryEd Bartosh
mkelfImage was failing trying to use initrd from ${DEPLOY_DIR_IMAGE}: DEBUG: Python function extend_recipe_sysroot finished | DEBUG: Executing shell function do_image_elf | Cannot open `tmp/deploy/images/qemux86/core-image-minimal-qemux86.cpio.gz': No such file or directory As the images have only one deploy point it's not possible to reference something the images themselves are deploying. They need to reference it in the "pre-sstate" directory ${IMGDEPLOYDIR}, not the post sstate one ${DEPLOY_DIR_IMAGE}. Fixed by using ${IMGDEPLOYDIR} instead of ${DEPLOY_DIR_IMAGE} in mkelfImage command line. [YOCTO #11767] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-07-17image_types: fix squashfs-lzo and squashfs-xz buildsEd Bartosh
Dependencies required for squashfs-lzo and squashfs-xz image builds were assigned to do_image_squashfs-lzo and do_image_squashfs-xz. As these tasks don't exist the dependencies were not installed and builds were failing. Correct task names for these image types are: do_image_squashfs_lzo and do_image_squashfs_xz because '-' and '.' are replaced by '_' in all do_image* task names. [YOCTO #11760] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-07-17image_types: remove Hob convenience variableJoshua Lock
IMAGE_EXTENSION_live is no longer used. It was used by Hob to map the live image type, but Hob is no longer part of the Bitbake codebase. Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-07-08image_types: fix kernel target on elf's image dependenciesLeonardo Sandoval
Kernel recipes provides 'virtual/kernel' so remove the native part. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-28image_types.bbclass: get rid of IMAGE_DEPENDSEd Bartosh
The IMAGE_DEPENDS_<type> variables can be set to add dependencies for individual image types. Those dependencies are added to the do_rootfs task, while they really should be added to the specific image type tasks. These variables are not documented anywhere. Replaced usage of IMAGE_DEPENDS_<type> with explicitly added dependencies to do_image_<type> tasks. [YOCTO #11302] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-28image_types.bbclass: Prompt error message on missing setting in UBI and UBIFSChoong YinThong
Prompt error message to guide user add argument MKUBIFS_ARGS and UBINIZE_ARGS on every UBI and UBIFS image creation. [YOCTO #11589] Signed-off-by: Choong YinThong <yin.thong.choong@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-03-26image_types: perform fsck on created ext imageEnrico Jorns
When performing a file system check, the image created with mkfs will trigger Pass 3A ('Optimizing directories') which turns the file system into state "changed" (EXT2_FLAG_CHANGED). This will let fsck request a reboot by setting the return code flag "2". The result of this is that each ext-image built with oe-core will trigger a reboot during the first time an fsck is triggered. A common case where this might occur is when fsck detects having a future superblock write time. This always happens when booting a newly created ext4 rootfs with a target that does not have a recent time set. This patch moves the initial fsck run that performs the optimization from the target to the host system and thus prevents the target from performing an avoidable reboot. Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Ulrich Ölmann <uol@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-21image_types: increase filesystem size for BTRFSEd Bartosh
16777216 bytes is a minimal possible filesystem size for BTRFS. mkfs.btrfs fails to create a filesystem if rootfs size is too small. Increased filesystem size to make it possible for mkfs.btrfs to create an image for small rootfs directories, e.g. for core-image-minimal. [YOCTO #11163] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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-07image_types.bbclass: fix image dependency chain collectionAndre McCurdy
If image type "foo" depends on image type "bar.xz", then dependencies should be collected from the base image type (ie "IMAGE_DEPENDS_bar") not from "IMAGE_DEPENDS_bar.xz". Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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-31image_types: use correct output directoryEd Bartosh
Wic put result images into <output dir>/build, which was confusing. Now it's fixed in wic code and images are put into output directory. Changed code in image_types to reflect this. [YOCTO #10783] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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_types.bbclass: rebuild .wks file when .wks.in changesPatrick Ohly
WKS_FILE(S) can refer to .wks.in files which get expanded during the build by do_write_wks_template. The actual content of the .wks.in file gets added to the recipe meta data during parsing, and thus we need to ensure that the recipe gets re-parsed when the file changes. This fixes two related problems: - editing the .wks.in file and rebuilding an image did not recreate the image unless something else changed or "bitbake -c clean" was used explicitly - when forcing a rebuild, the cached meta data and the actual one do not match, leading to "ERROR: Taskhash mismatch ... for ....bb.do_write_wks_template" Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> 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-23image_types: add RECIPE_SYSROOT_NATIVE to WICVARSEd Bartosh
Added RECIPE_SYSROOT_NATIVE to the WICVARS for wic to be able to access it when run from bitbake. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-01-23image_types.bbclass: build wic-toolsEd Bartosh
Added dependency do_image_wic -> wic-tools:do_build to ensure that all required tools are ready to use by wic. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-01-16image_types.bbclass: IMAGE_TYPEDEP_ now adds deps for conversion typesRandy Witt
Previously if IMAGE_TYPEDEP_* contained a conversion type of the form, "foo.bar", the dependency on CONVERSION_DEPENDS_bar would not get added to the task depends for do_rootfs. [YOCTO #10883] Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-16image_types.bbclass: look for wks files in <layer>/wicEd Bartosh
Added <layer>/wic directory to the list of paths to look for wks files. This makes wic behaviour consistent when invoked manually and by bitbake. Signed-off-by: Ed Bartosh <ed.bartosh@linux.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-10-28image_types: Add support for lzo compressed initial ramdiskVesa Jääskeläinen
Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-10-28image_types: Add support to compress initramfs with lz4Vesa Jääskeläinen
Changed to use lz4 as lz4c seems to be deprecated. Removed use of redirection in favor of using output file. As Linux kernel supports only legacy format for initial ramdisk add COMPRESS_CMD_lz4_legacy mode in case some users are using newer format. Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-10-25image_types: Use softer setting of WKS_FILESaul Wold
This will allow for more flexibility and overrides in BSP layers. Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>