Commit Graph

1389 Commits

Author SHA1 Message Date
Yeoh Ee Peng
456a03bc74 resulttool/report: Enable roll-up report for a commit
Enable roll-up all test results belong to a commit
and to provide a roll-up report.

(From OE-Core rev: a98a75a3db1fe9d327fd21919fb8ea09e76fb1e3)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-18 11:12:25 +00:00
Yann CARDAILLAC
7a6a5dcf9c correct do_patch for kernel bbappend in sdk
do_patch rule of SDK's workspace/appends/linux-*.bbhappend may fail if script are not written in Python

that was the case with Phytec's BSP, the fix was to replace the do_patch rule with :

do_patch[noexec]="1" when the file was generated in scripts/lib/devtool/standard.py

(From OE-Core rev: e51cb385e5573c7069de6e8308b9b68eb4a3a162)

Signed-off-by: Yann CARDAILLAC <yann.cardaillac@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-12 11:57:41 -07:00
Yeoh Ee Peng
975a1416e7 scripts/resulttool: Enable manual result store and regression
To enable store for testresults.json file from manualexecution,
add layers metadata to configuration and add "manual" map to
resultutils.store_map.

To enable regression for manual, add "manual" map to
resultutils.regression_map. Also added compulsory configurations
('MACHINE', 'IMAGE_BASENAME') to manualexecution.

(From OE-Core rev: 7521834f8557565d3898605257c7fd9505ea22bb)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-07 21:55:29 +00:00
Christopher Larson
6c1a511e08 oe.scriptutils: enable color in a more flexible way
Rather than recreating handlers and forcing them, iterate over the handlers
and enable color on ones we can handle. This makes it easier to handle color
properly when we introduce the bb.msg default log filters.

(From OE-Core rev: 713f44e0e0cde9b818c214002fd8b730d422fafa)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-06 10:39:25 +00:00
Jan Kiszka
94ba79aa4d wic: Ensure that sourceparams values can contain '='
This allows '--sourceparams key1=val1=val11,key2=val2'.

(From OE-Core rev: e59bba5ee21e9065dce86b912996b893f8946535)

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-28 17:47:10 +00:00
Yeoh Ee Peng
21b3b83a33 resulttool/regression: Ensure regressoin results are sorted
Sorted regression results to provide friendly viewing of report.

(From OE-Core rev: 59d827889dd8b790a7c9323c69565d6bba3041bd)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-28 17:47:10 +00:00
Richard Purdie
80d29f1cb1 resulttool/store: Fix missing variable causing testresult corruption
(From OE-Core rev: a89846cca457de10249881ab695f0f883bfb6f40)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-28 13:17:03 +00:00
Richard Purdie
2268bf470c resulttool/report: Ensure ptest results are sorted
(From OE-Core rev: 3ec9a6288793f384bf108d7194cf50147485fa28)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-27 18:04:14 +00:00
Richard Purdie
f11237c0aa resulttool/report: Ensure test suites with no results show up on the report
ptest suites with no results don't show up on the reports even though we have
a duration for them. Fix this so the fact they report no tests is visible.

(From OE-Core rev: 58268151704246a81ec8dae46c26346023057554)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-27 18:04:14 +00:00
Richard Purdie
43f793b78d resulttool/report: Handle missing metadata sections more cleanly
Currently some older results files cause the code to give tracebacks.
Handle these missing sections more cleanly.

