Commit Graph

146 Commits

Author SHA1 Message Date
Alex Franco 0cd5d6dcbb Empty image: filesystem allocation
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>
2015-08-29 13:38:06 +01:00
Patrick Ohly 3aaea35bb5 image_types.bbclass: allow replacing tar command
Usually, the host's tar command is sufficient. However, special cases
like archiving xattrs depend on a modern GNU tar version. The new
IMAGE_CMD_TAR makes that possible, with xattrs given as example.

(From OE-Core rev: d8db122114f4d0600b662f79b3673108b4b6c0b7)

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>
2015-08-19 18:05:33 +01:00
Juro Bystricky 407d156245 IMAGES_FSTYPES: default to EXT4
The following IMAGES_FSTYPES defaulted to ext3:
"vmdk", "vdi", "qcow2", "live", "iso", "hddimg"

This patch changes the default for those IMAGES_FSTYPES to
ext4 in order to bring the images more in line with other BSPs.

Besides improvements in performance and reliability ext4 provides
additional functionality as well (option to turn off the journaling,
dynamic resizing of VDI volumes etc.).

(From OE-Core rev: 2b56d671d2f0ef22786c97e29e1215eb80c94490)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-16 22:40:51 +01:00
Christian Ziethén 2963cc25af image: Support for qcow2
Add support for qcow2 image format. Implemented in the same way as
the previously existing vmdk and vdi solutions.

(From OE-Core rev: c1f9ed400e4b5fe5be4fac86021dea11a7546035)

Signed-off-by: Christian Ziethén <christian.ziethen@linaro.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-25 14:41:43 +01:00
Pushpal Sidhu 9238984340 image_types.bbclass: add support for multiple ubi sizes
Add new FSTYPE called 'multiubi'. This new type has the ability to
create multple ubi's, something that's extremely useful on boards that
can include varying flash sizes (e.g. 256MB vs 2GB).

Because we don't want to reuse code, I extracted the mkfs and ubinize
commands out to a new function that will handle the creation of both
multiple ubi's, as well as the 'ubi' FSTYPE (so as not to break current
boards).

Due to the single processes nature of the OE when doing it's
'create_image', this new multiubi_mkfs function also creates it's own
symlinks as well as cleans up it's own cfg file.

(From OE-Core rev: 1255476161f409a0999650c2c8bdaf36b1ba4b95)

Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-08 00:01:23 +01:00
Andre McCurdy a62cb8a77d image_types.bbclass: use pbzip2 for images requiring bz2 compression
(From OE-Core rev: b269fbe6585df97d02211dc5711e88833365e572)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:53 +01:00
Juro Bystricky a13c51e751 image: Support for VDI
Added support for VirtualBox VDI format. The support was
implemented by merging with the already existing VMDK support
for VM player by creating a new class image-vm.bbclass.
This class replaces the previous VMDK only image-vmdk.class.

(From OE-Core rev: 0a3e8eb9f592c3f1edd2c7521855f7406541651a)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:13 +01:00
Richard Purdie 764fbeaafe image_types: Add missing ext4 support
This is particularly problematic since qemu images switched to ext4 by
default and now cannot work properly with UIs like hob.

This patch adds in ext4 to the appropriate IMAGE* variables fixing this.

