Commit Graph

1095 Commits

Author SHA1 Message Date
Ed Bartosh 1dd8cca631 wic: use wic logger in wic source plugins
Replaced msger with wic logger in wic source plugins.

(From OE-Core rev: 19a868e9ad12fb27a7f713685d12f3d310fd6961)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:16 +00:00
Ed Bartosh 7c163ada95 wic: use wic logger in imager direct plugin
Replaced msger with wic logger in the direct plugin.

(From OE-Core rev: adeacb4e600b8438bd9db7e83a5cb4a118d186f3)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:16 +00:00
Ed Bartosh fe2d602240 wic: use wic logger in core modules
Replaced msger with wic logger in the core wic modules.

(From OE-Core rev: cdd6675951b74075c9b9159f7465a88f83775bac)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:16 +00:00
Richard Purdie f73172e64e devtool/sdk: Run build-sysroots after installing new things
After running sdk-install we need to ensure that the standalone sysroots are
updated as done when the eSDK is originally built. Add such a call so this
happens automatically and the envrionment scripts in the SDK work correctly
after updates.

(From OE-Core rev: 4f422071d6f9a074986f399d9e648977bd2e0a68)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:11 +00:00
Tim Orling ea8b9d5d7b scripts/lib/devtool/deploy.py: add --port/-P argument for target connection
Enable using, e.g. host port 2222 for connection to qemu target.
Defaults to 22 for standard ssh/scp port.

