summaryrefslogtreecommitdiffstats
path: root/meta/classes/image_types.bbclass
AgeCommit message (Collapse)Author
2021-07-28image_types: Restore pre-btrfs-tools 4.14.1 mkfs.btrfs shrink behaviorMarek Vasut
Currently the mkfs.btrfs generates large images with a lot of wasted space. This happens since OE-core updated btrfs-tools from 4.13.3 to 4.15.1 in commit 94b645aa77 ("btrfs-tools: update to 4.15.1") . Note in mkfs.btrfs(8) manpage section -r says the following: " -r|--rootdir <rootdir> ... Note This option may enlarge the image or file to ensure it’s big enough to contain the files from rootdir. Since version 4.14.1 the filesystem size is not minimized. Please see option --shrink if you need that functionality. --shrink Shrink the filesystem to its minimal size, only works with --rootdir option. ... Note prior to version 4.14.1, the shrinking was done automatically. " Add the --shrink option to EXTRA_IMAGECMD_btrfs to reinstate the original behavior and un-waste the space. (From OE-Core rev: c4a99d36967302c176b62fad840b5e79486ea356) Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alexander Kanavin <alexander.kanavin@linux.intel.com> Cc: Richard Purdie <richard.purdie@linuxfoundation.org> Cc: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-11image_types: add zsync conversionsRoss Burton
Add image conversion types to create zsync[1] metadata. Use .zsync if the image is already compressed and .gzsync if zsync should compress the image itself. The required tool, zsync-curl, has been submitted to meta-oe. [1] http://zsync.moria.org.uk (From OE-Core rev: e04113f8b139754c512278555558a1b88b35bc9e) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-31Add support for erofs filesystemsRichard Weinberger
Since Linux 5.4 a new read-only filesystem is available, erofs. Compared to squashfs it offers much better read performance with and without compression enabled. It suppports two optional compressors, lz4 and lz4hc. >From the mkfs.erofs man page: EROFS is a new enhanced lightweight linux read-only filesystem with modern designs (eg. no buffer head, reduced metadata, inline xattrs/data, etc.) for scenarios which need high-performance read-only requirements, e.g. Android OS for smartphones and LIVECDs. It also provides fixed-sized output compression support, which improves storage density, keeps relatively higher compression ratios, which is more useful to achieve high performance for embedded devices with limited memory since it has unnoticable memory overhead and page cache thrashing. This commit adds support for three new filesystem targets: erofs: erofs without compression erofs-lz4: erofs with lz4 compresssion enabled erofs-lz4hc: erofs with lz4hc compression enabled (From OE-Core rev: 41dead1ff8ccc49e6cd6e6f5d41a59d164693e0d) Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-06image_types.bbclass: tar: use posix format instead of gnuMartin Jansa
* gnu isn't compatible with --xattrs used e.g. here: https://github.com/advancedtelematic/meta-updater/blob/d3a832f66e8802cb45536ff278d5c77f946d341d/classes/image_types_ostree.bbclass#L16 causing do_image_tar failing with: | tar: --xattrs can be used only on POSIX archives | Try 'tar --help' or 'tar --usage' for more information. * https://www.gnu.org/software/tar/manual/html_chapter/tar_8.html says about posix format: This is the most flexible and feature-rich format. It does not impose any restrictions on file sizes or file name lengths. This format is quite recent, so not all tar implementations are able to handle it properly. However, this format is designed in such a way that any tar implementation able to read `ustar' archives will be able to read most `posix' archives as well, with the only exception that any additional information (such as long file names etc.) will in such case be extracted as plain text files along with the files it refers to. This archive format will be the default format for future versions of GNU tar. and: The default format for GNU tar is defined at compilation time. You may check it by running tar --help, and examining the last lines of its output. Usually, GNU tar is configured to create archives in `gnu' format, however, future version will switch to `posix'. * I've compared tar on centos7 and ubuntu-18.04: bash-4.2$ cat /etc/centos-release CentOS Linux release 7.9.2009 (Core) bash-4.2$ tar --version tar (GNU tar) 1.26 ... bash-4.2$ tar --help | tail -n 5 *This* tar defaults to: --format=gnu -f- -b20 --quoting-style=escape --rmt-command=/etc/rmt --rsh-command=/usr/bin/ssh ... bitbake@e0ee76f81c2f:/$ grep VERSION /etc/os-release VERSION="18.04.5 LTS (Bionic Beaver)" VERSION_ID="18.04" VERSION_CODENAME=bionic bitbake@e0ee76f81c2f:/$ tar --version tar (GNU tar) 1.29 ... bitbake@e0ee76f81c2f:/$ tar --help | tail -n 5 ... *This* tar defaults to: --format=gnu -f- -b20 --quoting-style=escape --rmt-command=/usr/lib/tar/rmt --rsh-command=/usr/bin/rsh Both support posix format (as pax POSIX 1003.1-2001). But centos7 version is already too old anyway, because it doesn't support --sort=name used since: https://git.openembedded.org/openembedded-core/commit/?id=4fa68626bbcfd9795577e1426c27d00f4d9d1c17 and https://git.openembedded.org/openembedded-core/commit/?id=f19e43dec63a86c200e04ba14393583588550380 says that 1.28 is the minium version now and https://git.openembedded.org/openembedded-core/commit/?id=7a66434cf11b7f051699b774e4fccd6738351368 recommends to use install-buildtools for hosts with tar < 1.28 On the other side latest tumbleweed from: https://hub.docker.com/r/opensuse/tumbleweed with tar-1.33 alredy defaults to posix format: b99dbb3d86dd:/ # head -n 3 /etc/os-release NAME="openSUSE Tumbleweed" ID="opensuse-tumbleweed" b99dbb3d86dd:/ # tar --version tar (GNU tar) 1.33 ... b99dbb3d86dd:/ # tar --help | tail -n 3 *This* tar defaults to: --format=posix -f- -b20 --quoting-style=escape --rmt-command=/usr/bin/rmt --rsh-command=/usr/bin/ssh I've packaged some sample rootfs directory with both tars and the result is identical (with --format=gnu as well as --format=posix). with ubuntu: tar --sort=name --format=gnu --numeric-owner -cf rootfs.ubuntu.gnu.tar -C rootfs . tar --xattrs --xattrs-include=* --sort=name --format=posix --numeric-owner -cf rootfs.ubuntu.posix.tar -C rootfs . tumbleweed: tar --sort=name --format=gnu --numeric-owner -cf rootfs.tumbleweed.gnu.tar -C rootfs . tar --xattrs --xattrs-include=* --sort=name --format=posix --numeric-owner -cf rootfs.tumbleweed.posix.tar -C rootfs . centos7 (without --sort=name): tar --format=gnu --numeric-owner -cf rootfs.centos7.gnu.tar -C rootfs . tar --xattrs --xattrs-include=* --format=posix --numeric-owner -cf rootfs.centos7.posix.tar -C rootfs . size is identical: -rw-r--r-- 1 mjansa mjansa 2487480320 Feb 5 09:19 rootfs.ubuntu.gnu.tar -rw-r--r-- 1 mjansa mjansa 2487480320 Feb 5 10:17 rootfs.centos7.gnu.tar -rw-r--r-- 1 mjansa mjansa 2487480320 Feb 5 10:26 rootfs.tumbleweed.gnu.tar -rw-r--r-- 1 mjansa mjansa 2579875840 Feb 5 10:15 rootfs.ubuntu.posix.tar -rw-r--r-- 1 mjansa mjansa 2579875840 Feb 5 10:16 rootfs.centos7.posix.tar -rw-r--r-- 1 mjansa mjansa 2579875840 Feb 5 10:26 rootfs.tumbleweed.posix.tar but md5s aren't: 5e3880283379dd773ac054e20562fdea rootfs.centos7.gnu.tar abeaf992c780aa780a27be01365d26f5 rootfs.centos7.posix.tar 0c6ee59d87ab56583293262de110bca4 rootfs.tumbleweed.gnu.tar 1555bc7276eaba924bf82a13a010fd6d rootfs.tumbleweed.posix.tar 553d802bba351e273191bd5b2a621b66 rootfs.ubuntu.gnu.tar b6d7b43b30174686f6625ba3c7aefdc6 rootfs.ubuntu.posix.tar diffoscope shows some differences when using gnu format: $ diffoscope rootfs.tumbleweed.gnu.tar rootfs.ubuntu.gnu.tar ... -00239890: 3030 3000 3030 3737 3637 0020 4b00 0000 000.007767. K... +00239890: 3030 3000 3031 3135 3737 0020 4b00 0000 000.011577. K... ... -00239900: 0075 7374 6172 2020 0000 0000 0000 0000 .ustar ........ +00239900: 0075 7374 6172 2020 0072 6f6f 7400 0000 .ustar .root... ... -00239920: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +00239920: 0000 0000 0000 0000 0072 6f6f 7400 0000 .........root... with posix format there are also some differences shown by diffoscope: $ diffoscope rootfs.tumbleweed.posix.tar rootfs.ubuntu.posix.tar 016a4c00: 2e2f 7573 722f 6269 6e2f 5061 7848 6561 ./usr/bin/PaxHea -016a4c10: 6465 7273 2f63 6861 7474 722e 6532 6673 ders/chattr.e2fs -016a4c20: 7072 6f67 7300 0000 0000 0000 0000 0000 progs........... +016a4c10: 6465 7273 2e32 322f 6368 6174 7472 2e65 ders.22/chattr.e +016a4c20: 3266 7370 726f 6773 0000 0000 0000 0000 2fsprogs........ ... 03937000: 2e2f 7573 722f 6269 6e2f 5061 7848 6561 ./usr/bin/PaxHea -03937010: 6465 7273 2f63 6f6e 7461 696e 6572 642d ders/containerd- -03937020: 6374 7200 0000 0000 0000 0000 0000 0000 ctr............. +03937010: 6465 7273 2e32 322f 636f 6e74 6169 6e65 ders.22/containe +03937020: 7264 2d63 7472 0000 0000 0000 0000 0000 rd-ctr.......... so cannot really say which format is better for reproducible tar archives from different distros, but posix at least supports xattrs and it's the format for future. (From OE-Core rev: 3ecea58f2a3382d9f4b410d6ad7089111334cb6f) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-31image_types: Ensure tar archives are reproducibleRichard Purdie
The tar output seems to vary depending on the version of tar used and distro configuration. Be explict about the output format to avoid this and be determinstic. (From OE-Core rev: c56f3c9febc1732aa1302524c6c4da36f16bd1f7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-20meta/classes: Add supprot for WIC<>VHD/VHDX conversionSinan Kaya
(From OE-Core rev: b57b1615d965575deb0bf164b9873fe31a4d39b4) Signed-off-by: Sinan Kaya <okaya@kernel.org> Co-Developed-by: Anatol Belski <anbelski@linux.microsoft.com> Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-03image_types: sort tarball file listingsRoss Burton
Help rootfs tarballs be reproducible by sorting the file listing. (From OE-Core rev: 4fa68626bbcfd9795577e1426c27d00f4d9d1c17) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-03image_types: remove obsolete tar commentRoss Burton
We now depend on tar 1.28, so talking about older tar versions is just confusing. (From OE-Core rev: f19e43dec63a86c200e04ba14393583588550380) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17image-artifact-names: introduce new bbclass and move some variables into itMartin Jansa
* similar to kernel-artifact-names for other recipes/bbclasses which need to use some deployed artifacts * bitbake.conf: move IMAGE_BASENAME, IMAGE_VERSION_SUFFIX, IMAGE_NAME, IMAGE_LINK_NAME variables * image_types.bbclass: move IMAGE_NAME_SUFFIX variable * currently IMAGE_NAME_SUFFIX is used only by image.bbclass, image_types.bbclass and meta/recipes-core/images/build-appliance-image_15.0.0.bb but if it's needed by some recipe which isn't itself an image, then it's useful in bitbake.conf, e.g. we have a recipe for creating VirtualBox appliances which combines .wic.vmdk with .ovf file to create .zip with appliance, but for that we need the filename of .wic.vmdk which now contains IMAGE_NAME_SUFFIX https://github.com/webOS-ports/meta-webos-ports/blob/4980ce52a43ac6897657602810313af359f0b839/meta-luneos/recipes-core/images/luneos-emulator-appliance.inc#L24 * we were hardcoding .rootfs suffix where needed, but for quite long time it's configurable with IMAGE_NAME_SUFFIX since: commit 380ee36811939d947024bf78de907e3c071b834f Author: Patrick Ohly <patrick.ohly@intel.com> Date: Mon Mar 7 18:07:52 2016 +0100 image creation: allow overriding .rootfs suffix and might not match with hardcoded .rootfs, so make it easier to use IMAGE_NAME_SUFFIX where needed even without inheritting whole image_types.bbclass [YOCTO #12937] (From OE-Core rev: 456b700d51a5052a285a8477304f902c335223be) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-18image_types: declare support for wic.zstDiego
Declare images in wic.zst format as supported, as bmaptool now supports zstd: https://github.com/intel/bmap-tools/commit/1b8437d58447d3796dc11fd0f2c62bec5746e5d6 Given the very fast decompression speed of zstd over, for example, gzip, writing images with bmaptool can provide big write speed improvements when decompression speed is the limiting factor (especially with very sparse images). (From OE-Core rev: 704b01f33196cfdeaa57e2f2602ff2d52b25ab93) Signed-off-by: Diego Rondini <diego.rondini@kynetics.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-04image_types: add Zstandard conversion supportStefan Agner
Add Zstandard (or just Zstd) compression support. This allows to create Zstd compressed tarballs by using tar.zst as IMAGE_FSTYPES. (From OE-Core rev: 77e0f502020085875bbc74da66815c89f19a9351) Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-27do_image_cpio: Improve reproducibilityErnst Sjöstrand
Find lists files in the order that the filesystem has registered them, which can vary. Adding a sort should have minimal performance impact. Also use the --reproducible option to cpio. (From OE-Core rev: 930c1f69c928e21bda6bef7aad926d335195e107) Signed-off-by: Ernst Sjöstrand <ernst.sjostrand@verisure.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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. (From OE-Core rev: b253101b9400cd12b80b6c5b7d1d0b01b31a6c6b) 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. (From OE-Core rev: 7a91a9818057d69cba32db2428ffc1a1ebb3876e) 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. (From OE-Core rev: 3a73662ea72fbf0180d9a66032b6d92248ae4ddf) 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. (From OE-Core rev: 9718c2d3fbb3281274af4556b34b7bac21fc7774) 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] (From OE-Core rev: 3e5f075184d91dd99cf25cfe84bba1c946ed0c7c) 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. (From OE-Core rev: 4a558a5f2db68538e0edad798ddf48eb9510a7d6) 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" (From OE-Core rev: 28b277a93a34bba033d9d0d9f3227c9453efd384) 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. (From OE-Core rev: 9d00b146c4125b195fac5a0743fe7d8e59edef7f) 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 ] (From OE-Core rev: c3b9aedcbe538d7fa74bd814644b4899769dec46) 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". (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>
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 ] (From OE-Core rev: e1c6442872c9361b6b61a83adcce9cade2f2ecd2) 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. (From OE-Core rev: 214fa7fe3b162162d2fa8b31eec28bedd86fcc7d) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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] (From OE-Core rev: 0c62a9b272d381bd5a16cfef19ecd1a15f521473) Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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. (From OE-Core rev: 061e04cb6335a10f560e57255b7335b8c9891207) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-30meta: 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. (From OE-Core rev: c97acbd034532895ce57c6717ed1b3ccc7900b0d) 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. (From OE-Core rev: dec029686a47b574edfce4472fe2167db54398fb) 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. (From OE-Core rev: 1b2ec7a04069a0af2d4164c24109a5fa2fd0b1f6) 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. (From OE-Core rev: 2781e8d608c0fd2108aeab294f982e9249793852) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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. (From OE-Core rev: de2f2fc9e8e6d874a11e69adc2f438975a5c1359) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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] (From OE-Core rev: 3a72f6783e142d53d19b37811a854d08d32485ab) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-07image_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. (From OE-Core rev: a93c5869cb716cba5e05bbe4fc2e1c11adb9e30f) 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-09-12image_types: support lz4 compressed squashfsEnrico Scholz
(From OE-Core rev: de70799af1a8bfe2fac22b90401053275d4714ba) Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31image_types.bbclass: improve reproducibility of .gz filesJuro Bystricky
When compressing with "gzip", do not save the time stamp in the compressed file metadata. (From OE-Core rev: a88c16c2dc5dd7e2fbf7ca908a8b48da7be8b34c) 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. (From OE-Core rev: 929ba563f1bc7195c4981b8e139c432b2cc388ea) 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] (From OE-Core rev: 402b4cffbb4c58cfee93db18192f2b218ee0ae35) 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. (From OE-Core rev: 65f27122950a35a67ce39ae4cfe93d0dca6b0dab) 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] (From OE-Core rev: 13d675b0f8968bcfdf36035fd959be285e3da378) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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] (From OE-Core rev: 1f8fc803262cdcc26dabc28af70bf0fdaf2e5847) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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. (From OE-Core rev: 2b30dcdc903c1b0c18e14e39b954177628d058bd) 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>
2017-07-08image_types: fix kernel target on elf's image dependenciesLeonardo Sandoval
Kernel recipes provides 'virtual/kernel' so remove the native part. (From OE-Core rev: 50e6f23ef1e304c335d44e3e8e7a6cfa5a93fa86) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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] (From OE-Core rev: c5f33d466122e53be910fa448af60ef3937eb828) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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] (From OE-Core rev: 4a63fa70462eb5a780380b92f916cc8e295246fc) Signed-off-by: Choong YinThong <yin.thong.choong@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27image_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. (From OE-Core rev: a93d005934192402d7cceb36016b25b7d0c65547) 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-22image_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] (From OE-Core rev: 17c2b1ca8a4e2023583645840db61bbde22bf65e) 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] (From OE-Core rev: e45f074b792a43aa2fd84a5a3f0e20bf1d88ad7e) Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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". (From OE-Core rev: 8a9f249a9166347cc0468191ce130003e3d306e1) 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. (From OE-Core rev: 786368568a9525212e69f5cbf6da236f0a6be013) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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. (From OE-Core rev: 94245144f5cef344d90bc2a7b3267cdae9d192e4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>