[YOCTO #7426]

(From OE-Core rev: e6aab245623b6ba1ca5f06632d1028c863cef737)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-31 22:39:20 +01:00
Saul Wold bd0ed7ce67 image_types: Fix MIN_BTRFS_SIZE to be 1024 blocks to match ROOTFS_SIZE
[YOCTO #7392]

(From OE-Core rev: b75e23568d72aea3c508492c129c361bedd98eb4)

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>
2015-03-10 10:47:47 +00:00
Saul Wold 842a33219e image_types: Error out if BTRFS image is too small
[YOCTO #6804]

(From OE-Core rev: 14a1c035ba654aff1ec09d884f0b0acf7b83ab79)

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>
2015-02-14 08:41:00 +00:00
Saul Wold 47a55255fe btrfs: create an empty file to build the fs in
The newer btrfs-utils needs an empty file to build the filesystem in, so
create an empty file and use it for the mkfs to build the fs in.

[YOCTO #6804]

(From OE-Core rev: 224c24d8a8ea6230ed56ea61cdb86e78c5ec4311)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-02 12:40:37 +00:00
Enrico Scholz 43dc6b5974 image_types.bbclass: manage 'cpio_append' directory
For cpio images, do_rootfs() can operate on a dirty '${WORKDIR}/cpio_append'
directory which contains e.g. files from previous builds.  This can cause
unwanted files in the image or can break the build.

E.g. when there is a cpio_append/init -> /sbin/init symlink symlink, the
'ln -sf' can fail due to SELinux restrictions:

| $ ls -la cpio_append/init
| lrwxrwxrwx. 1 ensc ensc 10 22. Jan 16:26 cpio_append/init -> /sbin/init
|
| $ strace ln -sf /sbin/init cpio_append/init
| ...
| stat("cpio_append/init", 0x7fffbb9ca310) = -1 EACCES (Permission denied)
| exit_group(1)                           = ?

Patch cleans up 'cpio_append' before executing the 'do_rootfs' task by
adding it to 'cleandirs'.  An alternative implementation (which avoids
creation of this empty dir for non-cpio images) might remove it within
IMAGE_CMD_cpio, but this might break builds where people rely on the
existence of this directory (e.g. to add local files).

(From OE-Core rev: 4db3cc2360289c062fa0df4678f2f2ef990f0c1a)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-29 15:36:48 +00:00
Enrico Scholz e598bd52ef image_types.bbclass: fixed 'init' creation for cpio images
When /init is a dangling symlink or a symlink to a file which can not be
stated on the build system (e.g. due to SELinux restrictions), the '[ !
-e .../init ]' test will succeed which causes the manual creation of
/init.

E.g. here:

| $ ls -la cpio_append/init
| lrwxrwxrwx. 1 ensc ensc 10 22. Jan 16:26 cpio_append/init -> /sbin/init
|
| $ strace /bin/test -e  cpio_append/init
| stat("cpio_append/init", 0x7fff374a9db0) = -1 EACCES (Permission denied)
| exit_group(1)                           = ?

To test for the existence of a file, both '-L' and '-e' checks must be
executed and to prevent SELinux noise, the '-L' should happen before
'-e'.

(From OE-Core rev: 2aa5d2880ee3578f4965f245addd365fb7b1c1ca)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-29 15:36:48 +00:00
Otavio Salvador 7856fb3f0c image_types.bbclass: Rework code to map types for 'ext3'
(From OE-Core rev: df00cb53f0548d34e5865b6fff314bff641af6e7)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-25 08:18:12 +00:00
Otavio Salvador fc74b5d007 image_types.bbclass: Respect IMAGE_TYPEDEP dependencies
The IMAGE_TYPEDEP dependencies also need to be taken into account when
building an IMAGE_FSTYPE.

(From OE-Core rev: 055fddd601536109e0574e84dc6570c322f22d44)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-25 08:18:12 +00:00
Nathan Rossi 31952101f3 image_types.bbclass: Populate cpio /init as symlink
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.

(From OE-Core rev: 3505558e067fdde4ab7aaaf3c50886f292d7c166)

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-19 18:07:59 +00:00
Peter A. Bigot 5fa2ce0773 image_types.bbclass: whitespace and reorder
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.

(From OE-Core rev: dd93b3a950d063f4e3020362c636006f51fb5782)

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-06 16:45:22 +00:00
Pascal Bach d6fd3030f9 image_types.bbclass: Make ubi depend on ubifs
The ubi command assumes the ubifs file is present.
This makes sure this is really the case.

(From OE-Core rev: 0a947408f32d7ab10d2004e7d9332296b82191a3)

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-04 10:27:11 +00:00
Mike Looijmans c23b321b44 Support image type "squashfs-lzo"
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.

(From OE-Core rev: ab659b1c1e13fd6863893abff86990d88aa36790)

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:51 +01:00
Richard Purdie f9ac0cb9b6 image_types: Fix ubi filesystem return codes
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]

(From OE-Core rev: f8125a1e9b6893a12355d55d4df584a8d97f0bff)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-03 16:49:20 +01:00
Jonas Eriksson cdf0d9715e cpio rootfs build: Avoid modifying rootfs dir
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.

(From OE-Core rev: 706055503f493a5af73240c0983c46dbe31d8fe9)

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-27 09:42:05 +00:00
Robert Yang 38d669f488 image_types.bbclass: use 4096 instead of 8192 bytes-per-inode
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]

(From OE-Core rev: 09ab3a00598d06e3a1bf871811c2ac37359c74da)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21 12:05:53 +00:00
Robert Yang 5809ce0c89 image_types.bbclass: use mke2fs -d to create the ext2/3/4 image
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]

