Commit Graph

197 Commits

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