boot-directdisk: avoid loop in MBR disk signature generation

Instead of looping until the generated signature is non-zero, just
return 'ffffffff' if it's zero. This avoids an infinite loop if the
generated signature is always zero.

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cross/crosssdl/native/nativesdk: Fix do_packagedata stamps

If you build nativesdk for machine A, then change to B you will see sstate
manifest warnings for the packagedata files. The stamps are machine
specific and should not be, ditto for native.

This patch copies the populate-sysroot extra stamp entries to avoid
these warnings.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gcc-common: Improve fpu code checksum dependencies

We only care about the end result in this case, not the specific inputs
that went into determining the gcc option. This change updates the code
to reflect that.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
pixman: Fix nativesdk rebuilds for armv7a

MACHINE=X bitbake nativesdk-pixman; MACHINE=Y bitbake nativesdk-pixman

where X is an armv7a machine and Y is not results in pixman rebuilding
due to the neon option. This is incorrect. The ultimate fix will be
not to apply target system overrides in the nativesdk case. Until
we do that we can at least work around the issue as done by this patch.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cross-canadian: Fix TUNE_PKGARCH references

The cross-canadian compilers are now build once per architecture but were being
installed into tune specific locations which is incorrect. This adjusts things
so they are make TARGET_ARCH specific. We gain the tune specific parts from the
target sysroot which remains tune specific, the compiler and tools are independent
ot that.

binutils/gcc require sysroot options but since we reset at runtime, these shouldn't
have dependencies in the sstate checksums. They are therefore also excluded.

With these patches, switching machines does not result in a rebuild of *-cross-canadian
and the compiler is correctly located and referenced in the target images.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
opkg: ignore result of opkg configure

Some packages may return error while running opkg-cl configure, during
first boot. This will fail 'ExecStart' and 'ExecStartPost' will not run.
Without 'ExecStartPost' opkg-configure service will continue to run on
successive boot attempts. 'ExecStartPost' should disable this service
after first boot irrespective of 'ExecStart' status.

Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
license.bbclass: use shutil instead of bb.utils.copyfile

bb.utils.copyfile is for a specific purpose and more complicated than needed
here, so just use shutil.copyfile.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
linux-yocto: enable CONFIG_INPUT_EVDEV as standard policy

We have a number (in fact most) BSPs that require INPUT_EVDEV for basic
functionality. The size increase is minimal, so we'll add it to the
standard configuration for all platforms.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-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>
dbus: fix QA error building nativesdk-dbus

Fixes the following QA error:

ERROR: QA Issue: nativesdk-dbus: Files/directories were installed but not shipped
  /run
  /run/dbus

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
kmod: ptest fixes

 Make kmod-ptest able to compile with separated source and
 build dir. Since kmod test files contain kernel modules for
 many different architectures, strip and arch gets confused
 and throws errors.

Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Signed-off-by: Björn Stenberg <bjst@enea.com>
Signed-off-by: Maxin B. John <maxin.john@enea.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
systemd-compat-units: Use correct run-postinsts script link

OE-Core commit 75a14923da1ba91eddde47f0907345c19c82d6f0 has moved
run-postinsts script execution from S98 to S99 in rcS.d. run-postinsts.service
should check for this script and run it on first boot rather than
S98run-postinsts, which is for opkg/dpkg.

Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
systemd: Track postinst/prerm in task checksum

When these functions change, the package should rebuild but currently it
does not. We need to add the dependencies manually as the dependency
code can't track dynamically created variables.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
udpated-rc.d: Track postinst/prerm/postrm in task checksum

When these functions change, the package should rebuild but currently it
does not. We need to add the dependencies manually as the dependency
code can't track dynamically created variables.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
oe-init-build-env: unset BBSERVER

If BBSERVER is set, we should unset it before proceeding. Its assumed the
user will have unloaded the server from memory should they have wished
to do so.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
connman-conf: add a global public DNS to network provisioning

In case of QEMU machines, a global public DNS is provisioned,
as the network is not configured via DHCP.
Google's public global DNS server 8.8.8.8 is used.

Partial fix for [YOCTO #4587] (qemu machines case).

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
oe-init-build-env-memres: Unset BBSERVER if already set

When starting a new server we don't want bitbake to connect to an existing
server so ensure BBSERVER is unset.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
package_rpm.bbclass: Workaround failure in attemptonly installs

[YOCTO #5313]

When performing an attemptonly install, we should skip an errors and
continue to install everything else.  However, there is a case where two
packages can conflict, and cause a hard failure.

This workaround, ignores this and allows the image to be constructed.
Note: Some items in the failed transaction may not get installed.

To fix this properly we need to find the issue in smart, and make it ignore
or at least attempt to resolve these kinds of conflicts.

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>
run-postinst: Ensure that the postinsts are ordered

The postinst files were being generated using purely the name of the package,
this unfortunately meant the run order would be based on the name of the
package and not the order in which it was installed on the filesystem.

If package A requires package Z to be fully installed, this causes a problem.

Note:

rpm - as the rpm based install proceeds the order is defined and captured.
      so the problem is resolved there.

ipk - this unfortunately does not appear to solve the problem for ipk, as
      the status file is not ordered in any appreciable way.  This does not
      cause any regressions however and sets the stage for a proper fix.

deb - this -may- fix the deb install.  Early testing indicates at least some
      ordering to the status file.  But it's unclear if it completely resolves
      the issue.

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>
python: Ensure build completes before install

At the start of install, python swizzles the makefiles around, leading
to chunks of do_compile running again. These race against the install
target, leading to errors if pieces are being recompiled whilst others
are being installed.

For now, workaround this by running the compile target with the new
makefile, then running install ensuring a parallel make race doesn't
happen.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
xdpyinfo: Add dependency on libxcomposite

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>