Commit Graph

146 Commits

Author SHA1 Message Date
Tom Rini d096d7e850 image_types.bbclass: Make u-boot signed images more versatile
With the introduction of chaining compression/conversion support we can
convert the old image_types_uboot.bbclass code that did a hand-chaining
of a set of ${filesystem}.${compression} into generic and arbitrary
support to sign whatever the user wants to sign for their image.

This, for the record, does remove setting a valid compression type in
the record in favour of just saying none.  This is not a generally
useful feature in U-Boot and I believe being versatile in terms of being
able to pass in arbitrary compressions is more important.

(From OE-Core rev: 979ff606d8c4c6f66c6dc533a92212f18708089e)

Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-05 22:39:48 +00:00
Enrico Jorns a2d1d525f0 image_types: perform fsck on created ext image
When performing a file system check, the image created with mkfs will
trigger Pass 3A ('Optimizing directories') which turns the file system
into state "changed" (EXT2_FLAG_CHANGED).

This will let fsck request a reboot by setting the return code flag "2".

The result of this is that each ext-image built with oe-core will
trigger a reboot during the first time an fsck is triggered.

A common case where this might occur is when fsck detects having
a future superblock write time. This always happens when booting a
newly created ext4 rootfs with a target that does not have a recent time
set.

This patch moves the initial fsck run that performs the optimization
from the target to the host system and thus prevents the target from
performing an avoidable reboot.

(From OE-Core rev: a93d005934192402d7cceb36016b25b7d0c65547)

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Ulrich Ölmann <uol@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27 08:15:07 +01:00
Ed Bartosh e7ce3c7f62 image_types: increase filesystem size for BTRFS
16777216 bytes is a minimal possible filesystem size for BTRFS.
mkfs.btrfs fails to create a filesystem if rootfs size is too small.

Increased filesystem size to make it possible for mkfs.btrfs
to create an image for small rootfs directories,
e.g. for core-image-minimal.