[YOCTO #11079]

(From OE-Core rev: a2bfa2cc9ee19f617f7d3b6447896e45eb855d2e)

Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:06 +00:00
Luck Hoang 1d133ec021 devtool: upgrade: fix error of import recipeutils
upgrade.py imports oe.recipeutils in meta/lib/ but path to oe.recipeutils
is not provided. This fails populate_sdk_ext.

(From OE-Core rev: 5f140359f859fea9cfe8c8d9c9584bceec875adb)

Signed-off-by: Luck Hoang <huyht1205@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-23 12:49:49 -08:00
Ed Bartosh 01b9ab89de wic: direct: move creation of PartitionedImage to __init__
Moved creation of PartitionedImage object from DirectPlugin.create
method to init. It makes the code a bit more readable and logical.

(From OE-Core rev: 9f225ef5620f2e47e762b2fd16fa5f8d6f1f60fd)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:45 -08:00
Ed Bartosh 924e84ea8d wic: direct: move generation of part.realnum to PartitionedImage
Moved the code that generates real partition numbers from DirectPlugin
to PartitionedImage.

The idea is to have all code that works with partitions
in PartitionedImage class.

(From OE-Core rev: dbd58b0b32288821d9dd5d1a3118cf7c6e8f098a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:45 -08:00
Ed Bartosh 32e2d92913 wic: direct: add PartitionedImage.prepare method
Moved code that calls prepare method of Partition objects
from DirectPlugin to PartitionedImage.prepare.

The idea is to have all code that works with partitions
in PartitionedImage class.

(From OE-Core rev: 700aa424f0aa239cf4149eed4bfb1dc7d9677431)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:45 -08:00
Ed Bartosh 01d37e7537 wic: direct: set bootloader.source in the __init__
Moved setting of bootloader source from do_create method
to __init__ as it doesn't have anything to do with image
creation.

(From OE-Core rev: 361b890da1c7b24de0a62516545e4c164830081d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:45 -08:00
Ed Bartosh 58528cd5a7 wic: direct: move UUID generation to PartitionedImage
Moved code that generates partition UUIDs from DirectPlugin to
PartitionedImage class as it's more logical to have it there.
This allows the code to be reused by other imager plugins.

Got rid of having yet another list of partitions in PartitionedImage.
Reused the list passed from DirectPlugin.

(From OE-Core rev: 20c70dd617d4abfff507e210610a58a9989f7c9b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:45 -08:00
Ed Bartosh d5f42cad0c wic: direct: add 'realnum' attribute to partition
Replaced call of _get_part_num method with an attribute.
This eliminates the need to call the method and loop over
partitions every time we need to know realnum for partition.

(From OE-Core rev: 96a26b6ddf22346dafa06b00816579439e98445f)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:45 -08:00
Ed Bartosh 77dc8e6ef3 wic: direct: remove useless code
Removed catching CreatorError and raising it again.

(From OE-Core rev: c17353c8ec9ecb52368e08dad999aafc9ac1b734)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:45 -08:00
Ed Bartosh 870171a205 wic: direct: don't catch ImagerError
Don't transform ImagerError exception into warning.
Let wic to catch it on the upper level.

(From OE-Core rev: 0cc84c81dd4a776aa37c8d1bcdcc3fa3af78d1e4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:45 -08:00
Ed Bartosh 417e5fbe2b wic: direct: remove set_bootimg_dir setter
Removed java-like setter set_bootimg_dir. It's more pythonic
to access public attributes directly.

(From OE-Core rev: c2a6ca4883ea59e6492ad3b4aa0e9bc358b87fed)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:45 -08:00
Ed Bartosh 6d91c5f6f4 wic: ksparser: set default disk to 'sda'
Set default value of --ondisk to 'sda' to ensure
we always have disk name for the partition.

This is a first step of replacing --ondisk with
disk <name> attribute of .wks. This is better as
all partitions share the same disk.

(From OE-Core rev: caa243a86ba50c676f8eb0a71440885a49f10cc4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:45 -08:00
Ed Bartosh 93906fb830 wic: remove utils/oe/__init__.py
This file and utils/oe folder are not needed anymore as
all modules were removed or moved out of this directory.

(From OE-Core rev: e3b73b1c07620cde423cc7db7e2f7d8b1ad25e25)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:45 -08:00
Ed Bartosh cdcc6e2753 wic: move PartitionedImage class to direct.py
As PartitionedImage is only used in direct.py it makes sense
to move it there. It's easier to maintain (and refactor) it
this way.

(From OE-Core rev: 2550622371f5c50857e5d58eabab01a1823c6fc3)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:44 -08:00
Ed Bartosh adf5e2956c wic: move disk operations to PartitionImage class
Disk operations were spread over DirectPlugin, DiskImage and Image
code making the code hard to understand.

Renamed Image class to PartitionedImage.
Removed DiskImage class.
Moved disk operations to PartitionedImage.

There was an implicit support for multiple disks: if different devices
were specified in .wks file (e.g. --ondisk sda and --ondisk sdb), wic
would theoretically generate multiple images. This is quite confusing
option and the code supporting it was broken for a long time. The same
effect (multiple output images) can be achieved in obvious and clear
way - by using multiple .wks files.

This functionality was removed. PartitionedImage works only with
one image. This makes the code less complex and easier to maintain.

(From OE-Core rev: 4dc9dbfc7fbc16d349a019e8973d50905cd28244)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:44 -08:00
Kristian Amlie f6a064d969 wic: Add --exclude-path option to rootfs source plugin.
It will omit the given path from the resulting partition, and if the
given path ends in a slash, it will only delete the content, and keep
the directory.

Since mkfs only accepts whole directories as input, we need to copy
the rootfs directory to the workdir so that we can selectively delete
files from it.

Since we want to use the copyhardlinktree() function, we need to put
the generic oe lib in the module search path.

(From OE-Core rev: 6602392db3d391d926dead49fcc54326015cfe35)

Signed-off-by: Kristian Amlie <kristian.amlie@mender.io>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:44 -08:00
Ed Bartosh 7cb17e3e9e wic: remove unused argument scripts_path
There is no need to pass scripts_path from main wic module
down the stack as it's not used there.

Removed scripts_path argument from DirectPlugin class
and wic_create function.

(From OE-Core rev: f9f72c506befdff13260f37ded0beaea3aa30fad)

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>
2017-02-15 20:06:44 -08:00
Ed Bartosh 74aee7a1a7 wic: direct: remove unused import
Removed unused import of wic.errors module.

(From OE-Core rev: 318ba1edfcf0cacf6adae7e1af625dcb43ec3881)

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>
2017-02-15 20:06:44 -08:00
Ed Bartosh 348c9c50c1 wic: direct: remove unused plugin attributes
Removed unused _disks, _disk_format and _disk_names
attributes from DirectPlugin class.

(From OE-Core rev: 178df49cf1674bfcf1cb7295d0494c3b23929d22)

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>
2017-02-15 20:06:44 -08:00
Ed Bartosh a9be5de4a1 wic: make sure layout_partitions is called once
Removed artificial _partitions_layed_out attribute and
unneeded call of layout_partitions method.

(From OE-Core rev: 702772edc839c220140ac0572bb14b4e44c81c1c)

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>
2017-02-15 20:06:44 -08:00
Ed Bartosh fd1f6fb201 wic: use the same partition object in direct and partitionedfs
Partition attributes were copied to the dictionary in partitionedfs
code, which makes the code hard to follow.

Used partition object passed from direct.py module as is in
partitionedfs.

(From OE-Core rev: 97db24d34847a641868f9ee83aae56f9dd5e0a8a)

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>
2017-02-15 20:06:44 -08:00
Ed Bartosh 4edcd63ba1 wic: direct: get rid of _get_parts getter
Replaced _get_parts getter with direct attribute
access to self.parts

Removed code that implicitly created partition
if there are no partitions mentioned in .wks file

(From OE-Core rev: 7ece57a80f4002d0d83dc322092e9178380ab509)

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>
2017-02-15 20:06:44 -08:00
Ed Bartosh 6355150674 wic: partitionedfs: rename __create_partition and __add_disk
Renamed private methods with leading double underscores:
__create_partition -> _create_partition
__add_disk -> _add_disk

There is no point to have those names mangled, one underscore
is enough.

(From OE-Core rev: 26f3218070d34ccd4e81fa3b8e1a15c03583d070)

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>
2017-02-15 20:06:44 -08:00
Ed Bartosh 86e190a614 wic: partitionedfs: get rid of __add_partition
3 lines long private method __add_partition is called only
from add_partition method. Merged them together to increase
readability.

(From OE-Core rev: b7fb20fffada61211dda6d41f99407618428f23c)

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>
2017-02-15 20:06:44 -08:00
Ed Bartosh b8354df789 wic: partitionedfs: merged __format_disks and create
Private method __format_disks is called only from create
method making the code less readable. Merged the code
into one method.

(From OE-Core rev: b76b1bd404487df38fd99bc0d0e6a59acb10c9d3)

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>
2017-02-15 20:06:44 -08:00
Richard Purdie bfd0a39bdf classes: Drop now unneeded update_data calls
Now that the datastore works dynamically we don't need the update_data calls
so we can just remove them. They're not actually done anything at all for
a while.

(From OE-Core rev: 8de0c5d3bd01919e2bf0394f9c485936d6098cec)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:55 -08:00
Paul Eggleton e8f4e06e76 devtool: improve parse failure handling
With the move to tinfoil2, the behaviour when parsing failed has changed
a bit - exceptions are now raised, so handle these appropriately.
Specifically when if parsing the recipe created when running devtool add
fails, rename it to .bb.parsefailed so that the user can run bitbake
afterwards without parsing being interrupted.

(From OE-Core rev: b9592bd3c1ab2155b9f62d18ce593b9c88eff279)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Paul Eggleton e0a94f2e1f recipetool: create: do not treat numbers in SCM URLs as versions
Numbers within SCM (e.g. git) URLs are extremely unlikely to be valid
version numbers - more likely they are just part of the name, thus don't
try to extract them and use them as the version - doing so causes pretty
bad behaviour within devtool:

--------- snip ---------
$ devtool add https://github.com/inhedron/libtr50
NOTE: Fetching git://github.com/inhedron/libtr50;protocol=https...
...
NOTE: Using default source tree path .../build/workspace/sources/libtr
...
RecursionError: maximum recursion depth exceeded while calling a Python object
--------- snip ---------

(This was because ${PV} was being substituted into the URL, but PV's
value was being set to include ${SRCPV}, so there was a circular
reference.)

(From OE-Core rev: 3427508b6ce865654f8bf01a6fc04b83c70315d3)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Paul Eggleton 6ac9c605e6 recipetool: create: properly handle npm optional dependencies
npm's package.json supports two types of dependencies -
optionalDependencies and dependencies; in the code for creating a recipe
from a non-npm source (e.g. a git repository) we were not handling
optionalDependencies and thus when pointed at a node.js application
outside of npm we weren't taking care of all dependencies.

(From OE-Core rev: 2b66cb9982d10ce1744d430858eaef3e5a72c8c0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Ed Bartosh 07f32d7af8 wic: fix call of serial_console_form_kargs
As syslinux module has been recently removed and
serial_consloe_form_kargs became local API in rootfs_pcbios_ext plugin
it should be called without syslinux. prefix.

(From OE-Core rev: d701673b658d879726d6cf846a6d5f4173c3b0e5)

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>
2017-02-05 09:22:18 +00:00
Ed Bartosh f9b58d0d11 wic: isoimage-isohybrid: use wic-tools to get syslinux path
wic-tools recipe specific sysroot contains syslinux as wic-tools
depends on it. Used wic-tools target to get syslinux path should
guarantee that syslinux is installed there and can be used.

(From OE-Core rev: be8ebac3b055070f690d42836bb0fdad32d29204)

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>
2017-02-05 09:22:18 +00:00
Ed Bartosh 71ce8d09e0 wic: flatten imager class hierarchy
wic code is hard to follow due to deep and twiggy class
inheritance tree.

Flatten imager tree:
 wic -> wic_create -> Creator -> DirectPlugin -> DirectImageCreator
to
 wic -> wic_create -> DirectPlugin
by
 removing Creator class and creator module
 merging DirectImageCreator into DirectPlugin

Changed APIs to use the same parameters names.

Passed parsed command line options as an object down the stack.

(From OE-Core rev: 1e28d512341ce470c7afb256a01e597ab87170ca)

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>
2017-02-05 09:22:17 +00:00
Ed Bartosh 14652a42d8 wic: direct: fix creation of work directory
It was a typo in current code: mktemp was used instead of
mkdtemp to create work directory. This is fixed by using
mkdtemp.

Create work directory as a subdirectory of output directory
to make sure both are on the same partition to make moving
of result image faster.

This also fixes possible disk space issues as mkdtemp uses
TMPDIR, TEMP or TMP environment variables to get default value
of its 'dir' parameter. Those variables are usually pointing
to /tmp, which is not the best location to create huge images.

(From OE-Core rev: e6579b4e007ce89000c46c09917fbd3c72f18a73)

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>
2017-02-02 17:37:45 +00:00
Ed Bartosh 81ef850314 wic: engine: create output dir
Make sure output directory exists before creating an image.
Create it if it doesn't exist.

(From OE-Core rev: e52bfb0e81d3fb2a474f08b2e2b8b89aadc61d14)

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>
2017-02-02 17:37:45 +00:00
Ed Bartosh f1957bf59e wic: remove syslinux.py
This module contains singe function serial_console_form_kargs, which
is used only by rootfs_pcbios_ext plugin. Moved it there and removed
syslinux module to make it easy to find and mainain plugin code.

[YOCTO #10619]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:45 +00:00
Ed Bartosh 653aaea3cc wic: code cleanup
Fixed indentation, unused imports, trailing lines etc.

[YOCTO #10619]

(From OE-Core rev: 5fa7768bfb4b6d464c6a812822b0665f52e7bea4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh 1f7ce90af6 wic: msger.py: remove unused APIs
Removed unused enable_logstderr and disable_logstderr APIs.

[YOCTO #10619]

(From OE-Core rev: 835f7a5c4c51f3d0d31d0193258b50596ceacb5a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh 9048f52f3a wic: removed code from __init__.py
The code deals with non-existing directory
and can be removed.

[YOCTO #10619]

(From OE-Core rev: e148884b8145fad212c4085f2ead5c3e5e3e42a2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh 614851f1db wic: move oe/misc.py one level up
Flattened directory structure:
   moved wic/utils/oe/misc.py -> wic/utils/misc.py

[YOCTO #10619]

(From OE-Core rev: 392532a2748ff2e6412eeb79163662b5168611ce)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh 2d6f96048e wic: move 2 APIs to wic.engine
Moved find_canned and get_custom_config APIs to engine module.
Removed empty wic.utils.misc module.

[YOCTO #10619]

(From OE-Core rev: 10e9afac46575d3f557b7cb505daa31ce9ce85fa)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh 759c24c404 wci: misc: removed build_name API
This API is not used in wic code.

[YOCTO #10619]

(From OE-Core rev: 9d14cb8bb8cf9559b7ff0efa03427624c18e2506)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh 08217a4c80 wic: partition: simlify calling plugin methods
Replaced parse_sourceparams function with list comprehension.
Used local variables instead of attributes.
Moved global variable to the local scope.

[YOCTO #10619]

(From OE-Core rev: 4adbac84046ff744f1452b5ff4d017d17d2d45e2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh d8a89baffb wic: removed test file
This file is not used anywhere in the wic code.

[YOCTO #10619]

(From OE-Core rev: e3c43ce3261663225aeba50b8c6229577574f9b7)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh 53bd29d65e wic: renamd direct_plugin.py -> direct.py
As this files is located in plugins/imager subdirectory it's
obvious that it's an imager plugin. Renamed to direct.py to
be consistent with plugin naming scheme.

[YOCTO #10619]

(From OE-Core rev: d5db8c2ee91bdd51bfbb2ebf61aea8ff0378d512)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh 8fda677a08 wic: simplified code of direct_plugin
Removed unused methods.
Got rid of get_default_source_plugin and _full_name methods.

[YOCTO #10619]

(From OE-Core rev: c5706f71dee531557a6b1290665283b8637fff6e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh 59496d9cdc wic: pylinted direct_plugin
Fixed wrong continued indentation, unused import and
trailing new line pyling warnings.

[YOCTO #10619]

(From OE-Core rev: e78762a4b52c31357ef29a5b93c53db7190fa4f2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh f36c70b067 wic: improve naming in direct_plugin classes
Synchronized attribure names in DirectImageCreator and
DirectPlugin for better readability. Simplified code,
removed unneeded global variable disk_methods.

(From OE-Core rev: b87b9ef84791615636424a224f74386a4aa0c2fa)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh 2db161f1c0 wic: get rid of __rootfs_dir_to_dict method
Replaced class method __rootfs_dir_to_dict with a list
comprehension.

[YOCTO #10619]

(From OE-Core rev: 266fd31410771db4c06539f7368c196a6d03000a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh ee10c2f1bb wic: moved content of direct.py to direct_plugin
This move simplifies directory structure and makes
further refactoring easier. The code from direct.py was used
only in direct_plugin, so it's safe to move it there.

[YOCTO #10619]

(From OE-Core rev: a8f5ebb26183faa9af6eb72f4dabfcf83aa1e8d4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh dba8cf377c wic: removed conf.py and empty config file.
Removed as they're not used anymore in wic code.

(From OE-Core rev: ffa2f3d7bf883d5add911b7c5d0be2b347733524)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh 0ff04e1e95 wic: direct_plugin: stop using config manager
This is a preparation to removing conf.py and config/wic.conf
from the codebase.

Got rid of using configmgr global object in direct_plugin and direct
modules. It was used to implicitly parse kickstart file and set
couple of variables.

Replaced usage of configmgr by passing parameters directly to the
DirectImageCreator.

[YOCTO #10619]

(From OE-Core rev: 79191119de010acb107f9392a991108728858441)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh 65a99448a4 wic: creator: stop using config manager
This is a preparation to removing conf.py and config/wic.conf
from the codebase.

confmgr object is complicated for no reason and almost
useless as all configuration info comes from command line and
bitbake variables. It's used it creator.py to store information
about output directory, logs and some never used functionality
like tmpfs for future use, which doesn't actually happen.

[YOCTO #10619]

(From OE-Core rev: 702ee7a1fe30d87d55ba9528ae89abff4e294fd9)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:37:44 +00:00
Ed Bartosh d5b2539213 isoimage-isohybrid: renamed variable hdd_dir
Renamed variable hdd_dir to deploy_dir as this variable is
assigned to the value of DEPLOY_DIR_IMAGE.

(From OE-Core rev: fc84893c319f3e8c72f13c58f25e0b54095c3a49)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Ed Bartosh 6740b8fdbb isoimage-isohybrid: use TRANSLATED_TARGET_ARCH instead of MACHINE_ARCH
isoimage-sihybrid plugin uses MACHINE_ARCH to get the name of initrd image.
It doesn't work for all machines, for example for quemux86-64 machine
MACHINE_ARCH is quemux86_64 and initrd name is
core-image-minimal-initramfs-qemux86-64.cpio.gz

Used TRANSLATED_TARGET_ARCH variable to get the initrd image name.
Replaced MACHINE_ARCH->TRANSLATED_TARGET_ARCH in WICVARS variable to
make it available from <image>.env file.

(From OE-Core rev: edf0830412de66eada9ef3f3947ca42e301c5377)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Tom Zanussi 66d08e0fda wic: Look for image artifacts in a common location
Rather than have each image type look for artifacts in image-specific
locations, move towards having them look for artifacts in a common
location, in this case DEPLOY_DIR_IMAGE

Use the existing deploy.bbclass to have the bootloaders put their binaries
in DEPLOY_DIR_IMAGE and then wic will find them and place them in the image

(From OE-Core rev: 1c8acea91e775b1b6f8b25e774aaba3e790fc59b)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Ed Bartosh 8a04795db6 wic: isoimage-isohybrid: stop using HDDDIR
Stop using HDDDIR in isoimage-isohybrid wic plugin.
This variable is set by hddimg code, which is going to be
removed soon.

All required artifacts should be available from ISODIR.
wic-image.bbclass has been modified to build iso artifacts,
so it should be safe to remove usage of HDDDIR.

[YOCTO #10835]

(From OE-Core rev: 4ceb0df10db7254b290784cabc5279ffa2b946a4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Ed Bartosh a508cb384c wic: use INITRD_LIVE in isoimage-isohybrid
INITRD variable is not set if hddimg is disabled.
isoimage-isohybrid can't get correct name for initrd if INITRD
variable is not set.

Added INITRD_LIVE to WICVARS and used it in isoimage-isohybrid
code to get initrd artifact name. Used INITRD if INITRD_LIVE is not set.

(From OE-Core rev: c672753be60550b15d5d593c251b61776d5b104d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Jukka Laitinen cebf67086f wic: partitionedfs: set partition name for gpt partitions
Set proper gpt partition name for the partitions in case given
in the configuration

(From OE-Core rev: bc6e6a34f35bd081d828160bab8ee12e770c7e1e)

Signed-off-by: Jukka Laitinen <jukka.laitinen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Ed Bartosh 3407f25216 wic: direct.py: get rid of names with two underscores
Attributes with two leading underscores are mangled in Python
and used mainly for avoiding name clashes with names from
subclasses. They're not needed in most of wic classes.

(From OE-Core rev: 2f92c0490f1acf5a6926fc6654ce3b6588ddcc24)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Ed Bartosh d59196c3a8 wic: remove unused API DirectImageCreator.get_disk_names
(From OE-Core rev: f77efbe81a5d3d16ecb1872cf237bb3e56c63c39)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:31 +00:00
Ed Bartosh e9bd1ed673 wic: make workdir a temporary directory
Wic used hardcoded path /var/tmp/wic/ as a work directory,
which caused conflicts if two wic instances run in parallel.

Made work directory unique and temporary. Moved results from
work directory to output directory when they're ready.

[YOCTO #10783]

(From OE-Core rev: 5d948f04823dedfa26a879aa6a5dc23de2bb9354)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:31 +00:00
Ed Bartosh 75318c7b0c wic: get rid of baseimager inheritance
Simplified DirectImageCreator code by removing inheritance
from BaseImageCreator. This inheritance doesn't make much sense
as DirectImageCreator is the only class that was inherited from
BaseImageCreator.

(From OE-Core rev: 4e9952514211ef4b9a3731ce915090385f335a31)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:31 +00:00
Ed Bartosh 7998501f47 wic: bootimg-pcbios: use wic-tools target
Used wic-tools target to get location of syslinux.

(From OE-Core rev: 5afd7def3b101bb3d650db4d005cb8d36aaf074a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:18 +00:00
Ed Bartosh 7d5f44b455 wic: misc.py: add parameter 'cache' to get_bitbake_vars
This parameter will be used to allow or prevent variable caching.

For example, we don't want to cache value of RECIPE_SYSROOT_NATIVE
wic-tools variable as we may decide to rebuild wic-tools.

(From OE-Core rev: e4269fdb4c3ef06b97df063f8586f74986215c83)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:18 +00:00
Ed Bartosh 657f1e44b1 wic: fixed test_iso_image test case
Fixed isoimage-isohybrid plulgin and correspondent wic tet case:
- used wic-tools target when getting varlue of STAGING_LIBDIR variable
- ensured that image is built with efi and hddimg enabled

(From OE-Core rev: 5878484da64c38c7fde45bb06d76e22e608eb022)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:18 +00:00
Ed Bartosh 349dbad11d wic: fixed recipe name
Renamed grub-efi-native -> grub-efi in NATIVE_RECIPES
dictionary as '-native' suffix is added to the recipe name in
the code.

(From OE-Core rev: cd0e7b20de2de67793d0454f4e5cf6bb6f4a16f7)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:18 +00:00
Ed Bartosh 4ab4e155f8 partition.py: use FAKEROOTCMD variable to get path to pseudo
wic used native sysroot to get path to pseudo utility.
This approach doesn't work with recipe specific sysroots.

Using FAKEROOTCMD should fix the issue.

(From OE-Core rev: 03e051d594f285ea3c014d45e9b30028e683c602)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:17 +00:00
Paul Eggleton 9b3e808624 devtool: fix source extraction to work with recipe specific sysroots
When extracting source for a recipe within devtool (for extract, modify
or upgrade) We need to redirect WORKDIR, STAMPS_DIR etc. under a
temporary directory so that:
 (a) we pick up all files that get unpacked to the WORKDIR, and
 (b) we don't disturb the existing build
However, with recipe-specific sysroots the sysroots for the recipe will
be prepared under WORKDIR, and if we used the system temporary directory
i.e. usually /tmp) as used by mkdtemp by default, then our attempts to
hardlink files into the recipe-specific sysroots will fail on systems
where /tmp is a different filesystem, and we'd have to fall back to
copying the files which is a waste of time. Put the temp directory under
the WORKDIR to prevent that from being a problem.

(From OE-Core rev: e10a973cd9390eacb13bdb99693a0622bd3695f5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
[RP: Add needed mkdirhier call]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Maciej Borzecki cb10cfd64f wic: partitionedfs: account for non-table partitions when checking if logical parititon is needed
Commit 8c1c43b790 `wic: Create a logical partition
only when it is really mandatory` did not account for partitions that are not
present in partition table.

(From OE-Core rev: 57b05e924bba7b2fff07a34690474c0fa3046865)

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19 22:47:20 +00:00
Ed Bartosh fae29ac083 wic: _exec_cmd: produce error if exit code is not 0
Current code doesn't always show error output of the
external command and even ignores non-zero exit code.

Moved checking of exit code value to the lowest level
possible: to _exec_cmd. This should make wic to always
check exit code of the external command and issue
an error if it's not 0.

[YOCTO #10816]

(From OE-Core rev: 7f68001579c08509332d633b27b5c2ea9386b6c9)

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>
2017-01-16 18:05:13 +00:00
Ed Bartosh c1bb8c9b14 direct.py: fix getting image name
part.rootfs_dir was used as an image name in the code.
However, when multi-rootfs feature is used this attribute
points to the name of the rootfs, e.g. if --rootfs command line
is rootfs1=core-image-minimal partf.rootfs_dir is 'rootfs1'.

The code also fails when image name is not provided in wic
commandline. For example, when wic is called with
--rootfs-dir=<path> part.rootfs_dir will contain path and
wic will crash trying to call bitbake -e <path> to get
value of ROOTFS_SIZE variable.

Fixed the code by getting image name properly and checking
if it's not a path.

[YOCTO #10815]

(From OE-Core rev: 2e05d9709f1308fc95d3406b8a409ea982c5b474)

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>
2017-01-16 18:05:13 +00:00
Ed Bartosh e652fa4420 canned-wks: remove mpc8315e-rdb.wks
This file has been moved to meta-yocto-bsp/wic/

(From OE-Core rev: efa7639b31c51e2874ba61fd68f9e2cb51145eaf)

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>
2017-01-16 18:05:13 +00:00
Ioan-Adrian Ratiu 436df4de37 wic/isoimage-isohybrid: remove do_stage_partition()
The purpouse of this function was to check dependencies for building a
hybrid iso and build them using bitbake if not found. Calling bitbake in
this context means this wic plugin itself cannot be instrumented inside
bitbake recipes which is undesirable, the benefits of this are clear:
there is no need to maintain outside scripts to generate an iso using wic
and the isohybrid building logic can be further abstracted away into an
isohybrid.bbclass in the future which can be easily inherited or something
similar.

So remove the function and add all dependencies to NATIVE_RECIPES so that
wic can print useful errors when they're not built.

To automate building the isohybrid image dependencies, add the following
somewhere in your image build inheritence hierarcy (or maybe create a
bbclass in the future to do these sort of things automatically):

DEPENDS += "syslinux syslinux-native cdrtools-native e2fsprogs-native \
            parted-native dosfstools-native mtools-native grub-efi-native"

(From OE-Core rev: ba4346069ab87f1cf942d1928f911eca6a9d65cd)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-16 18:05:12 +00:00
Ed Bartosh 5651e8da60 wic: fix parsing of 'bitbake -e' output
Current parsing code can wrongly interpret arbitrary lines
that are of 'key=value' format as legitimate bitbake variables.

Implemented more strict parsing of key=value pairs using
regular expressions.

(From OE-Core rev: f0ec387ad40fb9c098ac8d761993bc2bacc76e65)

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>
2017-01-16 18:05:12 +00:00
Alejandro Hernandez a250452f56 gummiboot: Remove old gummiboot recipe, related class and wks file
Since the gummiboot project is no longer being maintained
and we are using systemd-boot as a replacement instead,
we can now clean up all remaining gummiboot files.

[YOCTO #10332]

(From OE-Core rev: 65eb3f51b70baaf24de871301a7247d5baed00ed)

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>
2017-01-16 18:05:11 +00:00
Alejandro Hernandez 2dce2648e3 gummiboot: Remove/change gummiboot references with systemd-boot
After systemd-boot was introduced, its been tested for a while with no major
issues being found until now, this patch completely replaces all gummiboot
instances with systemd-boot ones, taking the next step into cleaning
up systemd-boot/gummiboot.

[YOCTO #10332]

(From OE-Core rev: f9a61d3400ad9068a6d83b8eb6aefe3098c58e68)

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>
2017-01-09 13:39:11 +00:00
Richard Purdie 022a8b58c8 meta/scripts: Various getVar/getVarFlag expansion parameter fixes
There were a few straggling expansion parameter removals left for
getVar/getVarFlag where the odd whitespace meant they were missed
on previous passes. There were also some plain broken ussages such
as:

d.getVar('ALTERNATIVE_TARGET', old_name, True)
path = d.getVar('PATH', d, True)
d.getVar('IMAGE_ROOTFS', 'True')

which I've corrected (they happend to work by luck).

(From OE-Core rev: 688f7a64917a5ce5cbe12f8e5da4d47e265d240f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Alejandro Hernandez 9d4a69fd0d example-recipe: Fix LDFLAGS compilation issue on newly created recipes
(From meta-yocto rev: aa3e99e24c3234b6f3f19169939d4cd498d0ce36)

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>
2016-12-22 08:53:03 +00:00
Ed Bartosh b05b1add7a wic: add kickstart file for MPC8315
Added kickstart file to produce partitioned image for
MPC8315 reference hardware.

[YOCTO #8719]

(From OE-Core rev: 8c873b4fd92b72adfc49d20bbfab4779857fb6c9)

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>
2016-12-22 08:50:17 +00:00
Maciej Borzecki 1988bae5bf wic: add --fixed-size wks option
Added new option --fixed-size to wks. The option can be used to indicate
the exact size of a partition. The option cannot be added together with
--size, in which case an error will be raised. Other options that
influence automatic partition size (--extra-space, --overhead-factor),
if specifiec along with --fixed-size, will raise an error.

If it partition data is larger than the amount of space specified with
--fixed-size option wic will raise an error.

(From OE-Core rev: fdd217ba874bd480e0180830fe2e6bd54dde19d9)

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-22 08:50:16 +00:00
Paul Eggleton 358befb76e devtool: modify: fix usage on the kernel
When using devtool modify on the kernel, we have to do a bit of a dance
with tinfoil instances because we only find out that we're working on a
kernel recipe after tinfoil is initialised, but then we need to build
kern-tools-native which we're doing just by running bitbake directly.
With the tinfoil2 changes, a datastore for the recipe that we were
keeping around across the opening and closing of tinfoil is no longer
able to be used. Re-parse the recipe to avoid this problem.

(In future this whole thing will be able to be done in the same tinfoil
instance thanks to tinfoil2, but that refactoring is yet to be done.)

(From OE-Core rev: 06127d0115ba449bf04e2579cd1010065e0ed6e3)

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>
2016-12-22 08:50:16 +00:00
Ed Bartosh 28c79d8aeb wic: look for wks files in <layer>/wic
Currently wic looks for wks files in
<layer dir>/scripts/lib/wic/canned-wks/ directories.
This path is too nested and doesn't look consistent with the
naming scheme of layer directories.

Added <layer>/wic directory to the list of paths
to look for wks files.

(From OE-Core rev: 803b5fa798cf7580c7c10401eb04a1cccf51b8ab)

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>
2016-12-22 08:50:16 +00:00
Christopher Larson db08ffee0a wic: obey the rootfs size from the metadata
When no --size is specified for the rootfs in the .wks, we want to obey the
rootfs size from the metadata, otherwise the defined IMAGE_ROOTFS_EXTRA_SPACE
and IMAGE_OVERHEAD_FACTOR will not be obeyed. In some cases, this can result
in image construction failure, if the size determined by du was insufficient
to hold the files without the aforementioned extra space.

This fallback from --size to ROOTFS_SIZE was already implemented when
--rootfs-dir is specified in the .wks, but it did not occur otherwise, neither
when --rootfs-dir= was passed to `wic create` nor when IMAGE_ROOTFS was used.
This made a certain amount of sense, as this fallback logic happened at such
a level that it wasn't able to identify which partitions were rootfs
partitions otherwise. Rather than doing it at that level, we can do it in
prepare_rootfs(), which is run by the rootfs source plugins.

Note that IMAGE_OVERHEAD_FACTOR and a --overhead-factor in the .wks will now
both be applied when --size isn't specified in the .wks. A warning is added
about this, though a user won't see it unless wic fails or they examine the
do_image_wic log.

Fixes [YOCTO #10815]

(From OE-Core rev: 1d50e11286722c4114c1ae0bc285f846cd85fc4c)

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>
2016-12-17 09:57:04 +00:00
Joshua Lock 6bba41832b scripts: remove True option to getVarFlag calls
getVarFlag() now defaults to expanding by default, thus remove the
True option from getVarFlag() calls with a regex search and
replace.

Search made with the following regex:
getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\)

(From OE-Core rev: 3e4806063fe11092b2307f113a6c0b0f04104091)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Joshua Lock c0f2890c01 scripts: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 0a36bd96e6b29fd99a296efc358ca3e9fb5af735)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Paul Eggleton 4448b2a122 devtool: extract: disable basehash mismatch errors
Using the setVariable commands here followed by buildFile will result in
"basehash mismatch" errors, and that's expected since we are deviating
*at runtime* from what was previously seen by changing these variable
values. Set BB_HASH_IGNORE_MISMATCH to turn off the errors.

(From OE-Core rev: b0169796f294bbec0397b7eae86454a46b68cdc5)

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>
2016-12-14 12:30:50 +00:00
Paul Eggleton 85de43fccd devtool: fix extraction of source to work in memres mode
Extracting the source for a recipe (as used by devtool's extract, modify
and upgrade subcommands) requires us to run do_fetch, do_unpack,
do_patch and any tasks that the recipe has inserted inbetween, and do so
with a modified datastore primarily so that we can redirect WORKDIR and
STAMPS_DIR in order to have the files written out to a place of our
choosing and avoid stamping the tasks as having executed in a real build
context respectively. However, this all gets much more difficult when in
memres mode since we can't call internal functions such as
bb.build.exec_func() directly - instead we need to execute the tasks on
the server. To do this we use the buildFile command which already exists
for the purpose of supporting bitbake -b, and setVariable commands to
set up the appropriate datastore.

(I did look at passing the modified datastore to the buildFile command
instead of using setVar() on the main datastore, however its use of
databuilder makes that very difficult, and we'd also need a different
method of getting the changes in the datastore over to the worker as
well.)

(From OE-Core rev: eb63b5339014fc72ba4829714e0a96a98e135ee2)

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>
2016-12-14 12:30:50 +00:00
Paul Eggleton 45adbe3709 classes/patch: move in logic to commit for additional tasks
If PATCHTOOL is "git", and PATCH_COMMIT_FUNCTIONS is set to "1", for
additional tasks between do_unpack and do_patch, make a git commit. This
logic was previously implemented in devtool itself, but it makes more
sense for it to be implemented in the patch class since that's where the
rest of the logic is for this (or in lib/oe/patch.py). It also makes
it possible for this to work with tinfoil2.

(From OE-Core rev: f24f59ea1d8bc335ea8576f6a346d0935f4a3548)

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>
2016-12-14 12:30:49 +00:00
Paul Eggleton 70ce595237 devtool / recipetool: use tinfoil parsing API
Use Tinfoil.parse_recipe_file() and Tinfoil.parse_recipe() instead of
the recipeutils equivalents, and replace any local duplicate
implementations. This not only tidies up the code but also allows these
calls to work in memres mode.

(From OE-Core rev: f13b56266ee96dfab65a3a7db50e8051aa9f071a)

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>
2016-12-14 12:30:49 +00:00
Paul Eggleton 1e29b57e92 devtool: package: don't try to initialise tinfoil twice
setup_tinfoil() already calls prepare(), we don't need to call it again
ourselves and doing so with tinfoil2 results in "ERROR: Only one copy of
bitbake should be run against a build directory". Calling prepare()
twice should probably still be allowed, so that ought to be fixed
separately, but in the mean time this code is still wrong so fix it
here.

(From OE-Core rev: 38b8a7d4aff096ea0a62f2ddf3fe2de1df591bf5)

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>
2016-12-14 12:30:49 +00:00
Ola x Nilsson 14abe7982c devtool: Load plugins in a well defined order
To allow devtool plugins in one layer to shadow another in a well
defined way, first search BBPATH/lib/devtool directories and then
scripts/lib/devool and load only the first found.

The previous search and load loop would load all found plugins with the
ones found later replacing any found before.

(From OE-Core rev: 1b2b8a0a80de17ea053002fdd124055d2798029a)

Signed-off-by: Ola x Nilsson <ola.x.nilsson@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-13 22:55:20 +00:00
Alessio Igor Bogani 8c1c43b790 wic: Create a logical partition only when it is really mandatory
Don't worth bother with logical partition on MBR partition type (aka
msdos) if disk image generated by wic should have 4 partitions.

(From OE-Core rev: 36a558fbdc96094626e7de1a3510691e30885368)

Signed-off-by: Alessio Igor Bogani <alessio.bogani@elettra.eu>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-13 22:55:19 +00:00
Paul Eggleton 8fe1f25ea0 recipetool: fix encoding-related errors creating python recipes
Yet another instance of us expecting a string back from subprocess when
in Python 3 what you get back is bytes. Just decode the output within
run_command() so we avoid this everywhere.

(From OE-Core rev: 103faae78cdff5280c7b7cdb7ca01e0868d02ec9)

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>
2016-12-08 10:31:29 +00:00
Jiajie Hu bfd8c35c3f devtool: fix handling of unicode characters from subprocess stdout
In previous implementation, a UnicodeDecodeError exception will be
raised if multi-byte encoded characters are printed by the subprocess.
As an example, the following command will fail in an en_US.UTF-8
environment because wget quotes its saving destination with '‘'(0xE2
0x80 0x98), while just the first byte is provided for decoding:

    devtool add recipe http://example.com/source.tar.xz

The patch fixes the issue by avoiding such kind of incomplete decoding.

(From OE-Core rev: 1875ea92546d23abcab1b40b562477a0016f712d)

Signed-off-by: Jiajie Hu <jiajie.hu@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 11:10:15 +00:00
Paul Eggleton 6e182aaa76 devtool: modify: support recipes with only local files as source
The hello-mod recipe is unusual in that it has only local files in
SRC_URI and builds these out of ${WORKDIR}. When you use devtool modify
on it, devtool puts all of those files in an "oe-local-files"
subdirectory of the source tree, which is not ${S} (or ${B}) any more
and thus building the recipe afterwards fails. It's a bit of a hack, but
symlink the files in oe-local-files into the source tree (and commit the
symlinks with an ignored commit so that the repo is clean) to work
around the problem. We only do this at time of extraction, so any files
added to or removed from oe-local-files after that won't be handled, but
I think there's a limit to how far we should go to support these kinds
of recipes - ultimately they are anomalies.

I initially tried a hacky workaround where I set effectively set B =
"${WORKDIR}" and that allowed it to build, but other things such as the
LIC_FILES_CHKSUM checks still broke because they expected to find files
in ${S}. Another hack where I set the sourcetree to point to the
oe-local-files subdirectory works for hello-mod but not for makedevs
since whilst that is similar, unlike hello-mod it does in fact have
files in the source tree (since it has a patch that adds COPYING) and
thus the same issue occurred.

Also tweak one of the tests that tries devtool modify / update-recipe on
the makedevs recipe to try building it since that would have caught this
issue.

Fixes [YOCTO #10616].

(From OE-Core rev: 857c06d6a1d161bf5a01311d07758bd4241929a3)

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>
2016-11-23 11:10:14 +00:00
Stephano Cetola 8b686f281c recipetool: add postinst to .deb import
The .deb import feature did not import postinst, postrm, preinst, or
prerm functions. This change checks to see if those files exist, and
if so, adds the appropriate functions.

[ YOCTO #10421 ]

(From OE-Core rev: ebb73aa6ad920bfd6a23f8c20105d6bcf07dd3d5)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 11:10:14 +00:00
Paul Eggleton 13c3a4bfa2 devtool: update-recipe: support replacing remote patches
If you have a patch remotely fetched in a recipe (e.g. from an http
server) that needs updating then add a local version and substitute the
entry in SRC_URI to point to it.

One can argue about how desirable it is to be modifying patches fetched
in this way, but then one can argue about how desirable it is to have
such patches in the recipe in the first place - and in any case if
devtool update-recipe is to correctly transfer changes to such patches
made in the git repository within the source tree to the recipe then
there isn't much choice but to do it this way.

(From OE-Core rev: a19c26cc78a181f9dd2706dd42e7e450d7ad4082)

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>
2016-11-23 11:10:13 +00:00
Paul Eggleton 55a157f4e6 devtool: update-recipe: fix handling of compressed local patches
It is possible to use gzip or bzip2 to compress patches and still refer
to them in compressed form in the SRC_URI value within a recipe. If you
run "devtool modify" on such a recipe, make changes to the commit for
the patch and then run devtool update-recipe, we need to correctly
associate the commit back to the compressed patch file and re-compress
the patch, neither of which we were doing previously.

Additionally, add an oe-selftest test to ensure this doesn't regress in
future.

Fixes [YOCTO #8278].

(From OE-Core rev: e47d21624dfec6f71742b837e91da553f18a28c5)

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>
2016-11-23 11:10:13 +00:00
Paul Eggleton 0ffd92707b devtool: update-recipe: check output before treating it as a string
As of the move to Python 3 and the fixes we applied at that time,
bb.process.run() will return a byte array of length 0 rather than an
empty string if the output is empty. That may be a bug that we should
fix, but for now it's easiest to just check the result here before
treating it as a string. This fixes running "devtool update-recipe" or
"devtool finish" on a recipe which has no source tree, for example
initramfs-framework.

Fixes [YOCTO #10563].

(From OE-Core rev: 66bf6978fc807ecc422fb6b6328f68bc3406cf15)

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>
2016-11-23 11:10:12 +00:00
Jussi Kukkonen 0cdbd2ad94 conf: Remove legacy X input drivers
xf86-input-libinput is RRECOMMENDed by xserver-xorg, these
legacy drivers are not needed.

(From meta-yocto rev: 715f72d7842b4a789a78e7889b2f01cd41f02df8)

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>
2016-11-15 15:19:55 +00:00
Maciej Borzecki 2eeed4838b wic: fix function comment typos
Fix typos in documentation of Image.add_partition() and
Image.__format_disks().

(From OE-Core rev: f5bf7bf253224912c66bab89f48ff63a73e0d698)

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-15 15:19:55 +00:00
Maciej Borzecki 294410cce3 wic: check that filesystem is specified for a rootfs partition
We explicitly check for --fstype if no source was provided for a
partition. However, this was not the case for rootfs partitions. Make
sure to raise an error if filesystem was left unspecified when preparing
a rootfs partition image.

(From OE-Core rev: b8c35fcad57810a87aa25ebeb533adf286eed565)

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-15 15:19:55 +00:00
Maciej Borzecki b92de9a6db wic: use partition size when creating empty partition files
It seems that prepare_empty_partition_ext() and
prepare_empty_partition_btrfs() got broken in commit
c8669749e3, thus one could observe the
following backtrace:

Backtrace:
  File "<snip>/poky/scripts/lib/wic/plugins/imager/direct_plugin.py", line 93, in do_create
    creator.create()
  File "<snip>/poky/scripts/lib/wic/imager/baseimager.py", line 159, in create
    self._create()
  File "<snip>/poky/scripts/lib/wic/imager/direct.py", line 290, in _create
    self.bootimg_dir, self.kernel_dir, self.native_sysroot)
  File "<snip>/poky/scripts/lib/wic/partition.py", line 146, in prepare
    method(rootfs, oe_builddir, native_sysroot)
  File "<snip>/poky/scripts/lib/wic/partition.py", line 325, in prepare_empty_partition_ext
    os.ftruncate(sparse.fileno(), rootfs_size * 1024)
NameError: name 'rootfs_size' is not defined

(From OE-Core rev: 0bf686739a5e8a1193f5be5aa60afbf2ea1e5074)

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-15 15:19:55 +00:00
Maciej Borzecki f0181e79ed wic: make sure that partition size is always an integer in internal processing
The size field of Partition class is expected to be an integer and ought
to be set inside prepare_*() method. Make sure that this is always the
case.

(From OE-Core rev: a37838f995ae642b0b8bdd47a605a264fb3bf200)

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-15 15:19:55 +00:00
Ed Bartosh 2ef30ef624 systemd-bootdisk.wks: use PARTUUID
Root device name in systemd-bootdisk.wks is 'sda'. This can cause
images, produced using this wks to refuse booting if real device
name is not 'sda'. For example, when booting MinnowBoard MAX from
MicroSD card the boot process stucks with this message on the boot
console output: Waiting for root device /dev/sda2...
This happens because real device name of MicroSD card on this device
is mmcblk1.

Used --use-uuid option for root partition. This should make
wic to put partiion UUID instead of device name into kernel command
line.

[YOCTO #10485]

(From OE-Core rev: 5b73d5f484cc844affe91ec19d881d42e187f30c)

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>
2016-11-15 15:19:54 +00:00
Paul Eggleton 43e652f3d1 devtool: add "rename" subcommand
When you run devtool add on a source tree we attempt to figure out the
correct name and version for the recipe. However, despite our best
efforts, sometimes the name and/or version we come up with isn't
correct, and the only way to remedy that up until now was to reset the
recipe, delete the source tree and start again, specifying the name this
time. To avoid this slightly painful procedure, add a "rename"
subcommand that lets you rename the recipe and/or change the version.

(From OE-Core rev: 9303d8055c45a0f6af295d70a6f6a8b9d8d8a7c9)

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>
2016-11-07 11:04:22 +00:00
Paul Eggleton e0b62c38ac recipetool: create: separate LICENSE items with & by default
recipetool sets the LICENSE value based on licenses detected from the
source tree. If there are multiple licenses then they were being
separated by spaces, but this isn't actually legal formatting and if
you're using "devtool add" you get a warning printed when devtool
parses the recipe internally.

Earlier I had made a conscious decision to do it this way since it's up
to the user to figure out whether the multiple licenses should all apply
(in which case they'd be separated with &) or if there is a choice of
license (in which case | is the correct separator). However, I've come
to the conclusion that we can just default to & and then the ugly
warning goes away, and it's the safest alternative of the two (and most
likely to be correct, since it's more common to have a codebase which is
made up of code with different licenses, i.e. all of them apply to the
combined work).

I've tweaked the comment that we add to the recipe to explicitly state
that we've used & and that the user needs to change that if that's not
accurate.

Fixes [YOCTO #10413].

(From OE-Core rev: ecac6aee8cf3313350b58c21012bcd67cfb915e4)

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>
2016-11-07 11:04:22 +00:00
Paul Eggleton e0944011e6 devtool: finish: warn if moving recipe to unconfigured destination layer
If you run devtool finish to move a recipe created in the workspace by
devtool add or devtool upgrade to a layer, and that layer is not
currently included in bblayers.conf (perhaps unintentionally), then the
recipe will no longer be visible to bitbake. In this scenario, show a
warning so that the user isn't surprised by the recipe "going missing".

(From OE-Core rev: 4da8a58e2997db4f24ae0cac0ba27259d7857a05)

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>
2016-11-07 11:04:22 +00:00
Paul Eggleton 09754b4119 devtool: finish: fix error if destination layer is not in bblayers.conf
If devtool finish is run on a recipe where the recipe file itself is in
the workspace (e.g. where devtool add / devtool upgrade has been used)
and the specified destination layer is not in bblayers.conf, then we
need to avoid running bitbake -c clean at the end because the recipe has
been moved, but the bbappend is still present in the workspace layer at
that point and so if we do it will fail due to the dangling bbappend.
It's difficult to do the clean at the point we'd want to because tinfoil
is holding bitbake.lock for most of the time, but in any case cleaning
the recipe is less important than it used to be since we started
managing the sysroot contents more strictly, so just disable cleaning
under these circumstances to avoid the problem.

Fixes [YOCTO #10484].

(From OE-Core rev: c6980307d43632f4172e79d9607004203af4e9c8)

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>
2016-11-07 11:04:22 +00:00
Paul Eggleton 452a1133dd devtool: add: show recipetool create output
When running devtool add, instead of hiding the recipetool create
output, change it so that it's appropriate to show in the devtool
context and show it in real-time. This means that you get status output
such as when a URL is being fetched (though currently no progress
information.) recipetool create now has a hidden --devtool option to
enable this display mode.

(From OE-Core rev: 219aec8803de4ef04c514c87ecfb15359c9424a6)

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>
2016-11-07 11:04:22 +00:00
Ed Bartosh c8669749e3 wic: call os.ftruncate instead of running truncate
Replaced running of truncate utility with the standard library
call os.ftruncate

(From OE-Core rev: 1ba6101ceaee354816e690d44bc9a5dd8dcf4011)

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>
2016-11-06 23:35:36 +00:00
Paul Eggleton a8169807e8 devtool: runqemu: work around runqemu script path assumption
The new runqemu script assumes that if OECORE_NATIVE_SYSROOT is set then
it shouldn't try to run bitbake to find out the values of various
variables such as DEPLOY_DIR_IMAGE; this assumption is incorrect for the
extensible SDK. To work around this, clear OECORE_NATIVE_SYSROOT in the
environment when running runqemu.

Fixes [YOCTO #10447].

(From OE-Core rev: abff69a48bf3076ce8e21356accdc8d85d2c8dbf)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-25 22:40:09 +01:00
Ed Bartosh a8efeb7df3 canned-wks: use GPT partition table
According to UEFI specification all EFI platforms must support
GUID Partition Table(GPT) disk layout. Here is a list of advantages
of using GPT disk layout over the legacy MBR partitioning:

 - Logical Block Addresses (LBAs) are 64 bits (rather than 32 bits).
 - Supports many partitions (rather than just four primary partitions).
 - Provides both a primary and backup partition table for redundancy.
 - Uses version number and size fields for future expansion.
 - Uses CRC32 fields for improved data integrity.
 - Defines a GUID for uniquely identifying each partition.
 - Uses a GUID and attributes to define partition content type.
 - Each partition contains a 36 character human readable name.

Used GPT partitioning in all EFI kickstart files.
Tested result images on NUC, MinnowBoard MAX and MinnowBoard Turbot.

(From OE-Core rev: 66d4efeb0face5fc8a1755dcd2ed3a611997a04d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 08:27:27 +01:00
Ed Bartosh a7648af6e9 systemd-bootdisk.wks: update kernel command line
Used ttyS0 console.
Removed usage of ttyPCH0 (FRI2 leftover)
Decreased bootloader timeout to 5 seconds
Removed 'vmalloc=256MB snd-hda-intel.enable_msi=0' as it's not
needed for any of reference BSPs.

(From OE-Core rev: ee16a283d695112236906338887c6eba109c9fb5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 08:27:27 +01:00
Ed Bartosh b5e8924068 mkgummidisk.wks: update kernel command line
Used ttyS0 console.
Removed usage of ttyPCH0 (FRI2 leftover)
Decreased bootloader timeout to 5 seconds
Removed 'vmalloc=256MB snd-hda-intel.enable_msi=0' as it's not
needed for any of reference BSPs.

(From OE-Core rev: 7b2443364a42c731bc9eefa6bb460262464e26b6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-09 12:31:40 +01:00
Leonardo Sandoval 65107a9abe machine.cfg: Unset CONFIG_64BIT for qemu i386 architecture
In modern kernels, ARCH=x86 defaults to 64 bits, so explicitly
unset this word length for qemu i386 architectures.

(From meta-yocto rev: 9750779bc78de3ea33d7f88e4972a5b21c3f811b)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-08 07:48:03 +01:00
Ed Bartosh 926a1e6551 mkefidisk.wks: update kernel command line
Used ttyS0 console.
Removed usage of ttyPCH0 (FRI2 leftover)
Decreased bootloader timeout to 5 seconds
Removed 'vmalloc=256MB snd-hda-intel.enable_msi=0' as it's not needed
for any of reference BSPs.

(From OE-Core rev: b46825a6ce5cecd24fed814bae48f9cfd0b97568)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:58 +01:00
Ed Bartosh dc67037b78 mkefidisk.wks: use MSDOS partition table
Stopped using GPT partition table in mkefidisk.wks as it's not
supported by all reference hardware.

(From OE-Core rev: 07bb11b097a67ff89ae633fa1992db5494d75c0c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:58 +01:00
Ed Bartosh 12ea11e4f8 wic: rewrite MBR disk identifier
Disk identifier created by parted doesn't match the one we generated
and used in bootloader config. We need to rewrite it to make our image
bootable.

Modified involved API and data structures to access previously
generated disk identifiers after MBR is initialized. Written disk
identifiers to MBR.

(From OE-Core rev: 221d3bdd6e0ab8a4d25e2c96bd976cbec4e76681)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:58 +01:00
Ed Bartosh 5763d8f9cd wic: generate PARTUUID for MDOS partitions
Added generation of partition UUIDs for MSDOS partitions.
UUID for MSDOS partitions is <disk identifier>-<partition number>,
where disk identifier is a random 4 bytes long number. It's usually
generated when MBR/partition table is initialized.

As UUID is used to point to the root partition in bootloader config
we need to generate it before the MBR is initialized.
After MBR is created we need to rewrite system identifier to match
it with what is used in bootloader config. This will be implemented
in the next commit.

(From OE-Core rev: 6ecc6addf4080eda75a15af077816c81c6bf70a5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:58 +01:00
Ed Bartosh e8ce5083c5 wic: set PARTUUID only for gpt partition table
sgdisk fails to set PARTUUID for msdos partitions as it's only
supported for GPT partitions.

Checked partition table format to run sgdisk --partition-guid
only for GPT partitions.

(From OE-Core rev: 0c1804821917d6d3a062ca19b63667d030138f21)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:58 +01:00
Stephano Cetola 3c51b742c9 devtool: modify command fails to ignore source files
With recent changes to recipeutils, the list of local files returned
by get_recipe_local_files could possibly include source files. This
only happens when the recipe contains a SRC_URI using subdir= to put
files in the source tree. These files should be ignored when
populating the list of local files for oe-local-files directory.

[YOCTO #10326]

introduced in
OE-Core revision 9069fef5dad5a873c8a8f720f7bcbc7625556309

(From OE-Core rev: 31f1bbad248c36a8c86dde4ff57ce42efc664082)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-06 07:51:01 +01:00
Leonardo Sandoval ff3c3b8996 yocto-bsp: linux-yocto recipes update (4.4 to 4.8) for x86-64 arch
[YOCTO #10301]

(From meta-yocto rev: 088662bd13fa7366cb471be4be746aa195defa3f)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:12 +01:00
Leonardo Sandoval 8cdef44537 yocto-bsp: linux-yocto recipes update (4.4 to 4.8) for PowerPC arch
[YOCTO #10301]

(From meta-yocto rev: f9d795172ae18489eaf40af7d32f8402299b805c)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:12 +01:00
Leonardo Sandoval 338c775499 yocto-bsp: linux-yocto recipes update (4.4 to 4.8) for qemu arch
[YOCTO #10301]

(From meta-yocto rev: b0e3518ffae3e72d7aad20860b3da79b70d74383)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:11 +01:00
Leonardo Sandoval fc34ac070a yocto-bsp: linux-yocto recipes update (4.4 to 4.8) for i386 arch
[YOCTO #10301]

(From meta-yocto rev: 0b58b90844c2898c604e7310c3fa5577044c0f08)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:11 +01:00
Leonardo Sandoval f43da797b9 yocto-bsp: linux-yocto recipes update (4.4 to 4.8) for MIPS64 arch
[YOCTO #10301]

(From meta-yocto rev: 586ff58a6a803539fd1cf6709dbcedf3ec88924e)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:11 +01:00
Leonardo Sandoval eb629657aa machine.conf: Remove duplicate xserver choices
All kernel choices today (linux-yocto_4.* and custom) have the same xserver options,
so remove the duplicate lines.

(From meta-yocto rev: c456b5cf172e5ee1fca078383cad189325ea05f5)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:11 +01:00
Leonardo Sandoval fe18ded6c3 yocto-bsp: linux-yocto recipes update (4.4 to 4.8) for MIPS arch
[YOCTO #10301]

(From meta-yocto rev: 01e16ff4d1df17daed184279868e151cbf35a1a8)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:11 +01:00
Leonardo Sandoval 6020616e7e yocto-bsp: linux-yocto recipes update (4.4 to 4.8) for arm arch
[YOCTO #10301]

(From meta-yocto rev: ad6e937db32721cfec8d4d85818d028878c5bc23)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:11 +01:00
Peter Kjellerstedt 79236477a1 devtool: deploy-target: Avoid unnecessary dependency on awk on the target
Relying on that awk is installed on the target just to extract the
fourth column (i.e., the free volume size) from `df -P` is an
unnecessary dependency for devtool deploy-target. As it is already
using sed to mangle the output from `df -P`, this can easily be
modified to only extract the free volume size.

(From OE-Core rev: 7bab454b0bf0075fbb2a5de06286a9da1df2adc6)

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>
2016-10-05 10:10:11 +01:00
Paul Eggleton 18caacae06 devtool: add: build nodejs-native if npm is needed and not available
If the user runs devtool add on an npm:// URL (or source tree that uses
node.js), and npm is not available, just build nodejs-native instead of
telling the user they need to do it; if that fails because there isn't
any such recipe (which would be the default, since it's not in OE-Core)
then produce a slightly more readable error message hinting at what the
user needs to do.

Note that this forces the use of nodejs-native rather than npm on the
host - this makes sense for two reasons: (1) we need it to be compatible
with nodejs for the target, and (2) we have to have a recipe for that
anyway, so allowing you to avoid having a recipe for the native version
isn't really beneficial.

There's a bit of a hack in here in order to allow this - for node.js
sources that aren't fetched via npm we don't know that they are that
until we've fetched and unpacked them, by which time we're inside
recipetool and have an active tinfoil instance that will prevent bitbake
being run. To avoid this being an issue, we allow recipetool to get to
the point where we know we need npm and then exit with a specific exit
code, at which point devtool can try to build it and then if that
succeeds, it will re-execute recipetool. This is definitely not ideal,
but it can't really be refactored and done properly until we do the
tinfoil2 refactoring; in the mean time though we still want to be
helpful to the user.

Fixes [YOCTO #10337].

(From OE-Core rev: f40662bde5aab158c4e4c3c3ff5e68665a4194a5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:11 +01:00
Paul Eggleton ee697d84ba devtool: add: display a warning for deprecated -f/--fetch option
We want to remove the -f/--fetch option at some point (as you can now
specify a URL as a positional argument instead) so display a warning
that it's deprecated if it is used.

(From OE-Core rev: 43476d77a91d50454ca26e016a3413b24e9f3aec)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:10 +01:00
Paul Eggleton 0c5fd7ad16 devtool: add: fix error message when only specifying a recipe name
We were supposed to be printing out the specified recipe name here but I
forgot to specify a parameter for the string.

(From OE-Core rev: 87f844e533adfc229a5d26857a82cc6b125216c8)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:10 +01:00
Ed Bartosh 3159738032 mkefidisk.wks: use partition UUID and GPT partition table
This is a preparation to use mkefidisk as a default wks for
genericx86* BSPs. This change enables usage of partition UUID
instead of device name to specify root partition in kernel
command line. It should make images to boot on devices with
boot device names that differ from what's mentioned in wks file.

(From OE-Core rev: 23cca700870230b46d251086441136e99659ef12)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-01 21:45:56 +01:00
Jianxun Zhang d19645bcde wic: rename and amend systemd-boot wks file
Rename wks for systemd-boot per the suggestion from community.
Also amend description to distinguish it from others when
running "wic list images".

(From OE-Core rev: 6303dbbaa08214a37caf38e3b6b5a30a108bd3b7)

Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-01 21:45:55 +01:00
Christopher Larson c8089ae233 recipetool: newappend: drop _provide_to_pn
This function was broken by the multi-config changes, and isn't needed anymore
now that recipeutils.pn_to_recipe can handle provides. Without this, the
newappend sub-command fails.

(From OE-Core rev: 4a5028dc3d1ab2f97465e63db5b05de73daebdfa)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:04 +01:00
Ed Bartosh 347316dc15 wic: remove partition images
Preserving images for every partition doubles disk space
consumed by an image build. As those images are not used,
so it's better to remove them after assembling final image.

(From OE-Core rev: 51171b4aa10f2218c5e27d785ca7bf4f3949a4b4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-24 07:30:09 +01:00
Ed Bartosh d6616a421f directdisk*.wks: add serial console support
Added serial console to kernel command line to to make it
easier to boot wic images on devices without display.

Tested on MinnowBoard MAX.

(From OE-Core rev: 9a774e3bcd5dc4c85d642acc7bf26095b8c620e4)

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>
2016-09-22 11:13:24 +01:00
Paul Eggleton 383a4af0e9 devtool: add: drop superfluous validation for recipe name
Now that recipeutils.validate_pn() properly validates characters used in
the name, we can drop this bit checking for '/' since that's not
permitted by validate_pn(). (The FIXME comment here - that I myself
apparently wrote - is questionable since that function was clearly never
intended to allow '/', perhaps I was misled because it was broken and
did so).

(From OE-Core rev: e010d9be3709cf3c607ffc03c3188abe4e1e9eb4)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20 15:11:07 +01:00
Paul Eggleton 90f925cd41 recipetool: create: support git short form URLs
In keeping with making recipetool create / devtool add as easy to use as
possible, users shouldn't have to know how to reformat git short form ssh
URLs for consumption by BitBake's fetcher (for example
user@git.example.com:repo.git should be expressed as
git://user@git.example.com/repo.git;protocol=ssh ) - instead we should
just take care of that automatically. Add some logic in the appropriate
places to do that.

(From OE-Core rev: 78c672a72f49c4b6cfd8c247efcc676b0ba1681a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20 15:11:07 +01:00
Paul Eggleton 147774fc1c recipetool: create: tweak license crunching
Filter out a plain "Licensed under the XXXX license" statement, as seen
in the capnproto project (and no doubt others).

(From OE-Core rev: ba4aa319fd49ee02ce2e30c2db0f3988c0e8833c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20 15:11:07 +01:00
Paul Eggleton 198c6d52c4 recipetool: create: pick up AC_PROG_SWIG
AX_PKG_SWIG is not the only commonly-used macro for detecting swig -
there's also AC_PROG_SWIG. As per AX_PKG_SWIG, add swig-native to
DEPENDS if AC_PROG_SWIG is found in configure.ac.

(From OE-Core rev: 847a1aa7153fc8a7b820353283a6f1e51d64f8de)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20 15:11:07 +01:00
Paul Eggleton 1370edb449 recipetool: create: detect python autoconf macros
If python is required then we need to inherit pythonnative (or
python3native) otherwise do_configure will probably fail since it won't
be able to find python.

(From OE-Core rev: 63234cc45aee91b031657971f36997e1443f80ee)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20 15:11:07 +01:00
Paul Eggleton 541c54e301 recipetool: create: fix error with git tree and no network
When creating a recipe for an existing local git clone, we attempt to
use the fetcher to determine if it supports the SRCREV variable.
Unfortunately running this code does a network check to get the latest
revision as a direct result of us using '${AUTOREV}' as a default value.
If you don't have a network connection this will of course fail. Rather
than have this block creating the recipe, catch the exception and just
guess from the URL.

Ultimately this should probably be fixed in the fetcher but for now this
will at least resolve the issue on this end.

(From OE-Core rev: f7e43f931d7d6019a3b2509b2b2635978fbbae36)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20 15:11:07 +01:00
Paul Eggleton e30276cb18 recipetool: create: fix name/version extraction from filename
I ran into an example where recipetool was getting the name/version
completely wrong:

https://bitbucket.org/sortsmill/libunicodenames/downloads/libunicodenames-1.1.0_beta1.tar.xz

>From this it would create a libunicodenames-1.1.0-beta1_1.1.0-beta1.bb
file (likely because it couldn't split the file name and therefore took
all of it, then got the version from one of the files inside the
tarball). When this happens it's just irritating because you then have
to delete the recipe / run devtool reset and then run recipetool create
/ devtool add again and specify the version manually.

This patch is the result of systematically running the
determine_from_filename() function over the files on the Yocto Project
source mirror and my local downloads directory and fixing as many of the
generic issues as reasonably practical - it now gets the name and
version correct much more often. There are still cases where it won't,
but they are now in the minority.

(From OE-Core rev: 7b018b1d493a8d10fd02b8cc220990b191c87fe5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20 15:11:07 +01:00