(From OE-Core rev: f778c191dbd5740173b3be07f4c1655d85a07bb2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-27 18:04:14 +00:00
Richard Purdie
d8f276b2cb resulttool/store: Handle results files for multiple revisions
Currently we cant store results if the results files span multiple
different build revisons. Remove this limitation by iterating.

(From OE-Core rev: 4da12c00963b02508056b87ce9b972528ce3a1be)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-27 18:04:14 +00:00
Olaf Mandel
4cae7e17b1 devtool: deploy-target: allow use of alternate ssh
Allow the use of an alternate SSH executable for deploy-target and
undeploy-target. The command can be specified with -e / --ssh-exec.

(From OE-Core rev: c2684740d7fd3aeb60b3ec7888000097effe82f4)

Signed-off-by: Olaf Mandel <o.mandel@menlosystems.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-25 10:43:07 +00:00
Richard Purdie
49b134f30a resulttool/resultutils: Avoids tracebacks for missing logs
(From OE-Core rev: ec020699086cc56bfa37bab38065472da52b3d0f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-25 10:43:06 +00:00
Richard Purdie
47eb3d00e9 resulttool: Improvements to allow integration to the autobuilder
This is a combined patch of the various tweaks and improvements I
made to resulttool:

* Avoid subprocess.run() as its a python 3.6 feature and we
  have autobuilder workers with 3.5.

* Avoid python keywords as variable names

* Simplify dict accesses using .get()

* Rename resultsutils -> resultutils to match the resultstool ->
  resulttool rename

* Formalised the handling of "file_name" to "TESTSERIES" which the code
  will now add into the json configuration data if its not present, based
  on the directory name.

* When we don't have failed test cases, print something saying so
  instead of an empty table

* Tweak the table headers in the report to be more readable (reference
  "Test Series" instead if file_id and ID instead of results_id)

* Improve/simplify the max string length handling

* Merge the counts and percentage data into one table in the report
  since printing two reports of the same data confuses the user

* Removed the confusing header in the regression report

* Show matches, then regressions, then unmatched runs in the regression
  report, also remove chatting unneeded output

* Try harder to "pair" up matching configurations to reduce noise in
  the regressions report

* Abstracted the "mapping" table concept used to pairing in the
  regression code to general code in resultutils

* Created multiple mappings for results analysis, results storage and
  'flattening' results data in a merge

* Simplify the merge command to take a source and a destination,
  letting the destination be a directory or a file, removing the need for
  an output directory parameter

* Add the 'IMAGE_PKGTYPE' and 'DISTRO' config options to the regression
  mappings

* Have the store command place the testresults files in a layout from
  the mapping, making commits into the git repo for results storage more
  useful for simple comparison purposes

* Set the oe-git-archive tag format appropriately for oeqa results
  storage (and simplify the commit messages closer to their defaults)

* Fix oe-git-archive to use the commit/branch data from the results file

* Cleaned up the command option help to match other changes

* Follow the model of git branch/tag processing used by oe-build-perf-report
  and use that to read the data using git show to avoid branch change

* Add ptest summary to the report command

* Update the tests to match the above changes

(From OE-Core rev: ff2c029b568f70aa9960dde04ddd207829812ea0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-21 12:34:00 +00:00
Mazliana
beed7523b6 scripts/resulttool: enable manual execution and result creation
Integrated “manualexecution” operation to resulttool scripts.
Manual execution script is a helper script to execute all manual
test cases in baseline command, which consists of user guideline
steps and the expected results. The last step will ask user to
provide their input to execute result. The input options are
passed/failed/blocked/skipped status. The result given will be
written in testresults.json including log error from the user
input and configuration if there is any.The output test result
for json file is created by using OEQA library.

The configuration part is manually key-in by the user. The system
allow user to specify how many configuration they want to add and
they need to define the required configuration name and value pair.
In QA perspective, "configuration" means the test environments and
parameters used during QA setup before testing can be carry out.
Example of configurations: image used for boot up, host machine
distro used, poky configurations, etc.

The purpose of adding the configuration is to standardize the
output test result format between automation and manual execution.

To use these scripts, first source oe environment, then run the
entry point script to look for help.
        $ resulttool

To execute manual test cases, execute the below
        $ resulttool manualexecution <manualjsonfile>

By default testresults.json store in <build_dir>/tmp/log/manual/

[YOCTO #12651]

(From OE-Core rev: f24dc9e87085a8fe5410feee10c7a3591fe9d816)

Signed-off-by: Mazliana <mazliana.mohamad@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-21 12:34:00 +00:00
Yeoh Ee Peng
1fd5ebdb06 resulttool: enable merge, store, report and regression analysis
OEQA outputs test results into json files and these files were
archived by Autobuilder during QA releases. Example: each oe-selftest
run by Autobuilder for different host distro generate a
testresults.json file.

These scripts were developed as a test result tools to manage
these testresults.json file.

Using the "store" operation, user can store multiple testresults.json
files as well as the pre-configured directories used to hold those files.

Using the "merge" operation, user can merge multiple testresults.json
files to a target file.

Using the "report" operation, user can view the test result summary
for all available testresults.json files inside a ordinary directory
or a git repository.

Using the "regression-file" operation, user can perform regression
analysis on testresults.json files specified. Using the "regression-dir"
and "regression-git" operations, user can perform regression analysis
on directory and git accordingly.

These resulttool operations expect the testresults.json file to use
the json format below.
{
    "<testresult_1>": {
        "configuration": {
            "<config_name_1>": "<config_value_1>",
            "<config_name_2>": "<config_value_2>",
            ...
            "<config_name_n>": "<config_value_n>",
        },
        "result": {
            "<testcase_namespace_1>": {
                "status": "<PASSED or FAILED or ERROR or SKIPPED>",
                "log": "<failure or error logging>"
            },
            "<testcase_namespace_2>": {
                "status": "<PASSED or FAILED or ERROR or SKIPPED>",
                "log": "<failure or error logging>"
            },
            ...
            "<testcase_namespace_n>": {
                "status": "<PASSED or FAILED or ERROR or SKIPPED>",
                "log": "<failure or error logging>"
            },
        }
    },
    ...
    "<testresult_n>": {
        "configuration": {
            "<config_name_1>": "<config_value_1>",
            "<config_name_2>": "<config_value_2>",
            ...
            "<config_name_n>": "<config_value_n>",
        },
        "result": {
            "<testcase_namespace_1>": {
                "status": "<PASSED or FAILED or ERROR or SKIPPED>",
                "log": "<failure or error logging>"
            },
            "<testcase_namespace_2>": {
                "status": "<PASSED or FAILED or ERROR or SKIPPED>",
                "log": "<failure or error logging>"
            },
            ...
            "<testcase_namespace_n>": {
                "status": "<PASSED or FAILED or ERROR or SKIPPED>",
                "log": "<failure or error logging>"
            },
        }
    },
}

To use these scripts, first source oe environment, then run the
entry point script to look for help.
    $ resulttool

To store test result from oeqa automated tests, execute the below
    $ resulttool store <source_dir> <git_branch>

To merge multiple testresults.json files, execute the below
    $ resulttool merge <base_result_file> <target_result_file>

To report test report, execute the below
    $ resulttool report <source_dir>

To perform regression file analysis, execute the below
    $ resulttool regression-file <base_result_file> <target_result_file>

To perform regression dir analysis, execute the below
    $ resulttool regression-dir <base_result_dir> <target_result_dir>

To perform regression git analysis, execute the below
    $ resulttool regression-git <source_dir> <base_branch> <target_branch>

[YOCTO# 13012]
[YOCTO# 12654]

(From OE-Core rev: 78a322d7be402a5b9b5abf26ad35670a8535408a)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-21 12:34:00 +00:00
Richard Purdie
8d2dd4a300 lib/buildstats: Improve error message
Just stating the recipe counts are different isn't helpful, showing
the differences makes it much easier to understand what changed.

(From OE-Core rev: 1d84b782e3af6f0e6922d72895c905877cc33739)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-16 08:19:34 +00:00
Richard Purdie
7e52e59222 wic/engine: Fix missing parted autobuilder failures
OE-Core rev: a88bcbae850a2e6d182291d3f8e167aabdbe4842 broke the ability
to find parted as it may be in sbin which is not in PATH for some users
on some distros.

Iterate on the original patch to fix this and also fix the original problem.

(From OE-Core rev: af3803e5189d7814f9dbd238fb6dab200f351e1a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-15 08:17:49 +00:00
William Bourque
df91cbf7ac wic/engine.py: Load paths from PATH environment variable
Load self.paths from environment variable and
if it fails, fall back to hardcoded list.
This is required for users that would need to load
different e2fsprogs binaries if their system's ones
are not recent enought

(From OE-Core rev: a88bcbae850a2e6d182291d3f8e167aabdbe4842)

Signed-off-by: William Bourque <wbourque@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-14 11:20:55 +00:00
Leonardo Augusto
89d4a8df07 scripts/lib/wic/engine: Fix cp's target path for ext* filesystems
Python subprocess' shell=True defaults to /bin/sh[1][2], which
often refers to a POSIX-compliant shell. As the -e flag is
not defined in the POSIX standard[3], some shells may
interpret "-e" as the first argument to the echo command,
causing the rest of the command line to fail.

In this particular case, "echo -e 'cd {}'" is interpreted
as "-e cd {}", which causes the first line of the command
to fail, and causing cp to always place the source file
in the filesystem's root.

Replacing "echo -e" for a printf command makes this
more portable.

This issue only affects "wic cp" for ext* filesystems.

[1] https://docs.python.org/2/library/subprocess.html
[2] https://docs.python.org/3/library/subprocess.html
[3] http://pubs.opengroup.org/onlinepubs/9699919799

(From OE-Core rev: 9a5b703d4e60c3ccdf80b5289b8e6fc91133fcde)

Signed-off-by: Leonardo Augusto <leobsd@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-14 11:20:55 +00:00
Robert Yang
5501f12ef6 checklayer: Avoid adding the layer if it is already present
* Rename add_layer() to add_layers() so that add_layer_dependencies() can
  re-use it.

* Avoid adding the layer if it is already present

[YOCTO #13148]

(From OE-Core rev: b9cc18d83f55ff48c3d6e60c56359f6736d5a06a)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-14 11:20:55 +00:00
Ross Burton
963ab2c49b devtool: add --all option to check-upgrade-status
The default behaviour is to show just recipes needing upgrades, but for
automated reports showing all recipes can be useful.

(From OE-Core rev: 29e064ac6bd8d1ef74c280bf85bf8428c37ba014)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-02 11:06:00 +00:00
Alexander Kanavin
3bf2035472 devtool: add a command to print an overall list of recipes that can be updated
A sample portion of the output:

$ devtool check-upgrade-status
...
NOTE: acpid                     2.0.30          2.0.31          Ross Burton <ross.burton@intel.com>
NOTE: u-boot-fw-utils           2018.11         2019.01         Marek Vasut <marek.vasut@gmail.com> d3689267f92c5956e09cc7d1baa4700141662bff
NOTE: u-boot-tools              2018.11         2019.01         Marek Vasut <marek.vasut@gmail.com> d3689267f92c5956e09cc7d1baa4700141662bff
NOTE: u-boot                    2018.11         2019.01         Marek Vasut <marek.vasut@gmail.com> d3689267f92c5956e09cc7d1baa4700141662bff
NOTE: bind                      9.11.5          9.13.5          Armin Kuster <akuster808@gmail.com>  cannot be updated due to: 9.11 is LTS 2021
NOTE: iproute2                  4.19.0          4.20.0          Changhyeok Bae <changhyeok.bae@lge.com>
NOTE: ofono                     1.25            1.27            Ross Burton <ross.burton@intel.com>
NOTE: wpa-supplicant            2.6             2.7             Changhyeok Bae <changhyeok.bae@lge.com>
NOTE: base-passwd               3.5.29          3.5.45          Anuj Mittal <anuj.mittal@intel.com>  cannot be updated due to: Version 3.5.38 requires cdebconf for update-passwd utility
NOTE: busybox                   1.29.2          1.30.0          Andrej Valek <andrej.valek@siemens.com>
NOTE: dbus-test                 1.12.10         1.12.12         Chen Qi <Qi.Chen@windriver.com>
NOTE: dbus                      1.12.10         1.12.12         Chen Qi <Qi.Chen@windriver.com>
NOTE: glib-2.0                  2.58.0          2.58.3          Anuj Mittal <anuj.mittal@intel.com>
NOTE: glib-networking           2.54.1          2.58.0          Anuj Mittal <anuj.mittal@intel.com>
...

(From OE-Core rev: 02284423b6391c77da19912192fc607fedb05e67)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-26 13:39:37 +00:00
Dan Dedrick
a563459ea4 devtool: improve git repo checks before check_commits logic
The check_commits logic assumes that both devtool-base and args.branch
exist in the git repo that it is operating on. In order to prevent
errors at that point it's best to first ensure that both of these refs
actually exist. If they don't both exist then the check_commits logic
should just be skipped, as it would be if the repo wasn't originally
checked out by devtool.

Previously if a user removed the args.branch branch from their devtool
cloned repo this code would crash on adding the repo with -n. The crash
would look like this:

Traceback (most recent call last):
  File "/home/ddedrick/src/poky/scripts/devtool", line 344, in <module>
    ret = main()
  File "/home/ddedrick/src/poky/scripts/devtool", line 331, in main
    ret = args.func(args, config, basepath, workspace)
  File "/home/ddedrick/src/poky/scripts/lib/devtool/standard.py", line 812, in modify
    (stdout, _) = bb.process.run('git log devtool-base..%s' % branch, cwd=srctree)
  File "/home/ddedrick/src/poky/bitbake/lib/bb/process.py", line 178, in run
    raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
bb.process.ExecutionError: Execution of 'git log devtool-base..devtool' failed with exit code 128:
fatal: ambiguous argument 'devtool-base..devtool': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

(From OE-Core rev: f13a3490fdb404bbd4c77e45b83540d6deec1358)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-22 14:35:58 +00:00
Dan Dedrick
84be37241c devtool: remove duplicate overrides
DEVTOOL_EXTRA_OVERRIDES only needs one entry for each instance of
overrides. Previous to these changes it would find every override to
SRC_URI and add it to the list. This would duplicate instances where
SRC_URI is modified multiple times with the same override like:
SRC_URI_append_foo += "file://0001-foo.patch"
SRC_URI_append_foo += "file://0002-bar.patch"

A bbappend might also overwrite a SRC_URI override, which would also
cause multiple instances to occur.

When there are multiple instances of the same override in
DEVTOOL_EXTRA_OVERRIDES it causes devtool modify to fail when creating
override branches. The failure occurs when attempting to create the same
override branch a second time and looks like this:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:devtool_post_patch(d)
     0003:
File: '/build/poky/meta/classes/devtool-source.bbclass', lineno: 202, function: devtool_post_patch
     0198:
     0199:        for override in extra_override_list:
     0200:            localdata = bb.data.createCopy(d)
     0201:            if override in default_overrides:
 *** 0202:                bb.process.run('git branch devtool-override-%s %s' % (override, devbranch), cwd=srcsubdir)
     0203:            else:
     0204:                # Reset back to the initial commit on a new branch
     0205:                bb.process.run('git checkout %s -b devtool-override-%s' % (initial_rev, override), cwd=srcsubdir)
     0206:                # Run do_patch function with the override applied
File: '/build/poky/bitbake/lib/bb/process.py', lineno: 178, function: run
     0174:        if not stderr is None:
     0175:            stderr = stderr.decode("utf-8")
     0176:
     0177:    if pipe.returncode != 0:
 *** 0178:        raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
     0179:    return stdout, stderr
Exception: bb.process.ExecutionError: Execution of 'git branch devtool-override-foo devtool' failed with exit code 128:
fatal: A branch named 'devtool-override-foo' already exists.

(From OE-Core rev: 90f667db2219f04e6d61588cd61056d3d8da6d7d)

Signed-off-by: Dan Dedrick <ddedrick@lexmark.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-22 14:35:58 +00:00
Alexey Brodkin
ca4a8eea62 wic: sdimage-bootpart: Use mmcblk0 drive instead of bogus mmcblk
Apparently either nobody ever used sdimage-bootpart.wks
or fstab was kept untouched due to "--no-fstab-update" usage as
some boards like IMX may have, see [1].

Otherwise addition of the following line to the target's fstab:
---------------------->8-----------------
/dev/mmcblkp1   /boot   vfat    defaults        0       0
---------------------->8-----------------

gets us unusable target:
---------------------->8-----------------
[*     ] A start job is running for dev-mmcblkp1.device (23s / 1min 30s)
[ TIME ] Timed out waiting for device dev-mmcblkp1.device.
[DEPEND] Dependency failed for /boot.
[DEPEND] Dependency failed for Local File Systems.

You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
to boot into default mode.
Press Enter for maintenance
---------------------->8-----------------

Fix it with use of "mmcblk0" device name.

[1] https://lists.yoctoproject.org/pipermail/meta-freescale/2018-February/022156.html

(From OE-Core rev: 57a925dbd949e488980b02896106efd82bf47ed2)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
Cc: Maciek Borzecki <maciek.borzecki@gmail.com>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-16 15:35:07 +00:00
Rasmus Villemoes
d6fe480c2b wic: allow bitbake variables in kickstarter files
image_types_wic.bbclass has a mechanism for doing variable substitution
on .wks files by simply letting the input file be called
.wks.in. However, that doesn't allow using variables in files included
via the include directive. This is unfortunate, because lacking either
the ability to include other files or variable substitution leads to
fragile and error-prone duplication between kickstarter files and
recipes/configuration files used for various boards.

This adds (somewhat naive) support for variable substitution in all
files parsed by wic. The user should add all required variables to
WICVARS to get them exported appropriately.

(From OE-Core rev: 8a75d614a8a1ff72c4af448ac3e1292d0e1d1a79)

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14 11:35:56 +00:00
Adrian Freihofer
ac9c5b9212 devtool: fix target-deploy --strip
This is a fixup for: e1ba46109e

devtool deploy-target --strip foo root@192.168.7.2
ended up with:
Traceback (most recent call last):
  File "/home/user/bar_sdk/sysroots/x86_64-pokysdk-linux/usr/bin/
        devtool", line 344, in <module>
   ret = main()
  File "/home/user/bar_sdk/sysroots/x86_64-pokysdk-linux/usr/bin/
        devtool", line 331, in main
    ret = args.func(args, config, basepath, workspace)
  File "/home/user/bar_sdk/layers/poky/scripts/lib/devtool/
        deploy.py", line 187, in deploy
    rd.getVar('base_libdir'))
TypeError: strip_exbar() missing 1 required positional argument: 'd'

(From OE-Core rev: bc349b2d99d74f6d7fb590fd97750e5ff8d6e6c4)

Signed-off-by: Adrian Freihofer <adrian.freihofer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-27 22:13:11 +00:00
Richard Purdie
dbe49d0ad1 scripts: Remove deprecated imp module usage
The imp module is deprecated, port the code over to use importlib
as recently done for bb.utils as well.

(From OE-Core rev: 24809582d4850190d87cd8eb8180d0dce215dbdf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-16 11:46:07 +00:00
Ming Liu
20eb0733e5 wic: bootimg-efi: add a title source parameter
Sometimes the users might want to change the title showing on UEFI
booting screen, so far it's hard-coded to 'boot'.

There is not a easy way to customize it in current design, I tried
firstly with '--configfile', but that does not work with --use-uuid,
since the later option will generate a UUID and write it to boot
config, only when the former option is not enabled.

So a new source parameter 'titile' is added in this patch, it defaults
to 'boot' to be consistent with the original title.

(From OE-Core rev: 37e16188ef3b1b328eb18b3e459c051c9c9f0332)

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-16 11:46:07 +00:00
Changqing Li
bfe2255172 checklayer: generate locked-sigs.inc under builddir
yocto-check-layer will find locked-sigs.inc under builddir,
but locked-sigs.inc is generated under current bitbake working
dir. if run yocto-check-layer outside builddir, we will met error
like "No such file or directory: *locked-sigs.inc". change to
run bitbake -S under builddir to fix this problem.

[YOCTO #12973]

(From OE-Core rev: 2ec0bc0b038bc6413978c8f34ef5c0d22b4bc3e7)

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-16 11:46:07 +00:00
Ross Burton
ff842fe777 wic: use explicit errno import
os.errno doesn't work in Python 3.7 and shouldn't have ever worked, so use
import errno explicitly.

(From OE-Core rev: 82f9157e84dcaf0ad4292053b09be68c2290d197)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-07 23:08:55 +00:00
Kai Kang
95477eaede wic: search nonarch STAGING_DATADIR for multilib
It fails to build multilib image such as lib32-core-image-minimal with
wic by set 'IMAGE_FSTYPES = "wic"':

| ERROR: Couldn't find correct bootimg_dir, exiting

When multilib is enabled, STAGING_DATADIR is expanded with MLPREFIX. But
dependencies of images such as syslinux is still populated to nonarch
STAGING_DATADIR.

Search nonarch STAGING_DATADIR to fix the error.

(From OE-Core rev: dbae9a6f9a1c6cc7d4dd680d7bbda3dfa40f3491)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-16 20:35:43 +01:00
Geoff Parker
50f41202cc wic: make engine.py:get_partitions() resilient to parted/dmidecode stderr output
Running wic commands on Debian 10 systems fail in
scripts/lib/wic/engine.py:get_partitions() due to new stderr output captured
when trying to parse the output from /sbin/parted as a non-root user.

The parted command calls the dmidecode utility, which produces this error
as a non-root user:
    /sys/firmware/dmi/tables/smbios_entry_point: Permission denied
    /dev/mem: Permission denied

scripts/lib/wic/engine.py:get_partitions() calls misc.py:exec_cmd(),
a subprocess wrapper which returns a combined stderr and sdtdout.
These messages to stderr confuse the partition table parser in
get_partitions().

This patch has the partition table parser ignore lines before the expected
"BYT;" header string.

Running wic in Debian 9 does not have this issue.

(From OE-Core rev: d6936301d7598b7a783beaae95109555faf6cc17)

Signed-off-by: Geoff Parker <geoffhp@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-12 16:57:21 +01:00
Davis, Michael
9fa7068855 wic: Support for changing the imager.
(From OE-Core rev: f24c3538a27388d282a94e2d8a70cd9108d0919c)

Signed-off-by: Michael Davis <michael.davis@essvote.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-10 12:47:35 +01:00
Anuj Mittal
c08ea14816 qemux86-directdisk: remove mem= parameter
Remove usage of a specific amount of memory and let it be controlled by
users. This was the default behaviour before it was changed by commit
3b79d9a78 that switched the wks file to be used for qemux86.

Also fixes the bitbake parsing issues seen because of memory starvation
using build appliance images.

Fixes [YOCTO #12894]

(From OE-Core rev: 18d6b668c52dc881cff7b107420e0de527eecce4)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-04 14:31:06 +01:00
Nicolas Dechesne
705941f8c3 checklayer: avoid recursive loop in add_layer_dependencies
When Layer A and Layer B depend on each other, then we will end up in a
recursive loop in function recurse_dependencies(). To avoid such situation
before making the recursive function call we check whether or not we have
already processed this layer.

e.g. without this patch, running this script on layers with dependency loops, we are seeing:

$ yocto-check-layer -d  /srv/work/oe/meta-openembedded/
INFO: Detected layers:
INFO: meta-python: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-python
INFO: meta-filesystems: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-filesystems
INFO: meta-gnome: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-gnome
INFO: meta-xfce: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-xfce
INFO: meta-networking: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-networking
INFO: meta-initramfs: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-initramfs
INFO: meta-oe: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-oe
INFO: meta-multimedia: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-multimedia
INFO: meta-perl: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-perl
INFO: meta-webserver: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-webserver
INFO:
INFO: Setting up for meta-python(LayerType.SOFTWARE), /srv/work/oe/meta-openembedded/meta-python
DEBUG: Processing dependencies core openembedded-layer for layer meta-python.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
...
...
...
[keep repeating]

This patch fixes this situation.

(From OE-Core rev: 171900b4bcb06416685ce90b63114a10fefe0b94)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-25 23:15:49 +01:00
Ioan-Adrian Ratiu
ad42d8e4d9 isoimage-isohybrid: don't include cpio in cpio image
Because the find | cpio processes execute in parallel connected via
the pipe, and the cpio outputs in the same dir find searches for
source files, the cpio will be included in itself partially, depending
on how fast the build machine creates the cpio file before cpio
gobbles it up.

This bloats the ISO image, though compression reduces the .iso file size,
once the kernel decompresses the cpio image and boots it live, it uses
up to double the RAM memory.

Fix this by creating the initrd.cpio file directly inside cr_workdir.

(From OE-Core rev: 7a7b29f5f1392f4f87af4f20cda99c66b4789fde)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-20 05:41:31 -07:00
Kevin Hao
821711bf2e wic: Introduce the --use-label partition parameter
We can use this parameter to make the wic use the label to name a
partition in /etc/fstab.

(From OE-Core rev: 51638edaa00befaed58e2def255d46ae44d9234f)

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-13 07:42:28 +01:00
Emmanuel Roullit
cfadccd7e2 wic: squashfs does support partition uuid.
wic allows the user to create disk image and reference each created
partitions via its partition UUID.

squashfs does not support filesystem UUID but it does offer support for
partition UUID.

$ lsblk -o NAME,FSTYPE,UUID,PARTUUID
NAME   FSTYPE   UUID                                 PARTUUID
sda
|-sda1 vfat     6078-ACD0                            95aa4ffb-741d-4d99-adf6-0358bc890046
|-sda2 squashfs                                      7d46da2d-29cc-4d5a-9e39-d0381c4abb0c
|-sda3 squashfs                                      d4a3e24e-410a-4f2c-8ad5-8f8321de177b
|-sda4 ext4     d72ec529-78e4-4cd3-b39b-781b6b1cb47c f3edc990-f4f6-4536-9587-44dae4ceb99f
`-sda5 ext4     a0b265aa-e935-40b8-9c6b-e9e58ad3890f 6e72ebaa-29ed-41cd-844c-3f76976cf41d

Modifying this constrain allows a user to create squashfs-based rootfs and boot
from them with such kernel argument 'root=PARTUUID=7d46da2d-29cc-4d5a-9e39-d0381c4abb0c'

Fixes: 2fbdcf4e59c8 ("wic: kparser.py: Check for SquashFS and use-uuid")
(From OE-Core rev: a8787bbfdf088b0ef9feb8e6b4230b743bb4086f)

Signed-off-by: Emmanuel Roullit <emmanuel.roullit@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-11 09:05:35 +01:00
Chen Qi
195e60ba96 build.py: add clean option to 'devtool build' command
Add -c (--clean) optiont to 'devtool build' command so that users
could easily clean things up when using devtool.

I encountered a problem about do_prepare_recipe_sysroot failure
when using `devtool build' command and I found myself in a situation
where I either have to use `bitbake' command to clean things up or
use `rm' to remove the directories under ${WORKDIR}.

So add a clean option as it would be helpful when users want to clean
things up to prepare an environment for a clean build.

(From OE-Core rev: 29d790cdeff19e520a35ec5902d6deaae8665492)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-10 12:13:06 +01:00
Alexandru Vasiu
0dc9785c08 isoimage-isohybrid: Fix variable names
initrd.cpio is created in initrd_dir, not in cr_workdir. Gzip will
let initrd.cpio uncompressed if the path is not found.

Also, grub_image variable doesn't exist, grub_src_image should
be used instead.

(From OE-Core rev: c88875b568a66297b1d3df380c590f20796c57f6)

Signed-off-by: Alexandru Vasiu <alexandru.vasiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-29 10:42:48 +01:00
Alexandru Vasiu
87943f2fe0 isoimage-isohybrid: Fix creating initrd.cpio
Only bsdcpio works with numbers for option -R to specify user:group,
while GNU cpio doesn't. Debian use GNU cpio so without this change,
you cannot create ISO images without installing bsdcpio.

(From OE-Core rev: 7c6ba368006ca94ecc0daac7b1c5e0fbe4236daf)

Signed-off-by: Alexandru Vasiu <alexandru.vasiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-29 10:42:48 +01:00
Kevin Hao
42643285cd wic: bootimg-partition: Select a preferred type if multi kernel images are installed
Automatically select one kernel type image based on a predefined
precedence list if there are multi kernel images installed.

(From OE-Core rev: d1d80566681d4cdc00aa3d4b5e4bcf5edb7132b7)

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-21 14:49:42 +01:00
Kevin Hao
511b7a565d wic: bootimg-partition: Add support to specify a custom extlinux.conf
Add support to specify a custom extlinux.conf via something like:
    bootloader --configfile="extlinux.conf"

(From OE-Core rev: 33f85c8bf80d70f00eeccd9ab3dfa417c0fc7df1)

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-21 14:49:42 +01:00
Kevin Hao
bce531d503 wic: bootimg-partition: Add support to create the u-boot boot config file
By leveraging the distro boot command feature in the u-boot, we can
compose the corresponding extlinux.conf when creating the wic image,
and let u-boot boot the kernel automatically. For more detail about
the u-boot distro boot command feature, please see doc/README.distro
in u-boot source files.

(From OE-Core rev: bdf8ae540af12ecc9ad60efd3651b0f71d12d3bd)

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15 21:45:58 +01:00
Kevin Hao
cb78ff423e wic: bootimg-partition: Add do_configure_partition() method
We want to add some u-boot specific config file. Before doing this,
we need know what files will be installed into this partition. So
move the codes about parsing the IMAGE_BOOT_FILES into
do_configure_partition(). No function change.

(From OE-Core rev: 3203037471c761f635d1f1c512cb623ff6977a41)

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15 21:45:58 +01:00
Kevin Hao
9f66ec6cb8 wic: bootimg-partition: Use the relative path in the install_task
(From OE-Core rev: 3a85df7bde1e82cd508da8a78b930fa361a0e720)

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15 21:45:58 +01:00
Kevin Hao
b5648a0319 wic: Remove the unused variable Partition.sourceparams_dict
We choose to pass the source parameters to the source plugins' hooks
via a local variable srcparams_dict. So the Partition.sourceparams_dict
is not used by anyone and seems pretty confused. So drop it.

(From OE-Core rev: d7130a7d0e61021f71fec1d7ae7d37ebb27f0e03)

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15 21:45:58 +01:00
Anuj Mittal
f0977aa7c5 wic/qemux86: don't pass ip parameter to kernel in wks
Images that rely on dhcp being used won't have network setup properly
otherwise.

Fixes [YOCTO #12804]

(From OE-Core rev: fb4dd04f65ea78890c1102424765056d93e6ca65)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-02 09:30:11 +01:00
Anuj Mittal
b7b203d8ea wic/engine: improve error reporting when using rm with wic
When trying to delete something from an ext partition using debugfs, we
don't show any error to the user when that operation fails.

Change this behavior to show the error generated by debugfs. Also,
fallback to use rmdir in case we are trying to delete a directory. However,
unlike mdeltree that is used for a FAT partition, there's no easy way to
delete a non empty directory. Show an error instead when that happens so
user can take appropriate action.

(From OE-Core rev: a405383e63c35d7b56108f192ca74755b122a639)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-26 13:16:40 +01:00
Chen Qi
869e501544 logging: use warning instead warn
The warn method is deprecated. We should use the documented warning instead.

Quoting from the python's official doc:
"""
Note: There is an obsolete method warn which is functionally identical to warning.
      As warn is deprecated, please do not use it - use warning instead.
"""

(From OE-Core rev: f467fd277eb77336097cfc0f5f329bdc8d0f70cb)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-26 13:16:40 +01:00
Anuj Mittal
bf7ed1d046 wic/engine: use up all free space when expanding partitions
Currently we just divide up the free space by the number of partitions
that need to be re-sized. This leads to problems when a user has
explicitly specified a subset of partitions (but not all) that need
to re-sized along with the sizes. As an example, for an image with 3
partitions, if we use:

wic write image.wic /dev/sdb --expand 1:10G

This would lead to paritions 2 and 3 each being re-sized to one thirds
of the free space instead of half.

Change the behavior to use up all the free space.

(From OE-Core rev: a88f1b5d88dbc5fb28be24b9787d73b9e0cdf183)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-18 10:18:42 +01:00
Anuj Mittal
82756dcac0 wic/engine: fix errors when expanding partitions
The UEFI spec implies that GPT partitions should be assumed to be on a 2048
sector boundary (for a 512 byte sector) and the current logic just
divides the free sectors available by the number of partitions that need
re-sizing, which may or may not align and the final result might
overshoot the limits imposed after alignment.

Since we are expanding already aligned partitions, just divide up the
free space in multiples of 2048. Also use the exec_cmd wrapper instead
of the subprocess call directly.

Fixes [YOCTO #12840]

(From OE-Core rev: 5eef63f5afdfbab8e30748cb1bf42bf2e6524759)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-18 10:18:42 +01:00
Christopher Larson
c9812c91fe recipetool: add 'edit' subcommand
This edits the recipe and any bbappends for the specified target.

(From OE-Core rev: 7aece42c6b4744c54a8eb05ff90bd3bf4fbb14a3)

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>
2018-07-04 00:02:16 +01:00
Ioan-Adrian Ratiu
870fbbd5c0 wic: isoimage-isohybrid: debloat image of redundant rootfs
There's no reason to have that rootfs.img filesystem in the image:
it's not used for anything because both the EFI and legacy boot paths
use the /initrd which contains the same contents as the rootfs.img,
only compressed. It was probably forgotten in there :)

My iso went down from 224 to 94 mb.

Tested using UEFI/legacy boots on CD-roms, usb dongle and qemu VM's.

(From OE-Core rev: 4c784379524cb12807ef87a02ef1514ed45c1cc3)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-29 11:07:45 +01:00
Ioan-Adrian Ratiu
b591fb889b wic: isoimage-isohybrid: fix UEFI spec breakage
It's really good that OE supports multiple EFI_PROVIDERs and that
commit 9a1709278de87 ("wic: isoimage-isohybrid: use grub-efi from
deploy dir") makes re-use of the grub-efi built image, but we should
still respect the standard otherwise the ISO will not boot, so install
grub images as boot[x64|ia32].efi not ${PN}-boot[x64|ia32].efi.

(From OE-Core rev: 1608129692d92c239b5fb9244b649a32b9009254)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-29 11:07:44 +01:00
Christopher Larson
2fe9a05666 oe.scriptutils.run_editor: ditch the error-prone argument quoting
Rather than trying to construct a string by quoting the files in an
error-prone way, parse $EDITOR to pass a list to subprocess rather than
a string.

(From OE-Core rev: c9fdf3d046606a0becb2e6b566a481c483b9021a)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-27 13:55:21 +01:00
Anuj Mittal
5d9d5b869d wic/bootimg-efi.py: recognize initrd when using grub
Make sure that we're able to use the initrd value specified in the wks
file when using grub-efi bootloader with bootimg-efi wic plugin.

Fixes [YOCTO #12689]

(From OE-Core rev: f1d5bb1f21e11714357aff4ae7e52421e3756c5a)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04 15:15:00 +01:00
Anuj Mittal
ccd8044f33 wic/engine.py: improve error message when required tools are missing
Instead of showing that command 'None' was found, show the name of
actual command that wasn't found on the host machine or at the native
sysroot path provided by user.

(From OE-Core rev: 3157ebb131e01e74689b1f87a35278350f315e7d)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04 15:15:00 +01:00
Anuj Mittal
9481289419 qemux86-directdisk.wks: remove uvesafb.mode_option
Let this be dictated by the module parameter value being set by qemu
machine configuration.

(From OE-Core rev: c40b241e8d40c8bc1c9e6065b12e260662f5bba4)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04 15:15:00 +01:00
Ricardo Ribalda Delgado
5f6bfdbff5 wic: Fix partition files UIDs on multi rootfs images
When a wks makes reference to multiple rootfs, libspeudo data is not
properly chossen. This results in filesystems with invalid UIDs for all
the files.

This can be tested with this .wks file:
part / --source rootfs --fstype=ext4 --rootfs-dir=core-image-base
part /mnt/data1/ --fstype=ext4 --source rootfs --rootfs-dir=core-image-minimal
part /mnt/data2/ --fstype=ext4 --source rootfs --rootfs-dir=core-image-minimal

And this script

$bitbake core-image-minimal core-image-base syslinux
$losetup --partscan --find --read-only --show test*direct
$sudo mount /dev/loop0p1 /mnt
$ls -lan /mnt
otal 40
drwxr-xr-x 18    0    0  1024 May 11 16:11 .
drwxr-xr-x 25    0    0  4096 May  6 06:31 ..
drwxr-xr-x  2 1000 1000  3072 May 11 15:51 bin
drwxr-xr-x  2 1000 1000  1024 May 11 13:59 boot
drwxr-xr-x  2 1000 1000  1024 May 11 13:59 dev
drwxr-xr-x 25 1000 1000  3072 May 11 15:51 etc
drwxr-xr-x  3 1000 1000  1024 May 11 13:59 home
drwxr-xr-x  6 1000 1000  3072 May 11 15:51 lib
drwx------  2    0    0 12288 May 11 16:11 lost+found
drwxr-xr-x  2 1000 1000  1024 May 11 13:59 media
drwxr-xr-x  3 1000 1000  1024 May 11 15:50 mnt
drwxr-xr-x  2 1000 1000  1024 May 11 13:59 proc
drwxr-xr-x  2 1000 1000  1024 May 11 15:51 run
drwxr-xr-x  2 1000 1000  3072 May 11 15:51 sbin
drwxr-xr-x  2 1000 1000  1024 May 11 13:59 sys
drwxr-xr-t  2 1000 1000  1024 May 11 13:59 tmp
drwxr-xr-x 10 1000 1000  1024 May 11 14:54 usr
drwxr-xr-x  8 1000 1000  1024 May 11 14:55 var
$sudo losetup -d /dev/loop0

(From OE-Core rev: 450335ba5e73a375eb9932b4c4cf37979640dbfc)

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-22 13:13:32 +01:00
Chen Qi
a6abac49bd devtool/upgrade: fix the order of license checksum representation
In most recipes in OE, beginline and endline are before md5 checksum.
We should obey this tradition in devtool's upgrade. Otherwise, we might
see meaningless change just because of the order change.

e.g.
-LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=7765a3d787cb4fed3ccc3c9cee030af9 \
-                    file://plugins/sudoers/redblack.c;beginline=1;endline=41;md5=805782a8466975716f8376b2be9aedde \
-                    file://lib/util/reallocarray.c;beginline=3;endline=16;md5=85b0905b795d4d58bf2e00635649eec6 \
-                    file://lib/util/fnmatch.c;beginline=3;endline=27;md5=67f83ee9bd456557397082f8f1be0efd \
-                    file://lib/util/getcwd.c;beginline=5;endline=27;md5=449af4cc57fc7d46f42090608ba3e681 \
-                    file://lib/util/glob.c;beginline=6;endline=31;md5=5872733146b9eb0deb79e1f664815b85 \
-                    file://lib/util/snprintf.c;beginline=6;endline=34;md5=c82c1b3a5c32e08545c9ec5d71e41e50 \
-                    file://include/sudo_queue.h;beginline=5;endline=27;md5=449af4cc57fc7d46f42090608ba3e681 \
-                    file://lib/util/inet_pton.c;beginline=3;endline=17;md5=3970ab0518ab79cbd0bafb697f10b33a"
+LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=cc4bf2366b059c9598e3947f885931ec \
+                    file://plugins/sudoers/redblack.c;md5=805782a8466975716f8376b2be9aedde;beginline=1;endline=41 \
+                    file://lib/util/reallocarray.c;md5=85b0905b795d4d58bf2e00635649eec6;beginline=3;endline=16 \
+                    file://lib/util/fnmatch.c;md5=67f83ee9bd456557397082f8f1be0efd;beginline=3;endline=27 \
+                    file://lib/util/getcwd.c;md5=449af4cc57fc7d46f42090608ba3e681;beginline=5;endline=27 \
+                    file://lib/util/glob.c;md5=5872733146b9eb0deb79e1f664815b85;beginline=6;endline=31 \
+                    file://lib/util/snprintf.c;md5=c82c1b3a5c32e08545c9ec5d71e41e50;beginline=6;endline=34 \
+                    file://include/sudo_queue.h;md5=449af4cc57fc7d46f42090608ba3e681;beginline=5;endline=27 \
+                    file://lib/util/inet_pton.c;md5=3970ab0518ab79cbd0bafb697f10b33a;beginline=3;endline=17 \
+                    "

After this change, it becomes:
-LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=7765a3d787cb4fed3ccc3c9cee030af9 \
+LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=cc4bf2366b059c9598e3947f885931ec \
                     file://plugins/sudoers/redblack.c;beginline=1;endline=41;md5=805782a8466975716f8376b2be9aedde \
                     file://lib/util/reallocarray.c;beginline=3;endline=16;md5=85b0905b795d4d58bf2e00635649eec6 \
                     file://lib/util/fnmatch.c;beginline=3;endline=27;md5=67f83ee9bd456557397082f8f1be0efd \
@@ -12,7 +12,8 @@ LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=7765a3d787cb4fed3ccc3c9cee030af9 \
                     file://lib/util/glob.c;beginline=6;endline=31;md5=5872733146b9eb0deb79e1f664815b85 \
                     file://lib/util/snprintf.c;beginline=6;endline=34;md5=c82c1b3a5c32e08545c9ec5d71e41e50 \
                     file://include/sudo_queue.h;beginline=5;endline=27;md5=449af4cc57fc7d46f42090608ba3e681 \
-                    file://lib/util/inet_pton.c;beginline=3;endline=17;md5=3970ab0518ab79cbd0bafb697f10b33a"
+                    file://lib/util/inet_pton.c;beginline=3;endline=17;md5=3970ab0518ab79cbd0bafb697f10b33a \
+                    "

(From OE-Core rev: 6c5cc1b298be6aa1e9d378bc8349e11cbf17d300)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-15 10:56:50 +01:00
Chen Qi
c5d7bd3ee9 devtool/sdk.py: error out in case of downloading file failure
It's possible that downloading file from updateserver fails. In
this case, we should error out instead of continue.

We have users reporting unexpected behavior of 'devtool sdk-update'.
When an invalid url is supplied, e.g., `devtool sdk-update http://invalid',
the program reports 'Note: Already up-to-date'.

This is obviously not expected. We should error out in such case.

(From OE-Core rev: 449564783dfb162536a2f772b3a8704973221e0f)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-15 10:56:48 +01:00
Ross Burton
4d2b500a08 oe-buildperf-report: highlight large changes in the HTML report
If the relative difference is greater than 2%, make the text bold to highlight
it.

(From OE-Core rev: 500e28311248713d4772480b81b10777390da909)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-11 07:49:38 +01:00
Sarah Marsh
d845b9960b recipetool: fixed uncaught NameError exception
When packaging a node application, a `NameError` can be thrown in create_npm.py if an optional npm dependency does not
support Linux.

(From OE-Core rev: 8293201d98d368d6322eaa960fb3e7cee2ba9368)

Signed-off-by: Sarah Marsh <sarah.marsh@arm.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-04 13:28:01 +01:00
Richard Purdie
b71709b0e2 wic/imager/direct: Ensure correct ROOTFS_DIR is shown
This changes the output of "wic create mkefidisk -e core-image-sato" from:

The following build artifacts were used to create the image(s):
  ROOTFS_DIR:                   /media/build1/poky/build/tmp.wic.ybraavmb/rootfs_copy

to:

The following build artifacts were used to create the image(s):
  ROOTFS_DIR:                   /media/build1/poky/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/rootfs

which s much less confusing for the user.

[YOCTO #12564]

(From OE-Core rev: a4941af2d3624aecc5dcd7ff54b7ea8c9e9dee8b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-20 08:19:46 +01:00
Alexander Kanavin
003e908865 yocto-check-layer: add a test for correct setting of LAYERSERIES_COMPAT_collection
[YOCTO #12661]

(From OE-Core rev: 13a80b22f28b81a0082d181674295a0f96111f6b)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-10 09:10:36 +01:00
Ming Liu
6c951c5a5e recipetool: create: fix port number parsing issue
A flaw was found when I run:
$ recipetool create "ssh://git@xxx.xxx:7999/xxx.git"

the url turned out to be: "git://git@xxx.xxx/7999/xxx.git;protocol=ssh"
after parsing, the port number was parsed as part of the path, this is
definitely wrong and lead to fetching failures.

This issue could be fixed in reformat_git_uri, by filtering out port
numbers when formatting ":".

(From OE-Core rev: 4290e04b69360b5e1da9f37166015e30f66cb335)

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-03 23:53:20 +01:00
Anuj Mittal
c37053857d checklayer: remove reference to undefined class
LayerError doesn't exist and will lead to an error when this failure
code path is hit.

(From OE-Core rev: 7780482772d005c77825dc3e99e63f00911156bf)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-20 09:59:31 +00:00
Alexander Kanavin
8cec60990e devtool: add --force-patch-refresh to 'modify' and 'finish' commands
This is very useful for updating patch context so that any fuzz is eliminated.
Simply issue:

devtool modify <recipe>
devtool finish --force-patch-refresh <recipe> <layer_path>

Without this flag, devtool will not deem the commits in the workspace
different to patches in the layer, even if the commits have different,
up-to-date context line in them.

(From OE-Core rev: 7e1d1887be8faaaab9996fca9a3fd750aeb7b62f)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-11 06:27:00 -07:00
California Sullivan
46bb764616 wic: add wks file to make use of exclude-path functionality
Using --exclude-path and a wks.in file we can create an image that takes
the /boot/ directory for the boot partition, has an empty /boot/
directory in the rootfs partition. The boot partition gets mounted to
/boot/ after startup.

(From OE-Core rev: db904053e8ee80fb6930c5e7e22287927e0f25e2)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:35:42 -08:00
Paulo Neves
2327e0f585 wic: Set a miniumum FAT16 volume size.
Set a miniumum FAT16 volume size because images are
not valid to parted if this minimum value is not respected.

The value set is determined experimentally forr a logical
sector size of 512. This fixed my local problem but, there
may be better solutions.

(From OE-Core rev: f7dfb4d43247d3c13a4e0a3853007d63b9512b83)

Signed-off-by: Paulo Neves <ptsneves@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-04 11:35:40 +00:00
Paulo Neves
5796b037d5 wic: partition plugin wrongly assumes it is rootfs
The partition plugin is used as the base for other plugins.
One of the methods the plugins use, is the prepare_rootfs
method.

The prepare_rootfs method wrongly assumes that the value
ROOTFS_SIZE from bitbake datastore is relevant to every
invocation of prepare_rootfs, which it clearly is not, for
example in the bootimg-partition case.

This commit adds an optional argument to prepare_rootfs
where a caller can tell prepare_rootfs if it is an actual
rootfs and whether related rootfs information retrieved from
bitbake is valid. The default behavior of this optional
argument is to assume that the invocation is an actual
rootfs, to maintain compatibility with previous
implementations.

(From OE-Core rev: 654d72d55194ec41bc1aacfcc6b2c8c9a305b042)

Signed-off-by: Paulo Neves <ptsneves@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-04 11:35:40 +00:00
Parthiban Nallathambi
8eb7e66246 wic: Add post operation hook for SourcePlugin
do_post_partition hook is needed if some operations like security signing
the parition needs to be done. source plugins can make use of this to implement
post operatiosn in do_post_partition. do_post_partition is called after
do_prepare_partition if present.

(From OE-Core rev: 5055489b9ab3fda32a285d0d165d080d11a4d432)

Signed-off-by: Parthiban Nallathambi <pn@denx.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-04 11:35:40 +00:00
Paul Eggleton
80feb637a4 devtool: search: tweak help text
* We now match on more than just target recipes, so don't specify that
  only target recipes are searched.
* We're printing the SUMMARY value in addition to the name, so mention
  that so it's clear where that text is coming from.
* Remind users that they should use quotes around the keyword to avoid
  shell expansion when using regular expressions.

(From OE-Core rev: cc68971557fe065e59ff47657f650051eb85db3c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:13:56 +00:00
Paul Eggleton
e8c7c36c60 devtool: search: also look in recipe cache
If pkgdata isn't present or is incomplete, then you get either a
traceback or you don't see the results you were hoping for. The recipe
cache that bitbake collects during startup contains some useful
information for each recipe that we could search through as well, and
we can access it easily using tinfoil's all_recipes() API function,
so add some code that does that. (We still show a warning if pkgdata
isn't present, as there are certain dynamic packages that are generated
at packaging time that won't show up in the cache).

One side-effect of this is that we will start showing non-target
recipes - that's actually a good thing, since seeing those is useful,
however we exclude nativesdk recipes when in the eSDK to avoid confusion
since nativesdk isn't directly applicable there.

Fixes [YOCTO #12356].

(From OE-Core rev: b8406383886d09a80a9a002150dcf364fa9902d7)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:13:56 +00:00
Paul Eggleton
3bb00af9ab devtool: deploy-target: don't specify ssh/scp port unless user does
If the user doesn't specify a port then we should avoid specifying one
on the ssh/scp command line in case the user has configured one for the
host they are connecting to, which was being overridden unnecessarily.

Fixes [YOCTO #12381].

(From OE-Core rev: f1020eef09fada7ef2231d5528576553f3f6bfe1)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:13:56 +00:00
Paul Eggleton
0465558e83 devtool: finish: fix erroneously creating bbappend for relative paths
After OE-Core rev 5e3fe00a0233d563781849a44f53885b4e924a9c we call
os.path.abspath() on the original layer path, but we later compare that
to the destination layer path. If that layer path isn't absolute but is
effectively the same path, it should be writing to the original recipe
but because we weren't making it absolute we were writing a bbappend
instead. Call os.path.abspath() on the destination path as well to avoid
that.

(From OE-Core rev: a85a78dcf226d160e9b504bfa67b306a9175ac29)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:13:56 +00:00
Paul Eggleton
e295135ba1 devtool: reset: delete bbappend file if _check_preserve() doesn't
If the .devtool_md5 file doesn't contain a reference to the bbappend
file (e.g. because devtool was interrupted before it could write that
out) then _check_preserve() won't delete it, so we need to delete it
separately because otherwise the recipe won't actually be reset.

(From OE-Core rev: 751d27600a3df18d96baaa48696acf33ee964bec)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:13:56 +00:00
Paul Eggleton
2f40a87424 devtool: fix poor handling of upgraded BBCLASSEXTENDed recipes
Fix two aspects of handling BBCLASSEXTENDed targets (e.g.
openssl-native) that have been run through "devtool upgrade":

* Fix recipe name not showing up in "devtool status"
* Fix "devtool reset" not deleting empty directories under the recipe
  directory within the workspace, which may lead to problems if you
  subsequently run "devtool upgrade" on the same target again

(From OE-Core rev: 56e04260d64de9c5b83893d97cf41b7ea9a45878)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:13:56 +00:00
Paul Eggleton
a1179425a9 devtool: set up git repos so that singletask.lock is ignored
singletask.lock is written out while certain tasks execute for recipes
that have externalsrc.bbclass enabled - this includes recipes in
devtool's workspace. It appears that there's a race where
singletask.lock will be there one minute and then when we try to get the
file checksum of it (since we want to know if anything in the source
tree has changed) it will be gone, and git chokes. To fix that, add
singletask.lock to .git/info/exclude in the repository, regardless of
whether we created the repository or not. In any case singletask.lock
should never be tracked by git, so this is a good thing to be doing for
that reason as well.

This fixes oe-selftest failures in test_devtool_modify that we've seen
on the Yocto Project autobuilder:

bb.data_smart.ExpansionError: Failure expanding variable
do_compile[file-checksums], expression was ${@srctree_hash_files(d)}
which triggered exception CalledProcessError: Command
'['git', 'add', '-A', '.']' returned non-zero exit status 128.

Note that this only fixes this issue for devtool; if you are using
externalsrc independently of devtool there's a chance this will still
be an issue unless you add singletask.lock to your .gitignore.

(From OE-Core rev: 334ba846c795fc0d8c73ce05a1b0882739c86650)

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>
2018-02-06 11:06:27 +00:00
Alexander Kanavin
c1058ac4f2 devtool: rename the suggested license change tag to 'License-Update:'
(From OE-Core rev: 3905ae20330f204f3c8997e2d5aaf15dcf5a860c)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-18 12:50:37 +00:00
Dogukan Ergun
bab3b2e939 wic: if we can't get from ioctl, try from os.stat()
Under some conditions, ioctl FIGETBSZ can't return real value.
We can try to use fallback via os.stat() to get block size.

Source of patch:
17365f4fe9

(From OE-Core rev: d8f7cf2d38934c248be91101236f7537d0d31ea7)

Signed-off-by: Dogukan Ergun <dogukan.ergun@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-14 09:11:57 +00:00
Adrian Fiergolski
faae2df397 wic: Fix a path to a psuedo state directory (PSEUDO_LOCALSTATEDIR).
In case of 'new_rootfs' the psuedo directory is not copied. Thus
PSEUDO_LOCALSTATEDIR should still point to the dsa
'native_sysroot'/../pseudo. Otherwise PSEUDO_LOCALSTATEDIR points to a not
existing director ('new_rootfs'/../pseudo) and UID and GUID attributes are not
applied to files of the image.

(From OE-Core rev: 19642e2d6e015072e4a413f4f57aee65df757cb9)

Signed-off-by: Adrian Fiergolski <adrian.fiergolski@cern.ch>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-02 17:24:37 +00:00
Tom Rini
9ebc830196 wic: Introduce --fsuuid and have --use-uuid make use of UUID too
First, allow for wic to be given a filesystem UUID to be used when
creating a filesystem.  When not provided, wic will generate the UUID to
be used.  Next, when --use-uuid is passed, we update the fstab to mount
things via UUID (and if not found, then use PARTUUID) as UUID is more
portable.

(From OE-Core rev: 9256b8799495634ee8aee5d16ff71bd6e6e25ed4)

Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-18 18:03:58 +00:00
Tom Rini
20748d8ddc wic: partition.py: Update comments slightly
First, we support squashfs as root, so mention that.  Second, the btrfs
rootfs creation function had a copy/paste of the previous function
comment, remove the irrelevant line.

(From OE-Core rev: 7cdd4034b3e6ff4e13d491dfba24906afe495e2d)

Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-18 18:03:58 +00:00
Tom Rini
cce54f6a19 wic: kparser.py: Check for SquashFS and use-uuid
The SquashFS filesystem does not support UUIDs so make this combination
be an error.

(From OE-Core rev: 2fbdcf4e59c835af0f4041bc34243decb42321ef)

Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-18 18:03:58 +00:00
Alexander Kanavin
2de2a19a00 devtool: add license checksum change handling to 'devtool upgrade'
Specifically, 'devtool upgrade' will now do these things:

1) determine if any of the license checksums need updating; if so,
write the new checksums into the LIC_FILES_CHKSUM value in the recipe
that is written to the workspace;

2) print a notice to the standard output:

NOTE: New recipe is /home/ak/development/poky/build/workspace/recipes/puzzles/puzzles_git.bb
NOTE: License checksums have been updated in the new recipe; please refer to it for the difference between the old and the new license texts.

3) and the cool part: devtool will create a diff of the old and new licenses,
and write the diff into the workspace recipe as a comment, like this:

======
 FIXME: the LIC_FILES_CHKSUM values have been updated by 'devtool upgrade'.
 The following is the difference between the old and the new license text.
 Please update the LICENSE value if needed, and summarize the changes in
 the commit message via 'License-checksum-change:' tag.
 (example: 'License-checksum-change: copyright years updated.')

 The changes:

 --- LICENCE
 +++ LICENCE
 @@ -1,8 +1,9 @@
  This software is copyright (c) 2004-2014 Simon Tatham.

  Portions copyright Richard Boulton, James Harvey, Mike Pinna, Jonas
 -Klker, Dariusz Olszewski, Michael Schierl, Lambros Lambrou, Bernd
 -Schmidt, Steffen Bauer, Lennard Sprong and Rogier Goossens.
 +Kölker, Dariusz Olszewski, Michael Schierl, Lambros Lambrou, Bernd
 +Schmidt, Steffen Bauer, Lennard Sprong, Rogier Goossens and Michael
 +Quevillon.

  Permission is hereby granted, free of charge, to any person
  obtaining a copy of this software and associated documentation files

======

(From OE-Core rev: ccb37f9e81eb78ed0eb2a238d7c3e196db9b2f72)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-18 18:03:58 +00:00
Alexander Kanavin
b52a9cf310 devtool: provide useful defaults for version/commit when upgrading recipes
Specifically, 'devtool upgrade' will use the latest upstream release if available
or latest commit if upstream never makes releases.

(From OE-Core rev: 45b4242b105ad36e94ae15a96d588a58b917b8e8)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-18 18:03:57 +00:00
Alexander Kanavin
5b61268fca devtool: add a 'latest-version' command
This command queries the upstream server for what the latest release is and prints
the output; it is a much neater way to find out these things than fumbling with distrodata,
'bitbake -c checkpkg' and awkward to read csv output in a file.

Examples:

python3 (tarballs):
NOTE: Current version: 3.5.3
NOTE: Latest version: 3.6.3

rpm (git):
NOTE: Current version: 4.13.90
NOTE: Latest version: 4.14.0
NOTE: Latest version's commit: da3720f62e57648fb1dc2a632744d38866139971

puzzles (git without version tags):
NOTE: Latest commit: ee8ea9b9785964694cb2b3ad77c3fb2460f49510

(From OE-Core rev: e8f5b5cc25ce7a9882f21473cefc47edcebf77d4)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-18 18:03:57 +00:00
Chang Rebecca Swee Fun
05bcd72f9f recipetool: create: fix conflict between SRCREV and tag
If you specify 'tag=' for a git URL and passed to recipetool create, you
will get into Bitbake expansion error shown below:

----- snip -----
$ devtool add --version 2.4.2 mbedtls "git://github.com/ARMmbed/mbedtls;tag=mbedtls-2.4.2"
...
bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: Conflicting revisions (abeccb9dbd7e19ae91ac50e1edd3803111c5f9b6 from SRCREV and mbedtls-2.4.2 from the url) found, please specify one valid value
----- snip -----

Assuming the tag is valid, we should get the tag commit hash and
drop the usage of 'tag=' from SRC_URI. By using a commit hash
corresponding to the tag will prevent bitbake from accessing
remote repository in order to expand SRCPV.

(From OE-Core rev: 53f8effa3eb07dc7035ff9933e7918318f242579)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-18 18:03:57 +00:00
Martin Hundebøll
23825ed16a wic: support filesystem label for rawcopy
The '--label' argument should work for '--source rawcopy' as it does for
'--source rootfs', so add a method in RawCopyPlugin to update the label
on the temporary filesystem images.

(From OE-Core rev: 303d6ca5ae986acd2e633b0dc5e386ee7771f8ab)

Signed-off-by: Martin Hundebøll <mnhu@prevas.dk>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-10 22:45:19 +00:00
Paul Eggleton
d6829f4f6c recipetool: create: fix failure handling included dicts
If a setup dict in a python setup.py file pulled in the contents of
another dict (e.g.  **otherdict), then we got an error when mapping
the keys because the key is None in that case. Skip those keys to avoid
the error (we pick up the values directly in any case).

A quick reproducer for this issue:

recipetool create https://files.pythonhosted.org/packages/source/p/pyqtgraph/pyqtgraph-0.10.0.tar.gz

(From OE-Core rev: ae62a9953e219df5147ed4a5ae3f4163d51cff28)

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>
2017-11-21 13:06:12 +00:00
Paul Eggleton
125e0b72b7 devtool: implement conditional patch handling
If you have a recipe that uses overrides to conditionally extend
SRC_URI to add additional patches, then you will often need to update
those patches if you're making other changes to the source tree (for
example if you're upgrading the underlying source). Make this possible
with devtool by creating devtool-override-* branches for each override
that conditionally appends/prepends SRC_URI, and have devtool
update-recipe / finish check each branch out in turn and update the
corresponding patches.

A current example of a recipe that does this is the quota recipe - it
applies an additional patch if musl is the selected C library (i.e.
libc-musl is in OVERRIDES).

Note that use of this functionality does require some care - in
particular, updates to patches that appear on the main branch (named
"devtool" by default) should be made there and not only on one of the
specific devtool-override-* branches that are created for each override.
The recommended procedure is to make the changes you want to make to the
main branch first, then check out and rebase each devtool-override-*
branch, testing each one by activating the corresponding configuration,
and then finally run devtool finish.

Fixes [YOCTO #11516].

(From OE-Core rev: aa87603d1ffd695027847f4df75c0406cf4e14d8)

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>
2017-11-11 12:14:27 +00:00
Paul Eggleton
9a80078e4b devtool: finish: add dry-run option
If you're not sure what changes devtool finish is going to make, or
you're not sure you're finished with your modifications, it is useful to
be able to see what devtool finish is going to do beforehand, so add
a -N/--dry-run option to make that possible.

(It's also very useful for debugging devtool finish itself.)

(From OE-Core rev: 05f2d5d2ce00c53825ccea5cd9c2262f9d27a638)

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>
2017-11-11 12:14:27 +00:00
Paul Eggleton
d906d7cea8 devtool: finish: improve reporting for removed files
If a file is going to be effectively removed from the destination by
devtool finish, we should report that rather than just reporting that
we're removing files from the workspace. This is a little tricky because
the way we actually operate when finishing is to:
 (1) remove all original files (as recorded by devtool upgrade, if that
     was used)
 (2) as part of updating the recipe file, remove the files from next to
     the new recipe (i.e. in the workspace for an upgrade, real recipe
     otherwise) corresponding to commits not in the git tree
 (3) copy over remaining files from the workspace to the destination

To report the files removed with respect to what was originally there,
we need to swap steps 1 and 2 so we can see what no longer exists after
the deletion, and suppress the reporting currently done in step 2 -
however, we still want to report removal in step 2 for the non-upgrade
case, so the latter is conditional.

(From OE-Core rev: db1d663507509cac9d97d7c96ac8590478767ba2)

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>
2017-11-11 12:14:27 +00:00
Paul Eggleton
541b7e2ce0 devtool: show a better error message if meta-files aren't found
If the files that the devtool-source class is supposed to create in the
source tree aren't found in the temporary directory then we know that
the class hasn't worked properly - say that explicitly.

(From OE-Core rev: 4621152509c037532b133e5e6d5b73bda7ddb602)

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>
2017-11-11 12:14:27 +00:00
Paul Eggleton
46a3662d4e devtool: upgrade: reformat --no-patch warning message
* Only log one warning message instead of one per line
* Be a bit more verbose
* "if list" is more pythonic than "if len(list)"

(From OE-Core rev: 2d11e9e6e73648c1cb514c0c10111c7886acae78)

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>
2017-11-11 12:14:27 +00:00
Paul Eggleton
fcb84383ce devtool: upgrade: automatically handle changes to source subdirectory
If the directory where the source code extracts to changes (for
example, when upgrading iucode-tool from 1.5 to 2.1.1, the subdirectory
in the tarball changed from "iucode_tool-${PV}" to "iucode-tool-${PV}")
then handle this automatically. Also handle when it changes to match the
default S value (i.e. "${WORKDIR}/${BP}") in which case we just drop
setting S in the recipe.

Fixes [YOCTO #10939].

(From OE-Core rev: d29881a652bf03627d257a1eac5f02ec17315b8b)

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>
2017-11-11 12:14:27 +00:00