rpm: Fix cpio 32 bit overflow issues on 64 bit inode filesystems

When building on XFS filesystems, the resulting rpms can be corrupted
with the same inode number being used for multiple hardlinked files.
There are two fixes, one to stop rpm crashing when accessing a broken
binary rpm, the other to stop generating them in the first places. Full
descriptions in the patch headers.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
rootfs.py: change the logic in _uninstall_unneeded

Previously, if we have 'package-management' and 'read-only-rootfs'
both in IMAGE_FEATRUES, we would meet the following error at system
start-up.

	rm: can't remove '/etc/rcS.d/S99run-postinsts': Read-only file system

However, what's really expected is that when there's no postinstall
script at system start-up, the /etc/rcS.d/S99run-postinsts should not
even be there.

Whether or not to remove the init script symlinks to run-postinsts should
not depend on whether we have 'package-management' in IMAGE_FEATURES; rather,
it should only depend on whether we have any postinstall script left to run
at system start-up.

This patch changes the _uninstall_unneeded function based on the logic
stated above.

[YOCTO #6257]

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>
texinfo: Use texinfo-replacement-native as an alias for texinfo-native.

If texinfo-native is added to ASSUME_PROVIDED, this will be needed for two
reasons. First, a world build will still build the native texinfo recipe, so
it will still get test coverage and will not rot. Second, when the target
architecture texinfo recipe is built, the native recipe must be built first
so its makedoc binary can be extracted, ASSUME_PROVIDED or no.

Signed-off-by: Max Eliaser <max.eliaser@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
texinfo-dummy-native: Create recipe w/ scripts to stand in for Texinfo utils.

More work toward eliminating the dependency on the host system's Texinfo--
Python scripts that understand the same command-line options as the Texinfo
utilities, and create blank output files if appropriate, but don't actually
do any of the work done by those utilities.

This will be necessary to avoid circular dependencies when we start explicitly
tracking dependencies on texinfo-native; i.e. texinfo-native ->
autoconf-native -> texinfo-native. If we have all native recipes that inherit
texinfo.bbclass depend on texinfo-dummy-native instead of texinfo-native, the
cycle is broken.

It may also provide a performance gain by skipping the actual work of
formatting and generating documentation files.

Signed-off-by: Max Eliaser <max.eliaser@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
texinfo.bbclass: native/cross uses dummy texinfo; target uses host's Texinfo.

To unpack that to more than a single line: -native and -cross recipes are made
to use the dummy Texinfo utilities provided by texinfo-dummy-native if they
invoke those utilities at build time. The target-architecture (cross-compiled)
recipes still use the genuine Texinfo utilites. Right now, they still use
the host system's Texinfo utilities, but could be made to use the
texinfo-native recipe we already ship with some config file changes.

Signed-off-by: Max Eliaser <max.eliaser@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
v4 cups: Shouldn't link against libgcrypt without using gcrypt functions

Backported from http://www.cups.org/strfiles.php/3308/cups-no-gcrypt.patch

This addresses the cryto dependency seen during build.

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
sed: enable ptest support

Install sed test suite and run it as ptest.

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
nfs-utils: Do not pass CFLAGS to gcc while building

Do not pass CFLAGS/LDFLAGS to gcc while building, The needed flags has
been passed by xxx_CFLAGS=$(CFLAGS_FOR_BUILD).

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
perf: fix broken shell comparsion in do_install

The patch was sponsored by sysmocom

Signed-off-by: Henning Heinold <henning@itconsulting-heinold.de>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
perf: split packging

* some fundamental perf commands can work
  without the dependency on perl, python or bash
  make them separate packages and RSUGGEST them

* bump PR

The patch was sponsored by sysmocom

Signed-off-by: Henning Heinold <henning@itconsulting-heinold.de>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
oprofile: Determine the root home directory dynamically

This commit detects the root home directory dynamically with changes to
the opcontrol script and the oprofile gui app source.

The commit replaces an earlier fix that detected and adjusted a
'non-standard' root home directory at build time.  The advantage of this
patch is that the oprofile tools are adjusted to the current run-time
path to ~root, not the build time path.

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
kexec-tools: Refine kdump device_tree sort

The commit b02d735bf was to rearrange the device-tree entries, and
assumed that these entries are sorted in the ascending order. but
acctually when I was validating kexec and kdump, the order of
serial node still is changed. So the patch is to sort these entries
by the directory name in ascending order.

Signed-off-by: Yang Wei <Wei.Yang@windriver.com>
Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
targetcontrol.py: make possible dynamical determination of rootfs type

YB: #6375

Added a new method get_image_fstype() that autodetermines what fstype to use for the rootfs file.
This method uses a new list variable 'supported_image_fstypes' that contains image fstypes supported by the target controller.

This method is also a classmethod which means outside scripts can get the image fstype.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
masterimage.py: enable dynamical determination of rootfs type

YB: #6375

Adding support for get_image_fstype() in the MasterImageHardwareTarget and GummibootTarget classes.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
core-image-testmaster.bb: add bzip2 to image

YB: #6375

Some test image fstypes require bzip2 decompression.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
targetcontrol.py: Add a classmethod to get extra files needed by the target controllers

YB: #6254

Add a new classmethod that can be used by outside scripts to get the extra files needed by the target controllers.
An outside script can predict rootfs, manifest and kernel files needed by a target controller, but sometimes there are other files needed.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
oeqa/controllers/testtargetloader.py: add 'import os'

YB: #6254

This module uses os but relies on other modules to import it. Adding 'import os' in order to be self-sustained.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
controllers/masterimage.py: Make testimage kernel naming pattern universal

YB: #6254

The QemuTargetControl class does not specify any kernel naming but the runqemu script it uses uses the " KERNEL_IMAGETYPE + MACHINE + '.bin' " naming scheme.
Modifying the other major target controller class, MasterImageHardwareTarget, to use the same kernel naming scheme.

This is usefull also to outside scripts that want to anticipate the kernel file name for all target controllers.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/test-remote-image: Add script for running runtime tests on remotely built images

YB: #6254

Adding a new script that will fetch image files from a remote images repository.
These images will then be used for local runtime testing.

Use the '-h' option for more details on usage.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
git: fixed typo in 'libexecdir' varname

variable is called 'libexecdir', not 'libxecdir'.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>