Commit Graph

40 Commits

Author SHA1 Message Date
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