Commit Graph

859 Commits

Author SHA1 Message Date
Scott Garman 81f4de35fc runqemu: remove core-image-* whitelist
Using a whitelist for image names to default to when none are
specified on the command line is no longer desired. Instead,
choose the most recently created image filename that conforms
to typical image naming conventions.

Fixes [YOCTO #5617].

(From OE-Core master rev: 9f69e00200cdbd5ba2e46a54f33c29797816e43f)

(From OE-Core rev: 48f4b36c1a6ad71da752866b8c28885d95444b4e)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-09 11:04:15 +00:00
Bastien JAUNY 37e9b199a6 yocto-bsp: Add missing format specifier in bblayers error message
If the build environment is misconfigured (e.g. a bad path
for a layer in bblayers.conf) the yocto-bsp script crashes with a
standard python error, not very explicit.  This fixes the problem.

 Signed-off-by: Bastien JAUNY <bastien.jauny@gmail.com>

(From meta-yocto master rev: 4a8e80b812eebdc1c9570b5d88aa0f3b34824b68)

(From meta-yocto rev: 578e06f113d870ec6a4e201458488344ca941e3d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-13 09:14:36 +00:00
Tom Zanussi 7d675f1967 wic: Remove selinux_check()
This seems to be an obsolete check - we don't have any problems with
image creation under selinux, so remove it.

(From OE-Core master rev: 12e81eceab9e0a483765566ad3791b14718195b5)

(From OE-Core rev: 28830d3988047023d3b47bcaf320f5efa4428da6)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 17:00:05 +00:00
Konrad Scherer 76e0ce8229 relocate_sdk.py: Allow script to work with Python 2.4 and 3.
Python 2.4 does not support the 'b' string literal or the
keyword 'as' in exception handling. Python 3 does not accept
the old method of exception handling and defaults to unicode.
The b() function converts strings to bytes on Python 3 and
using sys.exc_info() avoids the exception handling syntax.

(From OE-Core master rev: 1e2ec5f576f167673d7980737826987fefdc74a9)

(From OE-Core rev: 343127f2f81be337596d3eacbbc92278e82ce574)

Signed-off-by: Konrad Scherer <Konrad.Scherer@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 17:00:02 +00:00
Chen Qi fc9f1c8168 runqemu-extract-sdk: add --numeric-owner option to tar command
If the same username exists on both target and the build host, but
the uids differ, and we start target via NFS, then the uid for the
user will be incorrect on target.

For example, if postfix's uid on host is 119 and on target is 1024,
then if we start target via NFS, the uid for postfix will be 119.

The root cause is that when we use runqemu-extract-sdk to generate
the NFS rootfs for later use, the tar command will respect the username
instead of uid. So if PSEUDO_PASSWD environment is not set correctly,
the host /etc/passwd will be used, resulting in wrong uids.

The situation for gid is completely analogous to that of uid.

It's almost impossible for the runqemu-extract-sdk to guess the correct
location of the needed password file merely based on the target tarball
name.

This patch solves this problem by adding the '--numeric-owner' option
to the tar command so that the uid/gid will be used when extracting the
tarball using runqemu-extract-sdk. In this situation, we'll always get
the correct uid/gid after extracting the tarball.

[YOCTO #5364]

(From OE-Core master rev: acce6ff1a77cfd29e3868faa89b120becb58bbbf)

(From OE-Core rev: c2baac739a521d1edd408a24f6b1fece8f755218)

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>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 17:00:02 +00:00
Tom Zanussi 34739daf7c wic: Update and generalize pseudo setup for rootfs generation
Remove unnecessary pseudo exports i.e. PSEUDO_DISABLED and move the
setup to the top-level prepare_rootfs().

(From OE-Core master rev: 4bf11cd7d7301da664c098c8a0ae9c0294a6f423)

(From OE-Core rev: 8d661f578276c70e1671edfc810aa4dad97de970)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 17:00:01 +00:00
Tom Zanussi f29fde153b wic: Make find_binary_path() more user-friendly
find_binary_path() is useful, but if the binary isn't found, it prints
a stacktrace and a less-than-useful message.  Users complain when they
get stacktraces for things they can act on, so remove the stacktrace
and tell the user what the problem is.

(From OE-Core master rev: 0d9eef0eaa267500e8eedab8b72ddf24eb0516db)

(From OE-Core rev: 8a17195c9be38815e9ae431bcb18f66a4ad2cdcb)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 17:00:01 +00:00
Tom Zanussi b768094125 wic: Remove binary dependencies
Current functionality doesn't make use of kpartx, mount, or unmount,
and we use native mkswap, so remove the binary checks for those.

(From OE-Core master rev: 76293d2d6bbdeacd7b34f39f26fb97c3d7f9496f)

(From OE-Core rev: 0ed290b81e1c3b781170033f50db01ddfff14784)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 17:00:00 +00:00
Tom Zanussi 45bdd32eeb wic: Remove rpmmisc call from livecd
We don't currently use LiveCDImageCreator, but it makes calls when
initialized via the plugin interface to rpmmisc module functions,
which we don't want the dependency on.

To make it (and LiveUSBImageCreator) happy, we give it the dummy
"i386" value for now.

(From OE-Core master rev: e10ae516cfc10900ed12e84c743e3a7127372135)

(From OE-Core rev: a3cc57cf3116c997ec11dd3cbfa3b0d615e5dabc)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 17:00:00 +00:00
Tom Zanussi 72db8ccf90 wic: Remove rpm and grabber dependencies from BaseImageCreator
BaseImageCreator is a base class for DirectImageCreator and others,
and imports rpm and grabber (which imports rpm).

The various plugins e.g. DirectPlugin import the creators and
therefore these dependencies, which manifest at run-time as e.g.:

  Warning: Failed to load plugin imager/direct_plugin: No module named
    rpm

(From OE-Core master rev: a1e24c4a5f5771b7ad35e53ce96c6d82212e4d7e)

(From OE-Core rev: f5587ec7e7f925b321b9bfe6923be0879dadb2aa)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 17:00:00 +00:00
Tom Zanussi 8d158a7ecf wic: remove rpm warning code from BackendPlugin
We don't currently use rpm functionality, so we don't need to silence
rpm warnings.

(From OE-Core master rev: dd3cc03d4fa3347f8ef2db23d8ff98bdbdb73baa)

(From OE-Core rev: 8827b46d8cb4d6918451bd1c3c278465d8796e4b)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 16:59:59 +00:00
Tom Zanussi d3f1ed6967 wic: Remove dependency on myurlgrab module
mylrlgrab is in grabber, which imports rpm.  For current
functionality, we don't need to grab urls or import rpm, so remove the
dependency.

(From OE-Core master rev: 429ecc2afa499df35a1ae9da6f92b88c6f2d8d11)

(From OE-Core rev: 1ef27c9dfa28f65458750c0afb2e136c4b79b226)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 16:59:59 +00:00
Tom Zanussi ff4aaa8508 wic: Remove dependency on rpmmisc
rpmmisc imports rpm and contains misc rpm utilities related to
packaging and determining arches based on the packaging.  We should
never run across this in the initial version of wic, so remove the
dependency.

(From OE-Core master rev: 2d59b6eeb418cf23eef3e32b43354b4ab16a40b9)

(From OE-Core rev: b16a9de9f5eb2d252ee263a4b2c66c74ff4ff78f)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 16:59:59 +00:00
Tom Zanussi 7a5e6c4ec9 wic: eliminate module checks
We're removing all external dependencies including rpm and urlgrabber,
so we don't need this check.

(From OE-Core master rev: 429c0d72b9b8bfed34832e283be92996e074b9ac)

(From OE-Core rev: 898285fbe172e0e77f0986be8f5187f86bfca95b)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 16:59:59 +00:00
Tom Zanussi 3bcd49dddf wic: Remove dependency on rt_util module
rt_util contains bootstrap_mic(), which imports rpm and other things
we don't need because we don't do bootstrap i.e. runtime (set in
wic.conf) is always set to 'native', which means use what's on the
local host.

bootstrap mode is for downloading and installing rpms that wic needs,
which we may want to implement later; for now, we just want to use
what's local.

(From OE-Core master rev: 3103f0cb908eced7b751128c2bba898d12017c80)

(From OE-Core rev: f338d696b7f865bdb10020f806c69c78e8ed6625)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 16:59:58 +00:00
Tom Zanussi 9e27361d81 wic: add pseudo to the populate-extfs step
Without this, files in the generated filesystem pick up the wrong
ownership.

(From OE-Core master rev: 24a6b1324965080fef6c363edcb37768090eebea)

(From OE-Core rev: ecdc5422bd3e3efbf46c3d12d0a95d9f736a6d27)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 16:59:58 +00:00
Tom Zanussi 10cdde99a8 wic: Initialize return values in find_artifacts()
If one of these isn't found, it won't be initialized and will throw an
UnboundLocalError.

(From OE-Core master rev: ce6c3ec0e5f4822e85b8f957e9e31fa9de438c55)

(From OE-Core rev: 9bf229c7b66bda4fb52f53d6f7f6b86f10dc8681)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 16:59:58 +00:00
Tom Zanussi 9ee975be7b wic: Check for the existence/correctness of build artifacts
If a user uses the -e option and specifies a machine that hasn't been
built or uses the wrong .wks script for the build artifacts pointed to
by the current machine, we should point that out for obvious cases.

(From OE-Core master rev: a5b9ccadc0603c70c65f74fa386995c585a951db)

(From OE-Core rev: 54e0b423852580c62b43c5ead00f431b971bea1a)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 16:59:57 +00:00
Darren Hart e395ace671 wic: Check for external modules
Since eight unique files import rpm, perform a check at the top level
for the existence of the rpm module print a sensible error message if it
is not. This may be able to be removed if some of the core rpm
dependencies are removed from the mic libs.

Also check for urlgrabber.

This avoids a bracktrace in the event the modules are not installed
which can be very off-putting to would-be users.

(From OE-Core master rev: b11bfadba20c1f39a63e396e605a8316c2ed2a94)

(From OE-Core rev: 93b1d54bf377703cd0c7debce21b07b4fbf4e5a5)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 16:59:55 +00:00
Darren Hart 30df3a1e7b wic: Force lba off for FAT16 partitions
If fat16 is specified to the mkpart parted command, parted will
default to setting the lba flag which causes certain EFI firmware
to fail to detect the filesystem. lba shouldn't be necessary for
FAT16 filesystems anyway, explicitly disable it.

(From OE-Core master rev: 30442d432e203e655b7d40b93f7307f475de1614)

(From OE-Core rev: e437cd5ccaa44798107a6aa5177b1b867c94dfc3)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 16:59:55 +00:00
Tom Zanussi dad9e78f09 wic: check passed-in build artifact directories
Make sure they exist - complain if they don't.

(From OE-Core master rev: 24a585e3fd0ea0166991a6aa834bba15bcd8295d)

(From OE-Core rev: 4565512015d257e492d7fbb9e28c6086111d892d)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 16:59:54 +00:00
Tom Zanussi aeae568600 wic: check for build artifacts
wic needs to be given one form of build artifacts or another -
complain if the user doesn't do that.

(From OE-Core master rev: 9116a17efd42447f276000927d0c2ea63776865b)

(From OE-Core rev: f9b9b920dc071b0798cbdaa150314a0126d2afad)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 16:59:54 +00:00
Tom Zanussi 104166c804 yocto-kernel: Use variable-substituted BBLAYERS
The current find_bblayers() code finds and parses the BBLAYERS
variable manually, and therefore doesn't handle variable substitution,
which causes problems if used.

This change makes find_bblayers() use the variable-substituted
BBLAYERS instead.

Fixes [YOCTO #5106]

(From meta-yocto rev: 1629ac04e909143dc2c275c256094cb44c6cc43c)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-04 16:07:46 +01:00
Tom Zanussi 75c143a7ae wic: Add OpenEmbedded-specific implementation
Reuses the mic/livecd infrastructure but heavily subclasses and
modifies it to adapt to the special needs of building images from
existing OpenEmbedded build artifacts.

In addition to the OE-specific mic objects and modifications to the
underlying infrastructure, this adds a mechanism to allow OE kickstart
files to be 'canned' and made available to users via the 'wic list
images' command.

Two initial OE kickstart files have been added as canned .wks files:
directdisk, which implements the same thing as the images created by
directdisk.bbclass, and mkefidisk, which can essentially be used as a
replacement for mkefidisk.sh.  Of course, since creation of these
images are now driven by .wks files rather than being hard-coded into
class files or scripts, they can be easily modified to generate
different variations on those images.  They also don't require root
priveleges, since they don't use mount to create the images.  They
don't however write to media like mkefidisk.sh does, but rather create
images that can be written onto media.

(From OE-Core rev: f87acc5e59d3c2c39ff171b5557977dab4c8f4a6)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-01 22:56:03 +01:00
Tom Zanussi 9fc88f96d4 wic: Add mic w/pykickstart
This is the starting point for the implemention described in [YOCTO
3847] which came to the conclusion that it would make sense to use
kickstart syntax to implement image creation in OpenEmbedded.  I
subsequently realized that there was an existing tool that already
implemented image creation using kickstart syntax, the Tizen/Meego mic
tool.  As such, it made sense to use that as a starting point - this
commit essentially just copies the relevant Python code from the MIC
tool to the scripts/lib dir, where it can be accessed by the
previously created wic tool.

Most of this will be removed or renamed by later commits, since we're
initially focusing on partitioning only.  Care should be taken so that
we can easily add back any additional functionality should we decide
later to expand the tool, though (we may also want to contribute our
local changes to the mic tool to the Tizen project if it makes sense,
and therefore should avoid gratuitous changes to the original code if
possible).

Added the /mic subdir from Tizen mic repo as a starting point:

 git clone git://review.tizen.org/tools/mic.git

 For reference, the top commit:

 commit 20164175ddc234a17b8a12c33d04b012347b1530
 Author: Gui Chen <gui.chen@intel.com>
 Date:   Sun Jun 30 22:32:16 2013 -0400

    bump up to 0.19.2

Also added the /plugins subdir, moved to under the /mic subdir (to
match the default plugin_dir location in mic.conf.in, which was
renamed to yocto-image.conf (moved and renamed by later patches) and
put into /scripts.

(From OE-Core rev: 31f0360f1fd4ebc9dfcaed42d1c50d2448b4632e)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-01 22:56:03 +01:00
Tom Zanussi 53a1d9a788 wic: Initial code for wic (OpenEmbedded Image Creator)
Initial implementation of the 'wic' command.

The 'wic' command generates partitioned images from existing
OpenEmbedded build artifacts.  Image generation is driven by
partitioning commands contained in an 'Openembedded kickstart' (.wks)
file specified either directly on the command-line or as one of a
selection of canned .wks files (see 'wic list images').  When applied
to a given set of build artifacts, the result is an image or set of
images that can be directly written onto media and used on a
particular system.

'wic' is based loosely on the 'mic' (Meego Image Creator) framework,
but heavily modified to make direct use of OpenEmbedded build
artifacts instead of package installation and configuration, things
already incorporated int the OE artifacts.

The name 'wic' comes from 'oeic' with the 'oe' diphthong promoted to
the letter 'w', because 'oeic' is impossible to remember or pronounce.

This covers the mechanics of invoking and providing help for the
command and sub-commands; it contains hooks for future commits to
connect with the actual functionality, once implemented.

Help is integrated into the 'wic' command - see that for details on
usage.

(From OE-Core rev: 95455ae4251e06d66e60945092b784d2d9ef165c)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-01 22:56:03 +01:00
Jason Wessel cf2ebed2ff mkefidisk.sh: Allow using a loopback mounted file
It should be possible to generate a disk to a file using a loopback
device with mkefidisk.sh, which is useful for booting simulators.  To
make this possible the partitions for the loop back need to work
similarly to the mmc devices.  The mkfs.vfat also requires and
additional argument to force it to write to something other then a
real disk.

Example:
  qemu-img create -f raw bigdisk 4G
  dev=`sudo losetup -f`
  sudo losetup $dev bigdisk
  mkefidisk.sh $dev tmp-eglibc/deploy/images/qemux86/core-image-minimal-qemux86.hddimg /dev/sda
  sudo losetup -d $dev

Note:
  Also a bug was fixed in the mkefidisk.sh where if the disk you are
  writing to initially has an invalid label the size of the first
  partition will be computed incorrectly.  For the simulator disk
  creation this is generally always the case, but this can happen with
  real hardware as well.

(From OE-Core rev: 254899824900f2e8c6a34d2ad1b8cbea91acb4ae)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-30 22:11:58 +01:00
Richard Purdie b8819b02dc runqemu: Use correct kvm CPU options for qemux86* with kvm
The existing -cpu host option caused kernel panics when people attempted to use
the kvm option. After research and discussion, the best options appear to
be the kvm32/kvm64 cpu types so lets use these instead. These resolve
the kernel issues for me.

[YOCTO #3908]

(From OE-Core rev: bdc6d3be6ffa4ed358153f9c9332b632324f5833)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-26 16:37:56 +01:00
Laurentiu Palcu 5b5e1b9008 relocate_sdk.py: make it work also with python 3
Strings in Python 3, by default, are assumed to contain unicode
characters. In previous versions of python (<3), unicode strings are
explicitly declared with u"abc". If not, than they're automatically
converted to bytes. This doesn't happen anymore in Python 3.

Since we're dealing with binary files, opened in byte mode, make sure
that we explicitly convert all strings to bytes to make both python 2
and 3 happy.

Other changes:
 * add a safety check to make sure relocation did not change the file
   size;
 * a couple of cosmetic changes (wrap long lines so that we don't have
   to scroll to reach the end of them);

(From OE-Core rev: 175f20e27eadc79df16109961f5ce6232705e96f)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-26 16:37:55 +01:00
Paul Eggleton f79b21a57b scripts/runqemu: write temp file into correct location
We want the temporary file to be written in /tmp not the current
directory.

(From OE-Core rev: fcb40c11998030eb5fce89ce5a9ca567870aafa9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-24 17:57:03 +01:00
Tom Zanussi 0fc8317c63 yocto-bsp: add 3.10/remove 3.8 kernel from templates
For Yocto 1.5, 3.10 is the preferred kernel and 3.8 is obsolete.

This also removes any mention of emgd from the templates - we want to
discourage users from using it - it will be obsolete soon in any case.

Fixes [YOCTO #5107]

(From meta-yocto rev: 4dd4bf6ac2dcc7652ec8f807df02298546bdb41b)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-24 12:01:47 +01:00
Laurentiu Palcu 405be52d26 runqemu: set qemuarm memory size back to 128MB
The following commit, 6ccd4d6, increased the RAM size for qemu machines
to 256MB due to some smart sanity tests failing on autobuilder because
more memory was needed.

Unfortunately this leads to various, potentially dangerous, issues like
the one observed during sudoku-savant project compilation:

collect: relinking
collect2: error: '_ZNK6sudoku5ClearINS_6SquareEEclERS1_' was assigned to
'board.rpo', but was not defined during recompilation, or vice versa
board.o:(.rodata+0x8): undefined reference to
`sudoku::Clear<sudoku::Square>::operator()(sudoku::Square&) const'
board.o:(.rodata+0x20): undefined reference to
`sudoku::Clear<sudoku::Sequence>::operator()(sudoku::Sequence&) const'
board.o:(.rodata+0x34): undefined reference to `typeinfo for
sudoku::Action<sudoku::Sequence>'
...AND THE LIST CONTINUES...
collect2: error: ld returned 1 exit status
make: *** [sudoku-savant] Error 1

After some tests, I found that the maximum amount of memory needed for
sudoku to compile properly is 146MB(!?!).

My attempts to create a simpler test case (using templates), in order to
replicate and isolate the issue failed. All the tests compiled just
fine.

So, my guess is that this problem is certainly memory related but the
cause might be hidden in any of the following: qemu versatile hw model,
in the kernel or, highly unlikely but not impossible, the toolchain
itself. The reason I don't really think the cause is in the toolchain is
the fact that the compilation completes just fine for 128MB on qemuarm but
also on other qemu machines (with 256MB of memory).

Since this issue might need lots of time to have a proper fix, I'll revert back
to using 128MB for qemuarm for the time being.

[YOCTO #5133]

(From OE-Core rev: 06605bd6ddd4d6a788e1a107dcf15dde1027c094)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-22 12:19:41 +01:00
Paul Eggleton d652987612 classes/imagetest-qemu: remove old image testing class
This has now been superseded by testimage.

(From OE-Core rev: d469c92394a1a95ae7a45b8b80dc4c2918e0e9a6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-22 12:19:41 +01:00
Ross Burton 77ae0d905a wipe-sysroot: delete pkgdata stamps
The pkgdata stamps now need to be wiped away if the sysroot is destroyed.

(From OE-Core rev: e6ef8399cd8e97b9cd59855e11f1792445f0e65b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-22 12:19:32 +01:00
Stefan Stanacar 576a19ed6c scripts/contrib/build-perf-test.sh: record size in kb and remove extra spaces
(From OE-Core rev: 8c2b5948d41d753982242cd86a1498ab4f1bb317)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-14 08:29:41 +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
Paul Eggleton 6670be71f7 bitbake.conf: include machine name in DEPLOY_DIR_IMAGE
This allows a clean seperation between image outputs from different
machines, and makes it possible to have convenience symlinks to make
the output ready to deploy.

This did require some surgery in runqemu; if explicit paths to the image
and kernel are not supplied then DEPLOY_DIR_IMAGE needs to be determined
from bitbake or set in the environment. However the script does try to
avoid requiring it unless it really is needed. Corresponding changes
were made in the automated testing code as well.

Based on an RFC patch by Koen Kooi <koen@dominion.thruhere.net>

(From OE-Core rev: 7e90261aec61f79680b5eaeaf5b18c7b795412a4)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-14 08:21:00 +01:00
Peter Kjellerstedt 4137f9a996 bb-matrix-plot: Use interpolation for sparse data
If not every combination of BB_NUMBER_THREADS and PARALLEL_MAKE have
been tested by bb-matrix.sh, e.g., by using BB_RANGE="04 08 10 12 16"
and PM_RANGE="04 08 10 12 16", then the graph that gnuplot generates by
default looks very jagged due to the missing data points. By using
splines to interpolate the missing data the graph looks a lot better.

This should not change graphs where all data points are available in any
way, only improve sparse graphs.

(From OE-Core rev: 9642c1314da64c70254f6b012aa73ef37bbaa33f)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-14 08:21:00 +01:00
Peter Kjellerstedt 643252f889 bb-matrix: Clean before, rather than after, building
This makes sure the the first build starts from a clean state. Otherwise
one could have the first build affected by any leftover state from
a previous build.

This also leaves a working state behind after the final build.

(From OE-Core rev: f8f86ac88aa1bba99ba28762cfbd97d3721da7d9)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-14 08:20:59 +01:00
Ross Burton 40232ed397 yocto-bsp: conditionalise mesa-swrast on opengl in templates
As per the similar commit in oe-core on the qemu machines, the templates should
respect the opengl DISTRO_FEATURE when adding mesa-driver-swrast to new qemu
machines.

(From meta-yocto rev: 8d42ea2b2566913642c759e48ffe1f5f5166c510)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-11 12:29:06 +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
Saul Wold 0ca5d1fb38 yocto-bsp: remove apm as a default MACHINE_FEATURE
APM is not only obsolete, but also requires a kernel config enabled, which is not enabled by default

[YOCTO #5121]

(From meta-yocto rev: e25c43661f27b27e61aa7fae868237c1c60e3e25)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-09 16:28:47 +01:00
Mihai Prica 12d003a800 scripts/runqemu: Fix MACHINE regex
When runqemu tries to determine the MACHINE variable from a
kernel or vmdk filename that doesn't contain any known machine
name, the variable gets set to the filename. It should remain
unset and cause an error.

[YOCTO #2890]

(From OE-Core rev: 22c0668d9e0a22c095d78bab7b45ef4f803dd0d1)

Signed-off-by: Mihai Prica <mihai.prica@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-04 14:17:29 +01:00
Paul Eggleton 6ccd4d6a9d runqemu: set memory size to 256M for most qemu machines
Set memory size to 256M for qemuarm, qemux86, qemux86-64, qemumips,
qemumips64, and qemuppc.

This allows the smart automated tests to run on machines with a GUI
environment (such as Sato) running at the same time, for which 128M is
too limiting. Setting this in runqemu allows users manually using
runqemu to avoid the same out-of-memory issues under similar conditions
using smart, on-target compilation or other uses.

Fixes [YOCTO #5045].

(From OE-Core rev: fe5dfdece98692f8fa731c8d11c907a272266ea5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-02 18:02:59 +01:00
Ross Burton 212f512e46 wipe-sysroot: fix removals
The previous changes were totally broken as quoting globs doesn't work.  Remove
the quotes so the rm commands actually delete the stamps.

(From OE-Core rev: 5eca43debd7fbc861d41f4e260b37282915bd053)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-02 18:02:59 +01:00
Peter A. Bigot 118d74e28c oe-setup-rpmrepo: add native sysroot so nativepython can be found by env
This avoids the following new behavior resulting from the create_wrapper
fixes:

  llc[11]$ ../poky/scripts/oe-setup-rpmrepo
  /usr/bin/env: nativepython: No such file or directory

(From OE-Core rev: ce37ef05c14ba28773823d1f14f629c37c76d827)

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-30 18:06:31 +01:00
Chen Qi b2a0e3ad91 runqemu-ifdown: clean up the remaining iptables rules
The iptables rules for the tap interface are added by runqemu-ifup
everytime we use runqemu to start a qemu target. But it's not cleaned
up when runqemu exits.

This patch cleans up the remaining iptables rules for the tap interface
in runqemu-ifdown.

[YOCTO #5047]

(From OE-Core rev: ef38a0aed35357d035ca587162158cd2f55b958f)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-30 16:23:47 +01:00
Chen Qi 5bffc4ff4d runqemu-internal: provide more info if a preconfigured tap is used
We should provide the user more information if a preconfigured tap
is used. This is because the user might have manually set up the tap
interface to be used by other qemu binaries.

So at a minimum, we should let the user know how to make runqemu skip
that tap interface.

[YOCTO #5047]

(From OE-Core rev: ec08d92641cc51c567cc3745937b1839d3faa095)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-30 16:23:47 +01:00
Chen Qi a78bf1ce7b runqemu-internal: don't bring down preconfigured tap interface
runqemu-ifup and runqemu-ifdown should be pairs. If we're using a
preconfigured tap interface, the runqemu-ifdown should not be invoked
to bring it down.

(From OE-Core rev: f60f215f74b5fe5a43943c9d3ccdbe0fa06b7828)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-30 16:23:47 +01:00
Hongxu Jia 926a117486 list-packageconfig-flags.py: fix searching bitbake module failed
Run list-packageconfig-flags.py on wrlinux's platform in which
the oe-core layer and bitbake layer in different directories:
----
../layers/oe-core/scripts/contrib/list-packageconfig-flags.py
Traceback (most recent call last):
  File "../layers/oe-core/scripts/contrib/list-packageconfig-flags.py", line 28, in <module>
    import bb.cache
ImportError: No module named bb.cache
----

The script import bb module from bitbake lib dir, the previous
lib dir was hardcode and only worked on poky but not for others.

In this situation, look for bitbake/bin dir in PATH could fix this issue.

[YOCTO #5060]

(From OE-Core rev: 9e749c430f97b1a30cdf0c13dacd2a985ef7b433)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-30 16:23:47 +01:00