(From OE-Core rev: 6338fe9ba338615317a4e7ccc99287b236ac77ae)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07 14:45:23 +00:00
Jonathan Liu 8d7dd9ae47 image_types.bbclass: fix cpio IMAGE_CMD to preserve working directory
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.

(From OE-Core rev: 5ff6cb920f8be9068a23f7bf0cb1b9a9ff1eda5b)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-21 16:14:42 +00:00
Laurentiu Palcu f866b2e4b7 image*.bbclass, bootimg.bbclass: add image type dependencies
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]

(From OE-Core rev: 5e2796aa28e02ae3a076c6593c6533753720b13d)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-20 14:28:10 +00:00
Matthieu Crapet bc124dab9e image_types: minor, inline CPIO_TOUCH_INIT()
Since generic compression solution has been introduced
(see revision b7e4ed41ee480f00b7265341e9e2d2c2b9135143),
CPIO_TOUCH_INIT() is only called by IMAGE_CMD_cpio.

(From OE-Core rev: e856e04e6134ce98e89027864f69b2ab48d40dcc)

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-20 14:28:10 +00:00
Khem Raj 54562006c1 image_types.bbclass: Fix tar IMAGE_CMD to not change directories
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

(From OE-Core rev: 9a98b8bfe13b94d89a9e39cca821f26fdeaeffc3)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-18 08:38:52 +00:00
Dmitry Eremin-Solenikov 0db0bb61bf image_types: sum.jffs2 is replaced by jffs2.sum
Previous commit added support for sum 'compression' (rather
postprocessing) of jffs2 images. Drop support for sum.jffs2 image type.

(From OE-Core rev: 295c6c1452c8789a8b1d0090ff09a5cd7cf16507)

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-14 12:30:20 +00:00
Dmitry Eremin-Solenikov aed1f0cbac image_types bbclass: use compression framework for jffs2 sum images
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.

(From OE-Core rev: 2a15a364fdf85b0b18ba63fdb2a745a52b96478e)

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-14 12:30:20 +00:00
Laurentiu Palcu 7fc9bdaeed Activate the new python rootfs/image creation routines
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);

(From OE-Core rev: a83144bac8d67704ff66f5dc0fc56f5b63979694)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:38 +00:00
Koen Kooi 47d9fa8e3f image_types bbclass: add support for tar.lz4 and cpio.lz4
(From OE-Core rev: 0a541a0497902ee9993449b47da853b6c6a306d9)

Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-14 17:03:53 +00:00
Saul Wold a50da2ddb4 image_types: newer btrfs.mkfs needs an empty file to build the disk in
(From OE-Core rev: 836396a3450e7bf151956e87bd92f70c5050c995)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-20 14:03:29 +00:00
Richard Purdie 4d7639edd3 image_types: Improve dependency handling between types (and use for sum.jffs2)
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.

(From OE-Core rev: 4a05f4f03b7d710e9e19a97f5d2c35d101e2c648)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04 09:36:21 +00:00
Andrea Adami bc2040d6b1 image_types.bbclass: fix endiannes for sumtool (jffs2 summary)
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.

(From OE-Core rev: be566b6f77423f7f676bc6b0511966651d687871)

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-26 15:59:16 +01:00
Andrea Adami 1c3c8115e2 image_types.bbclass: do not force --no-cleanmarkers for jffs2
(From OE-Core rev: b3249f238d669f5f2422207f9c4414b64e24eb73)

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-26 15:59:15 +01:00
Valentin Popa f11cb8dd28 image types: split live into iso and hddimg
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]

