summaryrefslogtreecommitdiffstats
path: root/meta/classes/image_types.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* image_types: perform fsck on created ext imageEnrico Jorns2017-03-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* image_types: increase filesystem size for BTRFSEd Bartosh2017-03-221-5/+6
| | | | | | | | | | | | | | | | 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>
* image-container.bbclass: Add the "container" IMAGE_FSTYPESRandy Witt2017-02-191-0/+1
| | | | | | | | | | | | | 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>
* image_types.bbclass: fix image dependency chain collectionAndre McCurdy2017-02-071-1/+1
| | | | | | | | | | | 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>
* image-wic: move wic code to image-wic.bbclassEd Bartosh2017-01-311-95/+0
| | | | | | | | | | | 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>
* wic: change location of .env filesEd Bartosh2017-01-311-1/+1
| | | | | | | | | | | | | | | 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>
* image_types: use correct output directoryEd Bartosh2017-01-311-1/+1
| | | | | | | | | | | | | 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] (From OE-Core rev: 3983507bf859f6c3c29e9dea06ffe51f42c0759c) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* gzip/pigz/expat/image: Simplify gzip-native/pigz-nativeRichard Purdie2017-01-281-1/+1
| | | | | | | | | With recipe specific sysroots, the gzip-replacement-native dance/class is obsolete, simplify the code accordingly. (From OE-Core rev: 39865fdf3698a130f792d41853f9c9ca1901e335) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: rebuild .wks file when .wks.in changesPatrick Ohly2017-01-281-0/+4
| | | | | | | | | | | | | | | | | | | 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" (From OE-Core rev: d00b95b18237b276c221b16dfc511a6da150ef06) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: put .env files to ${STAGING_DIR}/imgdata/Ed Bartosh2017-01-231-1/+1
| | | | | | | | | | | | | | 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. (From OE-Core rev: 3797cfd7473d3f9b7c0d999dcf9cd9608c8c7c6c) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: add RECIPE_SYSROOT_NATIVE to WICVARSEd Bartosh2017-01-231-1/+1
| | | | | | | | | | Added RECIPE_SYSROOT_NATIVE to the WICVARS for wic to be able to access it when run from bitbake. (From OE-Core rev: 3443ff47374c7e20ea54e838609b991f3f72810e) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: build wic-toolsEd Bartosh2017-01-231-0/+1
| | | | | | | | | | Added dependency do_image_wic -> wic-tools:do_build to ensure that all required tools are ready to use by wic. (From OE-Core rev: 9f547605d2bec282c5679fb35cd5b28a37c5a0d5) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: IMAGE_TYPEDEP_ now adds deps for conversion typesRandy Witt2017-01-161-3/+11
| | | | | | | | | | | | | | 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] (From OE-Core rev: 037d39898e0e16c6d5b24a8d3844abfb328d3c14) 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>
* image_types.bbclass: look for wks files in <layer>/wicEd Bartosh2017-01-161-1/+1
| | | | | | | | | | | | 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. (From OE-Core rev: d345985db69dc86e9a8f8e2506b250d8780374cb) 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>
* meta: remove True option to getVar callsJoshua Lock2016-12-161-12/+12
| | | | | | | | | | | | | getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: Add support for lzo compressed initial ramdiskVesa Jääskeläinen2016-10-281-1/+3
| | | | | | | | (From OE-Core rev: 881347f6169890c63eab30017b9d63a67600439e) Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: Add support to compress initramfs with lz4Vesa Jääskeläinen2016-10-281-1/+2
| | | | | | | | | | | | | | | 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. (From OE-Core rev: 0ce5ccc7ec81a1e875c025fa0b384afdbe77fa45) Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: Use softer setting of WKS_FILESaul Wold2016-10-251-1/+1
| | | | | | | | | | | This will allow for more flexibility and overrides in BSP layers. (From OE-Core rev: 1886ab2f1dc1e3b5758a85604998e8deb9198f5e) 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>
* image_types.bbclass: add dependency do_image_wic -> do_bootimgEd Bartosh2016-10-151-0/+5
| | | | | | | | | | | | | | | | | | To produce certain types of images wic uses do_bootimg results to assemble final image. For example, it copies BOOT/EFI directory produced by do_bootimg to boot partition for every EFI image. The tricky part of this is that do_bootimg task is not always run, so we can't always make do_image_wic depend on do_bootimg. We only need to do it if do_bootimg present in task graph. Thank to Cristopher Larson for this fix. (From OE-Core rev: 1a961b4becf677c9eb07c5b24a8ddb75044663d1) 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>
* image_types.bbclass: remove redundant dependencyEd Bartosh2016-09-281-1/+0
| | | | | | | | | | | | | Removed parted-native dependency from do_image_wic as it's already mentioned in IMAGE_DEPENDS_wic variable. Thanks to Christopher Larson for pointing out to this. (From OE-Core rev: 82353471ccaae59967df7f14de0b4065cbc8169a) 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>
* image_types: add parted-native to do_image_wic dependsEd Bartosh2016-09-201-0/+1
| | | | | | | | | | | | As parted is always used by wic it makes sense to make do_image_wic dependent on parted-native:do_populate_sysroot. This should help to avoid adding it to all wic image recipes. (From OE-Core rev: c687c9fcc010947f52e1cd153ea74ae5f6343ca4) 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>
* image: Deploy images to IMGDEPLOYDIREd Bartosh2016-09-041-22/+22
| | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 6d969bacc718e21a5246d4da9bf9639dcae29b02) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: check COMPRESS_DEPENDS for backwards compatibilityMikko Ylinen2016-09-031-0/+1
| | | | | | | | | | | | To complete the transition/renaming to chained image type CONVERSION while maintaining bacwards compatibility to COMPRESS(ION), make sure also COMPRESS_DEPENDS is checked. Without this, the dependencies for legacy COMPRESSIONTYPES do not get built. (From OE-Core rev: 12a8ee44f05e21d5814e31cb9e13c9eab236b836) Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: use COMPRESSIONTYPES variable for backward compatibilityEd Bartosh2016-08-251-1/+7
| | | | | | | | | | | Recent renaming of COMPRESSIONTYPES variable can break recipes that still use it. Including value of COMPRESSIONTYPES variable into CONVERSIONTYPES should prevent this. (From OE-Core rev: 5b00d9bf5ebf2350e4a4d09b436193efba80a85c) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: rename COMPRESS(ION) to CONVERSIONPatrick Ohly2016-08-181-25/+25
| | | | | | | | | | | | | | | | | | | 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] (From OE-Core rev: 9d68c024790850cab72ead1e3372a5fcec4ef7b0) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: support template .wks.in files for wicChristopher Larson2016-07-201-0/+46
| | | | | | | | | | | | | | | | | | | | | These files are treated as the contents of a bitbake variable, so usual bitbake variable references are supported. I considered using another templating mechanism, for example the one used by yocto-layer, but then we'd end up largely mapping metadata variables to template fields anyway, which is a pointless indirection. Let bitbake expand the variables directly instead. This feature lets us, for example, reference ${APPEND} in --append, and avoid hardcoding the serial console tty in the wks file, and let the user's changes to APPEND affect wic the way they do the other image construction mechanisms. The template is read in and set in a variable at parse time, so changes to the variables referenced by the template will result in rebuilding the image. (From OE-Core rev: 51cb21fe5f050874d52f5b05a8a1de79ea4ebf2f) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: add intermediate var for WKS_FILE_CHECKSUMChristopher Larson2016-07-201-1/+2
| | | | | | | | | | This is a bit nicer to work with, and easier to override. (From OE-Core rev: 44f1d3cc613563b8d5be61a2648d0cd336fea728) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image/image_types.bbclass: fix fatal error during cpio debugfs creationAndré Draszik2016-06-121-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 659ae1d7df28115429f6f31450fad6d1f86e3031) Signed-off-by: André Draszik <adraszik@tycoint.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image types: add bmap generation optionAlexander D. Kanevskiy2016-05-141-1/+3
| | | | | | | | | | | | | | bmap image conversion type allows to create block map files for sparse images. Bmap file can be used together with bmap-tools for efficiently flash images to raw devices (hdd or usb drive) [YOCTO #9414] (From OE-Core rev: d3495d7b5ac90439691bafc5717a3bf1cf014737) Signed-off-by: Alexander D. Kanevskiy <kad@kad.name> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: add support for zip compressionPatrick Ohly2016-05-141-1/+5
| | | | | | | | | | | | Support for the other compression format is not always readily available on all OSes. Using zip instead of, say, xz is less efficient, but perhaps more user-friendly for users on such OSes. (From OE-Core rev: 27764738aa928959ca564e7299cf205c08684661) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: adjust default level of XZ compressionAlexander D. Kanevskiy2016-05-141-1/+1
| | | | | | | | | | | | XZ extreme compression method usually uses a lot more CPU time with not that often big saving on space. Same goes with -6 level of compression. Compression level -3 usually the best balance for time/size, especially on big images. (From OE-Core rev: e9dbf85828e9d4e16c6a96de8931cb15bbcd78bb) Signed-off-by: Alexander D. Kanevskiy <kad@kad.name> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: fix image/compression dependency collectionRoss Burton2016-05-111-20/+16
| | | | | | | | | | As compressions can be chained (i.e. cpio.bz2.md5sum) we need to walk the fstype list to collect the dependencies from each step. (From OE-Core rev: 05c59ed987cdddc00e9e217032a69197e40a8448) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: add WIC_CREATE_EXTRA_ARGSChristopher Larson2016-05-111-1/+3
| | | | | | | | | | This'll be of use to pass things like --bmap. (From OE-Core rev: 90b2738fb07e329cb6b867fb37a929d562f27d15) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: Ensure rootfs dependencies cover DEBUGFSRichard Purdie2016-04-191-1/+3
| | | | | | | | | If you configure a bz2 debugfs, pbzip2-native currently isn't built. This patch makes sure the dependencies are added. (From OE-Core rev: dd304a6fdc034d780e01e0055319e4a04aaad9d4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image-vm.bbclass/image_types.bbclass: IMAGE_NAME -> IMAGE_LINK_NAMERobert Yang2016-04-091-1/+1
| | | | | | | | | | | | If we create hdddirect in the first time, and run bitbake to create vmimg in the second time, then the previouse created ${IMAGE_LINK_NAME}.hdddirect may can not be found since it contains the data string which are different. Use IMAGE_LINK_NAME to fix the problem. (From OE-Core rev: 4aa8f67867a05bdf4a5ba90c8235740910662847) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: fix elfRobert Yang2016-04-091-1/+2
| | | | | | | | | | | | | | Fixed: | DEBUG: Executing shell function do_image_elf | Cannot open `/path/to/tmp/sysroots/qemux86-64/usr/src/kernel/bzImage': (null) | WARNING: exit code 1 from a shell command. The bzImage is in DEPLOY_DIR_IMAGE (From OE-Core rev: 24536aa578e483fc2a8594628befa4c78a05681c) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: set nodesize for btrfsRobert Yang2016-04-091-1/+1
| | | | | | | | | | | | | | The default value is 16K which is too big to create image for core-image-minimal: rootfs.btrfs is too small to make a usable filesystem Minimum size for each btrfs device is 41943040. Use 4K as ext2/3/4 to fix the problem. (From OE-Core rev: a3e4dc0d800fbae3674b1657c872f70589fc893e) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: use compress framework to produce checksums for imagesAlexander D. Kanevskiy2016-04-061-1/+7
| | | | | | | | | | | | | | | | | | | | Existing compress framework for producing various compressed versions of images is powerfull enough to be extended for other uses, e.g. to convert types of images. It is possible to use it also to produce image checksums at the time of image generation. This commit adds support for all supported at the moment coreutils hashing algorithms: md5, sha1, sha224, sha256, sha384 and sha512 Usage: IMAGE_FSTYPES_append = " hddimg.sha256sum" (From OE-Core rev: 1fbd27122ac4403b8688bc41d128602564a05506) Signed-off-by: Alexander D. Kanevskiy <kad@kad.name> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image creation: allow overriding .rootfs suffixPatrick Ohly2016-03-071-29/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | By default, the image file name contains ".rootfs" to distinguish the image file from other files created during image building. However, for certain image types (for example, .hddimg) the ".rootfs" suffix is redundant because the type suffix alone already uniquely identifies the main image file (core-image-minimal-intel-corei7-64.hddimg instead of core-image-minimal-intel-corei7-64.rootfs.hddimg). With this change, distros that prefer the shorter image name can override the .rootfs suffix unconditionally with IMAGE_NAME_SUFFIX ?= '' in their distro configuration or with some condition check like this: python () { if <whole-disk image format active>: d.setVar('IMAGE_NAME_SUFFIX', '') } The exact logic when to remove the extra suffix depends on the distro and how it enables its own image type. (From OE-Core rev: 380ee36811939d947024bf78de907e3c071b834f) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: Embed IMAGE_NAME in ubinize config fileDrew Moseley2016-02-071-9/+9
| | | | | | | | | | | | | | | | | | | | | When using the FSTYPE multiubi, make sure that each image build has a unique config file. Without this there is a race condition when building multiple images in a single bitbake command which results in errors similar to: ERROR: Error: The image creation script 'blah/tmp/work/blah/core-image-base/1.0-r0/temp/create_image.multiubi' returned 1: iniparser: cannot open ubinize_normal.cfg ubinize: error!: cannot load the input ini file "ubinize_normal.cfg" mv: cannot stat 'ubinize_normal.cfg': No such file or directory WARNING: blah/tmp/work/blah/core-image-base/1.0-r0/temp/create_image.multiubi:1 exit 1 from mv ubinize${vname}.cfg blahtmp/deploy/images/blah/ (From OE-Core rev: bc7643846f9fcef13a02f9299faa5454c843e8b1) Signed-off-by: Drew Moseley <drew_moseley@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Fix wic environment issuesRichard Purdie2016-01-191-1/+0
| | | | | | | | | | | | | | | | | | | | | The wic environment function needs to run after the rootfs size is setup. We move this code to a specific task, and depend on that task from the wic images and other places its needed. This fixes: ====================================================================== FAIL: test_image_env (oeqa.selftest.wic.Wic) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/decorators.py", line 106, in wrapped_f return func(*args, **kwargs) File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/wic.py", line 218, in test_image_env self.assertTrue(var in content, "%s is not in .env file" % var) AssertionError: False is not true : ROOTFS_SIZE is not in .env file (From OE-Core rev: 606f9e2d7d8d389c8d4f5c3090139d3bb780e09c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Fix do_rootfs referencesRichard Purdie2016-01-111-3/+3
| | | | | | | | | After the separation of do_rootfs, some rootfs references need changing to image_complete. (From OE-Core rev: 59a5f596ca29b1eb8283706e3c60fbb39f9c2c23) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: Rebuild when WICVARS changeMariano Lopez2016-01-071-1/+2
| | | | | | | | | | | | | | | | | | | | The procces to do a wic image is to save a file with variables required by wic and then call wic using this file. Because this is external to bitbake if the vars change, the image won't be rebuild; an example of such is IMAGE_BOOT_FILES. This patch adds these variables to vardeps of do_rootfs when a wic image is build. This will rebuild the image if a variable needed by wic changes. [YOCTO #8693] (From OE-Core rev: 12c54d50ed4c321dc272beb3c6cb770965c979f1) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: improve wks path specificationChristopher Larson2015-11-241-7/+29
| | | | | | | | | | | | | Hardcoding a full input path with zero flexibility goes against everything the Yocto Project is about. Rework it to let the user specify the wks base filename with WKS_FILE and it'll search the layers for the wks file and use it. (From OE-Core rev: 8cc7f5229f5447c2183ac319dd52c7ed737ec89b) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image types: add hdddirectPatrick Ohly2015-09-281-2/+3
| | | | | | | | | | | | | | | | | | When image-vm.bbclass was introduced, it indirectly also introduced a ".hdddirect" image type based on boot-directdisk.bbclass. However, one could only get that image when also enabling at least one of the virtual machine images. The .hdddirect images are useful by themselves. By registering image-vm.bbclass as implementation of it, it becomes possible to select them with: IMAGE_FSTYPES = "hdddirect" (From OE-Core rev: e3ff509091cbbfdef851f8a3c9e31c7b76d37e89) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: Don't try to create ubi symlink twiceMike Looijmans2015-09-231-10/+12
| | | | | | | | | | | | | | | | | | | | | | Fixes b6e64de541b37 "Restore compatibility with previous UBI filesystems" The multivolume UBI code creates symlinks for each volume. If the volume name is empty, it will create a symlink that the rootfs code will attempt to create again later, resulting in a crash like this (unless IMAGE_LINK_NAME is blank): ERROR: Error executing a python function in .../recipes-core/images/my-image.bb: File: '.../oe-core/meta/lib/oe/image.py', lineno: 203, function: _create_symlinks *** 0203: os.symlink(src, dst) Exception: OSError: [Errno 17] File exists To prevent this from happening, only create symlinks to volumes that have a name, and let the rootfs script create the default symlink later. (From OE-Core rev: fce257892488b9ef537526ccf412e9deda37c439) Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: Restore compatibility with previous UBI filesystemsMike Looijmans2015-09-141-2/+8
| | | | | | | | | | | | | | | | | Support for multiple ubi images has broken dozens of machine deployment scripts in two ways: Previously, ubi filesystems would be named $IMAGE_NAME as one would expect. The current version would append "_rootfs" to that name for no reason. Fix it so that the name for ubi images remains unchanged if there is only one image to build. Machines would append to IMAGE_CMD_ubi, adding extra image processing of their own. This is broken now that IMAGE_CMD_ubi became a variable instead of a function. Make IMAGE_CMD_ubi a function again, this also makes for more logical quotes (I was surprised to find that " within " would even work). (From OE-Core rev: b6e64de541b37bc5c558c4ad362a0467291a5609) Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.py: write bitbake variables to .env fileEd Bartosh2015-08-301-0/+4
| | | | | | | | | | | | | | | | Write set of bitbake variables used by wic into build/tmp/sysroots/<machine>/imagedata/<image>.env List of variables is defined in WICVARS variable in meta/classes/image_types.bbclass. This is needed for wic to be able to get bitbake variables without running 'bitbake -e'. (From OE-Core rev: 861ce6c5d4836df1a783be3b01d2de56117c9863) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: add wic image typeEd Bartosh2015-08-301-0/+12
| | | | | | | | | | | | | | | | wic image type is used to produce partitioned images. Image configuration should be stored in either <recipe>.<machine>.wks or <recipe>.wks file. .wks file should be put to the same location as image recipe and have the same name. [YOCTO #7672] (From OE-Core rev: 3658a3278a3752d4aa72cdff4aa8c9f5e1d90f93) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Empty image: filesystem allocationAlex Franco2015-08-291-1/+9
| | | | | | | | | | | | Increase sparse image block size when ROOTFS_SIZE is smaller than the minimum needed for ext4 to fit into it. [YOCTO #7664] (From OE-Core rev: 6938791ff97a23430afb4aa16d71aa8729a12ead) Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>