Commit Graph

1790 Commits

Author SHA1 Message Date
Markus Lehtonen fd4894fcb4 devtool: extract: update SRCTREECOVEREDTASKS for kernel
Add 'do_kernel_configme' and 'do_kernel_configcheck' to
SRCTREECOVEREDTASKS of kernel packages. These tasks should not be run
because kernel meta in the srctree is not necessarily up-to-date or
even present which causes build failures and/or invalid kernel config.
Especially so because 'do_patch' which is a dependency of
'do_kernel_configme' is not being run.

We now store .config in the srctree and 'do_configure' task is able to
run successfully.

(From OE-Core rev: 7ce4c18a4ba1ebcb9f46e652a881ace1f21d2292)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09 08:48:25 +00:00
Markus Lehtonen 34f1d819f4 devtool: extract: copy kernel config to srctree
This makes the correct kernel config to be used when building kernel
from srctree (extrernalsrc). If no kernel config is present in the
builddir 'do_configure' task copies .config from the srctree.

(From OE-Core rev: 3b516332e038a587685f6e0c14a7f04990bdd6cc)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09 08:48:25 +00:00
Mariano Lopez 8612f26004 directdisk-bootloader-config.wks: Add example for custom bootloader config
Add new wks file as a example for a custom bootloader configuration.
This change also includes the configuration that file that will be
used.

This example is using syslinux with MBR, the configuration file is
almost the same as the one generated by wic. As stated before this
is just an example.