(From OE-Core rev: f05ae5f57d9d1bd839fae0e3f353d4e0e303a183)

Signed-off-by: Valentin Popa <valentin.popa@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14 16:55:27 +01:00
Andrea Adami 7be46d903b image_types.bbclass: use mkfs.cramfs instead of makecramfs
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.

(From OE-Core rev: 451546a9d2f675ac331f72f4e66317685d931aba)

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-30 16:23:46 +01:00
Robert Yang 6a78e22aae image_types.bbclass: replace genext2fs with populate-extfs.sh
* 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]

(From OE-Core rev: 40c3e18f43b2f074cec97d21aeb8d21f26dd5048)

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-08-26 11:50:49 +01:00
Enrico Scholz 0450c31ca4 image_types.bbclass: set 'filetype' ext4 feature
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.

(From OE-Core rev: 75e077025397f3bde84e60a9da2c0564ade09b39)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-28 09:14:06 +01:00
Andrea Adami 1b22849f81 image_types.bbclass: add ubifs to IMAGE_TYPES
* 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'

(From OE-Core rev: 0dc5a90b2d95ad21025769b0300390a4ff0052ac)

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07 16:48:28 +01:00
Robert Yang 0948a237dd image_types.bbclass: remove the old images
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]

(From OE-Core rev: b3e2e405c53d63bc71872d41f455507be833e7eb)

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-21 00:18:42 +01:00
Tomas Frydrych bd35213554 image_types: fix default location of kernel when generating elf images
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.

(From OE-Core rev: 6e57a3231fb29f869d476b8511d6f4393f82651b)

Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-03 16:19:20 +01:00
Marc Ferland 8eb1fd4aa0 image_types.bbclass: Replace squashfs-lzma with squashfs-xz
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.

(From OE-Core rev: d915e2e084257830c43f7f21af3aec24b7e1a211)

Signed-off-by: Marc Ferland <ferlandm@sonatest.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-29 10:40:55 +00:00
Andreas Oberritter a3409b909d image_types.bbclass: only create links if the target exists
When creating images containing many partitions, rootfs.$type
may not be available.

(From OE-Core rev: cf8e9d8942fdddaac21fca46137120da959c814c)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-18 21:26:39 +00:00
Robert P. J. Day 46420331ef image_types.bbclass: Add and update comments regarding image types.
Explain the elf/cpio.gz snippet of code, and update a comment to
reflect the correct variable name.  No functional change.

(From OE-Core rev: 0ca4a3a25e4495bf6e2e3932c019bd15856faf55)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-16 11:57:33 +00:00
Saul Wold 8ebed883d4 image_types: fix squashfs-lzma image creation
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]

(From OE-Core rev: 8e82713724dfcb40f2ae24a166ec94f50f8b4cd0)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-19 18:16:16 +01:00
Andrei Gherzan 30db39829b image_types.bbclass: Round up ROOTFS_SIZE after base_size check
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.

(From OE-Core rev: 726c1617077da6b49606ac1a2cae64d2d02e6214)

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-14 09:50:26 +01:00
Kang Kai 15abf2571c image_types.bbclass: add variable for Hob
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.

(From OE-Core rev: fe0973df7c72b1acec7feae03a4e13c1f49c8b1f)

