Commit Graph

286 Commits

Author SHA1 Message Date
Robert Yang 1b1de89304 grub-efi.bbclass: make it can build vm and live together
* Make it can build vm and live (e.g., iso + vmdk) together as we did
  for syslinux.
* GRUBCFG -> GRUB_CFG as other GRUB_FOO vars

(From OE-Core rev: e38039e43f22d55a443064efa91752e2943fda79)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:16 +00:00
Robert Yang 4ebaeb281b bootimg.bbclass: fix settings for grub-efi.bbclass
Fixed:
- Found potential conflicted var LABELS ...
  Set LABELS to "boot install" would build out broken images when build
  vm + live together, use set_live_vm_vars() to fix the problem.

- Use ROOT and LABEL in boot-directdisk.bbclass and image-foo.bbclass,
  they are not only used by syslinux.bbclass, but also grub-efi.bbclass,
  add "SYSLINUX_" prefix would mislead users.

(From OE-Core rev: d7d1e0193c94abb1cd2daf1c298c8c1788f3616d)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:16 +00:00
Patrick Ohly 5d06f00471 image.bbclass: track ROOTFS_POSTUNINSTALL_COMMAND in do_rootfs vardeps
The list of variables influencing do_rootfs was not updated when
introducing ROOTFS_POSTUNINSTALL_COMMAND. As a result, making changes
in commands listed there or the variables they depend on did not trigger
a re-run of do_rootfs.

(From OE-Core rev: 66b461ce9df7ed06d7651b9b54a49a950b97a1d4)

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>
2016-03-20 23:12:26 +00:00
Patrick Ohly ba57ba1942 image.bbclass: support chaining compression (aka conversion) commands
It makes sense to use the compression mechanism also for conversion,
for example of a whole-disk image into .vdi (VirtualBox). That part
already works, like this:

   COMPRESSIONTYPES_append = " vdi"
   COMPRESS_CMD_vdi = "qemu-img convert -O vdi ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.vdi"
   IMAGE_DEPENDS_vdi = "qemu-native"

But then it also makes sense to allow compressing the resulting image,
which only works after enhancing the image.bbclass.

For example, suppose a custom image command produces "dsk" images. Then
it becomes possible to set
   IMAGE_FSTYPES = " dsk.xz dsk.vdi.xz"
and do_image_dsk will automatically produce the intermediate images,
convert to dsk.xz resp. dsk.vdi -> dsk.vdi.xz and delete all
intermediate images. Symlinks are also set correctly.

(From OE-Core rev: 588f14370372a66329b54606071175519ce88f1e)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 16:58:10 +00:00
Patrick Ohly 5ac3dc76a5 image.bbclass: fix incomplete .rootfs customization
The patch for making the .rootfs configurable was incomplete: in the
python create_symlinks() method the new variable must be expanded
explicitly.

Not doing so broke the symlink creation and that led to hard build
failures in image types depending on the boot-directdisk.bbclass (like
qcow2) because the build_boot_dd() method relied on the symlink.

(From OE-Core rev: 0d02159c8d66bb136f7da2c10fda7d1a57f40cec)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 22:10:54 +00: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
Richard Purdie 25871016e0 image: Run do_rootfs_wicenv after do_image
do_image can modify the content of the rootfs directory so we need to run
do_rootfs_wicenv after do_image compeltes or the command can fail.

(From OE-Core rev: 8f5429b5e543e122072a51b518cc137dfc8ec442)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:27:46 +00:00
Chen Qi eb6d14e64c image/populate_sdk: seprate variables to fix dependency
Previously, do_rootfs depends on variables like SDK_OS, SDK_OUTPUT, etc.
And changing variables like POPULATE_SDK_POST_HOST_COMMAND doesn't cause
do_populate_sdk to rerun.

This patch separates variables so that do_rootfs and do_populate_sdk could
correctly depend on their related variables.

