aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/image_types.bbclass
AgeCommit message (Collapse)Author
2014-12-24image_types.bbclass: Rework code to map types for 'ext3'Otavio Salvador
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-24image_types.bbclass: Respect IMAGE_TYPEDEP dependenciesOtavio Salvador
The IMAGE_TYPEDEP dependencies also need to be taken into account when building an IMAGE_FSTYPE. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-19image_types.bbclass: Populate cpio /init as symlinkNathan Rossi
For cpio/ramfs the kernel will first attempt to execute /init and will emit the following error as the file is empty: Failed to execute /init (error -13) If /sbin/init exists symlink to it so the kernel can immediately start the correct init executable instead of an empty file. Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-11-06image_types.bbclass: whitespace and reorderPeter A. Bigot
Use a multi-line value to set IMAGE_TYPES and put all the compressed versions of a format on one line. Other than moving ext2.lzma this is just whitespace. Signed-off-by: Peter A. Bigot <pab@pabigot.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-11-04image_types.bbclass: Make ubi depend on ubifsPascal Bach
The ubi command assumes the ubifs file is present. This makes sure this is really the case. Signed-off-by: Pascal Bach <pascal.bach@siemens.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-08-15Support image type "squashfs-lzo"Mike Looijmans
Add "squashfs-lzo" to the image types. LZO compression support has been in both kernel and squashfs tools for many years, but OE never enabled it. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-03image_types: Fix ubi filesystem return codesRichard Purdie
If the first command returns an error, it will not cause the image generation step to fail. Simply split up the statement into multiple lines to avoid this issue, they no longer need to be one line expressions. [YOCTO #6391] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-26cpio rootfs build: Avoid modifying rootfs dirJonas Eriksson
The Linux kernel requires that initrd images contain a /init file for the image to be used as an initrd, even if it is empty. Adding it into the rootfs directory creates a race, that can upset tar when building both a .tar and .cpio image file ("tar: .: file changed as we read it"). Additionally, whether or not the tar file will contain the /init file is also up to the race condition. To avoid this problem, move the /init addition out from the rootfs directory, and thus only include it in the .cpio image. Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> Signed-off-by: Josep Puigdemont <josep.puigdemont@enea.com> Cc: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21image_types.bbclass: use 4096 instead of 8192 bytes-per-inodeRobert Yang
The image not correctly created if 'ptest-pkgs' is in IMAGE_FEATURES, this is because there is no free inode left. We can use 4096 instead of 8192 bytes-per-inode to fix the problem, and most of the distributions us 4096, such as Ubuntu, Suse, Fedora and CentOS. There are another problems: * There are error message when there is no free inode left if we run the mke2fs command manually, but they are not in log.do_rootfs. * The image generation doesn't stop when error happens because mke2fs doesn't return failed for this case. Will fix them in other threads. [YOCTO #5957] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07image_types.bbclass: use mke2fs -d to create the ext2/3/4 imageRobert Yang
We used populate-extfs.sh which invoked the debugfs to create the image, now the mke2fs' option "-d root-directory" can do the same thing, and which is more faster, for example, the core-imag-sato: * In the past: $ time mke2fs -t ext4 rootfs.ext4 real 0m0.249s user 0m0.036s sys 0m0.132s $ time populate-extfs.sh /path/to/rootfs/ rootfs.ext4 real 0m29.355s user 0m10.637s sys 0m5.544s * Now: $ time mkfs.ext4 -F -d /path/to/rootfs/ rootfs.ext4 real 0m6.338s user 0m3.824s sys 0m1.356s More than 25 seconds are saved. [YOCTO #4083] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-21image_types.bbclass: fix cpio IMAGE_CMD to preserve working directoryJonathan Liu
The working directory is changed in a subshell when executing cpio to preserve the working directory for any subsequent commands. This is to keep the working directory consistent when generating multiple image types. Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-20image*.bbclass, bootimg.bbclass: add image type dependenciesLaurentiu Palcu
The following dependencies were manually added in the image creation code. However, in order to have an image dependency mechanism in place, use a new variable, IMAGE_TYPEDEP, to declare that an image type depends on another being already created. The following dependencies are added by this commit: elf -> cpio.gz live -> ext3 vmdk -> ext3 iso -> ext3 hddimg -> ext3 This commit adds also another new variable: IMAGE_TYPES_MASKED. Currently, masking out certain types from IMAGE_FSTYPES was hardcoded in the image creation code. [YOCTO #5830] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-02-20image_types: minor, inline CPIO_TOUCH_INIT()Matthieu Crapet
Since generic compression solution has been introduced (see revision b7e4ed41ee480f00b7265341e9e2d2c2b9135143), CPIO_TOUCH_INIT() is only called by IMAGE_CMD_cpio. Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-02-18image_types.bbclass: Fix tar IMAGE_CMD to not change directoriesKhem Raj
below commit commit 9d9bca8785911e8ae06d507bbfb99d6a811f072e Author: Jonathan Liu <net147@gmail.com> Date: Mon Feb 17 21:46:28 2014 +1100 lib/oe/image.py: fix working directory The working directory needs to be changed before the image creation commands instead of afterwards. exposed an issue when generating tar images, where it would cd into rootfs and then create the rootfs tarball and remain there since the cmd to cd into deploy dir moved up the immediate following cmd like tar.bz2 or tar.gz were still looking for tarball in current directory which esentially was not deploy dir but IMAGE_ROOTFS instead Signed-off-by: Khem Raj <raj.khem@gmail.com>
2014-02-14image_types: sum.jffs2 is replaced by jffs2.sumDmitry Eremin-Solenikov
Previous commit added support for sum 'compression' (rather postprocessing) of jffs2 images. Drop support for sum.jffs2 image type. Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-14image_types bbclass: use compression framework for jffs2 sum imagesDmitry Eremin-Solenikov
I got hit by a missing dependency in generation of sum.jffs2 images - at runtime, when images are generated using bitbake pool, it is possible for sum.jffs2 image to be scheduled for generation before jffs2 image is fully generated. Insted of adding additional hacks, reimplement sum.jffs2 generation as a compression scheme on top of plain jffs2 images. For now support for sum.jffs2 images is left in, it will be removed by the subsequent commit. Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11Activate the new python rootfs/image creation routinesLaurentiu Palcu
This commit will: * remove old bash code common to all backends; * create a new do_rootfs() python function that will use the new rootfs/image creation routines; * allow creation of dpkg based images; * fail for rpm/opkg (not implemented yet); Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2014-01-14image_types bbclass: add support for tar.lz4 and cpio.lz4Koen Kooi
Signed-off-by: Koen Kooi <koen.kooi@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-20image_types: newer btrfs.mkfs needs an empty file to build the disk inSaul Wold
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-11-04image_types: Improve dependency handling between types (and use for sum.jffs2)Richard Purdie
We're seeing a pattern of one image type needing to depend on another type. A good example is jffs2 and sum.jffs2. This patch makes sum.jffs2 depend on jffs2 which will then allow a EXTRA_IMGAGECMD to be set for sum.jffs2 individually without changing the jffs2 command. This allows the -pad option to be configured differently. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-26image_types.bbclass: fix endiannes for sumtool (jffs2 summary)Andrea Adami
For mkfs.jffs2 endianness can be be expressed in the long or short form with the optional size argument: --little-endian -l Strangely the sumtool has a different syntax and does accept the forms: --littleendian -l Prefer the short form valid for both tools. Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-10-26image_types.bbclass: do not force --no-cleanmarkers for jffs2Andrea Adami
Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-10-14image types: split live into iso and hddimgValentin Popa
Changes to split live into iso and hddimg without adding a new image type class. This patch has only a visible effect on HOB and solves part 2 of #3197 [YOCTO #3197] Signed-off-by: Valentin Popa <valentin.popa@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-30image_types.bbclass: use mkfs.cramfs instead of makecramfsAndrea Adami
The former is provided by util-linux and the latter is now to be removed for meta-filesystems. This allows to generate cramfs images whithout extra layers. Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26image_types.bbclass: replace genext2fs with populate-extfs.shRobert Yang
* The benefits: - Really support ext4 - Support the sparse file (we lost the sparse file in the image in the past, the sparse file became into the common file) - Fix the error reported by fsck: (ext2/ext3) Inode 1025, i_size is 16384, should be 17408. - Have a uniform code for ext2/3/4 generation * Comments from Darren Hart: Basically, genext2fs doesn't support creating ext4 filesystems. It creates, as I understand it, an ext2 filesystem, then adds a journal, and sets some bits. It can't support the newer features like extents. So what we end up with is a bit of a hack for a filesystem. The ext tools (e2fsprogs) unfortunately don't provide an integrated solution for generating prepopulated filesystem images as many other mkfs* tools do. One thing missing was symlink support in libext2fs. I added that support and demonstrated a script which uses the e2fsprogs debugfs tool that can populate the newly formatted filesystem from a directory and without root privileges. [YOCTO #3848] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-06-27image_types.bbclass: set 'filetype' ext4 featureEnrico Scholz
Generating filesystems with this flag allows more efficient directory traversals because getdents() returns the filetype in 'd_type' which allows to avoid an extra lstat() call. Creating ext4 filesystems with 'mkfs.ext4' sets this flag by default too. Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-06-07image_types.bbclass: add ubifs to IMAGE_TYPESAndrea Adami
* the IMAGE_TYPES variable is used exclusively by hob * IMAGE_CMD_ubifs is already present in the class * ubifs images can be flashed on existing ubi volumes with 'ubiupdatevol' Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-05-21image_types.bbclass: remove the old imagesRobert Yang
Remove the old image before the new one generated to save disk space when RM_OLD_IMAGE is set to 1, this is an easy way to keep the DEPLOY_DIR_IMAGE clean. [YOCTO #4391] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-03image_types: fix default location of kernel when generating elf imagesTomas Frydrych
Generation of elf images fails because kernel images are no longer staged under ${STAGING_DIR_HOST}/kernel, but rather ${STAGING_DIR_HOST}/usr/src/kernel. This patch fixes the path to point to the correct location. Signed-off-by: Tomas Frydrych <tomas@sleepfive.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-29image_types.bbclass: Replace squashfs-lzma with squashfs-xzMarc Ferland
Booting an image generated with squashfs-lzma results in a kernel error: "Filesystem uses "lzma" compression. This is not supported". Currently (well at least in Linux 3.8) the officially supported decompressors are: * LZO * XZ * ZLIB This change makes sure we use a supported compression algorithm for squashed root filesystems. Signed-off-by: Marc Ferland <ferlandm@sonatest.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-18image_types.bbclass: only create links if the target existsAndreas Oberritter
When creating images containing many partitions, rootfs.$type may not be available. Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-16image_types.bbclass: Add and update comments regarding image types.Robert P. J. Day
Explain the elf/cpio.gz snippet of code, and update a comment to reflect the correct variable name. No functional change. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-19image_types: fix squashfs-lzma image creationSaul Wold
This removes the dependency on a seperate binary which we don't seem to have. So, use mksquashfs's -comp lzma to replace that functionality [YOCTO #3126] Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-14image_types.bbclass: Round up ROOTFS_SIZE after base_size checkAndrei Gherzan
If we round up ROOTFS_SIZE to IMAGE_ROOTFS_ALIGNMENT before checking if base_size is greater then IMAGE_ROOTFS_SIZE, we can end up adding an unaligned value to IMAGE_ROOTFS_SIZE. Obviously, if IMAGE_ROOTFS_EXTRA_SPACE was overwritten with an unaligned value. So let's add the round up code after the base_size calculus and it's comparison. Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-07image_types.bbclass: add variable for HobKang Kai
Add a new variable "IMAGE_EXTENSION_live" for Hob to map image type "live" with real image file extension names. This is for Hob to remove the hard-coded maps. Signed-off-by: Kang Kai <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19Convert tab indentation in python functions into four-spaceRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-16image_types.bbclass: Default XZ_COMPRESSION_LEVEL to -e -6Andrei Gherzan
Having XZ_COMPRESSION_LEVEL on -e -9 and -T 0 will make xz eat more than 6Gb memory. Reduce this to -6 to make xz to use about 471Mb on the tested machine. Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-16image_types.bbclass: Add XZ variable to set number of threads to be used ↵Andrei Gherzan
while compressing Default this variable to 0. This will make xz use as many threads as there are CPU cores on the system. Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-16image_types.bbclass: Fix COMPRESS_CMD for xz to redirect compressed data to fileAndrei Gherzan
Having -c modifier makes xz to output the compressed data to stdout. In this way the needed data will be in the do_rootfs log. Redirect data to ${IMAGE_NAME}.rootfs.${type}.xz . Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-04image_types: Add elf image typeRaymond Danks
On x86, an ELF image file may be stored as a coreboot payload. The image file is constructed, using the mkelfimage utility, from a kernel and an initrd. Signed-off-by: Raymond Danks <ray.danks@se-eng.com> Acked-by: Darren Hart <dvhart@linux.intel.com>
2012-05-09image_types.bbclass: redefine EXTRA_IMAGECMD_jffs2 to leverage siteinfoTing Liu
Signed-off-by: Ting Liu <b28495@freescale.com>
2012-03-27image_types: remove duplicate setting of -i for inode countSaul Wold
inode count is already set in the EXTRA_IMAGECMD definition Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-26image_types.bbclass: Define runnable and deployable patternDongxiao Xu
Define runnable image type and machine pattern. Define deployable image type. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-13image_types: ensure .rootfs.ext3 is created before vmdk is created.Dexuan Cui
In the case of self-hosted-image.bb, IMAGE_FSTYPES = "vmdk", so the variables alltypes and subimages don't contain ext3, and .rootfs.ext3 won't be created, and finally the generated .hddimg and .vmdk don't have an actual rootfs -- the size of the .vmdk file is only about 9MB. [YOCTO #2067] Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2012-03-08image_types: add IMAGE_ROOTFS_ALIGNMENTKen Werner
Introduce a new variable called IMAGE_ROOTFS_ALIGNMENT that allows to control the aligment of the size of the rootfs. Its default value is set to 1KiB so that the existing behaviour is not changed. In case the SD card emulation of a QEMU system emulator gets used you may set the alignment to 2MiB. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-02image_types: Ensure duplicate compressed types aren't createdRichard Purdie
This allows IMAGE_FSTYPES = "tar.bz2 tar.bz2" to work (and now is faster since it will only do it once). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-02image_types.bbclass: We need to preserve order in the types variable and ↵Richard Purdie
avoid set() Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-02image_types: Ensure dependencies for compression types containing multiple ↵Richard Purdie
dots are handled correctly This ensures dependencies for image types like ext2.gz.u-boot are handled correctly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-01image-vmdk: Create image_vmdk class and setup image and image_types to use itSaul Wold
This creates a new image_vmdk class similar to live. The image_vmdk class needs to have a hddimg created by the image-live class, so it inherits it directly. The changes to image_types is to ensure that both live and vmdk images get the ext3 tools and dependencies. Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-29image_types: Correctness fixesRichard Purdie
* Add a newline to improve the output formatting * Use set() to turn the list into a set of unique items to prevnt the same image code running twice (for e.g. IMAGE_FSTYPES = "tar.gz tar.bz2") * Support multiple compression extensions such as ".gz.u-boot" * Fix basetype/type typo and fix multiple image generation Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>