Signed-off-by: Kang Kai <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-07 12:10:40 +01:00
Richard Purdie bfd279de32 Convert tab indentation in python functions into four-space
(From OE-Core rev: 604d46c686d06d62d5a07b9c7f4fa170f99307d8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 10:24:50 +01:00
Andrei Gherzan e21c59e020 image_types.bbclass: Default XZ_COMPRESSION_LEVEL to -e -6
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.

(From OE-Core rev: cfd201ecda95d00bc5d70aa5045c649b98ffe8b8)

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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-17 10:53:56 +01:00
Andrei Gherzan 89dc64c287 image_types.bbclass: Add XZ variable to set number of threads to be used while compressing
Default this variable to 0. This will make xz use as many threads as there are CPU
cores on the system.

(From OE-Core rev: 81c8e8a81e90ce95042e9fff8bac6fa011c416d1)

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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-17 10:53:56 +01:00
Andrei Gherzan 5a281ea940 image_types.bbclass: Fix COMPRESS_CMD for xz to redirect compressed data to file
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 .

(From OE-Core rev: 7ceea61636d6a6f886002e3c29941da3356157ac)

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-17 10:53:56 +01:00
Raymond Danks c9b01af84b image_types: Add elf image type
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.

(From OE-Core rev: 93e9de4e27919f59b6783d53f314df6e49ccb436)

Signed-off-by: Raymond Danks <ray.danks@se-eng.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-04 17:40:35 +01:00
Ting Liu c77298120c image_types.bbclass: redefine EXTRA_IMAGECMD_jffs2 to leverage siteinfo
(From OE-Core rev: 7c803cea58737ea0abc62cd21c3813d955f07224)

Signed-off-by: Ting Liu <b28495@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-09 21:42:52 +01:00
Saul Wold 401129c5fc image_types: remove duplicate setting of -i for inode count
inode count is already set in the EXTRA_IMAGECMD definition

(From OE-Core rev: db5a1785615f72a707c139a539c1cfa6c5bd0d23)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-27 13:26:37 +01:00
Dongxiao Xu 5b86fb09c5 image_types.bbclass: Define runnable and deployable pattern
Define runnable image type and machine pattern.
Define deployable image type.

(From OE-Core rev: 602a0aede00ec961ffb008619cc8f6ee4ae51f58)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-26 12:13:05 +01:00
Dexuan Cui fd6696a6f5 image_types: ensure .rootfs.ext3 is created before vmdk is created.
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]

(From OE-Core rev: 39f14c66d5df226689238810b759f502644deb5c)

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-13 11:45:11 +00:00
Ken Werner cddd52a442 image_types: add IMAGE_ROOTFS_ALIGNMENT
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.

(From OE-Core rev: 99128c209e3de3e9e175eacb3acf0f06857043fe)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-08 11:55:34 -08:00
Richard Purdie 98bb8f76dd image_types: Ensure duplicate compressed types aren't created
This allows IMAGE_FSTYPES = "tar.bz2 tar.bz2" to work (and now
is faster since it will only do it once).

(From OE-Core rev: b24d4bcde21b013e48eaffea5f3a70d8b1df1047)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-02 16:22:49 +00:00
Richard Purdie 1f033532a9 image_types.bbclass: We need to preserve order in the types variable and avoid set()
(From OE-Core rev: c547169f7dfe043affc2ddc5ae0a9091379df6de)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-02 16:22:48 +00:00
Richard Purdie 78ae63423f image_types: Ensure dependencies for compression types containing multiple dots are handled correctly
This ensures dependencies for image types like ext2.gz.u-boot are handled correctly.