[YOCTO #8670]

(From OE-Core rev: 590cf4be70f1355622d3a94d76b4cc6d525d4a34)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:39:30 +00:00
Robert Yang 8a2dfa1691 image.bbclass: check INITRAMFS_MAXSIZE
Usually, the initramfs' maxsize can be 1/2 of ram size since modern
kernel uses tmpfs as initramfs by dafault, and tmpfs allocates 1/2 of
ram by default at boot time, which will be used to locate the initramfs.

Set INITRAMFS_MAXSIZE to 131072K (128M) by default (ram 256M), the
initramfs is small usually, for example, core-image-minimal-initramfs is
about 21M (uncompressed, 17M * 1.3) by default, but if the user add a
lot pkgs to initramfs, we can error and stop to let the user know ealier
rather than fail to boot (e.g., OOM-killer) at boot time.

Please see the bug for more info:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=5963

[YOCTO #5963]

(From OE-Core rev: 155ba626b46bf71acde6c24402fce1682da53b90)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26 22:31:59 +00:00
Richard Purdie 6720bdac23 image: Don't create tasks with '.' in the name
Similarly to "-", "." doesn't work well in task names but is used in
some real world image classes. Work around this with some replacements
for now to unbreak layers.

(Issues don't show themselves until runtime, e.g. with --dry-run)

Tested-By: Otavio Salvador <otavio.salvador@ossystems.com.br>
(From OE-Core rev: f94d9be17d727b37dc655e7be272db2f290436aa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26 18:05:13 +00:00
Richard Purdie 2e9f092c97 image: Handle image types containing '-' correctly
Shell function names can't contain '-' characters, which means our image
task names also can't. Add some mapping to use '_' instead of the '-' so
images like "rpi-sdimg" work again.

(From OE-Core rev: e609a4dea2f6d9744e7d2a6650bebf2c02398907)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:24:53 +00:00
Richard Purdie 0910bc65f5 image: Always run do_rootfs_wicenv
The wic command can be used externally but for this to work, the wic
environment file needs to be present. Therefore write this out
universally, it runs in parallel with other image construction so
any performance implications are negligible.

(From OE-Core rev: b2576f2eab10e4c5dd86449312b417a269cc578e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:24:47 +00:00
Richard Purdie 05716dd7ee bootimg/image: Enhance bootimg to respect RM_OLD_IMAGE
Currently, iso and hddimg links don't respect RM_OLD_IMAGE. This
updates them to use the common symlinks code so that they behave
like the rest of the system.

(From OE-Core rev: 6a05cb64dfafd531d50454ef7141ff0290d01ca9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:24:47 +00:00
Richard Purdie d27491b694 image: Ensure we don't expand TMPDIR in image commands
Similarly to DATETIME, don't expand TMPDIR in image commands.
This ensures some of the stamp comparisons we make in the
QA tests work correctly.

(From OE-Core rev: a8c377beadb85b0ff503ec8ddd1a2cd05e363c19)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:24:47 +00:00
Richard Purdie ce8a2068d4 image: Fix instability of do_image_* checksums
The do_image_* tasks contained the expanded version of DATETIME. Due
to the expansion, we couldn't exclude the value from the task checksum
which meant the task would rerun.

We fix this by deleting the DATETIME value during expansion so we don't
expand any references to at that time. This means the task's hash can be
stable rather than having hardcoded date/time values. It will get expanded
at execution time.

This also fixes errors shown by -S:

NOTE: Reparsing files to collect dependency data
Writing locked sigs to /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/locked-sigs.inc
ERROR: Bitbake's cached basehash does not match the one we just generated (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/recipes-sato/images/core-image-sato.bb.do_image_tar)!
ERROR: The mismatched hashes were 77872792556367f1dde49a1425caf1a0 and 9bb0aca6286ab7dd22d3c69964beb665

(From OE-Core rev: ecbc1db7ed1f9848dee69507de8eb289b8ddeba0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:24:47 +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 b567235c0c image/image-live: Add back IMAGE_TYPES_MASKED support
IMAGE_TYPES_MASKED support was accidentally removed. The original
idea behind it was to remove some of the hardcoding in the core
image code, so do that for image-live and ensure the dependency
and masked variables correctly reflect the needs of the class.
This means we can remove all the hardcoded special cases since
image-vm already has the needed markup.

(From OE-Core rev: 9a2d4a3b8d7bb1cf7f1fb7fe47d5c002d9941c89)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 11:59:42 +00:00
Otavio Salvador e914e2ac15 image.bbclass: Handle image base type dependency properly
When a base image type has an implicit dependency (from IMAGE_TYPEDEP)
this has to be taken into account. This is a regression introduced by
OE-Core:c2dab18 (image: Create separate tasks for rootfs construction).

The issue has been found when building meta-fsl-arm based images which
does not include the rootfs image type explicitly in IMAGE_FSTYPES but
instead is added, using IMAGE_TYPEDEP, for the 'sdcard.gz' image.

Reported-by: Fabio Berton <fabio.berton@ossystems.com.br>
(From OE-Core rev: 191c7be3a6cc52911f244323072433f6a1172bf1)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 11:59:42 +00:00
Mark Hatle ea05e05826 image.bbclass: Unconditional includes of populate_sdk_ext fails
populate_sdk_ext requires uninative support, which is only available on
glibc based SDKMACHINES.  For instance, when using mingw32 a dependency
error will occur:

NOTE: Runtime target 'nativesdk-glibc' is unbuildable, removing...
ERROR: Required build target 'core-image-minimal' has no buildable providers.
Missing or unbuildable dependency chain was: ['core-image-minimal', 'uninative-tarball', 'nativesdk-glibc']

This is dues to populate_sdk_ext.bbclass having:
do_populate_sdk_ext[depends] += "buildtools-tarball:do_populate_sdk uninative-tarball:do_populate_sdk"
addtask populate_sdk_ext

Since bitbake can't determine for dependency resolution if the task is going
to be run yet, it blows up and says it simply can't be resolved.

Workaround this problem by making the inherit conditional on the SDK_OS
containing 'linux'.

(From OE-Core rev: e471ce3464d5ae024315d4839cccd4c651f9ba83)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 11:54:48 +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
Richard Purdie 0a4e1f968a image: Create separate tasks for rootfs construction
This patch splits the code in lib/oe/image into separate tasks, one per
image type. This removes the need for the simple task graph code and defers
to the bitbake task management code to handle this instead.

This is a good step forward in splitting up the monolithic code and starting
to make it more accessible to people.

It should also make it easier for people to hook in other tasks and processes
into the rootfs code.

Incidentally, the reason this code was all combined originally was due to
limitations of fakeroot where if you exited the session, you lost permissions
data. With pseudo this constraint was removed.

We did start to rework the rootfs/image code previously and got so far with
untangling it however we did prioritise some performance tweaks over splitting
into separate tasks and in hindsight, this was a mistake and should have been done
the other way around. That work was suspended due to changes in the people working
on the project but this split has always been intended, now is the time to finish
it IMO.

There were some side effects of doing this:

* The symlink for the manifest moves to the rootfs-postcommands class and into
  the manifest function.
* There is no seperate "symlink removal" and "symlink creation", they are merged
* The date/time stamps of the manifest and the built images can now be different since
  the tasks can be run separately and the datetime stamp will then be different
  between do_rootfs and the do_image_* tasks.

(From OE-Core rev: c2dab181c1cdabac3be6197f4b9ea4235cbbc140)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:29 +00:00
Richard Purdie fdced52387 image: Move pre/post process commands to bbclass
As the next step in splitting up do_image, move the pre and post processing
commands to separate tasks. This also creates the do_image_complete task
which acts as the end marker task for image generation.

(From OE-Core rev: 800528eaa421d451b596545125cb218e08989151)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:29 +00:00
Richard Purdie cdc0aeed9b image.bbclass: Separate out image generation into a new task, do_image
I've heard complaints from people trying to create more interesting image
types about how hard it is to understand the rootfs/image generation code
and that its a pain to develop/test/debug.

Having looked at it myself, the internal construction of shell functions which
then gets passed into a multiprocessing pool is rather convoluted and it places
rather odd constraints on when variables are expanded. Its therefore no wonder
people find it confusing/complex.

This patch starts the process of splitting this up by separating out image
generation from the do_rootfs task into a new do_image task.

(From OE-Core rev: 57578d0ca6c3aaf6edf0af2c4862d43c97415156)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:29 +00:00
Richard Purdie 2c5e7e04f1 image: Really remove lockfiles flag
This was supposed to be removed by a previous patch but was readded.
Really remove it.

(From OE-Core rev: 5661d8cb7849df62358368743134c0aaf523965e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-07 13:42:12 +00:00
Richard Purdie 401c632508 image: Condense do_rootfs function/flags
Various prefuncs and flags and addtask statements make sense to belong together
in one clearer function now, this patch cleans things up a bit.

(From OE-Core rev: eae0cf7875197f9520be54370bc670e27338aad3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:33 +00:00
Richard Purdie 0051510ae3 image/rootfs-postcommands: Separate out post rootfs commands to separate class
Reading image.bbclass is a little difficult as it has many post rootfs
helper functions and its hard to separate those from the core contents
of the rootfs/image code.

Moving it to a separate class would be one way of making it clearer
what these functions are. There are some comment layout improvements
but no code changes.

(From OE-Core rev: df4cb51c8e60fa46d4d15be8da3d84287ff08ae7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:33 +00:00
Richard Purdie 3428eddcd1 image: Remove pointless rootfs lock
It was added in aa3141e979 back in 2008
but I don't see why multiple images would need this now.

(From OE-Core rev: 2eaeac6d98c310cb2602ba194d934c5b7bed253d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:33 +00:00
Alexander Kanavin d592abd255 image.bbclass: tweak the key location for dropbear when rootfs is readonly
In the same way it's done for openssh.

(From OE-Core rev: a4b91f5199dd4d1302484cbd972a484d36f7886f)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:37 +01:00
Alexander Kanavin 006497e36a image.bbclass: when building a readonly rootfs, tweak ssh settings regardless of init system in use
Previously it was done only if sysvinit was in DISTRO_FEATURES.

(From OE-Core rev: 8aa5c66a29c1394e0418e94bdd49e5b268ffc790)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:36 +01: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
Christopher Larson 6c05e6a71a image.bbclass: add do_rootfs vardeps for {COMPRESS, IMAGE}_CMD_*
We want do_rootfs to rerun if the fstype or compression commands or
dependencies change for any of our configured fstypes (IMAGE_FSTYPES).
IMAGE_TYPEDEP isn't explicitly handled, as it's traversed already, so the end
result will change if it does, and we only really care about the results, not
how we got there. This uses oe.image.Image()._get_image_types() to get the
info about the image and compression types in use.

(From OE-Core rev: a3473d1ee30f8ec688d57dddb6e3c2b887194384)

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-09-18 09:05:26 +01:00
Christopher Larson 635d38594c image.bbclass: add rootfs_check_host_user_contaminated
This function is intended to be used in ROOTFS_POSTPROCESS_COMMAND, and checks
for any paths outside of /home which are owned by the user running bitbake.

(From OE-Core rev: 72903f7534cccad35886f2cad8aac98a59392ec7)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:48 +01:00
Christopher Larson b3d8b37428 image.bbclass: re-run do_rootfs when feature packages change
Currently, FEATURE_PACKAGE_<feature> isn't in any vardeps, so changing the
packages for a feature won't change the checksum for do_rootfs. Rather than
explicitly adding those to vardeps, just use the expanded form of
FEATURE_INSTALL and FEATURE_INSTALL_OPTIONAL, so the actual list of packages
from the features goes into the checksum.

(From OE-Core rev: fdd1669e04bd8219344b1896b9d9c6a187e4f84e)

(From OE-Core rev: 9697d13e48633515b80b2ab9bab84ca54ce3ed48)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:35:58 +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
Gary Thomas 6e78cc4fad *image.bbclass: Consolidate ROOTFS_POSTPROCESS_COMMANDs
Move ROOTFS_POSTPROCESS_COMMANDs from core-image.bbclass to
image.bbclass so that images built using just image.bbclass
will benefit from them.  Without this change, an image built
using image.bbclass did not honor read-only-rootfs image feature.

(From OE-Core rev: 2d310470d95f7b387dcde605e4691ee505fc3b4d)

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:39 +01:00
Richard Purdie 86d30d756a meta: Add explict getVar param for (non) expansion
Rather than just use d.getVar(X), use the more explict d.getVar(X, False)
since at some point in the future, having the default of expansion would
be nice. This is the first step towards that.

This patch was mostly made using the command:

sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *`

(From OE-Core rev: ab7c1d239b122c8e549e8112c88fd46c9e2b061b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:57:25 +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
Mark Hatle 7a7c6b021f image.bbclass: Add a method for creating a companion debug filesystem
The companion debug filesystem contains only the package database and the
complementary *-dbg packages for the main filesystem component.  This is
useful in a production environment to produce a companion filesystem capable
of remote system debugging, without requiring corresponding debug symbols or
source code on the device.

(From OE-Core rev: 1a6ed48c65f922c66b005aa966d7ee4878ee95e3)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>

If dbg pkgs have already been installed to the rootfs image,
the installation to companion debug filesystem will fail,
because both of image creation make use of the same pm
database.

In this situation, try to copy installed dbg files from rootfs
image to companion debug filesystem.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Acked-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-24 07:19:21 +01:00
tprrt 376b6b7068 image: zap_empty_root_password doesn't handle passwd file in shadow case
/etc/passwd isn't editted if /etc/shadow exists and should be else
it can cause problems with some login providers such as toybox.

(From OE-Core rev: 09ac2664fba223111c20c3000af6b8d5cdaabeb1)

Signed-off-by: tprrt <tprrt@tupi.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-24 11:06:55 +01:00
Martin Jansa 50c2ef0a5d image.bbclass: Allow to remove do_rootfs -> virtual/kernel:do_packagedata dependency
* this is causing dependency loops in some cases
  e.g. linux-hp-tenderloin depends on initramfs-android-image, but
    commit 41f0f86ec0a3e0b6f6c9bb4ef71a4215c00bf66c
    Author: Richard Purdie <richard.purdie@linuxfoundation.org>
    Date:   Tue Jan 27 15:24:52 2015 +0000
    Subject: image: Add missing depends on virtual/kernel for depmod data
  adds also dependency between <image>.do_rootfs and virtual/kernel:do_packagedata
  causing this dependency loop:

Dependency loop #1 found:
  Task 78 (meta-smartphone/meta-hp/recipes-kernel/linux/linux-hp-tenderloin_git.bb, do_install)
    (dependent Tasks ['linux-hp-tenderloin, do_compile',
                      'pseudo, do_populate_sysroot'])
  Task 88 (meta-smartphone/meta-hp/recipes-kernel/linux/linux-hp-tenderloin_git.bb, do_package)
    (dependent Tasks ['rpm, do_populate_sysroot',
                      'pseudo, do_populate_sysroot',
                      'linux-hp-tenderloin, do_install',
                      'initramfs-android-image.bb, do_packagedata',
                      'glibc, do_packagedata',
                      'file, do_populate_sysroot',
                      'gcc-runtime, do_packagedata'])
  Task 89 (meta-smartphone/meta-hp/recipes-kernel/linux/linux-hp-tenderloin_git.bb, do_package_write_ipk)
    (dependent Tasks ['linux-hp-tenderloin, do_package',
                      'opkg-utils, do_populate_sysroot',
                      'linux-hp-tenderloin, do_packagedata',
                      'pseudo, do_populate_sysroot'])
  Task 560 (meta-smartphone/meta-android/recipes-core/images/initramfs-android-image.bb, do_rootfs)
    (dependent Tasks ['bash, do_package_write_ipk',
                      'run-postinsts, do_package_write_ipk',
                      'db, do_package_write_ipk',
                      'update-rc.d, do_populate_sysroot',
                      'android-tools-conf, do_package_write_ipk',
		      'base-passwd, do_package_write_ipk',
                      'initramfs-boot-android, do_package_write_ipk',
		      'expat, do_package_write_ipk',
                      'bzip2, do_packagedata',
		      'glibc-initial, do_packagedata',
                      'openssl, do_package_write_ipk',
                      'bzip2, do_package_write_ipk',
		      'busybox, do_packagedata',
                      'zlib, do_packagedata',
		      'qemuwrapper-cross, do_packagedata',
                      'base-passwd, do_packagedata',
		      'busybox, do_package_write_ipk',
                      'zlib, do_package_write_ipk',
		      'qemuwrapper-cross, do_package_write_ipk',
		      'gcc-runtime, do_package_write_ipk',
		      'gettext, do_packagedata',
		      'initramfs-boot-android, do_packagedata',
		      'gettext, do_package_write_ipk',
		      'libgcc-initial, do_packagedata',
                      'expat, do_packagedata',
                      'gdbm, do_packagedata',
		      'depmodwrapper-cross, do_package_write_ipk',
                      'libgcc-initial, do_package_write_ipk',
                      'glibc-initial, do_package_write_ipk',
                      'linux-libc-headers, do_packagedata',
                      'glibc, do_packagedata',
                      'initramfs-android-image.bb, do_packagedata',
                      'glibc, do_package_write_ipk',
                      'sqlite3, do_packagedata',
                      'initramfs-android-image.bb, do_package_write_ipk',
                      'sqlite3, do_package_write_ipk',
                      'android-tools-conf, do_packagedata',
                      'ncurses, do_packagedata',
                      'openssl, do_packagedata',
                      'android-tools, do_packagedata',
                      'ncurses, do_package_write_ipk',
                      'cryptodev-linux, do_packagedata',
                      'android-tools, do_package_write_ipk',
                      'pseudo, do_populate_sysroot',
                      'cryptodev-linux, do_package_write_ipk',
                      'linux-libc-headers, do_package_write_ipk',
                      'depmodwrapper-cross, do_packagedata',
                      'linux-hp-tenderloin, do_packagedata',
                      'readline, do_package_write_ipk',
                      'opkg-utils, do_packagedata',
                      'linux-hp-tenderloin, do_package_write_ipk',
                      'python, do_packagedata',
                      'gdbm, do_package_write_ipk',
                      'opkg, do_populate_sysroot',
                      'python, do_package_write_ipk',
                      'libtool-cross, do_packagedata',
                      'db, do_packagedata',
                      'libgcc, do_packagedata',
                      'libtool-cross, do_package_write_ipk',
                      'update-rc.d, do_packagedata',
                      'update-rc.d, do_package_write_ipk',
                      'libgcc, do_package_write_ipk',
                      'opkg-utils, do_populate_sysroot',
                      'makedevs, do_populate_sysroot',
                      'readline, do_packagedata',
                      'base-files, do_packagedata',
                      'gcc-runtime, do_packagedata',
                      'opkg-utils, do_package_write_ipk',
                      'base-files, do_package_write_ipk',
                      'ldconfig-native, do_populate_sysroot',
                      'bash, do_packagedata',
                      'run-postinsts, do_packagedata'])
  Task 82 (meta-smartphone/meta-hp/recipes-kernel/linux/linux-hp-tenderloin_git.bb, do_compile)
    (dependent Tasks ['initramfs-android-image.bb, do_rootfs',
                      'linux-hp-tenderloin, do_configure'])

(From OE-Core rev: 2e3c8fd70694dcf9553b5e4c50a57b617a9130b6)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-20 15:29:11 +01:00
Randy Witt d2690754fe image.bbclass: Empty /var/volatile if it is a mount point
If /var/volatile is a mount point it shouldn't contain any files before
mount time. If files are there, they will no longer be able to be accessed
once the tmpfs gets mounted at /var/volatile.

This problem can be seen for instance when systemd creates
/var/volatile/log/journal as part of its package installation. It then
assumes the journal is persistent even though /var/volatile/log/journal
goes away shortly thereafter.

This change makes sure that there are no files in /var/volatile if it is
to be used as a mount point.

[Yocto #7388]

(From OE-Core rev: b574ac6f3c9e07f0054ed4261bc1f83583c29c53)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-25 12:39:45 +00:00
Richard Purdie 96104b825f image: Ensure manifests end with a newline
Manifests should end with a newline character but don't currently. This
is the easiest fix for now, the alternative would be a rewrite of the
internal code which is something to consider in due course.

[YOCTO #7427]

(From OE-Core rev: 98230d2d049c742c349f35b256b13afbc3d26235)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-25 12:39:44 +00:00
Randy Witt 54567379ac populate_sdk_ext: add extensible SDK
This bbclass will create an SDK with a copy of bitbake and the metadata
and sstate for the target specified for the task. The idea is to let
"system" developers both work on applications and then test adding them
to an image without having to switch between workspaces or having to
download separate items.

Rather than running bitbake directly however, the primary way of running
builds within the extensible SDK is to use the "devtool" command. The
rest of the build system is fixed via locked shared state signatures,
and thus only the recipes you have added get built.

(From OE-Core rev: bf81d6bb7f6df5405b8f2148e2a22e0030c12757)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24 17:41:43 +00:00
Saul Wold b7153be8ca image: add new items to IMAGE_FEATURES[validitems] list
Add the new items to the validitems list, this is fully tested, initial testing
had been done with a local change that did not make the original commit request

[YOCTO #7308]

(From OE-Core rev: 6e48bc5fbd834f19bdcac17007d27a750cc5f331)

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:02 +00:00
Chen Qi 1f292659c0 image.bbclass: don't let do_rootfs depend on BUILDNAME
BUILDNAME is set by cooker as a string of current time. Letting do_rootfs
task depend on this variable gets us no benefit. Besides, letting do_rootfs
task depend on this variable will cause us trouble when executing
`bitbake -S none core-image-minimal'. With current code, this command
gives us error complaining about the different bashhash of do_rootfs task.

(From OE-Core rev: eb6305d03723527830976c3a4ce2342a0e09eefc)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-08 08:00:26 +00:00
Saul Wold d42963a3fe core-image: split debug-tweaks into individual features
Split the debug-tweaks into a more fine tunable set of IMAGE_FEATURES
which activate the component functions.

Clean-up image-core and image bbclass by having the ROOTFS_POSTPROCESS_COMMANDs
in in one place for the debug-tweaks related functions

[YOCTO #5344]

(From OE-Core rev: e52d8281eb98dbade2d82451fa9788285121437e)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-08 08:00:25 +00:00
Dan McGregor 491d1db8d1 image.bbclass: make kernel depmod data optional
This allows an image to skip the creation of kernel depmod
data. It is useful for creating an image that will run as a
container image inside a host with no knowledge of the parent's
kernel.

(From OE-Core rev: ca641aedff5f6bd155796ead02cb2eb871f8c17a)

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-03 14:53:53 +00:00
Paul Eggleton 26e5b0f7b9 classes/image: ensure uninstalled packages do not appear in manifests
Since the rewrite of the image construction code in python a few
releases ago, we remove a couple of packages from the image as one of
the final steps when constructing the image (notably update-rc.d and
run-postinsts).  However, because of the order of operations, these
packages are still listed both in the buildhistory
installed_package*.txt files and in the manifest file created next to
the image, which is wrong.

There were two possible solutions to this: (1) change the order such
that the uninstallation occurs before calling ROOTFS_POSTPROCESS_COMMAND
or (2) add another hook variable in such that we can have the
package list collection code run at the right time. Because it's
currently possible (but very much not recommended) to install additional
packages within ROOTFS_POSTPROCESS_COMMAND, which may have postinstall
scripts and thus require the packages we would otherwise uninstall if we
were to take option 1, option 2 is really the least likely to cause
problems. Therefore, add ROOTFS_POSTUNINSTALL_COMMAND and make the image
and buildhistory classes use it.

Fixes [YOCTO #6479].

(From OE-Core rev: b198a189228648057c3be7d068598f50841b3bf9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-03 14:53:50 +00:00
Paul Eggleton 69c588b66d classes/image: skip recipe on invalid IMAGE_FEATURES item
If you add an item to EXTRA_IMAGE_FEATURES in your local.conf that is
not supported by image.bbclass itself (such as "tools-sdk" which is
implemented in core-image.bbclass), it can be somewhat annoying to have
the parse fall over if you have a recipe that inherits image.bbclass
only. Change the error from bb.fatal to skip the recipe instead so that
you only see the error when attempting to build the recipe, plus add a
bit of logic to report if the feature is coming in via
EXTRA_IMAGE_FEATURES.

Fixes [YOCTO #5023].

(From OE-Core rev: cbe9d2f748125aa2dffc829570d46f8dbc1781a4)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-03 14:53:50 +00:00
Paul Eggleton 44212390de classes/image: drop unused default of MACHINE_POSTPROCESS_COMMAND
In the daisy (1.6) timeframe, when we rewrote the image construction in
Python, we neglected to reimplement the support for the little used and
undocumented variable MACHINE_POSTPROCESS_COMMAND, and apparently nobody
noticed. We have a better method for implementing machine-specific image
formats that is in wider use (i.e. add a custom class which implements
the new image type, add the class to IMAGE_CLASSES and the type to
IMAGE_FSTYPES), and we now also have wic. Thus it makes more sense to
just call this variable unsupported now and drop the sole remaining
reference to it.

(From OE-Core rev: 46fef857d6c4ac25d89b71b542b019d0ed068c19)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-03 14:53:50 +00:00
Richard Purdie 36bd248463 image: Add missing depends on virtual/kernel for depmod data
We need the depmod data so that the kernel depmod command works successfully
at rootfs time. The fact this was working inconsistently is now highlighted
after the command was made to error out. A simple test case is:

bitbake virtual/kernel image
bitbake vrituak/kernel -c clean
bitbake image -c rootfs -f

We fix it by adding the missing dependency, the data is in PKGDATA_DIR and
hence we use packagedata.

(From OE-Core rev: 41f0f86ec0a3e0b6f6c9bb4ef71a4215c00bf66c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-29 15:36:52 +00:00
Richard Purdie 11ef55a93b kernel/image/depmodwrapper: Fixups for depmod
With the rpm package backend enabled, running:

bitbake <image>
bitbake virtual/kernel -c clean
bitbake <image> -c rootfs -f

results in an image with incorrect kernel module dependency information.
The problem is that the System.map and kernel-abiversion files are needed
for depmod and after the recent kernel changes, these are no longer in
sstate.

Its reasonable to require the kernel to unpack/build if you're
about to build a module against it. It is not reasonable to require this
just to build a rootfs.

Therefore stash the needed files specifically for depmod.

Also fix some STAGING_KERNEL_DIR references which were incorrect, found
whilst sorting through his change.

(From OE-Core rev: b851504dcf5e147c9efb1c7b6a4d22c1a1a87cd7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-23 14:32:02 +00:00
Otavio Salvador b3d517aad4 image.bbclass: Remove 'set_image_autologin' function
The set_image_autologin function is GPE Login specific and the package
is not available in OE-Core so the function should be added in the
meta-gpe layer, if necessary. Drop this from the OE-Core as it is
unused.

(From OE-Core rev: a7191a7018c1fe43fe35a894a09d2a165af1a4d2)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-31 17:04:51 +00:00
Chen Qi b4499ec036 image.bbclass: avoid boot error on read-only systemd image
New version of systemd implements a new feature of updating /etc
or /var when needed at boot. For details, please see link below.

Opointer.de/blog/projects/stateless.html

For now, at boot time, the systemd-sysusers.service would update user
database files (/etc/passwd, /etc/group, etc.) according to the configuration
files under /usr/lib/sysusers.d. This step is necessary for other systemd
services to work correctly. Examples of such services are systemd-resolved
and systemd-tmpfiles-setup.

The problem is that on a read-only file system, that is, if /etc is read-only,
the user database files could not be updated, causing failures of services.

This patch fixes this problem by adding users/groups at rootfs time.

(From OE-Core rev: 2501c2f03f24fbbefd9999dd444318704d8aa8c2)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-25 08:18:13 +00:00
Richard Purdie 1ff64a7e84 image: Avoid race over directory creation
There is a race over the do_package_qa task and the do_rootfs task
since rootfs recreates a directory. This patch disables the task
(which isn't used for images) to avoid the race:

NOTE: recipe core-image-minimal-1.0-r0: task do_package_qa: Started
NOTE: recipe core-image-minimal-1.0-r0: task do_rootfs: Started
ERROR: Build of do_package_qa failed
ERROR: Traceback (most recent call last):
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/bitbake/lib/bb/build.py", line 497, in exec_task
    return _exec_task(fn, task, d, quieterr)
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/bitbake/lib/bb/build.py", line 440, in _exec_task
    exec_func(func, localdata)
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/bitbake/lib/bb/build.py", line 212, in exec_func
    exec_func_python(func, d, runfile, cwd=adir)
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/bitbake/lib/bb/build.py", line 237, in exec_func_python
    os.chdir(cwd)
OSError: [Errno 2] No such file or directory: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/build/tmp/work/qemumips-poky-linux/core-image-minimal/1.0-r0/core-image-minimal-1.0'

(From OE-Core rev: 0550d112ad9c2ca9f8167dcae35200210923f2c5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:53 +00:00
Michael Jones 95fcc673e2 image.bbclass: whitespace
Don't mix tabs and spaces

(From OE-Core rev: 505a3a6a9a0c080bc5b7d16ed569b80b43869977)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-05 18:01:06 +00:00
Michael Jones d3b221d183 image.bbclass: remove comment that readonly only works for sysvinit
Should have been removed with
92f956d tweak read_only_rootfs_hook to also support systemd based systems

(From OE-Core rev: e8bd2783870e71b42c902a31bd6521d564915e99)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-05 18:01:06 +00:00
Peter A. Bigot d1434d97f5 image.bbclass: search both rootfs and native staging for passwd files
When pseudo is configured to disallow fallback to the build host
/etc/hosts and /etc/group, the selection of ${IMAGE_ROOT} for
PSEUDO_PASSWD is insufficient as the necessary files will not be
available until base-passwd has been installed and its pkg_postinst
script run.  Fall back to the ${STAGING_DIR_NATIVE} version of those
files until the rootfs versions are available.  (The native copies are
never modified by the build; the ones in ${STAGING_DIR_TARGET} are
updated and may contain settings not consistent with what would be
created by post-install useradd/groupadd commands invoked in the image
rootfs.

(From OE-Core rev: 8c653bafaa32126c54400bb56b9a94f07cd33197)

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-25 13:03:29 +00:00
Hongxu Jia 150f0f5fff classes/image: remove obsolete MULTILIB_VENDORS
In oe-core commit 03c5f39b4d7dd8c81e0a130b7d5884e5af039a24,
it removed obsolete codes about variable MULTILIB_VENDORS.

We clean up the rest obsolete codes related with
MULTILIB_VENDORS

(From OE-Core rev: 43a1c2dc08b4291e042b6c9ef981bd094ea2c477)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-04 10:27:07 +00:00
Robert Yang c4f51a048f image.bbclass: image_types.bbclass is a must
The image_types.bbclass is a must since we use this in image.bbclass:

[snip]
python () {
    deps = " " + imagetypes_getdepends(d)
    d.appendVarFlag('do_rootfs', 'depends', deps)
[snip]

The imagetypes_getdepends() is defined in image_types.bbclass. Use "+="
to replace "?=" since it is a must, so that the user can use
"IMAGE_CLASSES = foo.bbclass" in local.conf to add their own image
class.

NOTE: the IMAGE_CLASSES_append = " foo" doesn't work since we use this
in image.bbclass:
 IMAGE_CLASSES += "image_types"
 inherit ${IMAGE_CLASSES}

I think that it is because inherit takes effect before append?

Another way to fix the problem is:
IMAGE_CLASSES ?= ""
inherit image_types ${IMAGE_CLASSES}

But it seems that we need another name for IMAGE_CLASSES, for example
IMAGE_CLASSES_EXTRA, and also need update the doc, which would make it
complicated.

(From OE-Core rev: c225613d997ef40dedf64b880b5ca4ae89adfded)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:51 +01:00
Chen Qi eecd637546 image.bbclass: tweak read_only_rootfs_hook to also support systemd based systems
Modify the read_only_rootfs_hook function to make it also have effect
on systemd based systems.

(From OE-Core rev: 92f956d813303f8ee86fd40a4ee3d604a9b4e76e)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-02 09:26:14 +01:00
Roxana Ciobanu 56bfda20f4 image.bbclass/rootfs.py: add variables to rootfs[vardeps]
Added base variables and package backend specific variables to
rootfs[vardeps] in order for rootfs to rebuild when changes are made.

Set some variables as [func] to inform bitbake that they are shell
scripts, so that it invokes its shell dependency parsing. Without
marking them as functions, changes in the actual function body would
not trigger rootfs rebuilds.

[YOCTO #6502]

(From OE-Core rev: b8b6214b885a0757f0e628937f8fe21c92c45155)

Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-23 21:59:13 +01:00
Blair Elliott 00017b4dd8 initscripts: save /etc/timestamp with seconds accuracy
Currently, /etc/timestamp is saved with minutes accuracy.  To increase
the accuracy, modify the save-rtc.sh and bootmisc.sh scripts to save and
read /etc/timestamp respectively with seconds accuracy.

(From OE-Core rev: 8fed53e4e72230c61f23cb36eda36c228aede1e0)

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19 00:08:59 +01:00
Khem Raj 28bb9ddbb3 image.bbclass: Remove dependency on ldconfig-native for musl
it does not grok glibc ldconfig format

(From OE-Core rev: 9c85aef3ce25f6eb1d370a1a94e3fe16d59ec627)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-01 14:29:29 +01:00
Otavio Salvador 4c14b09498 Globally replace 'base_contains' calls with 'bb.utils.contains'
The base_contains is kept as a compatibility method and we ought to
not use it in OE-Core so we can remove it from base metadata in
future.

(From OE-Core rev: d83b16dbf0862be387f84228710cb165c6d2b03b)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-25 17:19:19 +01:00
Jonathan Liu b24f5e8252 image.bbclass: improve sed expressions for ssh_allow_empty_password()
The sed expression was also replacing documentation text containing
PermitRootLogin in the line so "PermitRootLogin yes" was specified
twice.

(From OE-Core rev: 0572196158d9505a624bdee71760978f284728b0)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-10 17:35:15 +01:00
Richard Purdie 1588b02d14 image/image-prelink/image-mklibs/sanity: Drop pointless EXPORT_FUNCTIONS
I'm sick of seeing people adding to EXPORT_FUNCTIONS in these classes
when they clearly have no idea what it does.

Worse, these uses of it are all broken, the naming is incorrect and
they do nothing. Lets remove them and try and preserve any remaining
part of my sanity.

(From OE-Core rev: 05a2fb19f722652c5d13be911b8ed45a264bbb40)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-01 23:37:01 +01:00
Saul Wold 30959dda95 image.bbclass: add function to disable SSH DNS Lookup for Qemu
This function disables the reverse DNS lookup on QEMU targets to reduce the
delay when using static IP address. By disabling DNS lookup we can save a great
deal of time during automated testing on the autobuilder (on the order of ~400
seconds per ssh tranaction). This is seen when using the testimage, there is a
delay getting logged-in from the server to target.

It's enabled for all qemu imgaes by default and can be overridden by setting
the SSH_DISABLE_DNS_LOOKUP variable.

[YOCTO #5954]

(From OE-Core rev: c93eeecb15c4acac9226a3394c93d7e99a809d6b)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-01 23:37:01 +01:00
Chen Qi 61b088abb8 image.bbclass: replace rootfs with /dev/root
Replace 'rootfs' with '/dev/root' in read_only_rootfs_hook function
to match the latest change in fstab file from the base-files recipe.

The related commit is as follows.

commit e8bc7a136a
    base-files: use /dev/root in /etc/fstab for systemd support

(From OE-Core rev: 31b5aeb5a0b82842e1dd8545bf5d43778d8c218b)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-27 09:42:07 +00:00
Paul Eggleton 004f9be18a classes/image: ignore modules.* changing during multilib image construction
Since we now run depmod when building images (as the postinst that does
this is now on kernel-base instead of kernel-image) it is possible to
have module file differences between the two halves of the multilib image,
and the code that checks for such differences detects this and fails.
Whitelist this file to avoid the failure.

Specifically, modules.alias, modules.dep and modules.symbol can differ
along with their .bin counterparts.

Related to fix for [YOCTO #5392].

(From OE-Core rev: 0a315804bf991664c0948e3024b8e8b9e9085808)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-22 12:12:20 +00:00
Paul Eggleton e2d24f5172 classes/image: disable pam nullok_secure with debug-tweaks
If you want passwordless logins to work with pam enabled, then you can't
have "nullok_secure" enabled on pam_unix entries. Add some
postprocessing to change these to "nullok" when debug-tweaks is in
IMAGE_FEATURES, in order to make passwordless logins with PAM work
again.

Fixes [YOCTO #5973].

(From OE-Core rev: a973fe10305c7d080d5c017ddd9b2bd860221659)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21 17:15:30 +00:00
Laurentiu Palcu 0ec27e63a3 image.bbclass, license.bbclass: adjust the name of list_installed_packages()
The old wrapper got renamed to image_list_installed_packages().

(From OE-Core rev: 118a2a44bbe5ed2e9bbd0012970686be454e5d4c)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21 12:05:53 +00:00
Paul Eggleton d14090ab73 Rename PACKAGE_GROUP variable to FEATURE_PACKAGES
Since tasks were renamed to packagegroups some time ago, this variable
name implies that its usage is necessarily related to them which is not
the case. Rename the variable to more closely represent what it does
(whilst still providing backwards-compatibility with a warning for
PACKAGE_GROUP).

(From OE-Core rev: d703e07ea5056624101e1bc48f10d25b602635e9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07 14:45:21 +00:00
Paul Eggleton 874ab5a568 classes/image: support package-management in IMAGE_FEATURES
Previously the "package-management" feature was only fully supported
when inheriting core-image.bbclass, which is not really ideal given that
this is the standard way of adding runtime packaging to an image in
OE-Core.

Part of the fix for [YOCTO #5424].

(From OE-Core rev: 18b8e526570b347d269fa47140949e4ea4800ac5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07 14:45:21 +00:00
Jonathan Liu 56636dd4e6 image.bbclass: add BAD_RECOMMENDATIONS/NO_RECOMMENDATIONS rootfs vardeps
Changes to BAD_RECOMMENDATIONS or NO_RECOMMENDATIONS require the rootfs
for the image to be rebuilt.

[YOCTO #5898]

(From OE-Core rev: f271ec4748d604d956f2d011af1deb7f7e3a68f9)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-05 15:50:20 +00:00
Laurentiu Palcu e091548568 (image|rootfs_ipk).bbclass, rootfs.py: ipk multilib fixes
This commit whitelists some common directories, so the multilib sanity
checks pass and also fixes an issue in lib/oe/rootfs.py when the
compared files do not exist.

(From OE-Core rev: 4615ac771175cd413f461c081f7d3191c49ccc4b)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-13 11:41:22 +00:00
Hongxu Jia 4d8982a1c6 image.bbclass/populate_sdk_base.bbclass: shift position of sdk complementary install definition
The sdk complementary install operation was defined in image.bbclass,
but the sdk recipe (such as meta-toolchain.bb) didn't inherit this
bbclass but populate_sdk, and both of image and populate_sdk bbclass
inherited populate_sdk_base bbclass, so move the sdk complementary
install definition to populate_sdk_base bbclass fixed this issue.

(From OE-Core rev: 907458935bab391f5bfba8f581ea9835078548d9)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:42 +00:00
Hongxu Jia 1a1ba04df7 image.bbclass/license.bbclass: ajustment list_installed_packages invoking
Since the list_installed_packages() function has refactored in
python, do the necessary adjustments to license_create_manifes-
t() and write_image_manifest() in license.bbclass and image.bb-
class respectively;

(From OE-Core rev: 4477991633d2971c17afbd0874b1ab2efb7d6eef)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:42 +00:00
Laurentiu Palcu e5a164231d image.bbclass: change POPULATE_SDK_POST_TARGET_COMMAND
Since rootfs_install_complementary() is now implemented in python for
each backend, remove it from POPULATE_SDK_POST_TARGET_COMMAND. Call it
directly in python.

(From OE-Core rev: c941fce37eb1ca7b77e5885c3e3e776f9538754b)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:40 +00:00
Laurentiu Palcu aaa92a67d8 image.bbclass, lib/oe/rootfs.py: remove intercept_scripts directory
Remove the directory, manually, in the Rootfs.create() function.

(From OE-Core rev: 37a9dc05272e7e49c8a475ccb3d10880dcee4763)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:39 +00:00
Laurentiu Palcu f52391a919 Cleanup image,rootfs_ipk,package_ipk bbclass files
This commit cleans up the functions that were ported to python.

(From OE-Core rev: d950ef40a3eae4b54cc62828e66d84a62d78c447)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:39 +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
Phil Blundell cc169c91f2 image.bbclass: Also uninstall update-alternatives and shadow for read-only-rootfs
If the rootfs is read-only then we aren't going to be updating any
alternatives or modifying the password file and these binaries will
be redundant.  In an ideal world we would be able to stop them from
being installed in the first place but this is non-trivial to arrange.
As a workaround in the meantime, let's just uninstall them once image
construction is finished.

(From OE-Core rev: d41097a970e9bfa553cd4bc3c9fad4b9073d7bd5)

Signed-off-by: Phil Blundell <pb@pbcl.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-02 22:37:42 +00:00
Ross Burton 1ec04bb215 image.bbclass: fix paths to run-postinsts
The run-postinsts script has been moved to ${sbindir}.

[YOCTO #5719]

(From OE-Core rev: 2c8dc1b00c0cf83da106ef9544cd11cde7ce43a1)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-28 00:52:35 +00:00
Chen Qi 655b432ac3 image.bbclass: add ability to set systemd default target
Add ability to set the default target for systemd images.

The default target for system is controlled by SYSTEMD_DEFAULT_TARGET.
The default value for this variable is derived from checking whether
IMAGE_FEATURES contains 'x11-base' or not. Each image could override
this value in its own recipe. For now, we don't need to do any change,
because all images that support graphical environment has 'x11-base'
in its IMAGE_FEATURES.

[YOCTO #3816]

(From OE-Core rev: 049f89155b1e80875aad6e53b21808b827c06915)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-06 11:13:54 +00:00
Chen Qi c38fee231b image.bbclass: fix for zap_root_password
Previously, this function replaces the root password with '*' if
'debug-tweaks' is not in IMAGE_FEATURES. It not only zaps empty root
password, but also zaps non-empty root password. That means, if the
user uses a bbappend file for base-passwd to set the root password, he
would not be able to login as root; if the user uses 'EXTRA_USERS_PARAMS'
to set the root password, he would still not be able to login as root.

What we really want from this function is to disallow empty root password
if 'debug-tweaks' is not in IMAGE_FEATURES. This function should not remove
non-empty root password because that password is usually deliberately set
by the user.

This patch renames zap_root_password to zap_empty_root_password to
better reflect the intent of this function. It also modifies the code
to make this function work correctly.

(From OE-Core rev: c1037a74f934966a0df8c85138b09d672b9f8b36)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-14 09:16:37 +00:00
Chen Qi 1034518fa7 image.bbclass: default USE_DEVFS to '1'
Default USE_DEVFS to "1" so that the `makedevs' command is not run
at rootfs time by default. There are mainly two reasons to do so.

1. This will fix a build failure with initramfs-kexecboot-klibc-image.
   "makedevs: No entry for root in search list "

2. Most of our images use a filesystem over /dev. Most of the time, it's
   just devtmpfs. So we actually are using a filesystem over /dev.

(From OE-Core rev: f54fdd6673a136ee1cee1f3263a8a7820de43ca3)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-14 09:16:37 +00:00
Roy Li 40b173c104 buildhistory.bbclass/image.bbclass: remove obsolete codes
After 1b8e4abd2d9c0 [bitbake.conf/package: Collapse PKGDATA_DIR into
a single machine specific directory], oe-pkgdata-util does not use
target_suffix parameter, so do not need to loop the vendor

(From OE-Core rev: 03c5f39b4d7dd8c81e0a130b7d5884e5af039a24)

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-09 18:01:45 +00:00
Richard Purdie 32c5d84823 image.bbclass: Depend on virtual/kernel:do_deploy
Now that none of the packagegroups depend on virtual/kernel, we have the problem
that MACHINE=qemumips bitbake core-image-minimal doesn't put a kernel
into the deploy directory. This breaks many common usecases and
user expectations.

To avoid this, add a dependency on the kernel deploy to image do_build tasks.
This should avoid any circular dependency issues but equally ensure users
have their expectations met.

[YOCTO #5581]

(From OE-Core rev: fe26b2379ecdbdb56acde8592bc0c2d95092a207)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-29 16:27:31 +00:00
Paul Eggleton 960e305d9a classes/image: write image manifest
Write a list of installed packages to a .manifest file next to the
image, so we can find out what went into the image after it has been
constructed without necessarily having to have buildhistory enabled
(although that will provide more detail.) We can make use of this for
example in the testimage class associated code that checks for installed
packages for determining whether or not to run specific tests.

Note: this replaces the previous ipk-specific manifest code with
something that works for ipk, rpm and deb, and instead of a pruned
status file, packages are listed one per line, in the following format:

<packagename> <packagearch> <version>

Tests for all three backends have shown that the performance impact of
this change is negligible (about 1.5s max).

Implements [YOCTO #5410]

(From OE-Core rev: 2978d1f2617a33e2e3a77e249d73e998d79b4ec9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-26 23:01:32 +00:00
Paul Eggleton bfc55b9fe4 classes/image-empty: remove
We don't actually need this dummy class; "inherit" can be used with an
expression that evaluates to nothing with current BitBake.

(From OE-Core rev: f312eb2d2a2715e772ed9e8afc7aea326d8079ec)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-14 13:39:47 +00: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
Chen Qi 80203494aa image.bbclass: uninstall package only if it's already installed
Remove a package from rootfs only if it's already installed. Also,
if a package is uninstalled, remove it from installed_pkgs.txt.

[YOCTO #5169]

(From OE-Core rev: b86dc63bc87763119fce8286f37f44361da824d0)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-24 17:24:12 +01:00
Paul Eggleton a3558bfb99 classes/testimage-auto: add class to allow automatically running image tests
Setting TEST_IMAGE = "1" alone will now automatically run tests on the
image immediately after the image is built instead of having to add
INHERIT += "testimage" and run bitbake -c testimage <image> manually
(but that will still work). This restores functionality that was
present in the older imagetest-qemu class with IMAGETEST.

(From OE-Core rev: 72269a8fbec35c39af30fbabb1fa9ca7c5ee8d69)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-22 12:19:34 +01:00
Richard Purdie 8ebe7be3d9 bitbake.conf/package: Collapse PKGDATA_DIR into a single machine specific directory
Currently we have a hierarchy of pkgdata directories and the code has to put together
a search path and look through each in turn until it finds the data it needs.

This has lead to a number of hardcoded paths and file globing which
is unpredictable and undesirable. Worse, certain tricks that should be
easy like a GL specific package architecture become problematic with the
curretn search paths.

With the modern sstate code, we can do better and construct a single pkgdata
directory for each machine in just the same way as we do for the sysroot. This
is already tried and well tested. With such a single directory, all the code that
iterated through multiple pkgdata directories and simply be removed and give
a significant simplification of the code. Even existing build directories adapt
to the change well since the package contents doesn't change, just the location
they're installed to and the stamp for them.

The only complication is the we need a different shlibs directory for each
multilib. These are only used by package.bbclass and the simple fix is to
add MLPREFIX to the shlib directory name. This means the multilib packages will
repackage and the sstate checksum will change but an existing build directory
will adapt to the changes safely.

It is close to release however I believe the benefits this patch give us
are worth consideration for inclusion and give us more options for dealing
with problems like the GL one. It also sets the ground work well for
shlibs improvements in 1.6.

(From OE-Core rev: 1b8e4abd2d9c0901d38d89d0f944fe1ffd019379)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-14 08:21:00 +01:00
Richard Purdie bd3164b9e6 image/populate_sdk: Ensure symlinks in target sysroot are relative
In the target sysroot of an SDK we can have target system absolute links
which don't make sense. This adds a script which fixes them up to become relative
paths instead.

[YOCTO #5020]

(From OE-Core rev: 57d6bdcad55c119e9ab8089d23d462436a0e4440)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-11 11:05:05 +01:00
Jason Wessel 0fa12e4466 kernel.bbclass, image.bbclass: Implement kernel INITRAMFS dependency and bundling
This patch aims to fix the following two cases for the INITRAMFS generation.
  1) Allow an image recipe to specify a paired INITRAMFS recipe such
     as core-image-minimal-initramfs.  This allows building a base
     image which always generates the needed initramfs image in one step
  2) Allow building a single binary which contains a kernel and
     the initramfs.

A key requirement of the initramfs is to be able to add kernel
modules.  The current implementation of the INITRAMFS_IMAGE variable
has a circular dependency when using kernel modules in the initramfs
image.bb file that is caused by kernel.bbclass trying to build the
initramfs before the kernel's do_install rule.

The solution for this problem is to have the kernel's
do_bundle_initramfs_image task depend on the do_rootfs from the
INITRAMFS_IMAGE and not some intermediate point.  The image.bbclass
will also sets up dependencies to make the initramfs creation task run
last.

The code to bundle the kernel and initramfs together has been added.
At a high level, all it is doing is invoking a second compilation of
the kernel but changing the value of CONFIG_INITRAMFS_SOURCE to point
to the generated initramfs from the image recipe.

[YOCTO #4072]

(From OE-Core rev: 609d5a9ab9e58bb1c2bcc2145399fbc8b701b85a)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-06 23:04:47 +01:00
Richard Purdie 554c892ccf meta: Don't use deprecated bitbake API
These have been deprecated for a long time, convert the remaining
references to the correct modules and prepare for removal of the
compatibility support from bitbake.

(From OE-Core rev: 6a39835af2b2b3c7797fe05479341d71a3f3aaf6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01 15:51:42 +01:00
Richard Purdie 93ec1e347c classes: Remove references to _remove in function names since this may become a bitbake keyword
There is a good chance we might want to support a bitbake operator
"_remove" which works in a similar way to _append and _prepend. As
such, we can't use those keywords in function or variable names.

(From OE-Core rev: 491fde8cd3fd493f9fec2fd434fe1be547f66148)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26 11:29:45 +01:00
Mark Hatle a6a3ec1ea0 image.bbclass: Add basic support for PACKAGE_EXCLUDE
Add the foundation for the PACKAGE_EXCLUDE support.

As part of this work, it was noticed that the PACKAGE_INSTALL and
PACKAGE_INSTALL_ATTEMPTONLY were still using he 'normal' version for
dependencies.  This should no longer be necessary as of the change in the way
the complementary package groups (dev, dbg, ptest and others) are defined.
By making this change the dependency tree is more correct than before, and
gives the ability for manipulating PACKAGE_INSTALL and
PACKAGE_INSTALL_ATTEMPTONLY, while adjusting the dependencies at the same
time.

Warning messages will be generated if the user is trying to exclude a
package that was previously in the PACKAGE_INSTALL or
PACKAGE_INSTALL_ATTEMPTONLY variables.

(See additional commits for package manager specific support.)

Add documentation on PACKAGE_EXCLUDE and related variables.

(From OE-Core rev: 208d4d5ef7c5ead35dc27b7808f92ed377377aa4)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-22 18:29:59 +01:00