Commit Graph

105 Commits

Author SHA1 Message Date
Richard Purdie fb1654fee4 image: Fix wic environment issues
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>
2016-01-19 17:24:46 +00:00
Richard Purdie 3341f3fbee classes: Fix do_rootfs references
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>
2016-01-11 23:26:29 +00:00
Mariano Lopez b1515064b5 image_types.bbclass: Rebuild when WICVARS change
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>
2016-01-07 13:40:20 +00:00
Christopher Larson 76d2e46211 image_types: improve wks path specification
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>
2015-11-24 15:50:28 +00:00
Patrick Ohly 5f371e5a0b image types: add hdddirect
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>
2015-09-28 12:00:21 +01:00
Mike Looijmans 9241ec5793 image_types.bbclass: Don't try to create ubi symlink twice
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>
2015-09-23 09:53:10 +01:00
Mike Looijmans 62fca975cf image_types.bbclass: Restore compatibility with previous UBI filesystems
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>
2015-09-14 20:46:36 +01:00
Ed Bartosh 7770281354 image.py: write bitbake variables to .env file
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>
2015-08-30 23:26:24 +01:00
Ed Bartosh 0f84702f08 image_types.bbclass: add wic image type
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>
2015-08-30 21:38:23 +01:00
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