[YOCTO #11163]

(From OE-Core rev: 17c2b1ca8a4e2023583645840db61bbde22bf65e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:19 +00:00
Randy Witt 1b8f485c24 image-container.bbclass: Add the "container" IMAGE_FSTYPES
The "container" fstype does very little other than pick tar.bz2 as the
actual image type and disable installation of ROOTFS_BOOTSTRAP_INSTALL.

[YOCTO #9502]

(From OE-Core rev: e45f074b792a43aa2fd84a5a3f0e20bf1d88ad7e)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-19 06:49:00 -08:00
Andre McCurdy 1baae2a0d1 image_types.bbclass: fix image dependency chain collection
If image type "foo" depends on image type "bar.xz", then dependencies
should be collected from the base image type (ie "IMAGE_DEPENDS_bar")
not from "IMAGE_DEPENDS_bar.xz".

(From OE-Core rev: 8a9f249a9166347cc0468191ce130003e3d306e1)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:10 +00:00
Ed Bartosh 02dafba6ed image-wic: move wic code to image-wic.bbclass
There is a lot of wic code in image.bbclass and image_types.bbclass
Having all code separated in one file should make it more readable
and easier to maintain.

(From OE-Core rev: 786368568a9525212e69f5cbf6da236f0a6be013)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Ed Bartosh c01cc6ff24 wic: change location of .env files
Current location of .env files $STAGING_DIR/imagedata. It doesn't
depend on machine and be rewritten by the builds for different
machines.

Changed location to $STAGING_DIR/$MACHINE/imagedata to avoid .env
files to be rewritten.

(From OE-Core rev: 94245144f5cef344d90bc2a7b3267cdae9d192e4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Ed Bartosh 6d78ff1144 image_types: use correct output directory
Wic put result images into <output dir>/build, which was confusing.
Now it's fixed in wic code and images are put into output directory.
Changed code in image_types to reflect this.

[YOCTO #10783]

(From OE-Core rev: 3983507bf859f6c3c29e9dea06ffe51f42c0759c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Richard Purdie ab0f46400c gzip/pigz/expat/image: Simplify gzip-native/pigz-native
With recipe specific sysroots, the gzip-replacement-native dance/class
is obsolete, simplify the code accordingly.

(From OE-Core rev: 39865fdf3698a130f792d41853f9c9ca1901e335)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Patrick Ohly 46ed698f05 image_types.bbclass: rebuild .wks file when .wks.in changes
WKS_FILE(S) can refer to .wks.in files which get expanded during the
build by do_write_wks_template. The actual content of the .wks.in file
gets added to the recipe meta data during parsing, and thus we need to
ensure that the recipe gets re-parsed when the file changes.

This fixes two related problems:
- editing the .wks.in file and rebuilding an image did not recreate
  the image unless something else changed or "bitbake -c clean" was
  used explicitly
- when forcing a rebuild, the cached meta data and the actual one
  do not match, leading to "ERROR: Taskhash mismatch ... for ....bb.do_write_wks_template"

(From OE-Core rev: d00b95b18237b276c221b16dfc511a6da150ef06)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Ed Bartosh dc4a612e60 image.bbclass: put .env files to ${STAGING_DIR}/imgdata/
As STAGING_DIR_TARGET started to point to a recipe specific
sysroot wic is not able to add .env files when .wks file refers
to multiple rootfs recipes.

Used STAGING_DIR instead of STAGING_DIR_TARGET to make the
directory with .env files the same for all recipes.

(From OE-Core rev: 3797cfd7473d3f9b7c0d999dcf9cd9608c8c7c6c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:17 +00:00
Ed Bartosh d781747102 image_types: add RECIPE_SYSROOT_NATIVE to WICVARS
Added RECIPE_SYSROOT_NATIVE to the WICVARS for wic
to be able to access it when run from bitbake.

(From OE-Core rev: 3443ff47374c7e20ea54e838609b991f3f72810e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:17 +00:00
Ed Bartosh 06a4500004 image_types.bbclass: build wic-tools
Added dependency do_image_wic -> wic-tools:do_build to ensure
that all required tools are ready to use by wic.

(From OE-Core rev: 9f547605d2bec282c5679fb35cd5b28a37c5a0d5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:17 +00:00
Randy Witt b138a8bba5 image_types.bbclass: IMAGE_TYPEDEP_ now adds deps for conversion types
Previously if IMAGE_TYPEDEP_* contained a conversion type of the form,
"foo.bar", the dependency on CONVERSION_DEPENDS_bar would not get added
to the task depends for do_rootfs.

[YOCTO #10883]

(From OE-Core rev: 037d39898e0e16c6d5b24a8d3844abfb328d3c14)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-16 18:05:12 +00:00
Ed Bartosh 8f38e76861 image_types.bbclass: look for wks files in <layer>/wic
Added <layer>/wic directory to the list of paths to look
for wks files. This makes wic behaviour consistent when
invoked manually and by bitbake.

(From OE-Core rev: d345985db69dc86e9a8f8e2506b250d8780374cb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-16 18:05:11 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Vesa Jääskeläinen 28832af7bb image_types: Add support for lzo compressed initial ramdisk
(From OE-Core rev: 881347f6169890c63eab30017b9d63a67600439e)

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-28 16:15:18 +01:00
Vesa Jääskeläinen 9664e41ff9 image_types: Add support to compress initramfs with lz4
Changed to use lz4 as lz4c seems to be deprecated.

Removed use of redirection in favor of using output file.

As Linux kernel supports only legacy format for initial ramdisk add
COMPRESS_CMD_lz4_legacy mode in case some users are using newer format.

(From OE-Core rev: 0ce5ccc7ec81a1e875c025fa0b384afdbe77fa45)

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-28 16:15:18 +01:00
Saul Wold 30d1af89ce image_types: Use softer setting of WKS_FILE
This will allow for more flexibility and overrides in BSP
layers.

(From OE-Core rev: 1886ab2f1dc1e3b5758a85604998e8deb9198f5e)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-25 17:58:59 +01:00
Ed Bartosh 65eb5144f5 image_types.bbclass: add dependency do_image_wic -> do_bootimg
To produce certain types of images wic uses do_bootimg results
to assemble final image. For example, it copies BOOT/EFI directory
produced by do_bootimg to boot partition for every EFI image.

The tricky part of this is that do_bootimg task is not always run,
so we can't always make do_image_wic depend on do_bootimg. We only
need to do it if do_bootimg present in task graph.

Thank to Cristopher Larson for this fix.

(From OE-Core rev: 1a961b4becf677c9eb07c5b24a8ddb75044663d1)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-15 10:01:43 +01:00
Ed Bartosh 390140e7b9 image_types.bbclass: remove redundant dependency
Removed parted-native dependency from do_image_wic as it's
already mentioned in IMAGE_DEPENDS_wic variable.

Thanks to Christopher Larson for pointing out to this.

(From OE-Core rev: 82353471ccaae59967df7f14de0b4065cbc8169a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:04 +01:00
Ed Bartosh 69005ae65c image_types: add parted-native to do_image_wic depends
As parted is always used by wic it makes sense to make do_image_wic
dependent on parted-native:do_populate_sysroot. This should help
to avoid adding it to all wic image recipes.

(From OE-Core rev: c687c9fcc010947f52e1cd153ea74ae5f6343ca4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20 15:11:08 +01:00
Ed Bartosh 9cc4492732 image: Deploy images to IMGDEPLOYDIR
Changed deployment directory from DEPLOY_DIR_IMAGE to
IMGDEPLOYDIR to make sstate machinery to do final deployment and
generate manifest.

Renamed variable deploy_dir to deploy_dir_image in selftest code
to avoid confusion with DEPLOYDIR variable.

Updated the code of rootfs.py:Rootfs class to use IMGDEPLOYDIR variable
as it's now used as a new deployment destination.

(From OE-Core rev: 6d969bacc718e21a5246d4da9bf9639dcae29b02)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-04 00:07:28 +01:00
Mikko Ylinen 5dcb2a1999 image_types: check COMPRESS_DEPENDS for backwards compatibility
To complete the transition/renaming to chained image type CONVERSION
while maintaining bacwards compatibility to COMPRESS(ION), make sure also
COMPRESS_DEPENDS is checked. Without this, the dependencies for legacy
COMPRESSIONTYPES do not get built.

(From OE-Core rev: 12a8ee44f05e21d5814e31cb9e13c9eab236b836)

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03 09:58:37 +01:00
Ed Bartosh e1ab8392d1 image_types: use COMPRESSIONTYPES variable for backward compatibility
Recent renaming of COMPRESSIONTYPES variable can break recipes that
still use it. Including value of COMPRESSIONTYPES variable into
CONVERSIONTYPES should prevent this.

(From OE-Core rev: 5b00d9bf5ebf2350e4a4d09b436193efba80a85c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-25 22:54:49 +01:00
Patrick Ohly ff3a455ee8 image.bbclass: rename COMPRESS(ION) to CONVERSION
With the enhanced functionality, the term "compression" is no longer
accurate, because the mechanism also gets used for conversion
operations that do not actually compress data.

It is possible to remove this naming problem in a backward-compatible
manner by including COMPRESSIONTYPES in CONVERSIONTYPES and checking for
the old COMPRESS_CMD/DEPENDS as fallbacks.

[YOCTO #9346]

(From OE-Core rev: 9d68c024790850cab72ead1e3372a5fcec4ef7b0)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 09:27:53 +01:00
Christopher Larson 42e870c5ed image_types.bbclass: support template .wks.in files for wic
These files are treated as the contents of a bitbake variable, so usual
bitbake variable references are supported. I considered using another
templating mechanism, for example the one used by yocto-layer, but then we'd
end up largely mapping metadata variables to template fields anyway, which is
a pointless indirection. Let bitbake expand the variables directly instead.

This feature lets us, for example, reference ${APPEND} in --append, and avoid
hardcoding the serial console tty in the wks file, and let the user's changes
to APPEND affect wic the way they do the other image construction mechanisms.

The template is read in and set in a variable at parse time, so changes to the
variables referenced by the template will result in rebuilding the image.

(From OE-Core rev: 51cb21fe5f050874d52f5b05a8a1de79ea4ebf2f)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:44 +01:00
Christopher Larson be90c3ec5c image_types.bbclass: add intermediate var for WKS_FILE_CHECKSUM
This is a bit nicer to work with, and easier to override.

(From OE-Core rev: 44f1d3cc613563b8d5be61a2648d0cd336fea728)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:44 +01:00
André Draszik 9ac4c8b11c image/image_types.bbclass: fix fatal error during cpio debugfs creation
If /init is just a symlink to /sbin/init, debugfs creation
fails with the following error:

ERROR: Error: The image creation script '<...>/debugfs.create_image.cpio' returned 1:
touch: cannot touch '<...>/cpio_append/init': Permission denied
WARNING: exit code 1 from a shell command.

ERROR: Function failed: do_rootfs

The reason is that IMAGE_CMD_cpio() is run twice on the same
WORKDIR. The first run creates a symlink in WORKDIR/cpio_append/init
to point to /sbin/init, while the 2nd run then tries to 'touch'
that link, which will fail, of course since /sbin/init is not
usually writable by non-root users.

Fix this by providing knowledge to the IMAGE_CMD_xxx() scripts
with regards to the fact that they are being executed in the
context of debugfs creation. The IMAGE_CMD_cpio() can now be
intelligent in the sense that it can avoid all additional symlink
handling during the debugfs run. The symlinks do not need to
be part of the debugfs, so we can skip that part altogether
in that case.

(From OE-Core rev: 659ae1d7df28115429f6f31450fad6d1f86e3031)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-12 23:47:18 +01:00
Alexander D. Kanevskiy 39498d0e90 image types: add bmap generation option
bmap image conversion type allows to create block map files
for sparse images. Bmap file can be used together with bmap-tools
for efficiently flash images to raw devices (hdd or usb drive)

[YOCTO #9414]

(From OE-Core rev: d3495d7b5ac90439691bafc5717a3bf1cf014737)

Signed-off-by: Alexander D. Kanevskiy <kad@kad.name>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:14 +01:00
Patrick Ohly dc939724c2 image_types: add support for zip compression
Support for the other compression format is not always readily
available on all OSes. Using zip instead of, say, xz is less
efficient, but perhaps more user-friendly for users on such OSes.

(From OE-Core rev: 27764738aa928959ca564e7299cf205c08684661)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:14 +01:00
Alexander D. Kanevskiy b39ddd9fe7 image_types: adjust default level of XZ compression
XZ extreme compression method usually uses a lot more CPU time with not
that often big saving on space. Same goes with -6 level of compression.
Compression level -3 usually the best balance for time/size, especially
on big images.

(From OE-Core rev: e9dbf85828e9d4e16c6a96de8931cb15bbcd78bb)

Signed-off-by: Alexander D. Kanevskiy <kad@kad.name>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:11 +01:00
Ross Burton 9b9b9832d6 image_types: fix image/compression dependency collection
As compressions can be chained (i.e. cpio.bz2.md5sum) we need to walk the fstype
list to collect the dependencies from each step.

(From OE-Core rev: 05c59ed987cdddc00e9e217032a69197e40a8448)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:33:40 +01:00
Christopher Larson af4e319861 image_types.bbclass: add WIC_CREATE_EXTRA_ARGS
This'll be of use to pass things like --bmap.

(From OE-Core rev: 90b2738fb07e329cb6b867fb37a929d562f27d15)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:33:40 +01:00
Richard Purdie 38c7e2d069 image_types: Ensure rootfs dependencies cover DEBUGFS
If you configure a bz2 debugfs, pbzip2-native currently isn't built.
This patch makes sure the dependencies are added.

(From OE-Core rev: dd304a6fdc034d780e01e0055319e4a04aaad9d4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 21:11:25 +01:00
Robert Yang 7fdb0618cf image-vm.bbclass/image_types.bbclass: IMAGE_NAME -> IMAGE_LINK_NAME
If we create hdddirect in the first time, and run bitbake to create
vmimg in the second time, then the previouse created
${IMAGE_LINK_NAME}.hdddirect may can not be found since it contains the
data string which are different. Use IMAGE_LINK_NAME to fix the problem.

(From OE-Core rev: 4aa8f67867a05bdf4a5ba90c8235740910662847)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-09 23:00:45 +01:00
Robert Yang 04e1978a74 image_types.bbclass: fix elf
Fixed:
| DEBUG: Executing shell function do_image_elf
| Cannot open `/path/to/tmp/sysroots/qemux86-64/usr/src/kernel/bzImage': (null)
| WARNING: exit code 1 from a shell command.

The bzImage is in DEPLOY_DIR_IMAGE

(From OE-Core rev: 24536aa578e483fc2a8594628befa4c78a05681c)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-09 23:00:45 +01:00
Robert Yang 513ea49657 image_types.bbclass: set nodesize for btrfs
The default value is 16K which is too big to create image for
core-image-minimal:
rootfs.btrfs is too small to make a usable filesystem
Minimum size for each btrfs device is 41943040.

Use 4K as ext2/3/4 to fix the problem.

(From OE-Core rev: a3e4dc0d800fbae3674b1657c872f70589fc893e)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-09 23:00:45 +01:00
Alexander D. Kanevskiy 4127fef8ba image_types: use compress framework to produce checksums for images
Existing compress framework for producing various compressed versions
of images is powerfull enough to be extended for other uses, e.g. to
convert types of images.

It is possible to use it also to produce image checksums at the time
of image generation. This commit adds support for all supported
at the moment coreutils hashing algorithms: md5, sha1, sha224,
sha256, sha384 and sha512

Usage:
IMAGE_FSTYPES_append = " hddimg.sha256sum"

(From OE-Core rev: 1fbd27122ac4403b8688bc41d128602564a05506)

Signed-off-by: Alexander D. Kanevskiy <kad@kad.name>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 22:57:26 +01:00
Patrick Ohly 26ee4ddc65 image creation: allow overriding .rootfs suffix
By default, the image file name contains ".rootfs" to distinguish the
image file from other files created during image building. However,
for certain image types (for example, .hddimg) the ".rootfs" suffix is
redundant because the type suffix alone already uniquely identifies
the main image file (core-image-minimal-intel-corei7-64.hddimg instead
of core-image-minimal-intel-corei7-64.rootfs.hddimg).

With this change, distros that prefer the shorter image name can
override the .rootfs suffix unconditionally with
   IMAGE_NAME_SUFFIX ?= '' in their distro configuration
or with some condition check like this:
   python () {
       if <whole-disk image format active>:
           d.setVar('IMAGE_NAME_SUFFIX', '')
   }

The exact logic when to remove the extra suffix depends on the distro
and how it enables its own image type.

(From OE-Core rev: 380ee36811939d947024bf78de907e3c071b834f)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:17:43 +00:00
Drew Moseley aacae25a3d image_types.bbclass: Embed IMAGE_NAME in ubinize config file
When using the FSTYPE multiubi, make sure that each image build
has a unique config file.  Without this there is a race condition
when building multiple images in a single bitbake command which
results in errors similar to:

    ERROR: Error: The image creation script
    'blah/tmp/work/blah/core-image-base/1.0-r0/temp/create_image.multiubi' returned 1:
    iniparser: cannot open ubinize_normal.cfg
    ubinize: error!: cannot load the input ini file "ubinize_normal.cfg"
    mv: cannot stat 'ubinize_normal.cfg': No such file or directory
    WARNING: blah/tmp/work/blah/core-image-base/1.0-r0/temp/create_image.multiubi:1 exit 1 from
      mv ubinize${vname}.cfg blahtmp/deploy/images/blah/

(From OE-Core rev: bc7643846f9fcef13a02f9299faa5454c843e8b1)

Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-07 17:30:00 +00:00
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