[YOCTO #8728]

(From OE-Core rev: 4a9db893f721c0da5d103d28b97a0302cc9e2197)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09 08:48:25 +00:00
Mariano Lopez c59dc3bae0 wic/help.py: Document the new option "configfile"
This just adds the "configfile" option for the bootloader
to wic help.

[YOCTO #8728]

(From OE-Core rev: 597045657a1a635f667404306160f9ab2551e954)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09 08:48:25 +00:00
Mariano Lopez 70338732ac wic: Allow to use a custom config for bootloaders
This change will allow to use a user defined file as the
configuration for the bootloaders (grub, gummiboot, syslinux).

The config file is defined in the wks file with the "configfile"
option in the bootloader line.

[YOCTO #8728]

(From OE-Core rev: d56546b0f312fd042b1a7df3bef97ac1c9b6a5b4)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09 08:48:24 +00:00
Mariano Lopez f95f729518 wic/utils/misc.py: Added function to search for files in canned-wks
This change add two new function to search for files in the
canned-wks folder for all the layers included in bblayers.conf.
This will be used to search for custom configuration files for
the bootloaders.

There are similar functions in the wic engine, but these are
focused in wks files only, so it was needed to create new ones.

[YOCTO #8728]

(From OE-Core rev: 356a942e75ac1743290d2c360d1bb89e2225b6cc)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09 08:48:24 +00:00
Mariano Lopez 9773faadfe wic: Prepare wicboot to allow custom bootloader config
Currently wic does the bootloader configuration file on the fly.
This change introduce a configfile variable for the bootloader;
this is to have a user defined configuration file for the
bootloaders (grub, syslinux, and gummiboot). This is particular
useful when having a multiboot system or scripts embedded in the
configuration file.

[YOCTO #8728]

(From OE-Core rev: 8347aee95ea271921c15ea8e580f0ff62325aa26)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09 08:48:24 +00:00
Ross Burton 70d459ceba scripts/oe-pkgdata-util: sort the packages in list-pkg-files
Sort the list of packages in list-pkg-files to make the output easier to read.

(From OE-Core rev: 6c31655c5abf6ad4308848c116444cc7b1e798bb)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-08 10:20:47 +00:00
Matt Madison 80e39195c7 wic: insert local Python paths at front
This follows how bitbake performs path insertion, and fixes a
failure to start wic on Ubuntu 15.10 with the distribution's
version of python-ply installed.

(From OE-Core rev: 59b1eefb801dfb1d4afe9640e3c8a070d4e1867f)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-08 10:20:47 +00:00
Alejandro Hernandez 2268a702f1 python3: Upgrade from 3.4.3 to 3.5
python3-native_3.4.3.bb -> python3-native_3.5.0.bb:
- changed version
- changed cheksum
- no license change, just dates

python3_3.4.3.bb -> python3_3.5.0.bb:
- changed version
- changed cheksum
- no license change, just dates

New:
- use_packed_importlib.patch: Fixes importlib on cross-compile environments

Rebased:
- Manifest
- 000-cross-compile.patch
- 020-dont-compile-python-files.patch
- 04-default-is-optimized.patch
- python-3.3-multilib.patch
- distutils3-base.bbclass
- distutils3-native-base.bbclass
- python3native.bbclass

Upstream:
- makerace.patch

Misc:
- pip2 is handled as default on major distros,
modified python3-pip to leave /usr/bin/pip available for pip2
- Fixed importing pip3 from python3 interpreter

(From OE-Core rev: 701ec1977ced1bb08461e6de98b4f63d21cba8a6)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:06 +00:00
Leonardo Sandoval cc34104561 oe-selftest: Enable code coverage on unit tests
Enable code coverage through the library 'python coverage'. In case the environment
variable COVERAGE_PROCESS_START is present (one of the requisites for measuring
sub-processes; the second one is including some coverage statements into the
python sitecustomize.py file) it will be taken into account, otherwise it is
exported with value '.coveragerc'. The latter value is a configuration file
(also automatically created) with some default settings. Once tests are
executed, a coverage report is shown on the log and the coverage output data is stored
with name '.coverage.<args>' where '<args>' is the name of the  unit tests executed
or 'all_tests' when running with --run-all-tests. This output data can be latter used
for better reporting using the same tool (coverage).

As briefly indicate before, measuring sub-process implies setting the env variable
COVERAGE_PROCESS_START (done automatically by the oe-selftest code with this patch if
not already set) and creating a sitecustomize.py as explained on [1].
If either one of these is missing, complete coverage will be incomplete.

Current measurements for 'oe-selftest --run-all-tests' indicate that current coverage
is around 42 % taking into account BBLAYERS, bitbake and scripts folders. More details
on [2], indicating the coverage per file/module.

This tasks has been done together with Humberto Ibarra <humberto.ibarra.lopez@linux.intel.com>

[YOCTO #8679]

[1] http://coverage.readthedocs.org/en/latest/subprocess.html
[2] https://bugzilla.yoctoproject.org/attachment.cgi?id=2854

(From OE-Core rev: b3feee2cefbbd98b66dc395b651f47c5028c80a0)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:05 +00:00
Khem Raj 6be94ec72c runqemu-internal: Replace wacom-tablet with tablet for usbdevice
When booting weston-core-image with latest wayland/weston/libinput
mouse/touchpad would not work on qemux86, this fixes the issue

(From OE-Core rev: 4abf18a25ccb1a062a3775be1a70eaf6c155349c)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:05 +00:00
Paul Eggleton 0cc3810299 recipetool: make plugin registration function name consistent with devtool
This should have been register_commands rather than register_command;
I used register_commands in devtool so lets change this here to be
consistent with that. (Since this is extensible through layers though we
need to remain compatible with the old name, so fall back to that if the
new function name isn't there.)

(From OE-Core rev: 1047f6592ac81643cd847f104da766dc4a4c81ea)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:05 +00:00
Paul Eggleton b381f804a5 recipetool: add setvar subcommand
Add a recipetool subcommand "setvar" to set a variable in a file. This
uses our existing logic such that it doesn't matter if the variable is
already set in the recipe, if it's set in the recipe or some inc file,
and if the variable is not currently set that the line setting the
variable gets inserted in the right place in the file.

Implements [YOCTO #7676].

(From OE-Core rev: 7c33ef77fa165182d24f0a9ae769e9e630e6bd47)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:05 +00:00
Paul Eggleton 1fbd76093d lib/oe/recipeutils: refactor patch_recipe_file() to use edit_metadata()
Use bb.utils.edit_metadata() to replace some of the logic in this
function; this avoids us effectively having two implementations of the
same thing. In the process fix the following issues:

* Insert values before any leading comments for the next variable
  instead of after them
* Insert overridden variables (e.g. RDEPENDS_${PN}) in the correct place
* Properly handle replacing varflag settings (e.g. SRC_URI[md5sum])

(From OE-Core rev: 0f81b83fc5fd908efa7f6b837137830ca65f6ed6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:04 +00:00
Paul Eggleton 0b850cb231 devtool: clarify help text
* Make some minor clarifications to help text
* Drop ArgumentDefaultsHelpFormatter and just put the defaults in the
  text itself where needed (because otherwise you get defaults shown for
  store_true options which is somewhat confusing).

(From OE-Core rev: a90ffea30c4578fd6acda2c5945b816ad33b13f5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:04 +00:00
Paul Eggleton 5001f23ecc devtool: build: enable showing default task in help
Enable access to the configuration object in register_commands() so that
we can read configuration values there; this allows us to show the
task that will be run in the command line help for the build subcommand.

(From OE-Core rev: 142d006de3235a034839ef7bbe147c56fc7af04a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:04 +00:00
Paul Eggleton f79022dfff devtool: build: use bbappend to set PARALLEL_MAKE
Use a bbappend file to set PARALLEL_MAKE instead of a postfile; this
is a bit neater and only affects the specified recipe.

(From OE-Core rev: b5bafc845892ac39f85f3642b120fb7b785a3d58)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:04 +00:00
Paul Eggleton 671f41e1d1 devtool: ensure we change back to the original dir on error
This is just belt-and-braces but we ought to use try..finally in this
kind of situation, so just do it.

(From OE-Core rev: a30b407474d4eb6620f1ec549b54187ebbaff008)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:04 +00:00
Paul Eggleton 74505b4295 devtool: search: print SUMMARY value
Print the SUMMARY value for each matched item assuming it's not the
default.

(From OE-Core rev: 596dee8882ebddb45a6cce9f12aa919107106156)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:04 +00:00
Paul Eggleton 3f46af2b19 devtool: drop unused plugin_init() functions
This function is no longer required to be defined for a plugin, so drop
it where it's a no-op.

(From OE-Core rev: 49716a5e27e704598321bd6c82275b16afc444aa)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:04 +00:00
Paul Eggleton 176211abeb devtool: package: use DEPLOY_DIR_<pkgtype> to get deploy directory
Rather than reconstructing the output path for packages, use the proper
variable.

(From OE-Core rev: 06d47777ed1650c479fadf98388f9a3a1f1f9eda)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:03 +00:00
Paul Eggleton 0fe742674e devtool: disable creating workspace for extract and search subcommands
For subcommands that don't actually involve the workspace, don't
auto-create the workspace.

(From OE-Core rev: 90cba7992bc1d227e242666cd486414bd4a45f7e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:03 +00:00
Paul Eggleton f79cc4d9c3 devtool: upgrade: provide a means to update the source branch
If you're upgrading a git recipe to a revision on a release branch
that's different to the branch for the current revision, then you'll
need to update the branch parameter in SRC_URI, so add a --srcbranch/-B
command-line parameter to let you do that easily. It handles both when
the branch is stated verbatim in the recipe, and when a reference to
another variable is used (a common convention is to use a SRCBRANCH
variable for this, though the code doesn't care what variable is used
if any).

(From OE-Core rev: e49a66fd898dd44e54c77a838ebef3d983ed2a03)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:03 +00:00
Paul Eggleton b4d4d2116a devtool: upgrade: fetch remote repository before checking out new revision
If we're upgrading a recipe that fetches from git, and we've simply
fetched a tarball of the repo instead of directly from the upstream repo
(this can happen if you have PREMIRRORS set up as in poky with a core recipe,
e.g. kernelshark) then we won't have any new revisions, and the checkout
will fail with "fatal: reference is not a tree: <hash>". To avoid this,
do a "git fetch" before checking out the new revision.

(From OE-Core rev: c4daebf3fe797a8063dcbc2ab229be2fbedc8134)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:03 +00:00
Paul Eggleton 9b7d45cf48 devtool: upgrade: remove erroneous error when not renaming recipe
If we're upgrading a git recipe the recipe file usually won't need
renaming; for some unknown reason we were throwing an error here which
isn't correct.

(From OE-Core rev: 656348dff9bc9dd1cafc8fff11e5e374e3667f0f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:03 +00:00
Paul Eggleton 9a704441b7 devtool: upgrade: fix updating PV and SRCREV
This code was clearly never tested. Fix the following issues:
* Actually set SRCREV if it's been specified
* Enable history tracking and reparse so that we handle if variables are
  set in an inc file next to the recipe
* Use a more accurate check for PV being in the recipe which will work
  if it's in an inc file next to the recipe

(From OE-Core rev: 8b8f04226ebf464fa61c05ca7af7c6cbda392339)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:03 +00:00
Paul Eggleton 6a52c738ba devtool: upgrade: fix removing other recipes from workspace on reset
If you did a "devtool add" followed by "devtool upgrade" and then did
a "devtool reset" on the recipe you upgraded, the first recipe would
also be deleted from the workspace - this was because we were
erroneously adding the entire "recipes" subdirectory and its contents to
be tracked for removal on reset. Remove the unnecessary call to
os.path.dirname() that caused this.

(From OE-Core rev: 65354e066f87df7d3138adceb22d6a05d1685904)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:03 +00:00
Tzu-Jung Lee 44ef78a46b devtool: include do_patch in SRCTREECOVEREDTASKS
The external source of kernel has been patched during the
construction of git repository. Include the do_patch task in the
SRCTREECOVEREDTASKS.

(From OE-Core rev: 0731c5a9e98f7b7f6e5ada9bbb99acb3f5884516)

Signed-off-by: Tzu-Jung Lee <roylee17@currantlabs.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:03 +00:00
Petter Mabäcker 2d21e5d233 create-pull-request: handle empty ODIR
In some situations you might end-up with an empty ODIR (pull-xx/). The
most common reason is that you have applied your patches on 'master'
branch (or you are by mistake standing on the 'master' branch),
this will result in the default behavior that 'git format-patch'
will try to diff master..master.

Solve this by aborting the script with a proper error code and message
if ODIR is empty after the 'git format-patch' call (that is expected
to generate the cover-letter and patches).

(From OE-Core rev: 5ef9249bbae4f08eb9b981d10f31bd3348449c82)

Signed-off-by: Petter Mabäcker <petter@technux.se>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:02 +00:00
Paul Eggleton c63b36fb39 scripts/gen-lockedsig-cache: improve output
* Print some status when running
* When incorrect number of arguments specified, print usage text

(From OE-Core rev: ac38d245878b618ddf56f9a68834d344500e45a6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:02 +00:00
Ed Bartosh 67af6d6402 wic: exec_native_cmd: implement support for pseudo
Wic runs some tools through pseudo, which makes exec_native_cmd
to fail and throw cryptic error message when tool is not baked:
For example:
  Error: exec_cmd: 'export
  PSEUDO_PREFIX=/media/ssd/poky-build/tmp/sysroots/x86_64-linux/usr;export
  PSEUDO_LOCALSTATEDIR=/media/ssd/poky-build/tmp/work/qemux86-poky-linux/
...
  PSEUDO_PASSWD=/media/ssd/poky-build/tmp/work/qemux86-poky-linux/ ...
  PSEUDO_NOSYMLINKEXP=1;/media/ssd/poky-build/tmp/sysroots/ ...
  mkfs.ext4 -F -i 8192 /var/tmp/wic/build/rootfs_platform.7.ext4 -L
  platform -d
  /media/ssd/poky-build/tmp/work/qemux86-poky-linux/core-image-minimal/...
  returned '1' instead of 0

Made exec_native_cmd aware of pseudo and properly report
errors when command is not found.

(From OE-Core rev: 04bab58809c63c9114feb0aadc9b6115be10fcc4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:02 +00:00
Tzu-Jung Lee 8ae27fa07b devtool: add sync command
The sync command is similar to the extract command, except it
fetches the sync'ed and patched branch to an existing git repository.

This enables users to keep track the upstream development while
maintaining their own local git repository at the same time.

(From OE-Core rev: e2fe4c99f1020a20b579832c4feafcd0e9bc2f75)

Signed-off-by: Tzu-Jung Lee <roylee17@currantlabs.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-25 08:08:09 +00:00
Robert Yang e67c5b0ccf bitbake-prserv-tool: check file name
Fixed:
$ bitbake-prserv-tool import /tmp/1
  File "/path/to/lib/bb/parse/__init__.py", line 114, in handle(fn='/tmp/1', data=<bb.data_smart.DataSmart object at 0x2369bd0>, include=True):
                     return h['handle'](fn, data, include)
    >    raise ParseError("not a BitBake file", fn)

ParseError: ParseError in /tmp/1: not a BitBake file

But 1.conf or 1.inc works well, check the filename and print proper
error message.

(From OE-Core rev: 273eee7a3614caea17c5bc93b720353641293cf7)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-25 07:50:30 +00:00
Christopher Larson 4e2c5e171c recipetool.append: don't choke on a trailing ; in a url
Apparently bb.fetch.URI can't handle this at the moment.

(From OE-Core rev: d3e0a300810251f34932f46daf5263a23846fedd)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-25 07:50:30 +00:00
Leonardo Sandoval a35f79ddd8 yocto-bsp: Set SRCREV meta/machine revisions to AUTOREV
By default, checkout to latest revision from the machine branch specified by
the user.

(From meta-yocto rev: f79a43406b5b323587415380ecffc87527c64653)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-25 07:45:21 +00:00
Leonardo Sandoval 9d585b5025 yocto-bsp: Set KTYPE to user selected base branch
Fixes the hardcode branch name set to KTYPE, where its value is used as a base branch
when user decides to create a new branch. Tested on x86_64 architecture.

[YOCTO #8630]

(From meta-yocto rev: ab895be90a0cae7dfa77a8aab3b19e5571e7e7bc)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-25 07:45:20 +00:00
Leonardo Sandoval 1542c2ab72 yocto-bsp: Typo on the file extension
By mistake, the file initially had a wrong extension name, so changing to the
correct one.

(From meta-yocto rev: 32c2278b8fe93429d4cfa097eefccd20157cd3b8)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-25 07:45:20 +00:00
Leonardo Sandoval f674ffa528 yocto-bsp: Avoid duplication of user patches ({{=machine}}-user-patches.scc)
On linux-yocto-dev or linux-yocto_X.YY bbappend files, the SRC_URI includes
{{=machine}}-standard.scc, which in turn includes {{=machine}}-user-parches.scc,
thus there is no need to include it again on the corresponding bbappend file.

[YOCTO #8486]

(From meta-yocto rev: 11c93b5dd8c651df478d4810e1b6ff6ad9fa57e8)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-25 07:45:19 +00:00
Leonardo Sandoval 9cc221dcb6 yocto-bsp: Default kernel version to 4.1 on x86_64
On the 3.19 to 4.1 migration, the target x86_64 was not taken into account
(no reason, just missing the correspoding update on the kernel-list.noinstall
file), so moving it to 4.1 to be align with the rest.

(From meta-yocto rev: 283665d9295c3c10f964496dc0110137e358daa6)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:40 +00:00
Ruslan Bilovol 7100c4201c scripts: runqemu: remove QEMUARCH from help message
The QEMUARCH env variable is not used since commit
"d469c92 classes/imagetest-qemu: remove old image
testing class". Remove it from help message so
it will not confuse other people

(From OE-Core rev: f2f2fa61e2c331409f20c999f93d78ef752b4fd2)

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:40 +00:00
Paul Eggleton 0821c36fed verify-homepage: fix recipe file selection
* We need to check all recipe files, not just the preferred ones
  (i.e. we have multiple recipes for different versions of the same
  piece of software). Print the recipe file name (without path) so we
  can tell the difference between them.
* We can skip BBCLASSEXTENDed variants of recipes

(From OE-Core rev: 3e81d209fd8c76fce5bee19acb591483c1335119)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:36 +00:00
Paul Eggleton 0c489216de verify-homepage: tidy up output and comments
* Set up and use a proper logger
* Tweak output messages and comments

(From OE-Core rev: 6ee412409ff9331847fbe4e44d1c2a47d2453f18)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:36 +00:00
Paul Eggleton 0e348e76f3 verify-homepage: get expanded HOMEPAGE value
We tend not to use any variables in HOMEPAGE values, but that doesn't
mean we would never do so.

(From OE-Core rev: 388737270b681439b31f4e1189bdc09d38705f25)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:36 +00:00
Paul Eggleton caaca00acb verify-homepage: use scriptpath to find bitbake path
We have shared code for this, let's use it.

(From OE-Core rev: e7a5d6e7802b58cf6eae1d83e4bf5c50ab66f80a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:36 +00:00
Ross Burton 11a9c24d6c runqemu: don't specify IP when starting a VNC server
Whilst qemu doesn't appear to support opening sockets on IPv6 yet, future-proof
the script by just specifying a port and letting qemu work out the rest.

(From OE-Core rev: abf8975bce4bf5d05dbb186d5089f0c3fe07eefb)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:36 +00:00
Alexander D. Kanevskiy aa1844e847 combo-layer: introduce ability to exclude component from mass update
There is no ability at the moment for situations where users would like
to keep section in combo-layer.conf but don't update it, unless explicitly
specified.

Now, by adding "update = no" to desired section would exclude
that repository from "combo-layer update" command.

It is still possible to explicitly update it by "combo-layer update $section".

By default, all repositories are assumed as "update = yes"

(From OE-Core rev: 74ecf1a0e5c8230e55cb1a309f711d98fa63ce79)

Signed-off-by: Alexander D. Kanevskiy <kad@kad.name>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:31 +00:00
Maxin B. John 24cfcc4ac0 runqemu-export-rootfs: update location of unfsd binary
oe-core commit: 24b80d211f3808a0ffebee426932f11b8d4d46e0 sets
sbindir = "${bindir}" in the nativesdk class.

So, update the location of unfsd binary from "/usr/sbin" to "/usr/bin" in
runqemu-export-rootfs. Also update unfs3-native to install unfsd under
"bin" directory so the binary is always in the same location.

[YOCTO #8315]

(From OE-Core rev: 2e98b80a3a11798145f58c8ccc8b873cd713f4f2)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-29 07:31:17 +00:00
Ross Burton da386d3d21 gtk-icon-cache: pass the native libdir to the intercept
The intercept runs against the native sysroot so we need to pass it
the native libdir instead of the target libdir, as otherwise it will
use target paths (such as lib64) in the native sysroot.

(From OE-Core rev: 0fe84007176c98644b1917966c98501beb7e0ce2)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-29 07:31:16 +00:00
Ross Burton 517132904e intercepts/update_icon_cache: use STAGING_DIR_NATIVE from environment
Instead of expecting that the calling postinst has exported
STAGING_LIBDIR_NATIVE (which will get set to the sysroot at package build time
and may not be correct if sstate is used), use the new STAGING_DIR_NATIVE that
is exported by rootfs.py.

[ YOCTO #8547 ]

(From OE-Core rev: 9fa5ff645eb683533af482925079dff5c9151831)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:30 +00:00
Ross Burton 2925cd9521 Revert "runqemu-export-rootfs: update location of unfsd binary"
unfsd appears to be moving around and is in sbin for at least two different
users, so revert the change to expect it in bin.

This reverts commit e56bda210e216251c04d872211081a89ac06dde6.

(From OE-Core rev: 2e065b02a3e65c8db8a26788fdc4d7f65d5a2a8f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:29 +00:00
Randy Witt 0f75740830 wic/utils/oe/misc.py: Preserve PATH when running native tools
Previously exec_native_cmd() would remove all items from PATH except for
the native sysroot. This can cause issues for the tools that are created
using create_wrapper().

Now instead of wiping out the PATH, run a sanity check to check if the
command is in the native sysroot.

(From OE-Core rev: ba127370e621b5b683d6f454596c3d0c60c13df7)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:29 +00:00
Richard Purdie 031d464504 scripts/oe-pkgdata-util: Fix variable name in error handling
Fix:
    logger.error('Unable to find pkgdata directory %s' % pkgdata_dir)
NameError: global name 'pkgdata_dir' is not defined

(From OE-Core rev: a1202ed17e11400f08064c9065fdfa996554d4ad)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:29 +00:00
Mariano Lopez 835525c8bb runqemu-ifup: Check if the tap interface is set up correctly
The process to set up a tap interface is as follows:
    - tap interface is created
    - An IP address is assigned to the tap interface
    - The interface is bring up
    - A route is added to the target using the tap
      interface

Of all the previous steps, only the first one is
check if it was sucessful. The status of the others
are ignored and all of them are required to have
basic connectivity in the target.

This patch adds the checks for the rest of the stpes
needed to set up the tap interface.

[YOCTO #8550]

(From OE-Core rev: 52f6bacffc517198f0d1f24e5418ee4c9cb5442a)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:28 +00:00
Aníbal Limón 9846275484 runqemu-internal: Enable support for use virtio devices.
Enable virtio usage for default in runqemu also get rid
of duplicate configuration from now all qemu machines uses
virtio.

[YOCTO #8427]

(From OE-Core rev: 0611321c9d6663493b37c33dea51e05511db4fbe)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:28 +00:00
Aníbal Limón eebcbe19b7 runqemu: Enable support for kvm without vhost in x86 and x86_64
KVM can be used without vhost so add a new option to runqemu for
use kvm with vhost.

Example,
	runqemu qemux86 core-image-minimal kvm # kvm without vhost
	runqemu qemux86 core-image-minimal kvm-vhost # kvm with vhost

[YOCTO #7443]

(From OE-Core rev: 7f5f8f87a4180a2b05188047c6a05da5571f94e2)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:28 +00:00
Costin Constantin 369c53600e scripts/oe-publish-sdk: create directory before making git repo
This patch fixes a small bug that prevents seting a git repo in exported SDK
layers dir. Before setting a git repo, that directory needs to be created.

[ YOCTO #6659 ]

(From OE-Core rev: 47860e483d7a9b4440d1ed9bd96d724370887f58)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:25 +00:00
Paul Eggleton db55d31dc2 devtool: handle virtual providers
For modify / extract / upgrade, if the specified "recipe" is not
actually a recipe but a virtual target such as virtual/kernel, map it
correctly to the actual recipe and make sure we use that name within the
workspace. Thanks to Chris Larson for reminding me this was still broken
and for a hint on how to fix it.

(From OE-Core rev: 1f7752282ffb47d2621030ddb2fa42a5e491d6d2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-21 22:56:03 +01:00
Paul Eggleton 5febb1dc5b scripts/gen-lockedsig-cache: fix race with temp file creation
As part of populating the sstate-cache with an artifact (.tgz file) we
create a temp file and then atomically move it to the final name. Due to
the glob used in this script such temp files were being matched, and
between the time they were matched and the time the script started
copying files, the temp file may have vanished.

This fixes random "No such file or directory" failures building the
extensible SDK on build setups where the sstate-cache directory is shared
amongst multiple build machines.

(From OE-Core rev: 588de5198c641ea1cfc3e01a6d129296bd2f706b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-19 17:57:59 +01:00
Paul Eggleton 5a02ec217d devtool: extract: fix error handling
If recipe parsing fails we need to exit out instead of attempting to use
the data object that's set to None, which resulted in a traceback.

(From OE-Core rev: a46fb1a06be2df00a0bceb4e60ebdecb55b5974c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-19 17:57:58 +01:00
Paul Eggleton 8cacd228e6 recipetool: create: fix change in path structure if --extract-to path exists
If the directory specified by --extract-to exists, because we were using
shutil.move() to move the temporary extracted directory to the specified
path, a subdirectory was being created under that directory instead of
moving the contents, which was a different result than if the directory
didn't previously exist. We could try to always move the contents but
that's complicated when any symlinks are involved; the simplest thing is
just to remove the directory (which should be empty anyway) before
moving the temporary directory across in its place.

(From OE-Core rev: 2880bd23b471c1966661b9f05726faf60f9c0e7e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-07 00:09:10 +01:00
Paul Eggleton e9616885fc devtool: update-recipe: avoid updating patches that have not changed
Use "git cherry" against the original tag that we made when we extracted
the source in order to find the revisions that are definitely new. This
allows you to modify a commit in the middle of the series and then run
devtool update-recipe and not have the subsequent patches unnecessarily
modified.

Fixes [YOCTO #8388].

(From OE-Core rev: 7baf57ad896112cf2258b3e2c2a1f8b756fb39bc)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-07 00:09:10 +01:00
Martin Jansa dff30d2906 fontcache: allow to pass extra parameters and environment to fc-cache
* this can be useful for passing extra parameters, pass
  -v by default to see what's going on in do_rootfs
* we need to use this for extra parameter we implemented
  in fontconfig:
  --ignore-mtime always use cache file regardless of font directory mtime
  because the checksum of fontcache generated in do_rootfs
  doesn't match with /usr/share/fonts directory as seen on
  target device causing fontconfig to re-create the cache
  when fontconfig is used for first time or worse create
  new cache in every user's home directory when /usr/
  filesystem is read only and cache cannot be updated.

  Running FC_DEBUG=16 fc-cache -v on such device shows:
  FcCacheTimeValid dir "/usr/share/fonts" cache checksum 1441207803 dir checksum 1441206149
* my guess is that the checksum is different, because pseudo
  (which is unloaded when running qemuwrapper) or because some
  influence of running the rootfs under qemu.

(From OE-Core rev: e07fdc5f047f309a0e99331f430c14d708ed2161)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 17:54:55 +01:00
Markus Lehtonen f3e57baa3a devtool: modify: use correct local files directory name
The name of the directory for local source files under srctree is
'oe-local-files', not 'local-files'. Fixes a bug that slipped through
in b7ab82485e4514e07ab8a76e554da27ddc92e6c0.

(From OE-Core rev: 68cbe684fe6d8fe3a44e47ed85837d09077df6d5)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 15:07:49 +01:00
Markus Lehtonen f047ee8c95 devtool: update-recipe: enable var history tracking
Enable variable history tracking so that the variables are updated in
the correct file - i.e. in the file they are already defined.

[YOCTO #7715]

(From OE-Core rev: b54796d013c562972e962126400503085281b425)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 15:07:48 +01:00
Leonardo Sandoval e20d8b84b3 scripts/lib/bsp/engine: Indent the karch properties when stored into a file
Make a bit more human-friendly the karch properties when storing
into a file.

(From meta-yocto rev: 39292d397658a8e30c73d4cdaced66cb0efa8380)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:39 +01:00
Leonardo Sandoval f2933cc5f9 yocto-bsp: Update templates to 4.1 kernel
Add 4.1 kernel support. Old bbapends were not removed, so user still
have the option for 3.14/3.19 kernels.

(From meta-yocto rev: f47ea7224765a3c3da3a9e0a989173b2b1950cfc)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:39 +01:00
Leonardo Sandoval 8283a57db8 scrips/lib/bsp/engine: List properties to stdout when output parameter is omitted
When user wants to output the list of properties for a corresponding architecture
and the output parameter is given (--o/-outfile), there is no need to show the
properties into the console.

(From meta-yocto rev: bd133e2a6e626b4158f5a303d85205de9c66e8f2)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:38 +01:00
Leonardo Sandoval b355a5e00e scripts/yocto-bsp: Exit successfully when asking for help
When user asks for help, the command should not exit with non-zero
status (failure), so removing the non-zero value on the system exit call.

(From meta-yocto rev: 98970326fb2f08e684cfc856103b2f9110c9f4fb)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:38 +01:00
Aníbal Limón 2ea0e4ca8e runqemu-internal: qemuarm enable usage of virtio devices
We are experiencing occasional segfaults in scsi sym53c8xx driver
on qemuarm boot. There are some old discussions into the mailing
lists [1] about the scsi problem and seems to be isn't fixed.

We use virtio blk/net devices into qemuarm64 also are supported
into qemuarm so change to use it because virtio devices are the best
choice.

[YOCTO #8060]

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8060#c10

(From OE-Core rev: bbfb3cd06e0ff5661ef3732ebfffa74b94400cd9)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:37 +01:00
Randy Witt 6f2047a0e2 runqemu-internal: Make sure two serial ports always exist
Since inittab for qemu images now always tries to start getty on a
second serial device, make sure that device exists.

Otherwise the following message will be spammed:
    INIT: Id "S1" respawning too fast: disabled for 5 minutes

[YOCTO #8374]

(From OE-Core rev: 988369afed85281f3ed9b2f3eeb30f5408498bb9)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:33 +01:00
Markus Lehtonen 5b629a962d devtool: modify: make bitbake use local files from srctree
This change makes it possible to have local files (non-remote SRC_URI
files, i.e. files that are located in the "recipe space") under the
srctree even if S!=WORKDIR. The files must be placed under the
'local-files' subdirectory.

Complements the previous patch that imports local files into srctree.

[YOCTO #7602]

(From OE-Core rev: b7ab82485e4514e07ab8a76e554da27ddc92e6c0)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:32 +01:00
Markus Lehtonen e9bae506e5 devtool: better support for local source files
* extract: Copy all local source files (i.e.  non-compressed/non-arcived
  SRC_URI files that have file:// URI prefix) - excluding patches - to
  the srctree repository. The files will be placed in a subdirectory
  called 'oe-local-files'. The oe-local-files directory is not committed
  to the Git repository, but, marked to be ignored by a .gitignore file.
  The developer can manually add and commit the files to Git if the
  changes to them need to be tracked.

  Before this patch, local source files (were copied (and committed) to
  the srctree repository only in some special cases (basically when
  S=WORKDIR) when doing devtool-extract. For most of the packages local
  files were not copied at all.

* update-recipe: This patch causes the local files to be 'synced' from
  the srctree (i.e. from the 'oe-local-files' subdirectory) to the
  layer.  Being 'synced' means that in addition to copying modified
  files over the original sources, devtool will also handle removing and
  adding local source files and updating the recipe accordingly.  We
  don't want to create patches against the local source files but rather
  update them directly.  Thus, 'oe-local-file' directory is ignored in
  patch generation when doing update-recipe, even if committed to Git.
  This functionality is only enabled if the 'oe-local-files' directory
  is present in srctree.

[YOCTO #7602]

(From OE-Core rev: a3bb5bd25b72bd1bcc156dabd0ffa2d9184bb160)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:32 +01:00
Markus Lehtonen a74fa38365 devtool: file mover function that creates target dir
Helper function for replacing a pattern like:
  target_dir = os.path.dirname(target)
  bb.utils.mkdirhier(target_dir)
  shutil.move(source, target)

(From OE-Core rev: c09e5b11225a673534594c3642ceead3eb5653a3)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:31 +01:00
Markus Lehtonen 109c09b58f devtool: update_recipe: refactor patch generation
Implement new function that handles patch file generation. The new
function also does the discovery of new, updated and deleted patches.

(From OE-Core rev: 183812e60e1dce09c77b41a5a927ab7fb6fdcf9d)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:31 +01:00
Markus Lehtonen c976028529 devtool: update-recipe: add new patches in correct order
When adding multiple new patches append them to SRC_URI in correct order
so that they apply correctly.

(From OE-Core rev: 819680092c1b49c16f4ab01d135d44311a9dacca)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:31 +01:00
Maxin B. John 452237b3f5 runqemu-export-rootfs: update location of unfsd binary
Update the location of unfsd binary from "/usr/sbin" to "/usr/bin" in
runqemu-export-rootfs

[YOCTO #8315]

(From OE-Core rev: e56bda210e216251c04d872211081a89ac06dde6)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:30 +01:00
Pascal Bach aa1253f23d runqemu: don't complain about conflicting machines if they are equal
When the MACHINE variable was set as an environment variable, via
"export MACHINE=qemuarm" and runqemu was executed as "runqemu qemuarm"

The confusing error message appears:
Error: conflicting MACHINE types [qemuarm] and [qemuarm]

This checks if the two values are equal, in that case there is no problem
and execution can continue.

(From OE-Core rev: 6615a21d578ba9ab053ba0b3deab26ebf88e577b)

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:30 +01:00
Ross Burton 8a12632e97 gdk-pixbuf: move gdk-pixbuf-query-loaders to $libdir for multilib safety
If for example gdk-pixbuf and lib32-gdk-pixbuf are in an image then only one
${bindir}/gdk-pixbuf-query-loaders will be installed, so only one variant will
actually be usable.

Solve this by moving gdk-pixbuf-query-loaders into ${libdir} as it's intimately
tied to the library and rarely directly invoked by the user, and update the
callers to use the right path.

(From OE-Core rev: 69df75f268e2b3d5874f05e2b5a6125f6d990a03)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:16 +01:00
Robert Yang c7624b4c49 oe-pkgdata-util: avoid returning skipped packages
The skipped packages may be pulled in by another package, for example,
when libc6-dbg is already installed and should be skipped, but it would
be pulled in by libsegfault, this patch fixes the issue.

(From OE-Core rev: 5040481f33b356d9acfd29a778b13544e27e7bb7)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:32 +01:00
Markus Lehtonen bdbd8b4fef devtool: upgrade: use shutil.move instead of os.rename
Rename fails over filesystem boundaries.

(From OE-Core rev: 479c8eb6547c311123ea30c9f06f2d44c6365473)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:25 +01:00
Paul Eggleton 346784b24b devtool: runqemu: avoid recipe parse
We only need the base configuration to get the variable values we want
to get here, there's no need to parse recipes / load the cache.

(From OE-Core rev: 84172ff7b325f081dba6430fd27f12e3745838b5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:25 +01:00
Markus Lehtonen 85d8b4a92f devtool: second fix for running from a different directory
Do not change change current working directory permanently, but, only
for the duration of tinfoil initialization instead. The previous fix
caused very unintuitive behavior where using relative paths were solved
with respect to the builddir instead of the current working directory.
E.g. calling "devtool extract zlib ./zlib" would always create create
srctree in ${TOPDIR}/zlib, independent of the users cwd.

(From OE-Core rev: 4c7f159b0e17a0475a4a4e9dc4dd012e3d2e6a1f)

(From OE-Core rev: 05060699e63cd25d089e83e9aa56c11d5baa8fd8)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:24 +01:00
Paul Eggleton 6c0066c145 devtool: add search command
Adds a subcommand to search to find the target recipe name providing
some file or capability. This is implemented by searching on recipe
name, package name, description, package contents (file names), and
runtime file provides. For example:

$ devtool search libGL
mesa

$ devtool search X11
xextproto
libxxf86vm
xf86driproto
xf86vidmodeproto
libxfixes
xproto
libx11
...

$ devtool search /bin/sed
busybox
sed

This is particularly useful within the extensible SDK but is also made
available in devtool alongside the build system.

Note of course that because this searches pkgdata, useful results depend
upon do_packagedata(_setscene) having executed for the recipe being
searched for.

(From OE-Core rev: 48cbde0ea77ed20126eceba5feb37c42a9229500)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:21 +01:00
Paul Eggleton 0613301c88 devtool: add basic means of running runqemu within the extensible SDK
We ship the runqemu script and if we build QEMU itself within the
extensible SDK, then it would be nice to be able to run it. This is a
very thin wrapper around runqemu, supplying the machine and image name
so the user doesn't need to. (This subcommand is only available within
the extensible SDK since it only really makes sense there where it is
otherwise hard to run runqemu directly.)

Implements [YOCTO #6657].

(From OE-Core rev: abca7a0cac7068ffe6a6b873d0842f804388b621)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:20 +01:00
Paul Eggleton c4181c6e7e devtool / recipetool: add handling for binary-only packages
Add a means of creating recipes for package files or archives that
contain a directory structure to be installed verbatim, for example an
rpm file. (We mostly just re-use bin_package here and skip some of the
normal build system checks.) This support is available in "recipetool
create" and "devtool add" which wraps the former.

(From OE-Core rev: 9e0a6b2e6f16185f8032d36b77d40802bc388987)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:20 +01:00
Paul Eggleton 76084cdfa6 devtool: build-image: delete bbappend at end of build
Upon further reflection, it seems to me that this bbappend ought to just
be deleted at the end of the build. This keeps things simple; you never
have to remember to delete any files to get back to where you were
before with the image. This means we can also drop the slightly awkward
message reminding the user how to do that. I've also updated the test to
look at the image manifest to determine if the command has worked
instead of looking for the (now deleted) bbappend.

(From OE-Core rev: f6b90bceaedf9bad3d111e6ca1fa79e59f472c73)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:19 +01:00
Paul Eggleton ef197f9b99 devtool: build-image: improve image recipe handling
* Make image optional for the extensible SDK (auto-determine it based on
  the targets the SDK was built for)
* Check that specified recipe is in fact an image

(From OE-Core rev: 8884875aacfedc69cc72898684e391e69fea00ba)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:19 +01:00
Paul Eggleton 8f67bb7990 devtool: build-image: tell user where to find output files
If the user is running "devtool build-image" within the extensible SDK
then they probably won't know where to find the resulting output files,
so we should tell them explicitly.

(From OE-Core rev: 9baf9fd7a53142a98c7f1cd49c7b001760af51f9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:19 +01:00
Paul Eggleton afb9340fc6 devtool: build-image: fix recipe/package terminology
We build recipes and include packages into the image, adjust the
terminology used in code and messages accordingly. Also fix a few typos.

(From OE-Core rev: 866f6e2de20b7022803e53c4de3ff341521b4db5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:18 +01:00
Paul Eggleton d7365185fe devtool: add: move important "recipe created" message to the end
If we end up printing a message about the build directory being the same
as the source, we should print that first and then print the message
about the recipe file possibly needing to be edited to the end so that
it has slightly more impact.

(From OE-Core rev: 97398d14c444fe2408dd6101ef46a0a406924bb5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:18 +01:00
Paul Eggleton 3bd0f33505 devtool: add: set up fetched source as a git repository by default
If the fetched source isn't already a git repository, initialise it as
one and then branch and tag, just as we do with "devtool modify". This
makes it easier to make changes, commit them and then use the
"devtool update-recipe" command to turn those commits into patches
on the recipe.

(From OE-Core rev: 2dd865086c37c9eff63c6d0bbfa9f2e909f9fffe)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:17 +01:00
Paul Eggleton e759b0b75d devtool: better handling for recipes that don't unpack source
Some recipes don't extract any source (for example, opkg-keyrings). We
were producing a traceback in this case because we weren't checking if
the directory existed.

(From OE-Core rev: 087ca0c644aad19e6e7d3921f99f3056471deb65)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:17 +01:00
Paul Eggleton a34f733d3a devtool: fix extracting source for work-shared recipes
Recipes that use work-shared (such as libgcc) are capable of unpacking
the source, but it doesn't necessarily unpack to ${WORKDIR}/${BP}. Use
the last part of the actual S value instead which is more likely to
work.

(From OE-Core rev: 0bab8086fdef93b88d5ec6b88b07ccc921dd786f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:17 +01:00
Paul Eggleton 5bc437b985 devtool: show proper error when extracting source for recipes with disabled unpack task
If you try to use "devtool modify -x" or "devtool extract" on a recipe
where do_unpack has been set as noexec (e.g. glibc-locale), then we get
an error because the expected source wasn't ever unpacked. Do a check up
front for noexec being set on do_unpack and error out with a reasonable
message if that's the case.

(From OE-Core rev: 39a93c85e798e72edd6ab3c05f8adbb1a97e893e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:16 +01:00
Paul Eggleton 210d959023 recipetool: create: fix handling of URIs containing #
The # character in a URI denotes a fragment; we don't care about this
since it is never supposed to be sent to the server, so remove it from
the URI before actually trying to fetch it or use it in SRC_URI within
the recipe.

(This has come up because download links on pypi.python.org seem to have
a fragment containing the md5sum of the download; without stripping this
off the fetcher will choke on it.)

(From OE-Core rev: 58dc726808817210764eab963a4d453dc4ff49aa)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:16 +01:00
Paul Eggleton a35ad723ce recipetool: create: fix creating empty shell functions
The shell considers empty functions to be a syntax error, so for
template shell functions that contain only comments (or no lines at all)
then add a : to act as a no-op which avoids the syntax error.

(From OE-Core rev: ff14d9e5b935b99b2efde479515e54c02ba58f6e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:16 +01:00
Paul Eggleton 30c7e7ac41 devtool: add: properly handle separate build directory
When we were adding a recipe for software that would typically be built
in the same directory as the source, we were always using a separate
build directory unless the user explicitly specified not to, leading to
errors for software that doesn't expect to be built that way (such as
Python modules using distutils). Split out the code that makes this
determination automatically from the "devtool modify" and "devtool
upgrade" code and re-use that here so the behaviour is consistent.

(From OE-Core rev: 320585b7ff6340df0b0dbc63f95ed3ca8fc3a993)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:15 +01:00
Paul Eggleton 99fc284545 devtool / lib/oe/recipeutils: ensure we can parse without bbappends
These functions ostensibly allowed parsing a recipe without bbappends
but this clearly hadn't been tested because a variable was unassigned in
both of them in that case.

(From OE-Core rev: d2bb9f08303bb120e811c03af2f5339e8f262cfa)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:15 +01:00
Paul Eggleton 5d1a117f44 devtool: add: ensure --color=never turns off recipetool colour output
(From OE-Core rev: 670bd063a5e0cdf89ea8d1f763af980d7e63d38a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:14 +01:00
Paul Eggleton ae788fbd46 devtool: check that source tree still exists
Sometimes, particularly if you extracted the source to /tmp which is on
tmpfs, the external source tree that is being pointed to may no longer
exist when you come to run "devtool build" or "devtool update-recipe"
etc. Make all of the commands that need to check for a recipe being in
the workspace call a single function and have that function additionally
check the source tree still exists where appropriate.

(From OE-Core rev: 0c3f289576a2ab35b1d1d8854d6763553cc3bf09)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:14 +01:00
Paul Eggleton 99cd79d8be scripts/contrib: add devtool stress tester
Add a script to run "devtool modify" followed by a build on every target
recipe in the environment (with the option to skip/resume from/only
include specific recipes). This takes far too long to run as an
oe-selftest test but is still something that is useful to be able to
run. There's also a slightly quicker mode that just runs "devtool
extract" on each recipe.

(From OE-Core rev: 278f40cce14af430ac1743436132584eedfe792e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:14 +01:00
Paul Eggleton 0dc9299774 classes/populate_sdk_ext: drop work-config.inc
This is not actually used for anything - I thought that we would need to
use it within devtool to set global configuration, but we're able to do
everything we need within the bbappends it creates, which also saves on
parse time. If we're not going to use work-config.inc let's just drop it
completely.

(From OE-Core rev: 84a1f82acd3b6ebb3c073aae6b996d2203dad2ce)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:12 +01:00
Alejandro Hernandez 6a02bbd5de python3-debugger: Adds pkgutils dependency to pdb
python3-debugger fails to be invoked to debug other scripts complaining about
not being able to import pkutil, this patch adds pkgutil as a dependency for python3-debugger
fixing the issue.

[YOCTO #8334]

(From OE-Core rev: f4d7f7075b3da1a3a37d6bb3e19613e7a068a63c)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:06 +01:00
Alejandro Hernandez a7dd758635 python3-debugger: fix importlib dependency
python3-debugger (pdb) needs importlib as a dependency, if not included
it produces an error when importing pdb, making pdb unusable, this patch
adds importlib dependency fixing the issue.

{YOCT0 #8333]

(From OE-Core rev: babab409393aacdc558851cc62ce60659da25068)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:05 +01:00
Nathan Rossi fe70aa4864 runqemu-internal: For qemumicroblaze use the QEMU provided device tree
Setup the qemumicroblaze machine to use the device tree provided by QEMU
instead of the device tree located in the images directory. Additionally
setup the default memory size to match the QEMU device tree.

(From OE-Core rev: 5830519bc10fa1195789d5b6a1b1bbbef4b940be)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:52:57 +01:00
Nathan Rossi 9aaf7e3f84 runqemu-internal: Fix qemu networking for qemuzynq an qemumicroblaze
This patch brings the qemu networking setup for qemuzynq and
qemumicroblaze into feature parity with the other qemu machines.
Specifically enabling TAP interface attachcment and kernel command line
IP configuration.

(From OE-Core rev: 49bdfab6ba1d92d8f48ce9c63d796a7cedf4f247)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:52:57 +01:00
Peter Kjellerstedt f32a6e1f59 oe-git-proxy: Allow socks4 as protocol in $ALL_PROXY
The current default is to use SOCKS4a when socks is specified as
protocol in $ALL_PROXY. However, not all socks servers support
SOCKS4a. By allowing socks4 as an additional protocol, this script
will happily work with SOCKS4 only servers.

(From OE-Core rev: da9ddf48ed4a13cdc47649e22ab6ef7e36e01fdf)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:52:56 +01:00
Peter Kjellerstedt 18309f0893 oe-git-proxy: Correct the parsing of a port in $ALL_PROXY
Due to an error in the regular expression used to extract a port
number specified in $ALL_PROXY, rather than allowing the port number
to be followed by an optional "/", the port was required to be
followed by "/?".

This corrects the regular expression to allow an optional "/". It also
allows the odd "/?" suffix for backwards compatibility.

(From OE-Core rev: 39eb19e2ae9add58c763b71b54bdb3739041b2d0)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:52:55 +01:00
Peter Kjellerstedt c035f3575b oe-git-proxy: Allow explicit IP addresses in $NO_PROXY
Without this fix, if one specified, e.g., 127.0.0.1 in $NO_PROXY, the
oe-git-proxy script would fail with a message like this:

/home/pkj/yocto/poky/scripts/oe-git-proxy: line 64: 32-127.0.0.1: syntax error: invalid arithmetic operator (error token is ".0.0.1")

(From OE-Core rev: c01e61d8b79d644880415986bdb1ba925f194329)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:52:55 +01:00
Ed Bartosh dd7726f0bc wic: fix partition size calculation
It was wrongly assumed that part.size is meagured in Mb. In fact it's
in Kb, so there is no need to convert bitbake variable ROOTFS_SIZE as
it's also in Kb.

(From OE-Core rev: 3703ecb4aa5267e6d7330e7978cc7c3bb2250ead)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:52:54 +01:00
Christopher Larson d18612a8a9 recipetool: add 'newappend' sub-command
This sub-command creates a bbappend for the specified target and prints the
path to the bbappend. The -w argument, as with some of the other recipetool
commands, will make a version-independent bbappend.

Example usage: recipetool newappend meta-mylayer virtual/kernel

[YOCTO #7964]

(From OE-Core rev: ac053163c7823e482ca1af2962342e64a54bfb52)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:30 +01:00
Bruno Bottazzini 935a8bd1d9 mkefidisk: Create interactive menu for the script
If it is passed only the image parameter, it will show some interactive
options to help to conclude the script.

With this patch it will detect devices available in the machine, asking
to choose what it is wanted to be flashed.

it will suggest the target device. If it is a SD card the suggestion
is /dev/mmcblk0. If it is a pendrive it will suggest to use /dev/sda.

(From OE-Core rev: 768fb686b8dfd47ff4cb4833ce166c213502f419)

Signed-off-by: Bruno Bottazzini <bruno.bottazzini@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:26 +01:00
Markus Lehtonen 06cde90f9f devtool: update-recipe: get srcuri parameters with decodeurl()
Use already existing bb.fetch.decodeurl() for getting the parameters for
a URI. This is more fault tolerant and maintainable.

(From OE-Core rev: cd201664b827e37fcabca272262016b171e997d9)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:46 +01:00
Patrick Ohly 2a05181d98 runqemu: avoid image file name mismatches
Giving anything with -image in it as bootparams or in qemuparams (for
example, an additional -drive parameter with an image file or an
"-initrd .../core-image-minimal-initramfs-qemux86.cpio.gz") caused
runqemu to treat these parameters as names of the rootfs image file.

Matching *-image) after checking the current argument for more
specific cases like bootparams and qemuparams avoids this
misinterpretation of the command line parameters.

(From OE-Core rev: 29e0aaa7345ca823bb4af2d4a870e98ac75e04e7)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:44 +01:00
Leonardo Sandoval e0543d1094 runqemu: Define OECORE_MACHINE_SYSROOT on setup_sysroot
At least the OVFM (UEFI Firmware for Qemu and KVM) recipe stores the BIOS
under $OE_TMPDIR/sysroots/$MACHINE, now defined as OECORE_MACHINE_SYSROOT.
The latter is used when searching BIOS, VGA BIOS and keymaps. As a example,
to boot a OVFM BIOS, one can run the following command:

$ runqemu qemux86-64 core-image-minimal \
    biosdir=usr/share/ovmf  \
    biosfilename=bios.bin \
    nographic

Note the bios* parameters: these two are needed to specify the subfolder
(parent folder is OECORE_MACHINE_SYSROOT) and BIOS filename (without it,
it picks a BIOS named bios-256k.bin).

[YOCTO #5654]

(From OE-Core rev: bded344a464bb854db3935da1f6a3320e5aa01e5)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:34 +01:00
Leonardo Sandoval f0af24eedf buildstats: Outputs 'task recipe elapsed-time' from each buildstats' recipe
Given a 'buildstats' path (created by bitbake when setting
USER_CLASSES ?= "buildstats" on local.conf) and task names, outputs
'<task> <recipe> <elapsed time>' for all recipes. Elapsed times are in
seconds, and task should be given without the 'do_' prefix.

Some useful pipelines

1. Tasks with largest elapsed times

    $ buildstats.sh -b <buildstats> | sort -k3 -n -r | head
    do_compile perl-5.20.0-r1 221.82
    do_configure gettext-native-0.19.4-r0 140.34
    do_compile openssl-native-1.0.2a-r0 107.48
    do_compile openssl-1.0.2a-r0 102.10
    do_configure perl-native-5.20.0-r0 90.70
    do_configure gettext-0.19.4-r0 88.17
    do_compile gcc-cross-i586-4.9.2-r0 83.98
    do_configure m4-native-1.4.17-r0 83.44
    do_compile qemu-native-2.2.0-r1 71.69
    do_compile glibc-2.21-r0 60.88

2. Min, max, sum per task

    $ buildstats.sh | datamash -t' ' -g1 min 3 max 3 sum 3 | sort -k4 -n -r
    do_configure 0.03 140.34 1968.66
    do_compile 0.01 221.82 1664.44
    do_install 0.03 40.31 330.45
    do_populate_sysroot 0.11 34.45 229.23
    do_unpack 0.01 36.1 193.54
    do_patch 0.01 9.2 62.07
    do_fetch 0.01 6.66 32.13
    do_populate_lic 0.09 1.65 30.7

(From OE-Core rev: 29fa8ee01ef3254272bcbdd13a8c7244548639a3)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:30 +01:00
Ed Bartosh 9485888656 devtool: make plugin_init optional
So far all devtool and recipetool plugins were expected
to have plugin_init function. This function is empty in
most of plugins as they don't require initialisation.

Making plugin_init optional would allow not having empty
plugin_init in every plugin.

(From OE-Core rev: b99640c89f067866b264f4ee4030fae4c2f338c0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:30 +01:00
Alex Franco 53e09c5d14 scripts: Move BUILDDIR chmod fix after checks in oe-setup-builddir
Makes more sense to have this fix after checking BUILDDIR exists, is
a directory and is writable.

[YOCTO #7669]

(From OE-Core rev: cf418deb32bf90479714e522e3fa309c41e47978)

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:29 +01:00
Paul Eggleton 69b7a613fc devtool: fix running from a different directory
Fixes the following error when running devtool from a directory other
than the build directory (or the SDK base path when using within the
extensible SDK):

  The BBPATH variable is not set and bitbake did not find a
  conf/bblayers.conf file in the expected location.
  Maybe you accidentally invoked bitbake from the wrong directory?

(From OE-Core rev: 1687ec04bfee327fe24fdfecb67db689835769f2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:53 +01:00
Brendan Le Foll 7b1f670ca3 devtool: add package plugin that lets you create package via devtool
Enables creating packages using devtool within the extensible SDK. (This
is only enabled within the extensible SDK because it provides no
advantage over just running bitbake directly there).

(From OE-Core rev: 6dc0269bca3e874582d61b40dbf0d495331fb96a)

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:53 +01:00
Paul Eggleton 6d50a5e0ed devtool: update-recipe: add a warning when recipe is inside the workspace
If a recipe has been added to the workspace via "devtool add"
or "devtool upgrade" then the recipe file itself will be in the
workspace layer; if you run "devtool update-recipe" particularly in the
upgrade case you might think it would apply the upgrade to the original
recipe, but it will not - in order to remain consistent it has to update
the recipe that's in use which is the one in the workspace. Warn the
user in this situation so that they know what they need to do when they
are finished.

(From OE-Core rev: 4801b64243e57e554a593f0857dd53621d8f52e5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:52 +01:00
Markus Lehtonen 3dd9fc39ab devtool: update-recipe: better 'auto' mode
Enhance the logic behind the 'auto' mode a bit by only updating the
SRCREV if the changes are already found upstream. The logic is simple:
update SRCREV only if the current local HEAD commit is found in the
remote branch (i.e. 'origin/<branch_name>'). Otherwise resort to
patching.

This affects a couple of the oe-selftest tests so update those as well.

[YOCTO #7907]

(From OE-Core rev: 9b9733b7d74032aef4979bec553019421e77da14)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:52 +01:00
Leonardo Sandoval 0d0e50810a devtool: Allow disabling make parallelism on build command
Through -s/--disable-parallel-make, the user can turn off parallelism
on the make tool. This can be useful when debuging race condition issues.
In order to set PARALLEL_MAKE = "" a post-config file created and then
passed into the build.

[YOCTO #7589]

(From OE-Core rev: 0bf2e4b3edfc43e7a2e8d3387a9370d110533b7c)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:52 +01:00
Leonardo Sandoval 1a721815ed devtool: Create a single file for the build devtool feature
The intention is to have a single file for each devtool feature
so devtool can grow in a modular way. In this direction, this patch creates
build.py, moving all related build features from standard.py to build.py.

(From OE-Core rev: 61bb1759f7ecb8b404f7d97573c61aef31f2f109)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:51 +01:00
Leonardo Sandoval 8be95c5fbe devtool: add upgrade feature
Upgrades a recipe to a particular version and downloads the source code
into a folder. User can avoid patching the source code.

These are the general steps of the upgrade function:

   - Extract current recipe source code into srctree and create a branch
   - Extract upgrade recipe source code into srctree and rebase with
     previous branch. In case the rebase is not correctly applied, source
     code will not be deleted, so user correct the patches
   - Creates the new recipe under the workspace

[YOCTO #7642]

(From OE-Core rev: 4020f5d91b3e4d011150d5081d36215f8eab732e)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:51 +01:00
Paul Eggleton 7cde0ebd59 devtool: improve modified file preservation to handle directory structures
Allow the _add_md5() function to be called with a directory in order to
recursively add the files under it. Additionally, we need to skip
preserving empty directories (since directories aren't listed in the md5
file).

(From OE-Core rev: 9383af78adc854a6f6de8b1520edf3cea0c477a6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:50 +01:00
Paul Eggleton ee0c11d988 scriptutils: split out simple fetching function from recipetool
This will now also be used by "devtool upgrade".

(From OE-Core rev: 0d0b8425eaf74a6d7f3d9f6471e6edca1a273c06)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:50 +01:00
Markus Lehtonen 3690281efb devtool: modify: enable do_shared_workdir for kernel
Do not put 'do_shared_workdir' into SRCTREECOVEREDTASKS when creating
bbappend for kernel packages. This will allow building packages that
depend on the shared build artifacts of kernel.

[YOCTO #6658]

(From OE-Core rev: 2355ccc627c0003a14693d1a023a003b7b44ea53)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:50 +01:00
Ed Bartosh 4031de53f4 wic: round variable before converting to int
Wic uses bitbake variable ROOTFS_SIZE to set correspondent
partition size. This variable is a literal representing
float value. Wic crashes trying to convert it to int with
the error: invalid literal for int() with base 10: '10166.0'

Fixed this by converting variable to float and rounding result.
This should work for int and float literals.

(From OE-Core rev: 3479e299b5f11dfcd3f5f97c4ad3e0449f6c6d6a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:45 +01:00
Qi.Chen@windriver.com ee428e27fe devtool: add mechanism for updating extensible SDK
Enable updating the installed extensible SDK from a local or remote
server, avoiding the need to install it again from scratch when
updating. (This assumes that the updated SDK has been built and then
published somewhere using the oe-publish-sdk script beforehand.)

This plugin is only enabled when devtool is used within the extensible
SDK since it doesn't make sense to use it next to a normal install of
the build system.

E.g.
devtool sdk-update /mnt/sdk-repo/
devtool sdk-update http://mysdkhost/sdk

(From OE-Core rev: 32cbd4c57fc8ca097a18929fc404c07322ef36dd)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:43 +01:00
Qi.Chen@windriver.com 2aaa59ed8e oe-publish-sdk: add script
Add a script to publish an extensible SDK that has previously been built
to a specified destination. This published SDK is intended to be
accessed by the devtool sdk-update command from an installed copy of the
extensible SDK.

e.g.
oe-publish-sdk <ext-sdk> <destination>

(From OE-Core rev: c201ab826046b30281341107b3e6a35204f5c9d8)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:43 +01:00
Martin Jansa e570b32020 postinst_intercept: allow to pass variables with spaces
* trying to pass foo="a b" through postinst_intercept ends
  with the actual script header to containing:
  b
  foo=a
  which fails because "b" command doesn't exist.

(From OE-Core rev: c66d7d85b7225be8c838449324d506565dd0081d)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:39 +01:00
Patrick Ohly 8215c42af1 runqemu: support full-disk images
This makes it possible to boot images with multiple partitions (the
ones ending in .hddimg or .hdddirect) in several ways:
   runqemu qemux86 core-image-minimal hddimg
   runqemu tmp/deploy/images/qemux86/core-image-minimal-qemux86.hddimg
   VM=tmp-glibc/deploy/images/qemux86/iot-os-image-qemux86.hddimg FSTYPE=hddimg runqemu

Same for hdddirect.

This is useful for testing initramfs scripts, secure boot (when
switching to UEFI), or boot loaders like syslinux. For testing the
content of the rootfs, the ext4 image is better because that approach
is faster (no need to create another large image during build, rootfs
can be read directly instead of reading boot.img through loop device).

When booting a live image, the kernel, initramfs (if any) and kernel
parameters are taken from the image by the virtual machine's BIOS, so any
additional kernel parameters given to runqemu are ignored. This can be
avoided (already without this change) in a slightly hacky runqemu setup:
   ROOTFS=tmp/deploy/images/qemux86/core-image-minimal-qemux86.hddimg \
   FSTYPE=ext4 \
   KERNEL=tmp/deploy/images/qemux86/bzImage-initramfs-qemux86.bin \
   MACHINE=qemux86 \
   runqemu serial kvm nographic 'bootparams=root=/dev/ram0'

The additional bzImage-initramfs-qemux86.bin kernel here was created
by adding this to local.conf:
   INITRAMFS_IMAGE = "core-image-minimal-initramfs"
   INITRAMFS_IMAGE_BUNDLE = "1"

In the code, the new FSTYPE=hddimg resp. hdddirect behaves almost
exactly like the older vmdk FSTYPE. New types were chosen because it
seemed cleaner than using FSTYPE=vmdk when the actual image pointed to
by VM is not in that format. The downside is that several checks for
FSTYPE=vmdk had to be duplicated for FSTYPE=hddimg.

The VM variable now gets interpreted as "virtual machine disk image"
instead of "vmdk image".

(From OE-Core rev: 37741c539f5d3021e59828b49e968cd42b89a368)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-06 15:26:23 +01:00
Markus Lehtonen 2b6218d449 devtool: run kernel dependencies
The kernel package needs "kern-tools-native" in order for it's
do_kernel_metadata. Thus, devtool extract for kernel in a pristine
environment fails. With the current bb.tinfoil implementation it is not
possible to run arbitrary bitbake commands - e.g. run
"bitbake kern-tools-native -c populate_sysroot" in our case. This patch
implements an ugly workaround for that problem, basically by hardcoding
this dependency and running the required bitbake task(s) before tinfoil
is initialized.

[YOCTO #6658]

(From OE-Core rev: a9eb80de164fb8a464e29bf1cc6c7cf397f36662)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:51 +01:00
Markus Lehtonen 3b3f9bbc30 devtool: extract: correct initial rev for kernel packages
Change handling of kernel packages so that the "initial rev" is parsed
correctly. Also, the devtool-specific git tags (devtool-base and
devtoo-patched) are now generated for kernel packages as well.

[YOCTO #6658]

(From OE-Core rev: 65fe3e45b10c5578446c758f66840891c62cd774)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:51 +01:00
Markus Lehtonen 9e9fd091d5 devtool: make required tasks be run in kernel build
Set SRCTREECOVEREDTASKS appropriately in the workspace .bbappend file
for kernel recipes. This tries to ensure that all needed tasks (esp.
configure and patch) are run when building the kernel - tasks which
would normally be disabled by externalsrc.bbclass.

[YOCTO #6658]

(From OE-Core rev: f0a3a38a653c643468452eba43a12795136720c9)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:50 +01:00
Alex Franco d8caef4f6e Fix recursive mode -st on BUILDDIR setup
Removing recursive option from chmod -st on BUILDDIR as it would
take very long on existing build directories

[YOCTO 7669]

(From OE-Core rev: 170cfa6a92effd197beb4b29704749a6a44deac7)

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:32 +01:00
Ed Bartosh 791a3912d9 wic: fix short variable names
Made short variable names longer and more readable.

Fixed pylint warnings "Invalid variable name" and
"Invalid argument name".

(From OE-Core rev: 872cb0d5d79b26f34e6b35d7be8870d245021be4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:31 +01:00
Ed Bartosh 14b47e22f9 wic: get rid of listing properties
Functionality of listing and using properties of wic images
does not exist in the wic code. However, there are plenty of
help and usage content about it, which is very confusing.

Removed everything regarding image properties from wic codebase.

(From OE-Core rev: af0a6d547a5a3efefdd4900f7079dfd10b85342d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:30 +01:00
Ed Bartosh 1561970e88 wic: fix pylint warning redefined-builtin
Renamed variables named as Python builtin functions.

(From OE-Core rev: bed98142e3e47ac2862ccf8fe3e4bdeabfc91172)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:30 +01:00
Ed Bartosh e7287e5157 wic: fix pylint warning unused-variable
Removed or reworked code with unused variables.

(From OE-Core rev: 3644b9f5ca25dfc61d4f5eda0f073c8a879b492b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:29 +01:00
Ed Bartosh e3a062ab1e wic: fix pylint warning no-member
Fixed pylint warning:
Instance of 'ConfigMgr' has no 'create' member (no-member)

(From OE-Core rev: 41e319730cdd9c320ae4d855df7aaff6f1679aaf)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:29 +01:00
Ed Bartosh e85f807b87 wic: use optparse instead of cmdln
cmdln.py https://pypi.python.org/pypi/cmdln was used in
creator.py to parse image plugin options and arguments.

There is no need in such a sofisticated API to do this
simple task. Standard option parser optparse.OptionParser
can do it just fine.

Modified Creator class to work with option parser.
Removed cmdln.py from the wic codebase.

(From OE-Core rev: 1e5220f74830b99cf8340a4f6977399b5cf49871)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:28 +01:00
Ed Bartosh f1bcf47ff4 wic: fix pylint warning multiple-statements
Fixed pylint warning:
More than one statement on a single line (multiple-statements)

(From OE-Core rev: fa43b8b482a9423208f5d2c12994fa15bcbddbb2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:28 +01:00
Ed Bartosh 0fc551edb6 wic: get rid of wildcard imports
Used explicit imports in partitions.py and wicboot.py

(From OE-Core rev: 975d919a0f81b06a5e9f99096e92e34e7fbf4b90)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:28 +01:00
Ed Bartosh c9876833a4 wic: fix errors in partition.py module
Fixed the followring errors found by pylint in partition.py:

E: 42, 0: class already defined line 33 (function-redefined)
E:429,63: Undefined variable 'fs' (undefined-variable)
E:432,37: Undefined variable 'fs' (undefined-variable)
E:481, 0: class already defined line 33 (function-redefined)
E:488,22: Undefined variable 'OptionValueError' (undefined-variable)

(From OE-Core rev: 83b1aa4b6480b625d1accee4c594162df2e84b96)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:27 +01:00
Ed Bartosh 90486ff047 wic: remove micboot.py
Moved functionaly of micboot.py Mic_Bootloader class to
Wic_Bootloader class of wicboot.py module.

(From OE-Core rev: 0be568537072d9b0027a0d3a532fc4696184453b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:27 +01:00
Ed Bartosh 282fb044d4 wic: remove micpartition.py
Moved functionality of Mic_Partition and Mic_PartData classes
from micpartition.py to Wic_Partition and Wic_PartData classes
of partition.py module.

Reduced level of inheritance.
Removed confusing mic legacy names.

(From OE-Core rev: eae139af81262b457cfb8ddf45a99523cc8a41cc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:26 +01:00
Ed Bartosh 2e2ac0cb7a wic: fix typo
Fixed typo in tool name: mkswqp -> mkswap.

(From OE-Core rev: e21d4b442437fac450070922ec74029ee1d10208)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:26 +01:00
Ed Bartosh 7d4bb40905 wic: get rid of scripts/lib/image
Moved content of scripts/lib/image/ to scripts/lib/wic as
one directory with the same name as a tool is self-explanatory
and less confusing than two.

(From OE-Core rev: 5dc02d572794298b3362378cea3d7da654456c44)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:25 +01:00
Ed Bartosh 77561e7191 wic: use ext4 in canned .wks files
Latest kernel doesn't have ext3 compiled in. Wic images produced
from canned .wks can't boot because of that. Switching to ext4
fixes this issue.

(From OE-Core rev: d281a65a81f369fc8d75023b8f911ce4106969c1)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:24 +01:00
Alex Franco cd61c1a6c5 Fix mode +st on TMPDIR when creating it
A sanity check fails when TMPDIR has setuid, setgid set. It was
proposed to fix this on TMPDIR creation instead of failing with
a sanity test only. This patch handles removal of those special
bits (and additonally, the sticky bit) from BUILDDIR and TMPDIR
when these directories are created.

[YOCTO #7669]

(From OE-Core rev: 8236d57439640a185c0226312cd4903a3ce2f53b)

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-01 11:43:58 +01:00
Ed Bartosh 15526a8591 devtool: build-image: add comments
Added couple of hopefully useful comments to the code.

(From OE-Core rev: 72dfe5b58c637d74971e025aef3ce0a64dc8172c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:14 +01:00
Ed Bartosh 2dac49db87 devtool: build-image: remove <image>.bbappend
Removed <image>.bbappend before generating it again as
it may cause tinfoil to fail due to its wrong content.

It's safe to do as <image>.bbappend is regenerated anyway.

(From OE-Core rev: 82c6452ca953eb32e2919d9f9e64497a15212be5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:14 +01:00
Ed Bartosh 96726242f0 devtool: build-image: add extra logging
Added logger calls to show if image is modified by the
plugin or not.

(From OE-Core rev: f719e956a6263784963b6ae9514030a1a1dc2aeb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:13 +01:00
Ed Bartosh 45ebff42af devtool: build-image: generate notification callback
Added notification callback to <image>.bbapend to notify
user that image is modified by build-image plugin.

(From OE-Core rev: 53cb00b8af58c326e2a045cd6f8a04a24dc4c1b5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:13 +01:00
Ed Bartosh 61ecb6ce47 devtool: build-image: filter out recipes
Filtered out non-target recipes and recipes with
recipe name != package name in build-image plugin.

Isolated all logic of getting recipes in _get_recipes
function.

(From OE-Core rev: efe685711ae6f4beec06ba591c74140ce56b96af)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:12 +01:00
Ed Bartosh 214dd950c9 devtool: build-image: improve help and description
Made parser help message and description more clear in
build-image plugin.

(From OE-Core rev: 39714557dde70c4b1ce8d08c7e1d21fd39a1d1a6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:12 +01:00
Ed Bartosh e9fbc7a2d2 devtool: build-image: rename LOG -> logger
Used logger variable name instead of LOG as it is used the rest
of the devtool code.
Pylint complains about 'logger' being invalid constant name,
but it's better to be consistent in naming.

(From OE-Core rev: a1c811df93e831a198464008564ce33ec98a3049)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:11 +01:00
Ed Bartosh 7eb7dc861f Revert "devtool: make add_md5 a public API"
This reverts commit 69c63728da.

Moved add_md5 back to standard.py as it's not used in
any plugin anymore.

(From OE-Core rev: 3823b7abf8c1e82e0448d7283de95422fd262135)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:11 +01:00
Ed Bartosh 71fdc64b8a devtool: make 2 functions public
Moved standard.py:_parse_recipe -> __init__.py:parse_recipe and
      standard.py:_get_recipe_file ->  __init__.py:get_recipe_file
to be able to call them from other modules.

(From OE-Core rev: f0e61a0d5597017c5f5d2dafb41118b79f505d9b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:10 +01:00
Ed Bartosh 906f885efe devtool: build-image: stop using add_md5
It doesn't make sense to use it as image recipe is not
in workspace. It means that we can't do 'devtool reset'
for the recipe, which is a main point of using add_md5.

(From OE-Core rev: f69613ed9d56c6e6ba322d8c9db07b7ed802042a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:10 +01:00
Ed Bartosh 7b421dccc1 wic: use bitbake variable ROOTFS_SIZE
If bitbake image is referenced in .ks file and --size is not used
there wic uses ROOTFS_SIZE variable to set minimum partition size.

ROOTFS_SIZE is calculated in meta/lib/oe/image.py when rootfs is
created. The calculation is done using other image parameters:
IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT, IMAGE_OVERHEAD_FACTOR
and IMAGE_ROOTFS_EXTRA_SPACE.

(From OE-Core rev: 173d440c14ee3140ae08c6a87decc9b2f4c9e391)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 23:26:26 +01:00
Ed Bartosh 530f3c52a4 wic: implement --vars option
This option is used to point wic to the directory with .env
files containing list of bitbake variables and their values.

If this option is used wic will get bitbake variables from
files instead of parsing 'bitbake -e' output.

The main reason for this is to support new mode, when bitbake
runs wic to produce wic images. In this case wic can't run bitbake
again as it's locked, so it will get variables from .env files.

(From OE-Core rev: abdfad1cd68fcd7387c2a508ab81512e8f6b93ce)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:23 +01:00
Ed Bartosh 5856f8ff96 wic: implement getting variables from .env files
Added functionality of getting variables from <image>.env files to
BitbakeVars class. env files will be parsed if the directory with
env files is known, i.e. when vars_dir attribute is set.
Otherwise 'bitbake -e' output will be parsed.

(From OE-Core rev: d21e4c1e56cab750ed4f6031d7f3dc5775a2c2cc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:22 +01:00
Ed Bartosh d80ad239e3 wic: set default image
Set BitbakeVars.default_image when wic is called with -e option.
This makes get_bitbake_var API to use provided image as a default
source of variables.

(From OE-Core rev: d465233579d5efa2e0578baac67f42a35ad8b993)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:22 +01:00
Ed Bartosh 95c6749af8 wic: add default_image attribute to BitbakeVars
New attribute is used when bitbake variable is requested without
specifying image name. The attribute should be set from outside,
for example when wic is called with '-e <image>' option.

(From OE-Core rev: 38d0b3744b5829333148ac4fc97dc45a8d0ba3a5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:21 +01:00
Ed Bartosh e1fe3479a6 wic: create new method _parse_line
Moved code that parses one line of 'bitbake -e' output
to separate method _parse_line.

This method will be also used later to parse lines of .env files.

(From OE-Core rev: 49ef04d3c9eeb76cbbc89b27b4dd1570b7a2552b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:21 +01:00
Ed Bartosh 58c393022f wic: add BitbakeVars class
Moved code of getting bitbake variables into separate class.

Created singleton object of this class in the module namespace.

Preserved existing API get_bitbake_var.

(From OE-Core rev: 3229d37993e315c9ca1902849746b9f50f35845c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:21 +01:00
Ed Bartosh 8313ceae26 wic: deferred call of hlp.get_wic_plugins_help()
If get_wic_plugins_help is called from wic main module
it calls git_bitbake_var at some point. This fails when
wic is called from bitbake as 'bitbake -e' can't be
run.

Moved call of this method to help.py in order to call it
later, when BitbakeVariables singleton is properly initialized
to get variables from .env files.

(From OE-Core rev: d401a8518fb4b0e8adeb34be8948fa780299870c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:08 +01:00
Ed Bartosh 31324ed0ea wic: rename variable
Renamed variable help -> hlp as 'help' is a name of Python
built-in function.

(From OE-Core rev: 94c85fdaec36bfda509be4a66082a0156bf76695)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:08 +01:00
Ed Bartosh b41de121c6 wic: remove undescore from function name
Renamed __exec_cmd -> _exec_cmd as double underscores cause
strange behaviour when function is called in class method.
Python complains that __exec_cmd method(!!!) of the same class
doesn't exist.

(From OE-Core rev: 3b400a06d755e3d437967f60842b1d9bd94f0814)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:08 +01:00
Aníbal Limón 4292352f00 runqemu-internal: Fixes unary operator expected in new TCPSERIAL_PORTNUM
If $TCPSERIAL_PORTNUM is empty string causes an error because
expands the expresion to,

$TCPSERIAL_PORTNUM == "" -> == ""

(From OE-Core rev: 7bbe24f19e6005eccefd404b3a6d5d9443dd5b36)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:06 +01:00
Ed Bartosh b2c1e64ecd devtool: implement build-image plugin
Implemented new plugin to build image from workspace packages.

Plugin creates <image>.bbappend file, adds
all workspace packages to the image using IMAGE_INSTALL_append
variable in bbappend file. After that it runs 'bitbake <image>'.

(From OE-Core rev: 00bc43868da3ea2a4532215d3abef8e150c7b2e5)

(From OE-Core rev: fc35c10fed382e385f00b76abcee94a0148b4aee)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:35:50 +01:00
Ed Bartosh 69c63728da devtool: make add_md5 a public API
Moved _add_md5 function from standard.py to __init__.py to
be able to call it from other modules.

(From OE-Core rev: ee38bb20dc7ba21dac782d8d13383f81dfedef55)

(From OE-Core rev: b07da7d38bcefe8efdd6b22bb9251bef599ef040)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:35:49 +01:00
Randy Witt 63340aefe5 runqemu-internal: Make sure tcpserial is always last
If this is not the case, sometimes the additional tcpserial will be
enumerated as ttyS0, which is not what we want. Because then it would be
the console, and qemurunner would not log things properly.

(From OE-Core rev: c71309616a3247cfab969b74d8642ff0bf9b6500)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 13:38:03 +01:00
Paul Eggleton 15c8835445 yocto-bsp / yocto-layer: fix template recipes
* Drop PR = "r0"
* Use SUMMARY instead of DESCRIPTION

(From meta-yocto rev: 433044641e2500f40fbd72d91bbc38d5cb288c1e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-25 10:47:20 +01:00
Randy Witt d893a2503d runqemu: Add a tcpserial option
The option was added so that the qemurunner could start a second tcp
serial port without adding machine conditional logic to qemurunner.

The issue that made this necessary was that when "virt" is passed to
qemu-system-aarch64, the normal mechanism for specifying a tcp serial
port does not work. This is because the hardware for the "virt" machine
is hardcoded in the device tree blob and the addition devices must be
virtio devices.

So runqemu can specify virtio for qemuarm64 whereas it seems all other
qemu machines work with the "-serial tcp*" option.

(From OE-Core rev: 849d65d55e4df5fa443b2cb7b4cee23913fc9d5a)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:47:07 +01:00
Paul Eggleton 025f759c81 scripts/create-recipe: drop
We have "recipetool create" (or "devtool add" which wraps it) instead
which works pretty well now, is written in Python and thus can call
into BitBake/OE code easily, and can do things that create-recipe can't;
any future improvements should go into recipetool and therefore I think
we'd rather people used it instead.

(From OE-Core rev: df0ef260f36df3993377196962eb6d52ab36b38c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:47:02 +01:00
Mihaly Varga 1308e30379 wic: add mkhybridiso kickstart file
Add kickstart file for generating a hybrid bootable iso image using
isoimage-isohybrid plugin, the output image is HYBRID_ISO_IMG-cd.iso,
the label is HYBRIDISO, and the rootfs.img file is an image with ext3
file system, and uses grub as bootloader for EFI boot and
syslinux for legacy boot.

(From OE-Core rev: e8769d52d6d8c67ba18595ebd27f5022bd0e66c4)

Signed-off-by: Mihaly Varga <mihaly.varga@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:46:56 +01:00
Mihaly Varga de5bc1b758 wic: Add plugin for hybrid iso image
This plugin creates a hybrid, legacy and EFI bootable ISO image.
The generated image can be used on optical media as well as
USB media.

Legacy boot uses syslinux and EFI boot uses grub or gummiboot (not
implemented yet) as bootloader. The plugin creates the directories
required by bootloaders and populates them by creating and
configuring the bootloader files.

The plugin adds an image file to the iso which
contains the directory tree of the rootfs folder specified by the
--rootfs argument or by the IMAGE_ROOTFS bitbake variable.

Using the isohybryd tool, the created .iso image is enhanced by a MBR
for booting from disk storage devices, consequently the provided
iso image could be copyed directly by dd comand onto USB drive or
could be burned to an optical media by using a suitable image burner.

The plugin depends on parted, e2fstools, syslinux, grub, cdrtools,
dosfstools and mtools program.

Some of the functions in this plugin were inspired from bootimg-efi.py
and bootimg-pcbios.py plugins implemented by Tom Zanussi.

(From OE-Core rev: 289c534b5d990e22e5547496f5f84cc9721ce3ee)

Signed-off-by: Mihaly Varga <mihaly.varga@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:46:55 +01:00
Paul Eggleton 0f23a3af8e lib/oe/recipeutils: avoid parsing in get_var_files()
Let's have the caller do this and then the function is a bit more
flexible (e.g. we can choose to parse with bbappends or not); fix up
calls to this function appropriately (of which there are only two, both
within devtool).

(From OE-Core rev: 6ba969f1ac5a1a0e277a21287fc5ae1622a6b14e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:40 +01:00
Paul Eggleton 677e8c8e97 devtool: fix handling of BBCLASSEXTENDed recipes
If a recipe is BBCLASSEXTENDed (e.g. to -native), its PN value and the
name of the bbappend will be different; we were assuming them to be the
same when reading in the workspace, leading to us seeing the base recipe
name everywhere afterwards.

Also add a test so we ensure this doesn't regress in future.

Fixes [YOCTO #8157].

(From OE-Core rev: b63fca00c2e24ad0c8b8b3c492d93ee4372fa92d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:39 +01:00
Paul Eggleton 48bb9eca79 devtool: extract: remove patches subdirectory when S == WORKDIR
Ensure that the "patches" subdirectory is removed from the right
location when S == WORKDIR (e.g. devtool extract makedevs).

(From OE-Core rev: 2062c88726400e09599aff51af95799a866b90c9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:39 +01:00
Paul Eggleton 5e880674a3 devtool: extract: prevent externalsrc from interfering with extraction
In case the user has set up externalsrc outside of devtool, force
EXTERNALSRC to blank for the recipe when extracting so that the original
source URI is still in SRC_URI and we're still able to extract it. (This
isn't a problem with devtool itself because the bbappends within the
workspace layer that apply externalsrc are explicitly filtered out when
devtool parses a recipe).

(From OE-Core rev: 5be16d639d1b78d114755bfd552ac901d0fdf4a9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:38 +01:00
Cristian Iorga b7cd76810a canned-wks: added a qemux86* directdisk recipe for wic
qemu-directdisk.wks creates a raw disk image
that a qemux86* machine can boot from.

(From OE-Core rev: 3b1a2baa95fee7479e85379c0f6f4d54c0db2042)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:33 +01:00
Ed Bartosh 4c35cd94e3 create-pull-request: cleanup bashisms
Made create-pull-request POSIX compatible:
   - Replaced /bin/bash -> /bin/sh in shebang.
   - Replaced usage of pushd/popd with generic shell commands.
   - Tested on zsh and dash.

(From OE-Core rev: b5c77a94b97b316b7ea075841d18b73e6dccbf2d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-16 09:24:56 +01:00
Ed Bartosh 9b97a0693b wic: release 0.2.0
Major changes in 0.2.0:
- implemented UUID support
- fixed support of GPT partition tables
- implemented running bitbake from wic
- implemented image compressing
- started testing with oe-selftest. implemented 17 test cases
- used native tools (parted, mkfs, mtools, etc)
- usability and documentation fixes
- code clenup

(From OE-Core rev: a0f8cb7e0ffa15e101d39463c77707c821250203)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:02 -07:00
Ed Bartosh 8ce8328901 wic: code cleanup: pylint misc.py
Fixed pylint warnings.
Increased pylint score from 8.02 to 9.40.

(From OE-Core rev: 26d8c70fb8a7cc8f6473ad1779b20b00616740c0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:02 -07:00
Ed Bartosh 8421e0e29f wic: code cleanup: remove unused code
Removed unused global variable wks_vars and 2 unused functions
get_wks_var and add_wks_var.

(From OE-Core rev: 7d87c821da6a5020e8dde3f1907fb8d6a023b110)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:01 -07:00
Ed Bartosh 87a846d588 wic: Report recipe name for native commands
exec_native_cmd was modified to report recipe to build
native programs.

Pairs executable->recipe are hardcoded as it's not possible
to obtain this information automatically.

[YOCTO #7631]

(From OE-Core rev: 1274379c91ee8e2fb9fbb34a6445cd5767eb4a35)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:01 -07:00
Ed Bartosh daa8109314 wic: Improve 'wic help overview' content
Included full console output and example of the .wks file
into the 'wic help overview' content.

Used qemux86-64 machine instead of crownbay to make example
working without cloning additional layers.

[YOCTO #7940]

(From OE-Core rev: 68d391eaf4fe9fc37e3278255d5da170f98b8763)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:01 -07:00
Ed Bartosh 04c5307cf7 wic: improved usage text
Made command line specification less confusing.
Reformatted usage output.

[YOCTO #7938]

(From OE-Core rev: c4a44ad4c5aa65657b69b811e793f98418159348)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:00 -07:00
Ed Bartosh da0f5037b6 create-pull-request: cd to relative directory
create-pull-request -d path creates empty patches if directory
is specified as a path, i.e. ./bitbake or ./bitbake/ or full path.
It behaves expected way only if script is run with -d bitbake, i.e.
relative dir name doesn't contain '\'.

Fixed this unwanted behaviour by changing directory and running
git format-patch in it with --relative, without specifying
relative path as a parameter.

(From OE-Core rev: 3042956a86167f89beccc5d05f1fad1844e7c36a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:00 -07:00
Richard Purdie 0968e3a68b runqemu: Handle device names like tapX@NONE
ip list can return devices in the form tapX@NONE. If it does so,
ensure we handle that case correctly. Newer distros appear to do
this in some cases.

[YOCTO #8129]

(From OE-Core rev: 6459dde380febce24d2c355d441d9cb3b14409b9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:13:58 -07:00
Richard Purdie 8020a9e44f runqemu: Add error handling for unexpected tap devices
In theory the code reduces the tap device number to an integer. This
patch adds error checking to ensure that does happen and that the script
exits if something unexpected happens.

(From OE-Core rev: 4238f3b6e320969aaf539e6afb1cb2bfd61bb28b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:13:58 -07:00
Patrick Ohly 8b847ffd04 combo-layer: fix action_pull for unknown branch
When reconfiguring the branch to something not already fetched,
action_pull fails with
   error: pathspec '<new branch name>' did not match any file(s) known to git.

It is the "git checkout" which fails like that. To solve this,
try the faster "git checkout + git pull" first and only if that fails,
fall back to the slow "git fetch + git checkout".

In the conf.hard_reset case, do the checkout always after the git fetch.

(From OE-Core rev: ad4d3b1da190cf08c6ac5f9a94a2a1c4980a184d)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:13:57 -07:00
Patrick Ohly b2a0c2fbd1 combo-layer: enhance output in action_pull
The git operations can fail, for example when the branch is unknown
or misconfigured.

Better move the info message and extend it such that it is printed
first and provides the necessary context, because otherwise the
CalledProcessError exception gets dumped without mentioning for which
component it occurred.

(From OE-Core rev: 00d01468a692faf4272894dd328e8c532bcf8b49)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:13:57 -07:00
Dominic Sacré b5e9dbbe82 python3: remove 2to3 symlink from package python3-2to3
The 2to3 symlink conflicts with its Python 2 equivalent in package
python-2to3.
The Python 3 version of the tool is still available as 2to3-3.4.

(From OE-Core rev: ff3633fa6a379d502f65b20d6a57d30c59f09ab6)

Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 22:24:18 +01:00
Dominic Sacré 0b69680a33 python3: remove package python3-robotparser
robotparser has been moved to urllib.robotparser in Python 3, and gets
packaged as part of python3-netclient alongside the rest of urllib.
This causes python3-modules to depend on an empty/missing
python3-robotparser package.

robotparser.py is relatively small and has no dependencies outside
urllib, so it makes more sense to eliminate the python3-robotparser
package than to alter the manifest for python3-netclient.

Part of the fix for [YOCTO #8048].

(From OE-Core rev: 9e01909f3239f0a88e20f12e65b6141e547b114a)

Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 22:24:17 +01:00
Christopher Larson 84ad12ead0 devtool: add --bbpath argument
(From OE-Core rev: a459b230387b34479212d54edeb3abf2b6274196)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 22:24:12 +01:00
Ed Bartosh 90bc2f35d0 create-pull-request: Implement -d option
This options allows to generate patches against relative directory by
using git format-patch --relative option.
See more details about --relative option in git diff manual page.

For example generating bitbake patchsets from poky can be
done this way: create-pull-request -u contrib -d ./bitbake

(From OE-Core rev: 9b544125e1e3d2cc2db8f5d20d6fd0746f8cef5d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:06 +01:00
Paul Eggleton 9a672bd569 devtool: use tinfoil shutdown method
Tinfoil now has its own shutdown method, use it instead of calling into
cooker - not only is it the right thing to do from an API perspective,
it also ensures proper lock handling.

(From OE-Core rev: c1f58caad4ff45efd213bf1412304a72903abe7e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:03 +01:00
Alexander Kanevskiy 405bb5b588 combo-layer: fix AttributeError traceback.
Commit c908a423f85a84ddd8249abd00254f29d47df74b introduced a new
issue in combo-layer that leads to a traceback as
args.hard_reset is an unknown variable. This change defines an
appropriate destination for the command args parser and fixes the
reference.

(From OE-Core rev: ac4ef551d506a5767946cf2fb717c2fd7f86df9c)

Signed-off-by: Alexander Kanevskiy <kad@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31 12:09:42 +01:00
Richard Purdie dab511c36d gcc: Add support for nativesdk-gcc
Being able to build a nativesdk gcc is useful, particularly in cases
where the host compiler may be of an incompatible version (or a 32
bit compiler is needed).

Sadly, building nativesdk-gcc is not straight forward. We install
nativesdk-gcc into a relocatable location and this means that its
library locations can change. "Normal" sysroot support doesn't help
in this case since the values of paths like "libdir" change, not just
base root directory of the system.

In order to handle this we do two things:

a) Add %r into spec file markup which can be used for injected paths
   such as SYSTEMLIBS_DIR (see gcc_multilib_setup()).
b) Add other paths which need relocation into a .gccrelocprefix section
   which the relocation code will notice and adjust automatically.

This patch adds tweaks to the relocation script to handle the
new section too.

(From OE-Core rev: cd3d874fced2ee4c950d9964d30c0588fd8772e7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31 10:32:37 +01:00
Paul Eggleton 67a3807c4c oe-selftest: add scripts/lib and bitbake/lib to path
In particular, this allows us to use code from bitbake's bb module
(such as tinfoil).

(From OE-Core rev: 5ca91cd0b56eb2da80c781fb46ae0b600c3f1eb9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:14 +01:00
Christopher Larson 51d760e2a7 oe-selftest: add libdirs from BBPATH to sys.path
This ensures that oeqa.selftest.* from layers are found.

[YOCTO #7625]

(From OE-Core rev: 182b8ed9f26ed8b6a8eb6dcaec82db9aca14b010)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:13 +01:00
Christopher Larson d2023c34e4 oe-selftest: obey oeqa.selftest.__path__
This ensures that all paths that hold selftest tests will be checked
(oeqa.selftest is a namespace package).

[YOCTO #7625]

(From OE-Core rev: 3c60cbced7b101ee52ce4a0a0bce542fd38f1821)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:13 +01:00
Christopher Larson 0eb40ba0de devtool: also load plugins from BBPATH
This makes it easier to extend, as a layer can add its own sub-commands.

Argument parsing is also separated into two steps, the same way it's done in
recipetool, as we need access to the global command-line arguments early,
before plugins are loaded, both for debugging arguments and for the bitbake
path (we need to load the bitbake module to get tinfoil, which is now needed
to load the plugins).

Rather than constructing tinfoil once and passing it through into sub-commands
for their use, we have to construct it for configuration metadata, use it, and
then shut it down, as some sub-commands call out to recipetool, which needs
its own tinfoil instance, and therefore needs to acquire the bitbake lock. If
we're still holding the lock at that point, that's clearly a problem.

[YOCTO #7625]

(From OE-Core rev: f9bc3b27244a141ec7273445d3ea139a047e0ddf)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:13 +01:00
Christopher Larson da02f483c4 recipetool: parse global args early
This separates the argument parsing into two steps, which lets us apply global
settings like enabling debugging before the plugins load, so we can see the
paths where plugins are being loaded.

(From OE-Core rev: 899288a1b255052a6ee0f97d42f8c4f0ec3c3140)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:13 +01:00
Christopher Larson 71366782d9 recipetool: also load plugins from BBPATH
This makes it easier to extend, as a layer can add its own sub-commands.

The bitbake path setup is moved earlier, as it has to be done before
tinfoil_init.

[YOCTO #7625]

(From OE-Core rev: 5753f20acc31d4d8d93069e3daccce1fad27b7ac)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:12 +01:00
Christopher Larson 89878f5906 recipetool.append: add extralines arg to appendsrc
This makes the function more reusable for other sub-commands.

(From OE-Core rev: c6feb6e97c9929560b1e3cec280c1d7976ecc030)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:12 +01:00
Christopher Larson e28c4ba7bf recipetool: catch BBHandledException from parsing
This ensures that we don't see a traceback on parsing failures.

(From OE-Core rev: 22ba003f62a321c3b8405a03d6c9ee04dc0a62a6)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:12 +01:00
Christopher Larson c56cb31565 recipetool: appendsrcfile: handle S == STAGING_KERNEL_DIR
When determining the path from WORKDIR to the extracted sources, we're using
S, but if S is in work-shared, that's problematic and won't give us good
results, so assume 'git' for that case, warning when appropriate.

(From OE-Core rev: dc70cf470f18c97b6762cbf7aca723769b47bc7d)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:41 +01:00
Christopher Larson 5c080f71bf recipetool: appendsrcfile: use -D, not -d for destdir
-d is already taken for --debug.

(From OE-Core rev: fc174debb073c99a0cabf4f00e66ab36c7e93989)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:41 +01:00
Christopher Larson 023e9b2685 recipetool: appendsrcfile: fix duplicate SRC_URI check
(From OE-Core rev: e9986529d15220a8482f5a7a2fdbe86110ee35b5)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:41 +01:00
Ross Burton 94c50ef8a9 Revert "create-pull-request: Fix error on 2.0 versions of git"
This breaks create-pull-request for git <2, which is many people.

This reverts commit 7ee64ea60ede5477b2f9a355d93bdc556e6b7895.

(From OE-Core rev: 26766ea8ee0ef121e54ff9084c4637aa8df984f4)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-21 23:53:45 +01:00
Cristian Iorga 77cd461edb runqemu-internal: add temporary disk interface to qemuarm64
Starting with qemu 2.4, a disk needs be attached via a specified
interface, even if that interface is none. In case of qemuarm64
machine, the board is virtual, so a none interface it works
correctly.

(From OE-Core rev: 7151dc110ef87518034fdcd7d85cbebdc76013ab)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:25 +01:00
Ben Shelton 6e8313de40 create-pull-request: Fix error on 2.0 versions of git
On 2.0 versions of git, the create-pull-request script exits with the
warning "No match for commit... Are you sure you pushed 'HEAD' there?".

This is due to a change in behavior where git used to guess the branch
you meant, but no longer does.  See the thread at
http://www.spinics.net/lists/git/msg233050.html for more information.

To accommodate the new behavior, if the COMMIT_ID is set to the default
of "HEAD", make it point explicitly to $BRANCH instead.

(From OE-Core rev: 7ee64ea60ede5477b2f9a355d93bdc556e6b7895)

Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:21 +01:00
Markus Lehtonen b0079ec5e9 combo-layer: implement --hard-reset option
This option causes combo-layer to do git fetch and hard reset instead of
git pull in the component repositories. This makes sure that the local
component repositories are always in sync with the remote - tolerating
force pushes and overriding any locally made changes.

(From OE-Core rev: c908a423f85a84ddd8249abd00254f29d47df74b)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:17 +01:00
Markus Lehtonen d1a1dbb8a5 combo-layer: only allow fast-forward when pulling
Only allow fast-forward merges in the component repositories when doing
git-pull. This makes it possible to spot problems (i.e. rewriting of
history) in the component upstream . Also, this change prevents the
creation of local-only merge commits in the component repositories.
These merges cause "last_revision" field of the combo-layer config to
point to a git commit that is only present in the users local component
repository but nowhere in upstream.

(From OE-Core rev: 5207169b9c6c4b05c6b043745905a5498adca1a3)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:17 +01:00
Ash Charles 3f79bf7f6c python-io: Add runtime dependency on contextlib
The python-io package includes ssl.py module which imports the
contextlib library.

This applied to Python 2.7.9 but not 3.3.

(From OE-Core rev: b6b9df15a630605619bff060d5073272685058d6)

Signed-off-by: Ash Charles <ashcharles@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:16 +01:00
Richard Purdie ee69463f4e recipetool/append: Fix selftest failure with multilib
If you have multilib enabled, it finds lib32-base-files instead of
base-files for test_recipetool_appendfile_basic causing a test
failure. Add a fix for this.

(From OE-Core rev: c9821a56da9c6e341408ea21e0d8a4cc5291dba6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:55:38 +01:00
Ed Bartosh 8f8d3362b8 wic: Set default set of bitbake variables
Set default set of bitbake variables to the set of variables
for the first parsed image.

This allows wic to find proper bitbake varibale values
if it's called with '-e <image>' even without specifying
image in the call of get_bitbake_var.

(From OE-Core rev: 18cc6d2ec4dc289bb0333dddc96df5a645ea53d0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-10 13:35:40 +01:00
Puustinen, Ismo daec53e977 combo-layer: modified to generate better commit messages.
This patch includes support for a global section in combo-layer.conf
called [combo-layer-settings]. Supported in this section is key
"commit_msg"; its value is the template for the git commit message
that updates the last_revision. The template can include substitution
for the updated component list: ${components}. The substituted value
will either be a comma-separated list of components or "all components",
if combo-layer was invoked without component list argument.

If the key is not present, the old default value is used for the commit
message.

Configuration file example:

[combo-layer-settings]
commit_msg = pulled in the latest changes for ${components}.

(From OE-Core rev: fe84747f961772b61031af59d44e54b178148379)

Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-08 00:01:22 +01:00
Daniel Istrate 75fa966d7c scripts/oe-selftest: Added mechanism for including/removing bblayers.inc
When oe-selftest starts it includes bblayers.inc into bblayers.conf
When oe-selftest ends it deletes bblayers.inc and the included line
from bblayers.conf

(From OE-Core rev: cf7bf27f565b34fdcd2caa25aaef068c0970965e)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-08 00:01:19 +01:00
Cristian Iorga 7e074c3641 runqemu-internal: correctly set format for root FS as raw
qemu guesses via probing the format of root FS, but
gives a warning and restricts write operations on block 0.
Fix it by setting correctly the format as raw for more
machines and non-KVM machines.
In some cases, replaced the way machine disk is set for qemu.

Fix for [YOCTO #7918]

(From OE-Core rev: 6f7144ebe2da4c72ef58280e034b2cc75331a471)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:39 +01:00
Ed Bartosh 00020fada3 wic: Code cleanup: unused imports
Fixed pylint warning unused-import

(From OE-Core rev: e77fda5fb6cb0a35308e4620ca4602715a471fbe)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:38 +01:00
Ed Bartosh 34172ef805 wic: Code cleanup: long lines, identation and whitespaces
Fixed pylint warnings bad-continuation, bad-continuation and
line-too-long.

(From OE-Core rev: db43e59f41b6bc19152cd4743585a3217015e272)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:38 +01:00
Ed Bartosh 335aa0fee8 wic: Fix confusing error message
Wic throws this message when any of the build artifacts are
not provided:
  Build artifacts not completely specified, exiting.
    (Use 'wic -e' or 'wic -r -b -k -n' to specify artifacts)
It was not clear which artifact was not specified.

Reworked the code to specify list of missed artifacts.
Now the message looks like this:
  The following build artifacts are not specified:
    bootimg-dir, kernel-dir, native-sysroot

[YOCTO #7912]

(From OE-Core rev: 98912687f15f6d7537746fb38499f739e1a47be9)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:38 +01:00
Ed Bartosh d88af4f518 wic: Remove __write_partition method
Moved code of __write_partition to 'assemble' method.
This way it should be more readable.

(From OE-Core rev: f7059362053c87f96ce68d1ab850962defb76540)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:38 +01:00
Ed Bartosh 0ef9cdd1ec wic: Refactor fstab update code
Made the code to backup and restore fstab only if it's modified.

Cleaned up the code. Made it more pythonic.

Improved code readability by moving code from several tiny
methods into one place.

(From OE-Core rev: e663b1857fd2975585003bfa4739f8f84c652708)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:38 +01:00
Ed Bartosh a49a422700 wic: Add --uuid partition option
Added --uuid option to the configuration of wks parser.
This option specifies partition UUID. The code to process
it is already in place. It was implemented for --use-uuid
option.

(From OE-Core rev: c7ffe3785e61f3c57aeeebc34ec573685f0ea6a8)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:38 +01:00
Ed Bartosh 594dc7213f wic: Fix naming conflict
Image file name is not unique for the partitions without label.
This causes image being rewritten and used as a source for all
partitions without label. Wic produces broken or incorrect result
images because of that.

Added wks line number to the image name to make it unique.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh 4023377bae wic: Remove duplicated code
Moved duplicated code of geting rootfs size
out of prepare_rootfs* methods.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh b5dce25ddc wic: Refactor prepare_empty_partition API
Moved code out of prepare_empty_partition* methods
to avoid code duplication.

(From OE-Core rev: 7dc4e007aa9f02162b3f24705e9d9dba7a1cf7ef)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh 052c8198d7 wic: Call methods better way
Shortened code by using getattr to obtain a method to call for
prepare_empty_partition_* and prepare_rootfs_* methods.

(From OE-Core rev: 066f713f71828ff6f408448e5ea4fcd56faa423e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh 73d0d23014 wic: Get rid of useless variable 'image_rootfs'
Removed useless variable 'image_rootfs' from 4 prepare_rootfs_* methods.

(From OE-Core rev: 4570412f70188d36312a5f9944d81df884302520)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh 1e307c3b40 wic: Rename partition images
Renamed partition images into <final image>.p<partition number>
This should make output directory look more organized and easier
to understand.

(From OE-Core rev: c826939e4eeed034f39207089ec1a7ed87c1c493)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh e9237bf0fa wic: Refactor prepare_rootfs API
Moved code out of prepare_roots* methods to avoid code duplication.

(From OE-Core rev: ab1c845758d4f80c82ffcf481007803905e45c29)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh 992f78939e wic: Turn off debug output for 'bitbake -e'
Switched debug level to 'normal' to prevent huge 'bitbake -e'
output to go into wic debug output. This should help to make
wic debug info much more clean and easier to read.

(From OE-Core rev: 71510c32d78ba24bf1172548f8eb4adfe621d2de)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:36 +01:00
Ed Bartosh 9ca3472f4f wic: Remove annoing debug message
Wic tries to find plugins in every layer and prints a message
'Plugin dir is not a directory or does not exist' if layer
doesn't have plugin dir. It causes a lot of duplicated
messages in the debug output, which makes it hard to find
useful info there.

(From OE-Core rev: e6ed2e07d70eaa07d4c2ab9e484eacedd193323e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:36 +01:00
Ed Bartosh 1cabf091fc wic: Include mount point into image report
Wic doesn't show any information for the partition if label is not set.
Fixed this by adding mount point to the report.

(From OE-Core rev: 36be9c1f7a6fded146a6f1c268455d826d78f97b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:36 +01:00
Ed Bartosh aa470a1fcd wic: Refactor getting bitbake variables
Wic gets bitbake variables by parsing output of 'bitbake -e' command.

This implementation improves this procedure as it runs 'bitbake -e' only
when API is called and does it only once, i.e. in a "lazy" way. As parsing
results are cached 'bitbake -e' is run only once and results are parsed
only once per requested set of variables.

get_bitbake_var became the only API call. It replaces find_artifacts,
find_artifact, find_bitbake_env_lines, get_bitbake_env_lines,
set_bitbake_env_lines and get_line_val calls making API much more clear.

(From OE-Core rev: 3abe23bd217315246ec2d98dc9c390b85cfe6a92)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:36 +01:00
Ed Bartosh ba2396831d wic: Fix misleading message
Due to usage of incorrect variable wic produces strange message
"No image named None found, exiting." when specified canned .wks
doesn't exist.

Fixed by replacing wks_file -> argv[0]

(From OE-Core rev: 2be905feff3c2166adaa8f50ad09d4b6896461ab)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:36 +01:00
Ed Bartosh b42d7d26e1 wic: Test rootfs plugin using image recipes
Added canned wks and testcase to create multi-rootfs images referring
bitbake image recipes.

(From OE-Core rev: 723ed56eda0e64b9678b846ef2001465b15e0c1b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:35 +01:00
Christopher Larson b428f88bc1 recipetool: add appendsrcfile(s) sub-commands
This adds the `appendsrcfile` and `appendsrcfiles` sub-commands, which let the
user add or replace one or more files in the recipe sources, either in a path
relative to `S` or `WORKDIR`. Each file gets added to `SRC_URI` as a file://
URI, using the subdir= parameter to specify the destination directory.

Examples:

    # Adds our defconfig as file://defconfig. If it's already in SRC_URI, it
    # won't be duplicated.
    recipetool appendsrcfile --workdir meta-mylayer linux-mel defconfig
    recipetool appendsrcfiles --workdir meta-mylayer linux-mel defconfig

    # Does the same, handling the different local filename
    recipetool appendsrcfile --workdir meta-mylayer linux-mel defconfig.mine defconfig

    # Adds our device tree files to the source tree
    recipetool appendsrcfiles --destdir arch/arm/boot/dts meta-mylayer linux-mel *.dts

Of course, for the latter example to be of use, the new dts files would need
to be added to `KERNEL_DEVICETREE` as well, and depending on the kernel,
`DEFCONFIG` or `KERNEL_DEFCONFIG` may need to be set.

Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
(From OE-Core rev: 8227172d05fb394d79ff83d3c36f5208ebebf92c)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:55 +01:00
Christopher Larson 49a089f8e1 recipetool.append: use argparse types for validation
This validates the arguments early, when argparse is parsing the arguments, in
a consistent way.

Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
(From OE-Core rev: bec92899f5324a4423b4ee70365eaa5dfb6891a6)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:55 +01:00
Ross Burton b053b81e68 oe-selftest: timestamp the test runs
The selftest can take a couple of hours to run, so add a custom result class to
timestamp the output to make it easy to spot any slow tests.

(From OE-Core rev: cce89c44948ee66ad0abb491be57e270038270e4)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:52 +01:00