(From OE-Core rev: d94cb18f7f17a492c7a948337d7d2d1d0785573f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-02 12:31:30 +00:00
Saul Wold 0e56519b33 image-vmdk: Create image_vmdk class and setup image and image_types to use it
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.

(From OE-Core rev: aa961e112b07d42c272e01f2d69f3c139e9ae70f)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-01 15:51:40 +00:00
Richard Purdie 40b81c778b image_types: Correctness fixes
* 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

(From OE-Core rev: eacedb4f2afa98dbd2f5ea7a9f52e6ea952a72d2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-29 18:25:03 +00:00
Otavio Salvador 7fee190f67 image_types.bbclass: fix bzip2 and xz compression commands
We need to use -f (force) or the command fails in the image file
already exists.

(From OE-Core rev: 419ddab8266ecfd6da1841d38a451a9fc5be49b0)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-29 12:56:45 +00:00
Otavio Salvador c97ebae788 image_types.bbclass: properly support IMAGE_LINK_NAME as empty
[RP: Remove unneeded len()]
(From OE-Core rev: 45a094372ea9e68888efee45d8e21cf2b7fa2df6)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-29 12:56:44 +00:00
Richard Purdie 126f634207 image_types: Refactor compression code into a generic compression solution
The current approach of adding each different compressed image type doesn't
scale. This patch changes the code so compressed images for each form are
automatically available using the form <type>.<compression type> in
IMAGE_FSTYPES. This doesn't change any existing externally visible behaviour
and the image generation process becomes more efficient as a result too.

(From OE-Core rev: b7e4ed41ee480f00b7265341e9e2d2c2b9135143)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-28 12:27:53 +00:00
Saul Wold 1792a02606 image_types: add vmdk type to use with VMware
(From OE-Core rev: c18e6d444929c32a714b3e46f21567867e48814c)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-23 23:59:39 +00:00
Andrea Adami 84e24f0f00 image_types.bbclass: refactor cpio images generation.
* Add common check for the presence of an /init
* symlink, being 'touch' would fail with it
* and 'touch -h' is not yet generally supported
* (depends on distro on build host).

(From OE-Core rev: ab282056148f3152f96b6990e09270ae5405da9d)

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-01 15:07:41 +00:00
Matthew McClintock 2eb5811da7 image_types.bbclass: Fix generating uncompressed ext2 images
(From OE-Core rev: d0687295456bcf240be657e6b5b508f718ca9ebd)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-17 14:53:21 +00:00
Saul Wold 4de7aafbed image_types: Fix rootfs size calcuation
The ROOTFS_SIZE calculation was not correctly taking into account
the IMAGE_ROOTFS_EXTRA_SPACE variable, it would only be applied if
the size as determined by the ((du * overhead) + extra space) was
greater than the IMAGE_ROOTFS_SIZE, so if the du * overhead was smaller

(From OE-Core rev: 73db21a65fbdaf0886a01bcd98ee66e73a7465b8)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-05 11:24:45 +00:00
Darren Hart db36190b7b image_types: Ensure /init exists for cpio rootfs archives
In order for the kernel to accept an initramfs as a rootfs,
it must have /init - even if it is an empty file. Touch /init
to ensure it exists for cpio and cpio.gz image types.

When used with initrd and rootfs=/dev/ram0, this allows the
cpio and cpio.gz images to be used as the rootfs.

(From OE-Core rev: 849b9aadae41d9b6777787213556bc538858b49a)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-03 12:14:29 +00:00
Nitin A Kamble e9799410b3 image-types: add btrfs as a supported fstype
(From OE-Core rev: 1e270a1854214dff1bde29753a357b9df9e66ad6)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-22 13:13:46 +00:00
Andrea Adami f6d6498269 image_types.bbclass: disable cleanmarkers for jffs2 images
* Add '-n' to suppress cleanmarker nodes since jffs2
* is usually used for NAND flash and the cleanmarkers are created in
* the OOB area by flash_eraseall -j
*
* From man pages: -n, --no-cleanmarkers
* Do not write cleanmarker nodes to the beginning of each erase block.
* This option can be useful for creating JFFS2 images for use on NAND flash,
* and for creating images which are to be used on a variety of hardware with differing eraseblock sizes.

(From OE-Core rev: 70a276509f0f006fcc269296afc3dcc88d2825e1)

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-08 15:24:26 +00:00
Andrea Adami 5e6261decb image_types.bbclass: implement jffs2 summary images (sum.jffs2)
* Building the jffs2 filesystem to include summary information speeds up
* the mount process considerably at the cost of increased size.
* The rate of speedup is generally higher on NAND chips and on the chips
* where the erase block size is large.

(From OE-Core rev: 2cb6a0d7aaa1ba712a899ee77a4c720da4e50214)

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-08 15:24:26 +00:00
Matthew McClintock 3fa155912a image_types.bbclass: add xz-native to deps for lzma ext2.lzma images
(From OE-Core rev: 0d637e33985437fbc826fdf13460ede5050db255)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-30 15:15:09 +00:00
Richard Purdie c8dee9b92d Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:

sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`

(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:19 +00:00
Koen Kooi 03748f351c image_types bbclass: use 4k bytes per inode so we don't run out of space immediately
genext2fs only creates the minimum number of inodes, after this patch it will scale with the rootfs size

(From OE-Core rev: c31cb0bdc5a61d2d9f21a2cea34c3d8ac3b47cb9)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-07 14:05:39 +00:00
Lauri Hintsala bce6dde682 poky: fix broken ubifs link in deploy folder
Fix broken rootfs image link when ubifs is used.

Function runimagecmd is using image name "${IMAGE_NAME}.rootfs.${type}".
Let's use the same name in IMAGE_CMD_ubifs.

(From OE-Core rev: 766f6165471691f651584ebda004e1abb4ea9eb6)

Signed-off-by: Lauri Hintsala <lauri.hintsala@bluegiga.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-20 17:13:34 +01:00
Matthew McClintock 8836afca8a Add support for generating ext2.lzma{, .u-boot} images
Machines can now add ext2.lzma and ext2.lzma.u-boot images as a
generated image type.

(From OE-Core rev: 927b2ce72c026e5e41bdd5690c48ebbc8b19e45e)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-29 16:54:38 +01:00
Matthew McClintock 8240072c70 Add support for generating ext2.bz2{, .u-boot} images
Machines can now add ext2.bz2 and ext2.bz2.u-boot images as a
generated image type. This also adds an extra parameter to
oe_mkimage which is the image compression type for mkimage

(From OE-Core rev: 4502a83ce67ac778112c25a1f4fa097c47e895b1)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-29 16:54:38 +01:00
Denis Carikli 4376a81af1 image_types: Fix ubi images creation
Without that commit ubinize.cfg lack a volume name value,
  and the related ubinize.cfg line looks like that:
    vol_name=
  which result in a broken ubi image,which after beeing flashed produce
  the following error:
    UBI error: vtbl_check: volume table check failed: record 0, error 11
  wich result in a kernel panic because the rootfs can't be mounted.

[RP: Moved from bitbake.conf to the .bbclass file]
(From OE-Core rev: 534dcaba0517ebfb6e48b6b436960a74e642a556)

Signed-off-by: Denis Carikli <denis@eukrea.com>
Acked-by: Anders Darander <anders@chargestorm.se>
Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-06 16:37:01 +01:00
Dmitry Eremin-Solenikov 654112e76c image_types.bbclass: use per-image dirs for extX.gz images generation
Currently image_types.bbclass uses deploy/images/${MACHINE}tpm.gz dir for
temporary files when generating extX.gz images. This can lead to races
and strange errors during image generation. To overcome this use
deploy/images/${MACHINE}tpm.gz-${PN} dir for temporary files.

(From OE-Core rev: 3016f8f13e86034cc1c5686fc01a3bf39eb33d79)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-05 20:25:46 +01:00
Chris Larson d15df2e6f7 image_types: add ext4 types from OE
(From OE-Core rev: c407d31a42786230062f21c8cf8dc8700dbc6f54)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-30 22:12:56 +01:00
Saul Wold ba8a726b7d classes/image*: Revamp creation of live images
This creates a live image as an IMAGE_FSTYPES, thus removing the
need to have additional -live.bb recipes.  To create a live image
one just needs to add live to the IMAGE_FSTYPES list

(From OE-Core rev: b3ff63796cd6629975ff0a726ba18cc168e0a2b2)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27 12:02:46 +01:00
Joshua Lock f7233d7612 classes/image_types: IMAGE_TYPES was missing some entries
Some of these entries are required by the GUI to enable the expected workflow
of the ADT, namely a compressed rootfs image.

(From OE-Core rev: dad2169cfb331b7af5c6d380347ea279a59bd716)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-26 15:52:48 +01:00
Joshua Lock 8a3692deaf classes/image_types: add a variable to list available IMAGE_FSTYPE's
This is for use in the Hob GUI to enable the user to change the type of the
generated image.

(From OE-Core rev: 12600138721262ce02e9dd243bcf44e52e065179)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-13 12:29:19 +01:00
Andrea Adami 9534a96a63 image_types.bbclass: add support for tar.xz, cpio.xz, cpio.lzma
* Once we add support for building kernel containing initramfs images
* we expect compressed cpio archives.
* Thus, add support for lzma and xz compressors for the initramfs images.
* While there, add support for tar.xz as done in org.openembedded.dev.
*
* Patch was imported from the OpenEmbedded git server
* (git://git.openembedded.org/openembedded)
*
* 'bitbake.conf: add cpio and ext4 .xz support'
* commit 7977d3325a09e2edf4a8a1b02f48085f88f7a631
* (From OE-Core rev: 38334acdc60432baf4f89f95663d64fab240131b)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
*
* 'bitbake.conf: Define tar.xz image types.'
* 1fca8dc50a821f4589fa5e339e6e279dd3c0dafe
* Signed-off-by: Tom Rini <tom_rini@mentor.com>
*
* 'bitbake.conf: add XZ_INTEGRITY_CHECK and LZMA_COMPRESSION_LEVEL variables'
* commit 312b42bcf2cc9b11266ba497ade68e8ddabb3007
* Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
*
* 'bitbake.conf: unbreak and improve lzma image compression handling and adapt
* linux-kexecboot.inc'
* commit c382a9ce64bf4291572665652138aa01b2e54306
* Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
* Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-12 15:08:20 +01:00
Nitin A Kamble 55c381316d image_types.bbclass: enable btrfs as one of the image type
(From OE-Core rev: d9b139122569bff742417984af8f790588d4e110)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-30 20:56:36 +01:00
Nitin A Kamble 65c68925b5 image-types.bbclass: get the image size in the whole number
Avoid fractions like 80.72 and round them to whole numbers.

(From OE-Core rev: 70b80215a08b2f1a3a813ac9a3948e39a1b26dd4)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-30 20:56:35 +01:00
Richard Purdie 92e165c4bc image_types.bbclass: Since we apply the override, look for the standard name variable, not the override name
(From OE-Core rev: a763fb1576f044dab8257a86bf37c879324dfa53)

Signed-off-by: Richard  Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-09 22:45:00 +01:00
Saul Wold a3d6defd63 image_types: add IMAGE_ROOTFS_EXTRA_SPACE
[YOCTO #886]

This address 2 needs after the IMAGE_ROOTFS_SIZE is cleaned up, by
removing the _ext2/3 overrides it allows for a cleaner override
using IMAGE_ROOTFS_SIZE to create a large rootfs, or by setting the
IMAGE_ROOTFS_EXTRA_SPACE, will allow for extra space allocated in Kilobytes
above the base size (determined by du of the rootfs * IMAGE_OVERHEAD_FACTOR,
default of 1.3).

(From OE-Core rev: 367934ada7c081ba3fc95f02dc14c7d6f97bfccb)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-25 15:50:57 +01:00
Saul Wold 470c0fee68 IMAGE_ROOTFS_SIZE Cleanup
This basic cleanup removes the _ext2/3 overrides from places they
no longer belong since they did not allow further overrides. In doing
this the core-image-minimal* recipes can now set a reasonably small
rootfs so that it's a realistic size for minimal.

The new default for minimal is 8M and will be adujsted upward by the
IMAGE_OVERHEAD_FACTOR (default of 1.3).

This also fixes the ROOTFS_SIZE usage in the IMAGE_CMD_<fstype> code

(From OE-Core rev: d3f6e1e6106ab539e73c19037915b2e4a5f2efa9)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-25 15:50:57 +01:00
Saul Wold 7aabd71d0a yaffs2: Remove yaffs2 from oe-core
Move to meta-extras
Also remove yaffs2 from image_types.bbclass

(From OE-Core rev: 6a97657ae834945ae26e5933d29bd94d0f7fea67)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-18 14:32:43 +01:00
Gary Thomas a67707bf49 Allow JFFS2 image options to be overridden
(From OE-Core rev: e37a7bdc0db2dd679509be7d9b53feca2688984d)

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-12 10:12:20 -07:00
Richard Purdie fd42d1ca77 image_types.bbclass: Drop IMAGE_EXTRA_OPTION in favour of the more standard EXTRA_IMAGECMD
(From OE-Core rev: 3c534247e08700eb18b27886d80e874006ee0cb8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-25 16:34:24 +00:00
Richard Purdie ed41be01dc bitbake.conf/image.bbclass: Move image type information into image_types.bbclass
Image generation code in .conf files is hard to read as it needs to be
single line. By moving this to a separate class, multiline functions
can be used instead improving readability. It also declutters
bitbake.conf.

There is no real functional change with this patch but it highlights
the need for improvements in places such as the IMAGE_EXTRA_OPTION
ext* specific variable which makes no sense.

(From OE-Core rev: a5c403f0fc71f38c0669691da7f637303ea09a27)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-25 16:34:23 +00:00