Compare commits

..

468 Commits

Author SHA1 Message Date
Alejandro Hernandez
36feb38045 linux-yocto: Update genericx86* SRCREVs for linux-yocto 4.4
(From meta-yocto rev: 6b55634430188b37ccf19b264502270a64ce4d58)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:48:53 +01:00
Alejandro Hernandez
f06b023de7 linux-yocto: Update genericx86* SRCREVs for linux-yocto 4.1
(From meta-yocto rev: b3abc0b3866d5e030ebdc358b9562c900dd4e0f7)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:48:53 +01:00
Ed Bartosh
317708235b bitbake: bitbake: implement idle timeout for xmlrpc server
Idle timeout can be specified either by -T/--idle-timeout option or
by sessing BBTIMEOUT environment variable. Bitbake xmlrpc server
will unload itself when timeout exprired, i.e. when server is idle
for more than <idle timeout> seconds.

[YOCTO #5534]

(Bitbake rev: 5fa0b3a19e7d0f40790f737abeddf499d53f1f6a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:48:52 +01:00
Ed Bartosh
4cba010529 bitbake: bitbake: implement --foreground command line option
This option makes bitbake xmlrpc server to run in foreground.
It should be useful for debugging purposes.

(Bitbake rev: 9d4254be5853a546a346bf0d19919dcfba12773d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:48:52 +01:00
Scott Rifenbark
380b6e80ce bitbake: bitbake-user-manual: Added new section on command-line execution
Needed a section on executing a list of task and recipe combinations.

(Bitbake rev: 6f6cd0674fd1595f4e74b7da692e0c348b2660c6)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:54 +01:00
Scott Rifenbark
cb40ae4872 bitbake: bitbake-user-manual: Applied review edits to "Recursive Dependencies"
Added a minor tweak to the third paragraph to be more inclusive
of the topic.

Fixes [YOCTO #9970]

(Bitbake rev: a5d36e8bccf35ffbca41a4facaa041d36f587529)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:54 +01:00
Scott Rifenbark
80b1efb62c bitbake: bitbake-user-manual: Fixed typo in the BBDEBUG variable description.
In the BBDEBUG variable description, the "-d" parameter needed to
be "-D".  Fixed it.

Fixes [YOCTO #9950]

(Bitbake rev: 475e7611f6c5b884d86152cb0b334e9d96849608)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:54 +01:00
Scott Rifenbark
9a9577ed49 bitbake: bitbake-user-manual: Added review changes to BBCLASSEXTEND description
Fixes [YOCTO #9909]

Added some technical clarifications to the existing note to be clear
about what is causing the limitations in this case.  Applied some
formatting fixed to for the use of the include word.

(Bitbake rev: e9ad2e0f6d2681dd793cc39c468eb86e57fd6f48)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Scott Rifenbark
4bc1ee5de4 bitbake: bitbake-user-manual: Added review changes to recursive section.
Applied formatting to a "after" word that should be
<filename>after</filename>.  Also added a new clarifying paragraph in
the "Recursive Dependencies" section.

Fixes [YOCTO #9861]

(Bitbake rev: ada90f68afd17cb85cb5957f3f91b537ee3599f6)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Andrew Bradford
35081f5518 bitbake: bitbake-user-manual: Addeds support for the Perforce Fetcher
Added a new Perforce Fetcher section in the same spirit as the existing
sections for other supported fetchers.  Changes included the new section,
removal of the bulleted item that mentioned this fetcher as an
"additional" fetcher, and the creation of a new variable in the glossary
named P4DIR.

(Bitbake rev: 47e03b1789ee1c18407dbac33a6c235752019865)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Scott Rifenbark
a6cffcffc1 bitbake: bitbake-user-manual: Added clarifying note to BBCLASSEXTEND variable.
Fixes [YOCTO #9909]

Added a note that talks about how the BBCLASSEXTEND mechanism
adds recipe variants.

(Bitbake rev: 185c9c5fc205fe9c9daf5238f11b92bd0954f5c6)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Scott Rifenbark
8c55a9cf88 bitbake: bitbake-user-manual: Added a note providing examples of task dependencies
Fixes [YOCTO #9861]

In the "Dependencies internal to the .bb File" section, I placed a
note providing more detail on how recipes are built regarding task
dependency.

(Bitbake rev: c2e72928fbd21d622860a54a55f4239ba27c07a2)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Scott Rifenbark
d918df7e8e bitbake: bitbake-user-manual: Updated dependency section for tasks
Fixes [YOCTO #9861]

I updated the section on dependencies to give a couple of examples
for task dependencies within a single recipe and dependencies for
tasks between two individual recipes.

(Bitbake rev: 231deeb2b0b3847cba971ca30c16e29357100ae6)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Scott Rifenbark
6743f12bbf bitbake: bitbake-user-manual: Updated the defaults for getVar and getVarFlag
There is no default.

Fixes [YOCTO #9683]

(Bitbake rev: 886afd6d876c9ae04cf681931db8f1774dc53096)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Scott Rifenbark
8321d66696 bitbake: bitbake-user-manual: Added new section on command-line execution
Needed a section on executing a list of task and recipe combinations.

(Bitbake rev: 17f7f366df3a5951ae88e24c43aecf3d65d83c14)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Kai Kang
321f4e9438 boost: fix CVE-2012-2677
Backport patch to fix CVE-2012-2677 for boost from:

https://svn.boost.org/trac/boost/changeset/78326

(From OE-Core rev: 0a2df616a5c3316704742f1dcf37b450920e0280)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Mark Hatle
d183d1e08b package_manager.py: Avoid installing an empty package list
It is possible in an attempt only install, that everything listed is not
available to be installed.  This will have the effect of clearing the
package list.  However, we only check for an empty package list at
the beginning of the function.  We need to also check before running the
install, otherwise we can fail due to 'error: no package(s) given".

(From OE-Core rev: 9ae6a2830dacb3c335754a6da91bd5cc30546b31)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Khem Raj
56aa9c8162 glibc: Update to 2.24 after hard-freeze
Drop upstreamed patch

(From OE-Core rev: 96f951af74dd8dcea1372249fb84c2c615a7bba3)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:52 +01:00
Ed Bartosh
2d5b282957 wic: rawcopy: make source filenames unique
Rawcopy plugin copies source files to build folder before using them
to assemble result image. After assembling the image wic renames
source files to <image>.p<partition number>. If the same source file
is used in multiple partitions wic breaks trying to rename file that
doesn't exist.

Added <line number> suffix to the files when copying them to the
build dir. This should make filename unique even if the same source
file is used for multiple partitions.

[YOCTO #9826]

(From OE-Core rev: 43a809bfe99024083b4ab4eb9895b084c9c4fa80)

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-07-21 07:47:52 +01:00
Ed Bartosh
788d6fb30d buildhistory-diff: reduce PKGR noise
When using PR service the buildhistory-diff output contains a lot of
PKGR changes: In practice the mass of PKGR updates hide other important
changes as they often account for 80% of all changes.

Skipped incremental and decremental changes of PKGR versions to reduce
amount of the script output. All changes are still included in the
output if script is run with -a/--report-all command line option.

[YOCTO #9755]

(From OE-Core rev: a343788b11f6c4f92ae8d2035fe8cb54f922227e)

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-07-21 07:47:52 +01:00
Stephano Cetola
d4d60218ec systemd: allow add users to groups in rootfs postprocess
Currently the functionality checks for the "u" and "g" flags to create users and
groups, but not the "m" flag to add users to groups. This change first checks to
be sure that the users and groups are created, creates them if necessary, then
adds the user to the group.

(From OE-Core rev: f0a77bee3d092cf79b7e584b943a623eddd6e13d)

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-07-21 07:47:52 +01:00
California Sullivan
031c2f6ced initrdscripts/init-install*: Select install target instead of looping through
Its not immediately apparent that more than one install target could be
available. With this change we list the available devices up front then
prompt the user for which one to use, reducing confusion.

Fixes [YOCTO #9919].

(From OE-Core rev: e68774f684543fd75250e56ea88a5e0cb0a2dd0a)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:52 +01:00
Jose Perez Carranza
8da54b401d oeqa/controllers: Add test target for Systemd-boot
A new test target is neede to test Systemd-boot similar
to gummiboot. Created a copy of GummibootTarget class
and named as SystemdbootTarget, at this point the
gummibootTarget will remain until documentation is
updated with new systed information.

(From OE-Core rev: d1fd3a7dbc363bdc02d810f796b3b810cb13f029)

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:52 +01:00
Mariano Lopez
cd78d8745d oetest.py: Fix problem when there is more than one json file for package extraction
This allow to have more than one test to have json file in order
to install packages in the DUT without using a package manager.

[YOCTO #9926]

(From OE-Core rev: 129c2b4589710aa24e23108f2728f1625b72cb06)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:52 +01:00
Robert Yang
736eab6e73 oe-selftest: print errors when failed to find test
For example:
$ oe-selftest --run-tests-by name hello world
2016-07-12 00:33:28,678 - selftest - ERROR - Failed to find test: hello
2016-07-12 00:33:28,679 - selftest - ERROR - Failed to find test: world

(From OE-Core rev: 665a0f93bde0d61e0c7ceab072ca3f1f22b2f700)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:52 +01:00
Mariano Lopez
e1aa836bb9 lib/oeqa/utils/commands.py: Move updateEnv() from runexported.py
updateEnv() can be used in other places so move the
function to utils/commands.py

(From OE-Core rev: 380e5d80898cac4ffc9715b3f597d0b62a0643ff)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:52 +01:00
Richard Purdie
90436919f8 bitbake: cooker: Fix incorrect dot file generation
In the runqueue cleanup/conversion, "dep" was mistakenly used where "tid" should
be leading to incorrect task-depends.dot files and causing general confusion.
Fix this, its clearly incorrect looking at the code.

(Bitbake rev: 689730dbb068c5ea3593e7b92fe5d5e5c0c3760a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 16:46:12 +01:00
Aníbal Limón
1bf1e2c208 bitbake: toaster-tests: add class SeleniumTestCaseBase for browser tests
In order to reuse the Selenium helper outside a Django
environment (for functional testing), add a new module
containing the base class SeleniumTestCaseBase, which only
inherits unittest.TestCase

Add a class SeleniumTestCase with multiple inheritance of
StaticLiveServerTestCase and SeleniumTestCaseBase to prevent
existing tests from breaking.

(Bitbake rev: 1177b3f368d8b7f8557eb649adb2e327b6df801c)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:38:52 +01:00
Ross Burton
a61eb1f844 intltool: remove broken XML::Parser detection
intltool.m4 has a chunk of code that runs during configure which probes for a
perl binary and verifies that it has the XML::Parser module.  However in builds
using intltool-native the perl binary that it finds is likely to not be the one
that the intltool scripts will be using as the scripts hardcode nativeperl yet
the m4 fragment searches for "perl" in $PATH.  If the host perl doesn't have
XML::Parser the configure will fail, despite the fact that the scripts will
work.

Solve this by taking an old patch from the upstream bug system to simply remove
the check in intltool.m4 as it's generally useless, and remove existing patches
that almost but not quite solved this issue.

(From OE-Core rev: 9900000d404b09a701d5368d529eb515e054e3f0)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:53 +01:00
Ross Burton
ae39c3a0f6 intltool: merge .bb and .inc
There's no use in having these split, so merge them together for clarity.

(From OE-Core rev: bf88f089c3bb8ceef7338436a1688a44399efc57)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:53 +01:00
Ross Burton
bb42984277 oeqa/recipetool: update recipe test to pass SHA
(From OE-Core rev: 71dd4c05c41e8b363dc1ecac1f5105d316ee82dc)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:53 +01:00
Ross Burton
738f47a2d9 oeqa/devtool: update recipe test as libmatchbox changed
(From OE-Core rev: b36712eef14c20007e0adb01cc7d4bce9e7926bb)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:53 +01:00
Jussi Kukkonen
bf69538e54 xf86-input-libinput: Upgrade 0.16.0 -> 0.19.0
Note that the xorg configuration file for input-libinput now sorts
lower than it used to (90 -> 60).

(From OE-Core rev: 9bbdf41999ddf34855af72327d82e1390da97888)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:53 +01:00
Jussi Kukkonen
6c2f073ab9 xf86-input-evdev: Upgrade 2.10.2 -> 2.10.3
(From OE-Core rev: e925641c168082a0b1de43d113dbd0b66ef77814)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:53 +01:00
Jussi Kukkonen
e7d910b761 xkeyboard-config: Upgrade 2.17 -> 2.18
(From OE-Core rev: 7e7048545e4a4b6b52ba63a5043a36d1bc00aefa)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:52 +01:00
Jussi Kukkonen
fded0a03dc libxfixes: Upgrade 5.0.1 -> 5.0.2
(From OE-Core rev: c1bc50445ff92b4b2915af1cf41f5f8b09f4e375)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:52 +01:00
Jussi Kukkonen
a5392dd424 weston: Upgrade 1.10.0 -> 1.11.0
Remove now unnecessary patch, rebase others.
Add musl build fix patch.

(From OE-Core rev: f915e81336a63331bc6e4b920089d1495ae7f63f)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:52 +01:00
Jussi Kukkonen
ddb0de6508 wayland: Upgrade 1.10.0 -> 1.11.0
Add a musl build fix patch.

(From OE-Core rev: 9b3d71ef63b5ebcd6540bbb2668478da87ecc911)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:52 +01:00
Jussi Kukkonen
534cc8612c wayland-protocols: Upgrade 1.3 -> 1.4
Remove backported patch.

(From OE-Core rev: 4c6de7dc96648db134cff85250026e307d0700b0)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:52 +01:00
Jussi Kukkonen
d18a28c09a mesa: Upgrade 11.2.2 -> 12.0.1
Massive mesa upgrade (OpenGL 4.3, GLVND support, vulkan driver
for intel etc), although many new things are disabled by default.

License file change does not change the actual licenses.

piglit results (with piglit update on ML) on an old NUC with Intel
HD5000 for reference:
       pass:   33972
       fail:     306
      crash:       2
       skip:   30857
       warn:       7
      total:   65144

(From OE-Core rev: 6da724dc9cb72e77aa8b1613c3ad71fefc81903f)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:52 +01:00
Jussi Kukkonen
00191b802d mesa-demos: Require X11 distro feature
Mesa-demos theoretically does not require X11 (apart from xdemos/)
but reality is that every other binary requires glut. So:
 * 'non-glut' part of mesa-demos requires X11
 * current freeglut recipe also depends on X11

There is apparently wayland support in freeglut now: This recipe
should be modified when meta-oe freeglut recipe has that feature.

The change became necessary now because mesa no longer mistakenly
installs GL files when X11 is disabled (and mesa-demos configure
currently requires GL).

(From OE-Core rev: d02a3a745fbb7b534f22de861e7a43e7dacc7970)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:52 +01:00
Joshua Lock
4518058942 image: add do_image_qa task to run QA checks on the constructed image
This task runs all functions in IMAGE_QA_COMMANDS after the image
construction has completed in order to validate the resulting image.

Image sanity checks should either be Python functions which raise
bb.build.FuncFailed on failure or shell functions with return a
non-zero exit code.

Python functions may instead raise an oe.utils.ImageQAFailed
Exception which takes an extra argument, a description of the
failure.

   python image_check_python_ok () {
       if True:
           raise bb.build.FuncFailed('This check always fails')
       else:
           bb.note("Nothing to see here")
   }

   image_check_shell_ok () {
       if true
           exit 1
       else
           exit 0
       fi
   }

[YOCTO #9448]

(From OE-Core rev: c9bef2ecf1a30159d11781184829f41844a58c13)

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-07-20 10:28:52 +01:00
Armin Kuster
d1fdd0ad55 python3: Security fix CVE-2016-5636
Affects python3 < 3.5.1
Base Score (4.4) Medium

(From OE-Core rev: a7cbd6805febadaad60d1e05899e10e9a8a36c26)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:52 +01:00
Armin Kuster
81106cd333 python2: Security fix CVE-2016-5636
Affects python2 < 2.7.11
Base score (4.4) Medium

(From OE-Core rev: 4d1f651047a045955b436357753c7e094468b4ed)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:52 +01:00
Armin Kuster
3aaf023202 bzip2: Security fix CVE-2016-3189
Affects bzip2 <= 1.0.6
CVSS v2 Base Score: 4.3 MEDIUM

(From OE-Core rev: 979c61e47d416b940ca53e22acffdacb2625cf89)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:52 +01:00
Armin Kuster
c0dbed63c6 openssl: Security fix CVE-2016-2178
affects  openssl <=  1.0.2h
CVSS v2 Base Score: 2.1 LOW

(From OE-Core rev: 5b3df0c5e8885ea34f66b41fcf209a9960fbbf5e)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:51 +01:00
Armin Kuster
03f6074ad4 openssl: Security fix CVE-2016-2177
Affects openssl <= 1.0.2h
CVSS v2 Base Score: 7.5 HIGH

(From OE-Core rev: 2848c7d3e454cbc84cba9183f23ccdf3e9200ec9)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:51 +01:00
Robert Yang
61577c5e4c xmlto: only target requires coreutils
The coreutils added to RDEPENDS was for tail command which is everywhere
on the build host, so only add it to target. There was a side effect if
coreutils-native was build, when its commands install to sysroots, they
would be removed during rebuild, and cause other recipes fail to build:

/path/to/tmp/sysroots/x86_64-linux/usr/bin/mkdir -p lib/sys
make: /path/to/tmp/sysroots/x86_64-linux/usr/bin/mkdir: Command not found

(From OE-Core rev: 4a0e3ca3733e2b6f3f20065421dbb9da2058014c)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:51 +01:00
Khem Raj
f74ddc6df4 piglit: Fix build on musl/arm
(From OE-Core rev: 336c1caeb86996cd316256ad15f392b9597ae414)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:51 +01:00
Robert Yang
dbf53c9f42 xuser-account: remove GROUPADD_PARAM
The group shutdown had been provided by base-passwd, otherwise, it may cause
sysvinit failed to build:

$ bitbake xuser-account sysvinit && bitbake xuser-account sysvinit -ccleansstate && bitbake sysvinit
[snip]
| chown: invalid user: root.shutdown
[snip]

(From OE-Core rev: d72793ca3cbedca3eaca2a7c62f4c93d3c3af358)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:51 +01:00
Felipe F. Tonello
e24bc6d9f2 recipes-graphics: Added native and nativesdk support for some libraries
These libraries are used in some recipes outside oe-core, so we should add
this class support to avoid duplication and bbappends on other layers.

(From OE-Core rev: 2db2724c4386fc07bd667060eb12b479747e0d35)

Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:51 +01:00
Robert Yang
69dfc58449 tcl: fix sed command in do_install
The -I= and -L= is used for cross compile, target doesn't need, and
binconfig.class can handle usr/bin/crossscripts/tclConfig.sh.

Fix do_configure error for the recipe which uses tclConfig.sh, for
example, postgresql.do_configure:
configure: error: header file <tcl.h> is required for Tcl

(From OE-Core rev: c6f24481b2fc965eeebca5508d68f1b9e5b3f212)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:51 +01:00
André Draszik
bffb0fbfcc oe-git-proxy: don't depend on syslinux
gethostip comes from syslinux. It seems odd to depend on a bootloader
to clone a git repository.

Switch to using getent from the c-library, which should be available
on every system.

We now also support the case where a hostname resolves to more than
one IP address.

(From OE-Core rev: c91dbf3ca2faec95195c85b65aa6cab7de9bca2c)

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:51 +01:00
Chen Qi
dd0474c7e8 sysstat: upgrade to 11.3.5
(From OE-Core rev: 3434f3cfe40d140fec2660d24508eeeaec4f66a8)

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>
2016-07-20 10:28:51 +01:00
Chen Qi
db0c499101 sudo: upgrade to 1.8.17p1
(From OE-Core rev: 0564ab21fe403dd3e43240f7cfad619a356cee06)

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>
2016-07-20 10:28:51 +01:00
Chen Qi
35c9e2a3ea cups: upgrade to 2.1.4
(From OE-Core rev: 2524b8380f8c701dc173d81e39cda833e21e7003)

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>
2016-07-20 10:28:51 +01:00
Chen Qi
1854732804 byacc: upgrade to 20160606
(From OE-Core rev: 4cd2db8850c76a842d6a4e85eddd1bf66dd56a6b)

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>
2016-07-20 10:28:51 +01:00
Chen Qi
e53630ee3a at: upgrade to 3.1.20
configure-fix-with-without-selinux.patch is removed as it has been merged.

(From OE-Core rev: c28379fbe62b75a3156bef4d9191fc69155a6297)

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>
2016-07-20 10:28:50 +01:00
Jussi Kukkonen
096b4c639b libxsettings-client: Remove as unneeded
xsettings-client is not meant to be a shared library and the only
user in oe-core (libmatchbox) now has an in-tree copy.

(From OE-Core rev: ed5cbf977dca8f3d85c8d933071c6e49fb4bd95f)

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-07-20 10:28:50 +01:00
Jussi Kukkonen
49d3d7da29 libmatchbox: Upgrade 1.11 -> 1.12
libmatchbox now has a in-tree xsettings-client.

* Use git SRC_URI like the other matchbox components.
* Remove upstreamed patch.
* Update license info (xsettings code is MIT).
* Stop depending on libxsettings-client

(From OE-Core rev: f28b0359c9e993233d5985e27152dc5cb4fbfd13)

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-07-20 10:28:50 +01:00
Jussi Kukkonen
b1d573bdc8 matchbox-keyboard: Upgrade to 0.1.1
(From OE-Core rev: 9b4783572db0a7f4462c1ca6a7e6b95c319f3d19)

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-07-20 10:28:50 +01:00
Jussi Kukkonen
16fa164d15 sato-screenshot: Upgrade 0.2 -> 0.3
(From OE-Core rev: e9ff03c4af75914b9abb5c5237e6a08aa631d332)

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-07-20 10:28:50 +01:00
Jussi Kukkonen
8bf2692b1b matchbox-panel-2: Upgrade 2.10 -> 2.11
New release finishes the port from buggy ScalingImage to
ScalingImage2.

(From OE-Core rev: cb476bac7306f45c14d5c6c4c5d8351e5582ee40)

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-07-20 10:28:50 +01:00
Maxin B. John
548401503d libpng: update to 1.6.23
1.6.22 -> 1.6.23

License files changes are due to updates in Copyright date and Version

(From OE-Core rev: 83a43b1bd124b6306e0f852ad3961f4672fbc7dd)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:50 +01:00
Maxin B. John
11f23ecee8 linux-firmware: update to revision cccb6a0da9
Upgrade to revision cccb6a0da9

(From OE-Core rev: 418a0ebb318b32068a26addc4846e9c3aa2a044d)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:50 +01:00
Khem Raj
5813d4053e nss: Fix build on mips/clang
This issue is also reported here
https://trac.macports.org/ticket/51709
Patch is also from same ticket

(From OE-Core rev: 119ff60101ed6fd542f1280d37a24411d8b14264)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:50 +01:00
Ed Bartosh
05084640e6 wic: oe-selftest: build bmap-tools-native
bmap-tools-native is required to generate .bmap file. Without it
wic fails with this error when run with --bmap option:
    Error: A native program bmaptool required to build
           the image was not found

Added bmap-tools-native to the list of requirements to build
in Wic.setUpLocal method.

(From OE-Core rev: dd11ab551f9bf1d8761d0430f19510a9caa53a12)

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-07-20 10:28:50 +01:00
Khem Raj
ed319ff401 musl: Fix mips regressions in 1.1.15
Bobby Bingham (2):
      remove or1k version of sem.h
      remove obsolete gitignore rules

Rich Felker (4):
      remove obsolete and unused gethostbyaddr implementation
      fix asctime day/month names not to vary by locale
      fix regression in tcsetattr on all mips archs
      revert unrelated change that slipped into last commit

(From OE-Core rev: 681b75cb7c1ad88774d611119c9a7f6d076ff2c5)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:50 +01:00
Ross Burton
bb915a1492 binutils: backport fix for TLSDESC relocations with no TLS segment on arch64
As exposed by WebKit on aarch64 hosts, which causes binutils to throw an
internal error.

[ YOCTO #9509 ]

(From OE-Core rev: b31294e4f34dfb530c40526ab56c07aedb76e31b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:49 +01:00
Ross Burton
4fdfee4a78 classes/license.bbclass: don't set [dirs] and [cleandirs]
There's no need to set these as the restore from sstate will create the
directories as required.

(From OE-Core rev: 3ab3ebc06d22f0776091e39237235ea50c4503b2)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:49 +01:00
Ross Burton
6494a59552 glibc: use the host locale archive in nativesdk builds
The nativesdk libc when used by buildtools has a hard requirement on supporting
a UTF-8 locale because Python 3 needs a UTF-8 locale.  However we currently only
ship the C locale, which means that Python attempts to lookup the user's locale
(for example, en_NZ.UTF-8) in the locale archive under it's prefix it fails and
falls back to C.  This the results in Python using ASCII instead of UTF-8 for
file encoding, and bitbake breaks.

Th obvious solution would be to ship all locales, but this would add
approximately 250MB to the size of the buildtools tarball (which is currently
around 30MB).  Generating a binary locale archive reduces this down to 100MB,
but this is still a drastic increase in footprint.  If we ship a subset of
locales in the tarball then there will be users whose locale isn't in the
tarball, and they'll have to change their locale to an "approved" one, which
isn't the best of messages to send to new users.

The alternative is to tell the nativesdk libc that the locale archive isn't
under it own prefix but is in fact at /usr/lib/locale/locale-archive, so the
buildtools libc uses the host locale archive. The locale archive format appears
to be at least fairly stable: our glibc 2.24 can read the locale archive
generated by glibc 2.17 (Centos 7).

[ YOCTO #9775 ]

(From OE-Core rev: 75321b6b0f2c0ac667b9350b387b01a188e195c8)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:49 +01:00
Kai Kang
604778091e perl: fix CVE-2016-2381
Backport patch to fix CVE-2016-2381 from perl upstream:

http://perl5.git.perl.org/perl.git/commitdiff/ae37b791a73a9e78dedb89fb2429d2628cf58076

(From OE-Core rev: 07ca8a0131f43e9cc2f720e1cdbcb7ba7c074886)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:49 +01:00
Alejandro del Castillo
ac0910efcc opkg: upgrade to v0.3.3
Bug fix release to address two regressions:

*  Fix build breakage when using configure option --enable-sha256
*  Do not remove packages if removal operation is not valid due to
   installed dependents

(From OE-Core rev: 9219e87c6add5bcc95ac00a019a6c24083846f50)

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:49 +01:00
Paul Eggleton
d62fd7711d devtool: add finish subcommand
Add a subcommand which will "finish" the work on a recipe. This is
effectively the same as update-recipe followed by reset, except that the
destination layer is required and it will do the right thing depending
on the situation - if the recipe file itself is in the workspace (e.g.
as a result of devtool add), the recipe file and any associated files
will be moved to the destination layer; or if the destination layer is
the one containing the original recipe, the recipe will be overwritten;
otherwise a bbappend will be created to apply the changes. In all cases
the layer path can be loosely specified - it could be a layer name, or
a partial path into a recipe. In the case of upgrades, devtool finish
will also take care of deleting the old recipe.

This avoids the user having to figure out the correct actions when
they're done - they just do "devtool finish recipename layername" and
it saves their work and then removes the recipe from the workspace.

Addresses [YOCTO #8594].

(From OE-Core rev: fa550fcb9333d59b28fc0e4aebde888831410f5c)

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-07-20 10:28:49 +01:00
Paul Eggleton
10a5af5eb4 devtool: upgrade: record original recipe files
This provides us with the information we need to remove the original
version recipe and associated files when running "devtool finish" after
"devtool upgrade".

(From OE-Core rev: 92eb42c347af919cd9f8739515fdf806c12b5ba8)

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-07-20 10:28:49 +01:00
Paul Eggleton
7af3295b0b devtool: update-recipe: refactor to allow calling separately
This will be called by "devtool finish" to allow it to update the recipe
or create the bbappend depending on the destination.

(From OE-Core rev: 5067cdc73483b53d46d9bf584723e41957c7ec54)

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-07-20 10:28:49 +01:00
Paul Eggleton
5d78525a2d devtool: reset: refactor to allow calling separately
This will be called by "devtool finish" to allow it to reset the recipe
at the end.

(From OE-Core rev: b8d398516556eaf97679e28ad58448f570984b52)

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-07-20 10:28:49 +01:00
Paul Eggleton
7435cdf750 lib/oe/recipeutils: fix a few issues in find_layerdir()
* Allow the function to be called with the base layer path (in which
  case it will just return the same path)
* Ensure that the function doesn't recurse indefinitely if it's called
  on a file that's not inside a layer
* Correct the doc comment for accuracy

(From OE-Core rev: 912026d85c2f535be2f60c45979162ea25c7f356)

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-07-20 10:28:49 +01:00
Paul Eggleton
c4297f3e22 devtool: update-recipe: don't copy local files that haven't changed
If there are files in the oe-local-files directory which are identical
to the original version, then we shouldn't be copying them to the
destination layer. This is particularly important when using the -a
option to create a bbappend.

(From OE-Core rev: 9230bfcc839eb35630949f0a8ed058ca1fa944b1)

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-07-20 10:28:49 +01:00
Paul Eggleton
8be2077a38 devtool: update-recipe: find and use existing files directories
devtool update-recipe was defaulting to the ${BPN} named directory when
adding patches next to a recipe, but that meant if you already had files
in a ${BP} named directory (i.e. name and version) or "files" then you'd
end up with two directories next to the recipe, which is usually not
what you want. To avoid this, look through FILESPATH and take the first
one that's the same level or one level down from the recipe and already
exists, if any.

(From OE-Core rev: c7a8190cf8bdf86ba850b6780b8e951e90232c06)

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-07-20 10:28:49 +01:00
Ross Burton
220a68bfc2 bash: fix string format errors when enabling security flags
If security_flags.inc is included then bash 3.2.48 fails to build:

| ../bash-3.2.48/print_cmd.c:1152:3: error: format not a string literal and no format arguments [-Werror=format-security]
|    cprintf (indentation_string);

Backport a patch from upstream to solve this.

(From OE-Core rev: 293d90d757d0d1e292c90cb0e9c576faf911ffcc)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:48 +01:00
Ross Burton
2184694a17 bash: ensure LDFLAGS is passed when building ptest
(From OE-Core rev: 71794837b477a78e2f5408348e269f58f9b1ec7e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:48 +01:00
Jussi Kukkonen
d713c48a35 libevdev: Upgrade 1.5.1 -> 1.5.2
(From OE-Core rev: 8dd7655211adff5731f0e8f187fad35d9e09862a)

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-07-20 10:28:48 +01:00
Jussi Kukkonen
b66059b1a9 librsvg: Upgrade 2.40.15 -> 2.40.16
(From OE-Core rev: 21cd050707a276b93736f0d28f849bfb31efb562)

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-07-20 10:28:48 +01:00
Jussi Kukkonen
c12458403b libgpg-error: Upgrade 1.22 -> 1.23
(From OE-Core rev: 7b60c4b7414600e16ff4ffa5ed0f999fa5e66100)

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-07-20 10:28:48 +01:00
Jussi Kukkonen
54d500947d freetype: Upgrade 2.6.3 -> 2.6.5
A new supposedly superior subpixel hinting mode was added and made
default in 2.6.4 but 2.6.5 reverts the default to "no hinting".

License checksum changes because of a copyright symbol change.

(From OE-Core rev: 1494f9163ee4f866f9ccb6347038bf3ec205dfe3)

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-07-20 10:28:48 +01:00
Jussi Kukkonen
0a98691289 fontconfig: Upgrade 2.11.95 -> 2.12.0
License unchanged, just moved by a few lines.

(From OE-Core rev: 10bbf6ac62803eb625ccba8b3225d818707120ec)

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-07-20 10:28:48 +01:00
Jussi Kukkonen
3eaf1accb3 cairo: Remove unnecessary UPSTREAM_CHECK_REGEX
This overwrites the regex set by upstream-version-is-even.bbclass.

(From OE-Core rev: 6660b9958aea5e71e992dcc238b6d84667513d2e)

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-07-20 10:28:48 +01:00
Jussi Kukkonen
b3e40449e2 expat: Upgrade 2.1.1 -> 2.2.0
Remove a patch that is no longer needed.
License checksum changes because of a copyright year change.

(From OE-Core rev: 911510181ac933d5d1fc7d88890eb67d5d338acf)

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-07-20 10:28:48 +01:00
Ross Burton
5d5efbc665 packagegroup-core-tools-testapps: remove Piglit temporarily
(From OE-Core rev: 9e227ecb3a994133cf9b85d6dd424afe85edfbaf)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:48 +01:00
Jussi Kukkonen
c3753a8b18 piglit: Upgrade version, use python3
* Remove backported patch
* Update dependencies to use python3 modules, add depencies added
  in the new version
* Install only stripped binaries to keep size down
* Fix bash-completion install location

(From OE-Core rev: f7193a306cfc3ac0a3fdcf891716a59f5b8178e8)

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-07-20 10:28:48 +01:00
Ross Burton
b384b724ec oe/lib/package: handle shlibs files disappearing
During a parallel build it's possible for unrelated shlib files to be removed if
the recipe they came from is about to be rebuilt.  They can't be involved in the
dependency chains as otherwise they wouldn't be removed, so just silently handle
files disappearing.

[ YOCTO #8555 ]

(From OE-Core rev: 1e355da3fda742c78d99ddd2ee5caa9df52f92e1)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:47 +01:00
Ross Burton
72becf96c9 bitbake.conf: use ${prefix} to define exec_prefix
This was simply changing prefix will relocate everything which is generally the
intention, whilst still allowing the variables to be set independently.

(From OE-Core rev: 2676ee77bacde03e75c2ceccfdc4c28a684569e6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:47 +01:00
Aníbal Limón
ad6aaae4bf utils/qemurunner.py: QemuRunner.start() add support for specify extra kernel cmdline
Add ability to specify extra_bootargs (kernel cmdline) in order to enable systemd
debug log in images that enables systemd init.

[YOCTO #9299]

(From OE-Core rev: 09d62551c289b5607341a4f9c46eecd6390ad774)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:47 +01:00
Khem Raj
e558b50afc site: Move rsync_cv_HAVE_C99_VSNPRINTF to common-linux
If we do not cache is then configure in distcc will try
to compute it using AC_TRY_RUN which will give some result
on x86-64 host when target is x86-64 but it generally is wrong
for cross compilation. We therefore cache it for all linux
targets.

This issue is highlighted by clang when compiling distcc
where it figures that its cross compiling and therefore triggers
it to include its own implementation of snprintf() which does
not go well with clang, gcc compiles it fine thats why we
never saw the problem thus far.

(From OE-Core rev: e940dfcb5ad4017e5fe616c583253439603656db)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:47 +01:00
Khem Raj
17dcf19d86 nss: Fix build with clang
Add a patch to disable a clang specific warning
and avoid passing clang options to gcc when we have
cross compiler is clang but host compiler is gcc
We do not need to use target cflags when building
native pieces and hence avoid the inter-mixing of
compiler options

(From OE-Core rev: d13640f39f8f467597daa42774102329e82d9b68)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:47 +01:00
Jussi Kukkonen
317447f1d1 python-six: Add to oe-core
Recipes are moved from meta-openembedded/meta-python

Changes compared to meta-python version:
* Modified to not inherit pypi
* Fix python-io dependency for python3
* Support native, nativesdk
* Do not install .egg

(From OE-Core rev: 9979e35ffb0dfb20d8aaffa8e2ec5e33f27fc009)

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-07-20 10:28:47 +01:00
Derek Straka
89eab25990 python3: update manifest RDEPENDS for importlib and compression packages
zipfile.py has dependencies on importlib, threading, and shell
importlib has a dependency on lang
operator and contextlib added to the lang package instead of falling into misc

(From OE-Core rev: 769ad8e114fda1fe112d3747408edbeb7b066a85)

Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:47 +01:00
Khem Raj
4a5de974e7 db: Use cross libtool
Reintroduce the use of cross-libtool when building the target package
this fails otherwise with clang

| ./libtool --mode=execute true db_printlog
| /usr/lib/libstdc++.so: file not recognized: File format not recognized
| clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)

(From OE-Core rev: f9fab69a15a71f541f93fb38319de03ad07b1bf5)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:47 +01:00
Patrick Ohly
15ba3c1a96 initramfs-framework: make rootfs module optional
It still gets installed by default via RRECOMMENDS without having to update
users of the framework (because without it, the framework is incomplete),
but that recommendation can be overridden on a per-image basis.

(From OE-Core rev: 73bfaa0e57a3b6c8779ba716c1e38fcbee734947)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:47 +01:00
Robert Yang
7eaf3056c8 testimage.bbclass: INHERIT -> IMAGE_CLASSES
Use IMAGE_CLASSES which is only seen by image recipe.

(From OE-Core rev: 7be8f1a9dad4512c3a979ad744e223edb38fccc6)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:47 +01:00
Maciej Borzecki
45743114c8 wic: mountpoint is an optional argument
According to wic documentation partition mount point is an optional
argument. Skipping mount point also makes sense in certain
configurations when one needs to specify a partition that is not mounted
by the running system, such as a recovery or a mirror partition (in dual
rootfs setups).

(From OE-Core rev: 5e063a4c6bb0e0623a4d25bb2bf6eecd9ad6b9f1)

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-07-20 10:28:47 +01:00
Ross Burton
65a0c27483 report-error: replace build paths with markers not whitespace
To remove potentially personal information and reduce irrelevant noise when
searching for similar reports the error reporting class removes ${TOPDIR} from
the logs.  Whilst this is valid intention, the replacement of ' ' results in
potentially confusing logs as it appears that builds are happening in /tmp, or
whitespace can appear in places where it isn't allowed which can look like a
bug.

Solve both of these by replacing the value of TOPDIR with the literal string
TOPDIR.

Also replace TMPDIR after TOPDIR, as it's not uncommon to have TMPDIR somewhere
other than directly under TOPDIR.

(From OE-Core rev: 95794e261628f83ddab0aa7b8bafb6409cc9deb5)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:46 +01:00
Ross Burton
3ad542a85a rpm: remove CVS-based recipe
This recipe doesn't really get used or maintained, and as the sole recipe in
oe-core that uses the CVS fetcher it's removal means we don't need to list CVS
as a host dependency.

(From OE-Core rev: 0cb5c06ea12c9070f19045cc82fc6276bfad3970)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:46 +01:00
Alexander Kanavin
d291ca3040 recipes-sato: fix upstream version check
(From OE-Core rev: 15390ec8600055964642c87aadb94e8457c3e1b6)

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>
2016-07-20 10:28:46 +01:00
Alexander Kanavin
470558f77e python-numpy: fix upstream version check
(From OE-Core rev: 4d564091b9f24767e36d7b635cce7c5ba9c61ae3)

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>
2016-07-20 10:28:46 +01:00
Alexander Kanavin
447d715e26 python-scons: fix upstream version check
(From OE-Core rev: 2717af4cb74ddb96aa973a526f368c13923284c1)

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>
2016-07-20 10:28:46 +01:00
Alexander Kanavin
652cacc1d8 epiphany: update to 3.20.3
(From OE-Core rev: b6d14f1fd328f349015489e1b9643fc4c07d2290)

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>
2016-07-20 10:28:46 +01:00
Alexander Kanavin
441a1fc6eb libwnck3: upgrade to 3.20.1
(From OE-Core rev: a5debef1205117846506b014245155c1f1be5b07)

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>
2016-07-20 10:28:46 +01:00
Alexander Kanavin
15901eb07b desktop-file-utils-native: update to 0.23
(From OE-Core rev: d155f9b82ef5d2af956ef6b6caab587f6d977779)

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>
2016-07-20 10:28:46 +01:00
Alexander Kanavin
f4cd97c30d bash-completion: update to 2.3
Drop files that are no longer present upstream.
Package cmake modules.

(From OE-Core rev: d0cb76159669810574dfdf15a42650cd47234a89)

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>
2016-07-20 10:28:46 +01:00
Jianxun Zhang
4c9b1a472f wic: clone gummiboot wks for systemd-boot
This wks is just a copy of gummiboot wks with bootloader
changed to systemd-boot. A very basic boot test on a X86
target is done with a direct-boot image generated by:

wic create mksystemd-bootdisk -e core-image-minimal

Because we plan to replace gummiboot with systemd-boot at any
time in the future, we summarize history (as much as I can) of
the current gummiboot wks before it's gone:

-----------------------------------------------------------------
commit 7d4bb40905
Author: Ed Bartosh <ed.bartosh@linux.intel.com>
Date:   Wed Sep 2 13:58:02 2015 +0300

    wic: get rid of scripts/lib/image

    Moved content of scripts/lib/image/ to scripts/lib/wic as
    one directory with the same name as a tool is self-explanatory
    and less confusing than two.

    (From OE-Core rev: 5dc02d572794298b3362378cea3d7da654456c44)

    Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

commit 77561e7191
Author: Ed Bartosh <ed.bartosh@linux.intel.com>
Date:   Wed Sep 2 13:58:01 2015 +0300

    wic: use ext4 in canned .wks files

    Latest kernel doesn't have ext3 compiled in. Wic images produced
    from canned .wks can't boot because of that. Switching to ext4
    fixes this issue.

    (From OE-Core rev: d281a65a81f369fc8d75023b8f911ce4106969c1)

    Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

commit 072657ce98
Author: Tom Zanussi <tom.zanussi@linux.intel.com>
Date:   Mon Aug 11 20:35:41 2014 -0500

    wic: Add mkgummidisk kickstart file

    This is the same as mkefidisk but uses gummiboot instead of grub-efi.

    (From OE-Core rev: 5979409ebfab0bb07b3c2b2fcf14a722c441f07b)

    Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-----------------------------------------------------------------

(From OE-Core rev: 546cd8352b8adce074831ec31cfa3bb2bf2f0084)

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-07-20 10:28:46 +01:00
Jianxun Zhang
3091a8c58a wic: add systemd-boot option in EFI boot image plugin
The new systemd-boot enabled in OE is the old gummiboot
merged into systemd project. Our intention is to replace
gummiboot with systemd-boot in OE once every feature based
on gummiboot is supported with systemd-boot.

Before we can purge gummiboot, we temporarily keep both of
the two bootloaders supported.

Patch doesn't do replacement for every "gummi" occurrence.
We think cleaning can be done in background after we disable
people to use gummiboot, so we just keep change small and
safe this time.

(From OE-Core rev: daa5f8b886408eb6a17898b18ac97d5a0d76d2cc)

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-07-20 10:28:46 +01:00
Christopher Larson
a98a818086 gcc-cross: default linker hash style to sysv
We explicitly set the hash style to gnu in our LDFLAGS. Setting the default to
this in the toolchain, while convenient, actually hides bugs, as a failure to
obey LDFLAGS isn't noticed. By removing this, it's not dissimilar to how we
poison the sysroot -- rather than relying on the default, notice right away if
somoeone isn't obeying the needed flags.

This will result in a failure to obey LDFLAGS causing a GNU_HASH QA failure,
which is what's often seen with external toolchains. This brings us all on the
same page, and makes sure a failure to obey LDFLAGS is seen early.

This is limited to cross, to retain ease of use for SDKs.

(From OE-Core rev: fa436aeb3242cbfdbbe16d448d45bce8eb5b74fd)

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-07-20 10:28:46 +01:00
Yuqing Zhu
648fd334da gstreamer1.0-plugins-bad: Fix little rectangel appears at the center when use squeeze and tunnel effects
(From OE-Core rev: 061990f9aa97f2dac88e473b9852aed6f3f00f32)

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:45 +01:00
Yuqing Zhu
c62fd75866 gstreamer1.0-plugins-bad: Use the newer texture() function in glcolorconvert
GLES3 deprecates texture2D() and it does not work at all
in newer versions than 3.3. The new function can fix it.

(From OE-Core rev: dc1859a1dda854b1302d046713a3bd15e99c3f5b)

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:45 +01:00
Yuqing Zhu
a933b784ec gstreamer1.0-plugins-bad: Add glBindFragDataLocation in glshader
There are some cases where it's needed for
binding in/out variables in shaders.

(From OE-Core rev: 2ddbc4fac1d5e84428c503b48e5015ac506a962f)

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:45 +01:00
Yuqing Zhu
352acc90c4 gstreamer1.0-plugins-bad: Don't use the predefined variable name in glcolorconvert
Using 'sample' as a variable name is an error in GLES3.

(From OE-Core rev: bf58344101de5cbdfb54534b028aad2112863033)

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:45 +01:00
Yuqing Zhu
365fdce1ed gstreamer1.0-plugins-bad: Implement multiple render targets for GLES3
There are numerous slight differences required between Desktop GL and GLES3 for
multiple render targets. Need to realize it.

(From OE-Core rev: 11618110c2e17d6018ad5ec71ec0f357e900034d)

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:45 +01:00
Yuqing Zhu
e1eca35850 gstreamer1.0-plugins-bad: Enable gldeinterlace on OpenGL ES
Enable gldeinterlace on OpenGL ES to improve performance.

(From OE-Core rev: 0b6c21fd4e4094c0462a4dd4b29f56cdc6e7a769)

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:45 +01:00
Chen Qi
b0d66a77c7 gettext_0.16.1: remove useless files to avoid sysroot conflicts
Do as the 0.19.6 version do, remove these files to avoid sysroot conflicts
with gettext-native-minimal.

[YOCTO #9890]

(From OE-Core rev: 65eb9b78e9e57a12db4f0053e35ad555a4c33029)

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>
2016-07-20 10:28:45 +01:00
Robert Yang
f583dad244 git: 2.8.4 -> 2.9.0
(From OE-Core rev: 005c8d1a3bdb109ff52397219e63e4c385c2b974)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:45 +01:00
Ed Bartosh
6ac1f9038d sstate.bbclass: make PV to depend on PV variable value
Currently PV is defined in meta/conf/bitbake.conf as a python
expression: "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE',
False),d)[1] or '1.0'}". As FILE is whitelisted it causes PV to
not depend on it. This causes sstate code to not detect that
PV changes when recipe filename changes.

Making PV to explicitly depend on PV variable value overrides default
behaviour. Instead of depending on python expression bitbake depends
on evaluated value of PV variable, which should fix the above
mentioned issue.

[YOCTO #9806]

(From OE-Core rev: 918646ca803d56004fb0ab7c21e86cc9cb14513d)

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-07-20 10:28:45 +01:00
Khem Raj
5c545caef8 v86d: Accept aarch64 as build host
(From OE-Core rev: 709c603dec19690bcf21034867b815b5679b921a)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:45 +01:00
Khem Raj
54fd9afef7 libunwind: Port to ppc/musl
(From OE-Core rev: da2a5e01156482c4c341c5983425d93ee8f02821)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:45 +01:00
Khem Raj
d2296eaa9e webkitgtk: Fix build on ppc with musl
(From OE-Core rev: b9659af922b336e6d41c1dd0aa0f13e6975cff7b)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:44 +01:00
Khem Raj
fa0b782be8 python{3}-numpy: Predefine of sizeof off_t on mips/mipsel/ppc
Fixes below errors as seen on musl

| In file included from numpy/core/include/numpy/ndarraytypes.h:4:0,
|                  from numpy/core/include/numpy/ndarrayobject.h:18,
|                  from numpy/core/include/numpy/arrayobject.h:4,
|                  from numpy/core/src/multiarray/compiled_base.c:7:
| numpy/core/include/numpy/npy_common.h:167:10: error: #error Unsupported size for type off_t
|          #error Unsupported size for type off_t
|           ^~~~~
| In file included from numpy/core/include/numpy/ndarraytypes.h:4:0,
|                  from numpy/core/include/numpy/ndarrayobject.h:18,
|                  from numpy/core/include/numpy/arrayobject.h:4,
|                  from numpy/core/src/multiarray/compiled_base.c:7:
| numpy/core/include/numpy/npy_common.h:167:10: error: #error Unsupported size for type off_t
|          #error Unsupported size for type off_t
|           ^~~~~

(From OE-Core rev: 6d8cc72e7f83b9819ff1bbdb72ca61f98de403a4)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:44 +01:00
Aníbal Limón
d55b7650d3 linux-yocto: Enable debug/printk.scc KERNEL_FEATURE on qemuall machines.
We are experimenting some issues in the Autobuilder infraestructure
possible due to high I/O loads, in order to provide more information
about intervals of times in printk enable by default debug/printk.scc
on qemu development images.

[YOCTO #9299]

(From OE-Core rev: dfa8be08aa6e7ad6dbc615df8875dc2ac1ac8946)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:44 +01:00
Tom Hochstein
e833508075 nativesdk-packagegroup-sdk-host: Add wayland-scanner to the SDK native toolchain
The build tool wayland-scanner was missing from the native toolchain
of the Yocto Project SDK build.

(From OE-Core rev: 6305923412d839f23e81025b6547bcd3e4e711cc)

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:44 +01:00
Maxin B. John
9045e21b7f neard: upgrade to 0.16
0.15 -> 0.16

(From OE-Core rev: a6c88ff6c22a832762d3357967e885064feb577b)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:44 +01:00
Joe Slater
01a3261b59 libidn: add license per package
The idn package is GPLv3 and the rest is LGPLv2.1+ or LGPLv3.

(From OE-Core rev: 518b1891e4dcbd710724ad3473105efbc25a2ed1)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:44 +01:00
Christopher Larson
42e870c5ed image_types.bbclass: support template .wks.in files for wic
These files are treated as the contents of a bitbake variable, so usual
bitbake variable references are supported. I considered using another
templating mechanism, for example the one used by yocto-layer, but then we'd
end up largely mapping metadata variables to template fields anyway, which is
a pointless indirection. Let bitbake expand the variables directly instead.

This feature lets us, for example, reference ${APPEND} in --append, and avoid
hardcoding the serial console tty in the wks file, and let the user's changes
to APPEND affect wic the way they do the other image construction mechanisms.

The template is read in and set in a variable at parse time, so changes to the
variables referenced by the template will result in rebuilding the image.

(From OE-Core rev: 51cb21fe5f050874d52f5b05a8a1de79ea4ebf2f)

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-07-20 10:28:44 +01:00
Christopher Larson
be90c3ec5c image_types.bbclass: add intermediate var for WKS_FILE_CHECKSUM
This is a bit nicer to work with, and easier to override.

(From OE-Core rev: 44f1d3cc613563b8d5be61a2648d0cd336fea728)

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-07-20 10:28:44 +01:00
Ross Burton
8cc2f2c65a Revert "core-image-sato: add gtk+ for M1"
We added gtk+ to core-image-sato for M1 solely because the SDK self test was
building an application (sudoku) that links to GTK+ 2.

Now that sukoku has been replaced with galculator this workaround can be
removed.

This reverts commit 282d5f7f85.

(From OE-Core rev: aaccc1109fbdda72ffc5b5e66177d00b365d267b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:44 +01:00
Ross Burton
38d2c59ab8 remove sukoku
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:44 +01:00
Ross Burton
ad0cfdbf7d testimage: swap sudoku for galculator
Also delete the removal of suduko for qemumips, as galculator builds fine on
that hardware now.

(From OE-Core rev: 4a81b3f669073455c9b2ee1514c43b96df9f7faa)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:44 +01:00
Ross Burton
9c4b143607 oeqa/sdk: remove buildsudoku test
This application needs GTK+ 2 which we're trying to move away from for Sato
images.

(From OE-Core rev: 5e52f208a17e7122209675fa96de6e7807c62feb)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:44 +01:00
Bruce Ashfield
0b61f87cda linux-yocto/4.1: pinctrl backports
Integrating the following mainline commits:

  pinctrl: make pinctrl_register() return proper error code
  pinctrl: Remove .owner field
  pinctrl: mediatek: add pinctrl/GPIO/EINT driver for mt8127
  pinctrl: mediatek: Add Pinctrl/GPIO driver for mt6397.
  pinctrl: add imx7d support
  pinctrl: sirf: add sirf atlas7 pinctrl and gpio support
  pinctrl: Add Pistachio SoC pin control driver
  pinctrl: lpc18xx: add the missing group function map
  pinctrl: lpc18xx: create pin cap lookup helper
  pinctrl: add lpc18xx pinctrl driver

(From OE-Core rev: 58c43f62700610fbaf2989f55d87ba9212f4361f)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:43 +01:00
Bruce Ashfield
200fcba58e linux-yocto: powerclamp and gpio configuration changes
Integrating the following commits to tweak the default configuration
for powerclamp and gpio:

   features/thermal: make INTEL_POWERCLAMP driver built as module
   gpio: disable Intel PMIC gpio

(From OE-Core rev: b5541c3db22fbe8b4e0389b5937cbb5ae0284f00)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:43 +01:00
Bruce Ashfield
8a4fb05315 linux-yocto/4.4: pwm and mei updates
Backporting upstream mei changes, and two pwm changes from
Mika Westerberg's pwm-4.4 branch:

  pwm: lpss: Prevent on_time_div overflow on lower frequencies
  pwm: lpss: fix base_unit calculation for PWM frequency
  mei: don't use wake_up_interruptible for wr_ctrl
  mei: fix waiting for wr_ctrl for corner cases.
  mei: don't clean control queues on notify request timeout
  mei: drop global me_client_index
  mei: do not pin module if cldrv->probe() failed
  mei: bus: use scnprintf in *_show
  mei: fix format string in debug prints
  mei: fix double freeing of a cb during link reset
  mei: wd: drop AGAIN the watchdog code from the core mei driver
  mei: split amthif client init from end of clients enumeration
  mei: hbm: send immediate reply flag in enum request
  mei: bus: run rescan on me_clients list change
  mei: drop reserved host client ids
  mei: hbm: warn about fw-initiated disconnect
  mei: fixed address clients for the new platforms
  mei: fill file pointer in read cb for fixed address client
  mei: discard replies from unconnected fixed address clients
  mei: clean write queues and wake waiters on disconnect
  mei: wake blocked write on link reset
  mei: drop superfluous closing bracket from write traces
  mei: bus: fix notification event delivery
  mei: bus: fix RX event scheduling
  mei: amthif: interrupt reader on link reset
  mei: amthif: use rx_wait queue also for amthif client
  mei: amthif: drop parameter validation from mei_amthif_write
  mei: amthif: replace amthif_rd_complete_list with rd_completed
  mei: amthif: allow only one request at a time
  mei: rename variable names 'file_object' to fp
  mei: constify struct file pointer
  mei: amthif: don't drop read packets on timeout
  mei: amthif: don't copy from an empty buffer
  mei: call stop on failed char device register
  mei: fix possible integer overflow issue
  mei: debugfs: allow hbm features list dump in earlier stages
  mei: debugfs: adjust active clients print buffer
  mei: trace pci configuration space io
  watchdog: mei_wdt: re-register device on event
  watchdog: mei_wdt: register wd device only if required
  mei: bus: whitelist the watchdog client
  watchdog: mei_wdt: add status debugfs entry
  watchdog: mei_wdt: implement MEI iAMT watchdog driver
  mei: wd: drop the watchdog code from the core mei driver
  mei: drop nfc leftovers from the mei driver
  mei: always copy the read buffer if data is ready
  mei: prevent queuing new flow control credit.
  mei: bus: remove redundant uuid string in debug messages

(From OE-Core rev: a525872906afbd76d8b3e1c53a5b8da3ffda81ee)

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:43 +01:00
Bruce Ashfield
171d825923 linux-yocto/4.4: update to v4.4.14
Updating the korg -stable release.

(From OE-Core rev: 9c0c00e7b8d330533f7e83638050f1030a0cbf89)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:43 +01:00
Bruce Ashfield
8e1615226f linux-yocto/4.1: update to 4.1.27
Integrating the korg -stable release.

(From OE-Core rev: f4e867e6be0ece72a4bae8843599d24d5540cbe6)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:43 +01:00
Bruce Ashfield
6ae50db71e linux-yocto/config: mei, gpio and usb type c
Merging the following configuration changes into the 4.1 and
4.4 linux-yocto kernel meta data:

  mei.cfg: mei driver is no longer in staging
  bsp/intel-common: add keyboard-gpio to intel-common-drivers
  features/thermal: Enable Intel PMIC thermal feature
  broxton: Enable USB Type C feature for broxton

(From OE-Core rev: 5218a27645b57f0d38d9b17bcb2f41e3e04c0d67)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:43 +01:00
Bruce Ashfield
0c5b11a701 linux-yocto/4.4: cpumask: Export cpumask_any_but()
Backporting a mainline commit to Intel uncore can be completely
modular.

(From OE-Core rev: 416b33bd2c6a79ce025c1a9943965497f17d7659)

Signed-off-by: Nilesh Bacchewar <nilesh.bacchewar@intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:43 +01:00
Bruce Ashfield
59d3fb6db0 linux-yocto/4.1/4.1: mei, usb and extcon changes
Backporting the following mainline changes to the 4.1 and 4.4
kernels:

  device property: Avoid potential dereferences of invalid pointers
  device property: convert to use match_string() helper
  lib/string: introduce match_string() helper
  device property: fix for a case of use-after-free
  device property: fwnode->secondary may contain ERR_PTR(-ENODEV)
  xhci: harden xhci_find_next_ext_cap against device removal
  xhci: rework xhci extended capability list parsing functions
  xhci: parse xhci protocol speed ID list for usb 3.1 usage
  extcon: Redefine the unique id of supported external connectors without 'enum extcon' type
  extcon: Remove optional print_name() function pointer of extcon_dev
  extcon: Update the prototype of extcon_register_notifier() with enum extcon
  extcon: Use capital letter for the name of external connectors
  extcon: Use the unique id for external connector instead of string
  extcon: Remove the optional name of extcon device
  extcon: adc-jack: Remove the unneeded num_cables field
  extcon: Alter MHL-TA cable name to TA cable name
  extcon: Unify the dock device names on max8997/77693
  extcon: Unify the jig cable names on rt8973 and max14577/77693/77843
  extcon: Fix the checkpatch warning and minor coding style issue
  extcon: Add extcon_get_edev_name() API to get the extcon device name
  extcon: Modify the device name as extcon[X] for sysfs
  extcon: Add manufactor name of each extcon device

And the following config change:

  mei.cfg: Add CONFIG_INTEL_MEI_TXE=m

(From OE-Core rev: a04c634adc3d073701ecf2576fe9dd0cf8ace629)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:43 +01:00
Bruce Ashfield
92469ae0e3 linux-yocto/4.1/4.4: x86, power and usb-c mainline backports
Updating the 4.1 and 4.4 kernels with mainlin backports for platform/feature
support.

Also updating the kernel meta data to configure and use those new features.

(From OE-Core rev: d33f1ccd8ddf8eeaf262267d8618f2422adda629)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:43 +01:00
Ed Bartosh
63ff759627 bitbake: bitbake: main: implement server autostart feature
If environment variable BBSERVER == 'autostart' bitbake will
automatically load server if it's not running yet.

If host and port are in bitbake.lock then bitbake tries to check
if server is running and responses to commands and starts new
server only if this check fails.

[YOCTO #5534]

(Bitbake rev: 89c6e625d47303b2aad8e6645762f17aee01b2d4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:23:46 +01:00
Ed Bartosh
b190c08b48 bitbake: bitbake: utils: add BBSERVER to the list of preserved variables
All environment variables that are not in the list returned by
preserved_envvars_exported are cleaned by bb.utils.clean_environment.

Added BBSERVER to the list as we need to access it in bb/main.py
after the call of bb.utils.clean_environment.

(Bitbake rev: 15c4ea679f4fe097a9f21cccfc82907b5f39a4e4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:23:46 +01:00
Ed Bartosh
6597ba6b43 bitbake: bitbake: xmlrpc: implement check of connection to server
Implemented check_connection function. The purpose of this function
is to check if bitbake server is accessible and functional.
To check this this function tries to connect to bitbake server and
run getVariable command.

This API is going to be used to implement autoloading of bitbake
server.

[YOCTO #5534]

(Bitbake rev: 1a18f5ceb478f766b53850451549333f655621ea)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:23:45 +01:00
Ross Burton
dead7b22b4 bitbake: lib/bb/utils: no need to unsetenv when manipulating os.environ
Doing both os.unsetenv(foo) and then del os.environ[foo] is pointless as del
will call unsetenv automatically.

(Bitbake rev: a4463e2ff3c7d234320176d671719243292f1af0)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:23:45 +01:00
Scott Rifenbark
aae4c2a629 ref-manual: Updated the "Recipe Logging Mechanisms" section
Fixes [YOCTO #9950]

Added more detail on the functions for logging.

(From yocto-docs rev: b7ed4d84ae5221765201fe661af3741fb01da738)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:52 +01:00
Scott Rifenbark
451334a841 ref-manual: Applied review changes to the DEPENDS variable.
Updated the note with some formatting and grammar changes.

Fixes [YOCTO #9933]

(From yocto-docs rev: afef28ae894c313f85ddbaeef8b0abbc2700ba2c)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:52 +01:00
Scott Rifenbark
bdf9003cfb ref-manual: Added review changes to BBCLASSEXTEND description
Fixes [YOCTO #9909]

Added some technical clarifications to the existing note to be clear
about what is causing the limitations in this case.  Applied some
formatting fixed to for the use of the include word.

(From yocto-docs rev: cbbd960d8665d9fb6b92698c14728d1c0bcc659f)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:51 +01:00
Scott Rifenbark
acdfb5f3cc ref-manual: Added notes to the DEPENDS variable description.
Fixes [YOCTO #9933]

Added two notes to help clarify how DEPENDS works with pre-compiled
objects.  There are some details that trip people up.

(From yocto-docs rev: 06917e97adf24816b0aee6fdfdd14aa79d4c6ab2)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:51 +01:00
Scott Rifenbark
b09a3adb64 toaster-manual: Changed the Webport address:
Using 0.0.0.0:8400 as a better way to set up this address.  Easier
on the user.

(From yocto-docs rev: bef463d2743989596388fda7e97119f43da045a8)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:51 +01:00
Scott Rifenbark
640181cce8 ref-manual: Added clarifying note to the BBCLASSEXTEND variable.
Fixes [YOCTO #9909]

Added a note that talks about how the BBCLASSEXTEND mechanism
adds recipe variants.

(From yocto-docs rev: a05990ecb760519a685a1c5ddcf2ce3e048bfbf2)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:51 +01:00
Scott Rifenbark
48336f5139 ref-manual: Added cross-referencing to tasks and dependencies
Fixes [YOCTO #9861]

Placed some section links into the "Tasks" and the "Dependencies"
sections of the BB manual from several areas:

 * The "Normal Recipe Build Tasks" section
 * The variable description for DEPENDS
 * The variable description for RDEPENDS

(From yocto-docs rev: d96347fdb4c3d5a34695f20e995f165c5ba91c32)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:51 +01:00
Scott Rifenbark
cf3b80b0c8 ref-manual: Added new glossary entry for REMOVE_PKG_SUPPORT.
Fixes [YOCTO #9899]

New variable description added.

(From yocto-docs rev: 95b740d719a7a6ffe3a06a1f152af4d877ee08c7)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:51 +01:00
Ed Bartosh
a814a61afb toaster-manual: splitted long line
The TOASTER_DIR=... checksettings line is too long and got truncated
when documenation in pdf format is made. Splitting it to two lines
should fix this.

(From yocto-docs rev: f3bf1c7b4094a9fda60f7f9d99363a947afed261)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:51 +01:00
Ed Bartosh
f6493824aa toaster-manual: point keywords to Django documentation
Pointed SECRET_KEY, STATIC_ROOT and DATABASE keywords to the
Django documentation.

(From yocto-docs rev: d4a6291ad6ef40963c601e60dd861c76499d8b3f)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:51 +01:00
Michael Wood
9a5af9c94b toaster-manual: Update toaster start documentation
- Update starting toaster to source toaster start
- Add webport address documentation
- Remove redundant "syncdb" call
- Make it clearer that collectstatic uses STATIC_ROOT

(From yocto-docs rev: 75516923f72b8d1f52cfd62281f71b637c9cac93)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:50 +01:00
Ed Bartosh
e92b3a8241 toaster-manual: add OpenSUSE to the list of distros
Updated instructions of restarting apache. As OpenSUSE way of
restarting apache is the same as Ubuntu and Debian it's enough to
just add OpenSUSE to the list of distros.

(From yocto-docs rev: 0aed02ca72303574d17996dc56484f76c772c864)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:50 +01:00
Ed Bartosh
4e017740b7 toaster-manual: update runbuilds instructions
Added sample configuration files and instructions for the runbuilds
systemd service. Service runs runbuilds in a screen session for user
convenience. User can attach to the session to see the runbuilds
output, monitor logs and build environment.

(From yocto-docs rev: 40beaa575fb96a06992a1d62bb45cd0cbbe2ae86)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:50 +01:00
Ed Bartosh
3d24037b76 toaster-manual: update apache configuration file
Changed access control instructions to work with Apache 2.4 according
to https://httpd.apache.org/docs/current/upgrading.html.

Added 'Require all granted' for wsgi.py according to
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/modwsgi/.

Changed python module path for WSGIDaemonProcess as python version
changed and modules are installed to the different path.

(From yocto-docs rev: 503b6c3c250936e889ce146bfcd301ed55e638d2)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:50 +01:00
Ed Bartosh
c3e076f555 toaster-manual: add instructions for OpenSUSE
Added description of the location of apache configuration file for
OpenSUSE Leap 42.1

(From yocto-docs rev: 50f9a376072ce0b7d3ed4650ca3c3ea8e5ff14dc)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:50 +01:00
Ed Bartosh
aa42629969 toaster-manual: change mysql driver
Here is a quote from Django 1.9 documentation regarding this:
mysqlclient is a fork of MySQLdb which notably supports Python 3
and can be used as a drop-in replacement for MySQLdb. At the time
of this writing, this is the recommended choice for using MySQL
with Django.

(From yocto-docs rev: deb02aeea4912f9d7978de3529467e4503eeeffb)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:50 +01:00
Ed Bartosh
4b3c59509c toaster-manual: add instructions to create user
Creating separate toaster account would make production setup
more isolated and maintainable.

(From yocto-docs rev: 50ed20ad881da8d454a520903dadff20c5011fae)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:50 +01:00
Ed Bartosh
14194fa66c toaster-manual: add list of packages for openSUSE
Added package installation instructions for openSUSE Leap 42.1

(From yocto-docs rev: 895fd65a8641c877ef6eba49e20d34fd71dd7d66)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:50 +01:00
Ed Bartosh
2134659165 toaster-manual: update list of packages
Changed mod_wsgi package names as Toaster requires python 3 version
of mod_wsgi. Added missing python3-pip, mariadb-server, mariadb-devel
and python3-devel to the list of packages for Fedora.

(From yocto-docs rev: 8a2da9855c0ed5dd137808fa976cbe707048551e)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:50 +01:00
Ed Bartosh
b094b97c4a toaster-manual: update distro versions
Changed Ubuntu and Fedora versions to the latest ones.

(From yocto-docs rev: 50a7d0110e9f8c7c3c8c8c5b6e3a1495c9f9ff79)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:49 +01:00
brian avery
64b8e17892 toaster-manual: Switch to pip3 dependency installer
Our switch to python3 requires us to dump the virtualenv approach
as long as we need python to resolve to python2 in the same shell
that python3 resolves to python3. To enable users to install
Toaster's python package dependencies locally, we are changing to
using pip3 and these doc changes explain how to do that.

(From yocto-docs rev: 06b8820bcb90d1855ccb2712b616bb89847a148f)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:49 +01:00
Ed Bartosh
f6378c10ef toaster-manual: add instructions to create user
Creating separate toaster account would make production setup
more isolated and maintainable.

(From yocto-docs rev: 33c638d3e9a68d06d929276c6064d567ed7fe696)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:49 +01:00
Scott Rifenbark
444a80a355 ref-manual: Added a new section on setscene task variants
Fixes [YOCTO #9251]

I added a new section on the task variants for setscene, which uses
the shared state cache.  The section describes the BitBake processing
that helps the build system to not have to build everything from scratch.

(From yocto-docs rev: 6aa0e6b837de14dd7d6c5ef34328bbf268dd6d71)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:49 +01:00
Scott Rifenbark
4fb1961acf ref-manual: Fixed typo in the "Shared State" section.
Fixes [YOCTO #9823]

The do_deploy[sstate-inputdirs] string was wrongly
do_deploy[sstate-inputsdirs].

(From yocto-docs rev: 49e7cb239f4f4f70dc5738686f1bca135772bcbe)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:49 +01:00
Scott Rifenbark
b67f865e67 ref-manual: Review edits to the PR variable in glossary.
Fixes [YOCTO #9843]

Some minor rewordings and removal of a stray comma.

(From yocto-docs rev: 0b0c8b0b1c4edb86eb2b20c73ffb83d640f6b916)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:49 +01:00
Scott Rifenbark
e5fabb90dc ref-manual: Updated the RDEPENDS variable description in the glossary
Fixes [YOCTO #9380]

Updated the shlibdeps description for this variable to try and
satisfy automatically added version restrictions.

(From yocto-docs rev: d94de0b24591206620c83a9022a9d813141a7637)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:49 +01:00
Scott Rifenbark
b66e84e19d ref-manual: Updated the PR variable description.
Fixes [YOCTO #9843]

The variable description was very brief.  These changes added some
substance to the description and how the OpenEmbedded build system
uses the variable.

(From yocto-docs rev: cc9117d4e16c56dd54f81804fda94561e61d91a7)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:49 +01:00
Scott Rifenbark
33e1c39361 dev-manual: Review edits to the package installation section
Fixes [YOCTO #9672]

A couple typos here needed fixed.  Also, a missing statement in
the JSON example.

(From yocto-docs rev: 8756cb363a70a8b77077a666c62c0f678ffb3d3e)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:48 +01:00
Scott Rifenbark
77031ba572 ref-manual: Updated the flag descriptions for shared state details
Fixes [YOCTO 9823]

I added more details to the explanations of how shared state is
implemented.  Included a bulleted list of the various statements
of code to help explain flags and settings.

(From yocto-docs rev: 518352f88c8dda16f2915a7bb9901ffd7686d739)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:48 +01:00
Scott Rifenbark
57acc32724 dev-manual: Edits to the package feed creation section.
Updated the introduction of the trio of variables used for package
feed naming in the "Build Considerations" section.

Fixes [YOCTO #1882]

(From yocto-docs rev: 4c7efd08f9f543dd3c4f2e6d68c72d16fd7b0b8c)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:48 +01:00
Scott Rifenbark
fc518b5a48 ref-manual: Updated the DISTRO_FEATURES description of Bluez5
Edits to explain that by default, DISTRO_FEATURES backfills
bluetooth support with Bluez5.  If the user wants to use the
Bluez4 feature, they need to backfill consider Bluez5.

(From yocto-docs rev: 4e8b34c8c5841cdc1cae564decae4689ae4f2b11)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:48 +01:00
Paul Eggleton
45baa90c8c bitbake: fetch2: implement progress support
Implement progress reporting support specifically for the fetchers. For
fetch tasks we don't necessarily know which fetcher will be used (we
might initially be fetching a git:// URI, but if we instead download a
mirror tarball we may fetch that over http using wget). These programs
also have different abilities as far as reporting progress goes (e.g.
wget gives us percentage complete and rate, git gives this some of the
time depending on what stage it's at). Additionally we filter out the
progress output before it makes it to the logs, in order to prevent the
logs filling up with junk.

At the moment this is only implemented for the wget and git fetchers
since they are the most commonly used (and svn doesn't seem to support
any kind of progress output, at least not without doing a relatively
expensive remote file listing first).

Line changes such as the ones you get in git's output as it progresses
don't make it to the log files, you only get the final state of the line
so the logs aren't filled with progress information that's useless after
the fact.

Part of the implementation for [YOCTO #5383].

(Bitbake rev: 4027649f422ee64b1c4e1ad8d48ac295050afbff)

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-07-19 15:04:37 +01:00
Elliot Smith
843f7ae410 toaster.bbclass: only scan files-in-image.txt if it exists
We can reach the method in toaster.bbclass which tries to read from
the files-in-image.txt file via a build which doesn't create that
file (e.g. "bitbake core-image-minimal -c rootfs"). This causes
the build to fail with an exception.

Check that this file exists before trying to read from it.

[YOCTO #9784]

(From OE-Core rev: 8b369cdd73ab17cdf834a591b97b25840caeb740)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 09:03:32 +01:00
Elliot Smith
ac339ece20 toaster.bbclass: remove directory scan logic for detecting artifacts
toaster.bbclass does a scan of the image deploy and SDK directories
when a build finishes. However, this brings no benefit and could be
better managed and made easier to modify if moved to toasterui and
carried out when the BuildCompleted event occurs.

Remove the image scan code from toaster.bbclass, prior to moving it
to toasterui and buildinfohelper.

Also remove the license manifest update code, as this can also be
done from toasterui.

The postfuncs for do_populate_sdk are retained, but no longer
do the directory scan for SDK artifacts. Instead, they fire
an event with the value of the TOOLCHAIN_OUTPUTNAME variable,
as this is only accessible at the point when the do_populate_sdk
and do_populate_sdk_ext tasks are run. The value of this can then
be used by buildinfohelper to find the SDK artifacts produced by a
target.

[YOCTO #9002]

(From OE-Core rev: 67ebb5406c0fcdd1b28bf446249aa6fe34a741a8)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 09:03:32 +01:00
Elliot Smith
8d08a73225 bitbake: toaster-tests: package count/size shouldn't show for non-image builds
If a build doesn't produce any image files, the package count
and size shouldn't be shown.

Also add some metadata to build dashboard elements so it is clear
what they're for, and so they can be queried by the tests.

(Bitbake rev: 3d5090af4475b1d0bb56911a8e30abf9097c1b3c)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith
8ccf8392aa bitbake: toaster-tests: new custom image button shouldn't show for non-image builds
[YOCTO #9514]

(Bitbake rev: 9bc014d89434400c1493fa9f07ce3a51d37dab51)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith
db5426b079 bitbake: toaster-tests: add tests for build artifact display on build dashboard
Add tests for display of image, kernel and SDK artifacts on the
build dashboard, checking that the "Images" option in the left-hand
menu and the "Build artifacts" section display correctly for
different types of build.

Also add metadata to elements on the build dashboard so it's clearer
what they represent, and to assist in finding them in the tests.

Add a method to the test helper to make it more convenient to check
whether a single element matching a selector exists.

[YOCTO #8556]
[YOCTO #8563]
[YOCTO #9500]

(Bitbake rev: 644a888ce5a2141f2e6e1c22430e196b65cb1313)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith
9475a684c4 bitbake: toaster: the customise image button shouldn't rely on targets
The build dashboard customise image button (for creating a new
custom image based on an image recipe used by a build) shouldn't
rely on targets: whether a new custom image can be created or not
depends on whether any of the recipes used by the build are image
recipes.

Modify the method used to determine whether a build has customisable
images to look at the image recipes used during the build, rather
than whether the targets run by the build refer to image recipes.

(Bitbake rev: 6648876c91134bda8498b4f8d7ace9147ec0d985)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith
2db40e3771 bitbake: toaster: add package manifest path to Target objects
Store the path to the *.rootfs.manifest file for targets which
generate images.

A link to the package manifest is displayed in the build dashboard
for targets which produce image files.

Like the license manifest path, if a target would have produced
the package manifest (but didn't, because it already existed), that
path is copied from the target which did produce the package
manifest.

(Bitbake rev: 79b8e349a0da2ea6b97ad82daa5837e6dfffe0af)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith
1027e0e313 bitbake: toaster: better display of targets which produced no images
SDK targets (populate_sdk) produce SDK artifacts but no image files.
Currently, these targets appear under the "Images" heading in the
build dashboard, even though they aren't strictly image targets.

Change the heading to "Build artifacts". Also remove the section
which states that a build produced no image files: this is not
correct for populate_sdk targets (those targets don't produce
image files under any circumstances); and other changes mean
that all targets which do produce images will now show those
files.

The check for whether to display the "Build artifacts" section also
needs to change, as we show targets here which didn't produce any
images but did produce SDK artifacts.

[YOCTO #8556]

(Bitbake rev: b4dce68045c4615e7a6a474e952f670721a3b54e)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith
adbf206526 bitbake: toaster: show manifests in their own section of the build dashboard
In the build dashboard, add a section for manifests to each target,
which will contain the license and package manifests for a target.

As we don't record the package manifest (yet), just move the
license manifest link to that section for now.

(Bitbake rev: 58cb685b567a081834a605530957f165d35fcf5e)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith
07a58a8944 bitbake: toaster: only show "New custom image" button for builds with image targets
Add a has_image_targets() method to Build, and use that to hide
the "New custom image" button on the build dashboard if a build
has no targets which build images.

[YOCTO #9514]

(Bitbake rev: 3c4b053e44ea512ef2ced67289a7b0161db6ce9b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith
587275eefd bitbake: toaster: use has_images() methods to display images correctly
In the build dashboard, we had issues with showing images correctly,
as we were using the is_image property of targets to determine
whether a target would have image files. This property can
be set to True if a target refers to an image recipe
(e.g. "core-image-minimal"), even if the task used in the build
didn't produce any image files.

By adding has_images() methods to the Target and Build objects,
which count associated Target_Image_File objects,
we can correctly determine whether a target has image files
associated with it, and if any of the targets for a build has
image files. This means that we can screen out the left-hand
"Images" menu options for builds which contained image-related
targets (e.g. "core-image-minimal") but which didn't produce
any images (e.g. "rootfs" task).

[YOCTO #9500]
[YOCTO #9784]

(Bitbake rev: f6bba0ff254d5ed3163151d4b938f3a43c9acb0a)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith
150e5588a0 bitbake: buildinfohelper: only record image files for tasks which make images
If a target is built which is classified as an "image" target
(e.g. "core-image-minimal"), Toaster reads the list of files in
the image (from the files-in-image.txt file).

However, Toaster continues to do this for builds which don't
produce images, if the recipe providing the target is an
image recipe. This can result in a list of files in the image
being attached to a target which didn't produce an image (e.g.
rootfs).

When associating files with an image, ensure that only targets
with a task which produces an image have "files in the image"
associated with them.

[YOCTO #9784]

(Bitbake rev: 44375d0c2a88e0070b8067c9285b89c54eaf3152)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith
00c2c0be5e bitbake: toaster: improve scan for SDK artifacts
SDK artifacts were previously picked up by toaster.bbclass and
notified to buildinfohelper (via toasterui). The artifacts
were then added to the Build object, so that it wasn't clear
which artifact went with which target; we were also unable
to attach SDK artifacts to a Build if they had already been
attached to a previous build.

Now, toaster.bbclass just notifies the TOOLCHAIN_OUTPUTNAME when
a populate_sdk* target completes. The scan is moved to buildinfohelper,
where we search the SDK deploy directory for files matching
TOOLCHAIN_OUTPUTNAME and attach them to targets (not builds).

If an SDK file is not produced by a target, we now look for a
similar, previously-run target which did produce artifacts.
If there is one, we clone the SDK artifacts from that target
onto the current one.

This all means that we can show SDK artifacts by target, and should
always get artifacts associated with a target, regardless of whether
it really build them.

This requires an additional model, TargetSDKFile, which tracks
the size and path of SDK artifact files with respect to Target
objects.

[YOCTO #8556]

(Bitbake rev: 5e650c611605507e1e0d1588cd5eb6535c2d34fc)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith
f39ae146ea bitbake: buildinfohelper: fix retrieval of targets
When buildinfohelper records the targets for a build, it looks
up any existing targets for a build and creates them if they
are not present. This is because in the case of Toaster-triggered
builds, the Target objects have already been created (inside
triggerBuild()) and don't need to be recreated; but in the case
of cli builds, the Target objects have to be created by
buildinfohelper.

The issue is that the code for retrieving an existing target for
a build only looks for Targets with a matching target and build,
e.g. Targets for build X with target "core-image-minimal". But it
is perfectly legitimate to call bitbake with a command like
"bitbake core-image-minimal:do_populate_sdk
core-image-minimal:do_populate_sdk_ext". In such a case, the
code which looks for matching targets finds two objects, as it
doesn't filter by task.

Add the task into the filter for the Target so that only one
Target object is be returned. Note that a command
line like "bitbake recipe:task recipe:task" will still cause an
error as bitbake doesn't de-duplicate the command line arguments
and will run the recipe:task combination twice.

(Bitbake rev: 1c0a689fdaae6469d4afb98583161073d32ea50b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith
4125da7763 bitbake: toaster: attach kernel artifacts to targets
The bzImage and modules files were previously attached to a build,
rather than to the target which produced them. This meant it was
not possible to determine which kernel artifact produced by a
build came from which target; which in turn made it difficult to
associate existing kernel artifact with targets when those
targets didn't produce artifacts (e.g. if the same machine + target
combination was built again and didn't produce a bzImage or modules
file because those files already existed).

By associating kernel artifacts with the target (via a new
TargetArtifactFile model), we make it possible to find all
the artifacts for a given machine + target combination. Then, in
cases where a build is completed but its targets don't produce
any artifacts, we can find a previous Target object with the same
machine + target and copy its artifacts to the targets for a
just-completed build.

Note that this doesn't cover SDK artifacts yet, which are still
retrieved in toaster.bbclass and show up as "Other artifacts",
lumped together for the whole build rather than by target.

[YOCTO #8556]

(Bitbake rev: 9b151416e428c2565a27d89116439f9a8d578e3d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith
e9808576da bitbake: toaster: improve image file suffix retrieval
Refactor retrieval of suffix from image file path, making it a
a method on Target_Image_File. This makes it easier to use this
in the build dashboard for individual images, plus reduces the
complexity of the code required to get all of the image file
suffixes for a build.

(Bitbake rev: 9c38de3dec74c122c2060cad37331bdafc6858ec)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith
5dfa120a7c bitbake: toaster: do image and artifact scan on BuildCompleted
Move the image and artifact scan code from toaster.bbclass and
consolidate its logic with the existing logic in buildinfohelper.

Remove handler setup for events which used to be fired from
toaster.bbclass but which are now handled directly by buildinfohelper.

[YOCTO #8556]

(Bitbake rev: f0085cd554604cfff4a3f40a34825fbb6878004f)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith
b0585e6b0c bitbake: toaster: display Target targets in build dashboard
The build dashboard was showing the targets for the build in the page
heading and title as "Target object".

Add a filter which extracts the "target" from each Target object
as a string so that the heading and title display correctly.

Also sort the image file suffixes alphabetically.

[YOCTO #8556]

(Bitbake rev: 33a24992139e7dc05d14bbe1da60299b732945aa)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Ed Bartosh
844e1f9e1d bitbake: runqueue: improve exception logging
Runqueue errors direct the user to view the "failure below",
but no additional error message is available.

Log the stacktrace so that the user can see what went wrong.

Also fix a typo in the log message.

(Bitbake rev: e191f401e372ee181bc02250232ad9cb9a0e9477)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Robert Yang
7a220aeaae bitbake: lib/bb/utils.py: return sorted OrderedDict in explode_dep_versions2
The OrderedDict's item is sorted by insertion order, there might be a
problem when build the same recipe again, for example:
- First build of acl:
  Depends: libattr1 (>= 2.4.47), libc6 (>= 2.24)
- Second build of acl:
  Depends: libc6 (>= 2.24), libattr1 (>= 2.4.47)

They are exactly the same depends, but tools like "diff" doesn't think
so. Return sorted OrderedDict will fix the problem.

(Bitbake rev: a392f19f16ef8202ce3c12afbeb186a02438da17)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Paul Eggleton
bc3a206de3 bitbake: knotty: avoid errors when fetching outside of a task
In a few places we use the fetcher code to fetch files outside of a
task, for example uninative in OE. In that case the pid of the event is
0 and that was causing an error in BBUIHelper.eventHandler(). Check the
pid and do nothing if it's 0.

(Bitbake rev: 59cb919e5cd5c653fb4d69b2d6a4320648443e10)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:50 +01:00
Ross Burton
2afcbfef2c bitbake: build: don't use $B as the default cwd for functions
When bitbake executes a shell or Python function it can cd/chdir() into a
directory before executing the task. If no directory is specified then the
default of $B is used.  However $B is an OpenEmbedded variable and BitBake
shouldn't be aware of it.

To solve this change the semantics slightly so that if no directory is
specified, the current working directory isn't changed.  There's also a sanity
check that emits a warning if a Python task does os.chdir() without restoring
the old path, and the previous working directory is restored.

This does change semantics: whereas before a function in OE would have $B as the
working directory unless specified, now the working directory is the top of the
build tree.  Any breakage this causes can be solved by either adding
do_some_task[dirs] = "${B}" or by using absolute paths in the task.

[ YOCTO #4634 ]

(Bitbake rev: 67a7b8b021badc17d8fdf447c250e79d291e75f7)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:50 +01:00
Ross Burton
faa726824d bitbake: lib/bb/build.py: decode the command as UTF-8
The messaging FIFO is UTF-8, so decode the command as UTF-8 as well as the value
as otherwise "bberror" != b("bberror") and none of the messages from shell
functions are ever displayed.

Also add an else to the command parser so unhandled commands are noticed.

[ YOCTO #9947 ]

(Bitbake rev: 42d727743fa599e0a3c5ad2c29a1e6ede1a918bb)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:47:06 +01:00
Ross Burton
b7a741cbca bitbake: lib/bb/utils: fix set_process_name
With Python 3 create_string_buffer needs a bytes() not a str() but as we were
catching all exceptions nobody noticed.

[ YOCTO #9910 ]

(Bitbake rev: 6576a9a95486c28a01d4211b4a33cc3e2c55a7cc)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:47:06 +01:00
George McCollister
627d01997f useradd-staticids: use map() instead of imap()
In Python3 the itertools module's imap function has been migrated to the
globalname space as map(). Calling itertools.imap() will fail because it
no longer exists.

(From OE-Core rev: da7a2c7b00b40a8759dbe9f4ab6df3e337e3d6b6)

Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:12:00 +01:00
Jussi Kukkonen
fd08714c26 python3: Add compression to python3-shell dependencies
python3-shell needs python3-compression for tarfile.

(From OE-Core rev: fe5979534bd4fc1f3e5401c9a86e4aff571aec24)

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-07-12 23:10:16 +01:00
Jussi Kukkonen
4473e64ba7 python3-native: Add "io" to rprovides
(From OE-Core rev: 824fa3f9a5e10348b18cf00e6f562f5ec781ac26)

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-07-12 23:10:16 +01:00
Jussi Kukkonen
5e747eb3c8 python3: Add dependencies for python3-misc
http.server requires email.parser. argparse requires
codecs and textutils.

(From OE-Core rev: 64c307c8b1af32e1219e7c9ad3f634869e0fd33f)

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-07-12 23:10:16 +01:00
Christopher Larson
114206fb4c buildstats-summary: round the floating point percentage
This was rounded in python 2, but python 3 changed the default behavior of /.
We could switch to the same behavior as previous by switching to // rather
than /, but there's value in keeping at least one decimal point, to avoid the
misleading case where it says 0% but the reuse is non-zero.

(From OE-Core rev: 35d36a4d097ce8a0fd0be2f795e3d5052d4f753c)

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-07-12 23:10:16 +01:00
Paul Eggleton
029e3ebcb2 lib/oe/patch: handle encoding differences in patch files
With Python 3, the encoding of a file is significant; several recipes in
OE-Core have patches which are not fully utf-8 decodable e.g. man,
lrzsz, and gstreamer1.0-libav, leading to errors when using devtool's
modify, upgrade or extract subcommands on these recipes. To work around
this, try reading the patch file as utf-8 first and if that fails try
latin-1 before giving up.

(From OE-Core rev: 7f4d7a6f51569954e204f110827a8ce256bcdc68)

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-07-12 23:10:16 +01:00
Paul Eggleton
f465039737 recipetool: create: support specifying a file as the local source
It is currently possible to specify a file (e.g. a tarball) on the local
disk as the source, but you have to know to put file:// in front of it.
There's really no need to force users to jump through that hoop if they
really want to do this so check if the specified source is a file and
prefix it with file:// if that's the case.

Also ensure the same works for "devtool add" at the same time.

(From OE-Core rev: 71350003790c38e84b0e525a71a2fe5d24e3d083)

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-07-12 23:10:15 +01:00
Paul Eggleton
54486a1ac3 recipetool: create: fix handling of github URLs
For a while now, Github hasn't been advertising a specific repository
URL since cloning the web URL with git works. Armed with this knowledge
and fully expecting people to just paste the github URL, we need to
handle this situation specially. If it looks like a github URL to the
root of a repository then treat it as a git repository instead of a
normal https URL to be fetched by the wget fetcher.

(From OE-Core rev: 7998dc3597657229507e5c140fceef1e485ac402)

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-07-12 23:10:15 +01:00
Maxin B. John
2c9291dfb9 graph-tool: convert to python3
move graph-tool to python3

(From OE-Core rev: 0d0864ae0ff9e53623ad1c7146b071f2a046f21f)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:15 +01:00
Paul Eggleton
baed9bd848 scripts/contrib/devtool-stress: exclude more recipes by default
These recipes can't be used with devtool because they can't be unpacked
in the normal way.

(From OE-Core rev: b2cf098969b8b800a78d650cf60c0b5ad31c85b5)

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-07-12 23:10:15 +01:00
Paul Eggleton
89f8348dc5 scripts/contrib/devtool-stress: skip incompatible recipes
If devtool returns exit code 4 then record the recipes as "skipped"
rather than "failed" - these are recipes we know cannot work (usually
because they don't provide any source).

(From OE-Core rev: 8fc109f1cb6eb437c12d2d11a6937de6f035e296)

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-07-12 23:10:15 +01:00
Paul Eggleton
5c91537ab2 devtool: return specific exit code for incompatible recipes
Certain recipes cannot be used with devtool extract / modify / upgrade -
usually because they don't provide any source. Return a specific exit
code (4) so that scripts such as scripts/contrib/devtool-stress.py know
the difference between this and a genuine failure.

(From OE-Core rev: ffd295fed4ab81fc0bd00bb145ef4d72c49584bf)

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-07-12 23:10:15 +01:00
Paul Eggleton
d56caf3408 devtool: reset: allow reset to work if the recipe file has been deleted
We were attempting to open the recipe file unconditionally here - we
need to account for the possibility that the recipe file has been
deleted or moved away by the user.

(From OE-Core rev: 47822a2aff56fd338c16b5ad756feda9f395a8a1)

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-07-12 23:10:15 +01:00
Paul Eggleton
117c80f9dc devtool: update-recipe: fix --initial-rev option
In OE-Core revision 7baf57ad896112cf2258b3e2c2a1f8b756fb39bc I changed
the default update-recipe behaviour to only update patches for commits
that were changed; unfortunately I failed to handle the --initial-rev
option which was broken after that point. Rework how the initial
revision is passed in so that it now operates correctly.

(From OE-Core rev: b2ca2523cc9e51a4759b4420b07b0b67b3f5ac43)

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-07-12 23:10:15 +01:00
Robert Yang
7f6f998af2 gtk+3: update 0003-Add-disable-opengl-configure-option.patch
The patch contained git style patch like:
| diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx-with-gl-context.h
| similarity index 100%
| rename from gdk/x11/gdkx.h
| rename to gdk/x11/gdkx-with-gl-context.h

Which can't be applied by older patch tool such as patch 2.6.1. So
update the patch.

(From OE-Core rev: f9ac2c33c9a168f8b0fa2eca321f5377bad11fee)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:15 +01:00
Robert Yang
e5f9326f26 file: 5.27 -> 5.28
Remove host-file.patch which is already in the source.

(From OE-Core rev: 43c2dcb70d88eeed2735eb4347e89250d606cd42)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:15 +01:00
Armin Kuster
824e7f7951 tzcode-native: update to 2016f
changes done in data

(From OE-Core rev: 29377fa91a5f679909d582317c2b53d1f2e5da88)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:15 +01:00
Armin Kuster
64c54efa2d tzdata: update to 2016f
Changes affecting future time stamps

    The Egyptian government changed its mind on short notice, and
    Africa/Cairo will not introduce DST starting 2016-07-07 after all.
    (Thanks to Mina Samuel.)

    Asia/Novosibirsk switches from +06 to +07 on 2016-07-24 at 02:00.
    (Thanks to Stepan Golosunov.)

  Changes to past and future time stamps

    Asia/Novokuznetsk and Asia/Novosibirsk now use numeric time zone
    abbreviations instead of invented ones.

  Changes affecting past time stamps

    Europe/Minsk's 1992-03-29 spring-forward transition was at 02:00 not 00:00.
    (Thanks to Stepan Golosunov.)

(From OE-Core rev: dc80bf9b092a76f758d01474619cd9db46a1070d)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:14 +01:00
Robert Yang
56e23aeb1a debianutils: 4.7 -> 4.8
(From OE-Core rev: 362ba287eecec475203367f65f9cb20c783cda8d)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:14 +01:00
Robert Yang
4de8b37aa6 gmp: 6.1.0 -> 6.1.1
(From OE-Core rev: 55fea8ead3ebef7e28a982a7721bc0ec42b5ca86)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:14 +01:00
Robert Yang
65a8f241e1 libpcre: 8.38 -> 8.39
* Remove CVE-2016-3191.patch which is already in the source.
* The LIC_FILES_CHKSUM is changed since it has updated the date from
  2015 to 2016, the contents are the same.

(From OE-Core rev: 3feb1b000482f31e2cc683c2944059d70197fa44)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:14 +01:00
Robert Yang
4dd398024a wget: 1.17.1 -> 1.18
(From OE-Core rev: eccd082d5bb2ddfab3b87c3f0ff08a6877d12f10)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:14 +01:00
Jan Remmet
c072b18725 mtd-utils: build also for nativesdk
(From OE-Core rev: 61fe784a654f4f61c01ff7c4e1adb8077ef0ecf9)

Signed-off-by: Jan Remmet <j.remmet@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:14 +01:00
Richard Purdie
3e0137113e linux-yocto-dev: Handle performance regression
After commit 0437a59e3c, the linux-yocto-dev
recipe is being parsed every time we run "bitbake -p". This was spotted
on some performance benchmarks and showed up as a performance regression.

We can tweak the recipe to ensure this doesn't happen and that its only
used if selected.

(From OE-Core rev: 5c21fd5eb8b689504e7f6a4ee2f674c32e3d928b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:14 +01:00
Armin Kuster
6deadf5498 gcc: CVE-2016-4490
v2: add missing .inc changes
    add YP bug # to patch

[Yocto #9632]

not in 6.1.1 so back porting.

(From OE-Core rev: 5d644f5f54097282a77060d78d4f359a8a4c83bb)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:14 +01:00
Paul Eggleton
661ff395e9 gcc-runtime: add SUMMARY values
It's useful to know what the various libraries are that get produced by
gcc-runtime, as well as to have a specific SUMMARY for the recipe.

(From OE-Core rev: b8d5b4107c64784ea8c8f364a84c2bc76cd0b1b0)

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-07-12 23:10:14 +01:00
Paul Eggleton
1c0fc7fcf7 gcc: add runtime packages to RRECOMMENDS
In order to use certain features of gcc, you need the corresponding
runtime library. It seems to me that these ought to be installed by
default when installing the compiler since they are required if certain
command line options are used, so add them to RRECOMMENDS. I used
RRECOMMENDS since some of these packages may or may not exist depending
on architecture and build options; additionally it makes it possible to
use BAD_RECOMMENDATIONS if you really want to exclude them.

The impact of this isn't too bad in the context of an image providing
on-target compilation - about a 30MB increase in size for an image
containing gcc and g++.

(From OE-Core rev: 658d9a764e91f394472c9082a3ed3fa7b9b417d2)

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-07-12 23:10:14 +01:00
Andre McCurdy
7355e4ef97 libgcc: remove duplicate configure options
The original fix [1] was made redundant by the followup [2].

 [1] http://git.openembedded.org/openembedded-core/commit/?id=d774bb2d10f2c05900f87dcc53f073433ca02121
 [2] http://git.openembedded.org/openembedded-core/commit/?id=d7799a17d5e802db3f8d16bdc824aae81538e675

(From OE-Core rev: 2f6e42068a0af01034e738daa6a7ce1a3bcb434d)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:14 +01:00
Ross Burton
a219424914 glibc: add more Imagination Meta relocation to elf.h
glibc master added the EM_METAG tag but didn't add the relocation defines.
However the kernel tooling only checks for EM_METAG when defining its own values
so scripts/recordmcount ends up using R_META_* symbols without their definition.

Whilst the kernel can and should be fixed, this breaks all users of recordmcount
so patch elf.h to add the values.

(From OE-Core rev: 61f73ae289bf8dfe72d5f4beaac966fb4ac8dc90)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:13 +01:00
Khem Raj
ea439968b6 glibc: Upgrade to latest tip of master
- libc-package.bbclass: Do not use --old-style
  This option has been dropped from latest glibc

(From OE-Core rev: 78ab1e7cdedc6a73395af5d053b49cf081416732)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:13 +01:00
Khem Raj
ec336702a2 binutils: Upgrade to 2.26.1
Delete upstreamed patch

(From OE-Core rev: 37e8b6ecf9f9163d7b5b3becdc2feba57df4838f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:13 +01:00
Khem Raj
d428f2eeb8 musl: Update to v1.1.15 release
here is shortlog of changes
http://git.musl-libc.org/cgit/musl/commit/?id=faf69b9a73d09fafcbe4fd3007b8d8724293d8e1

(From OE-Core rev: 3164db2a2f16eedfed3bcd2413321e7473900637)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:13 +01:00
Zhenhua Luo
6bb3069eef tune-ppce500mc.inc: pass -mcpu=e500mc for ppce500mc kernel compile
Currently the -mcpu parameter is not passed to cross gcc when assembling
kernel .S file, the implicit -mcpu option that defaults to the latest
server cpu might casuse incorrect assembling.

A existent case is that wait instruction of ppce500mc is incorrectly assembled
to power9 version with default -mcpu setting, accordingly kernel boot calltrace
happend when wait instruction is executed on ppce500mc targets.

(From OE-Core rev: b17f91ed06a604e3d356fe17756bfe2ca61594b7)

Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-10 14:12:17 +01:00
Ross Burton
586249ac83 classes/libc-package: remove pointless copying when running localedef
localedef handles attempts to read/write the archive in parallel correctly by
creating the file atomically, gracefully handling racing to create, and has
exclusive locks when writing.  Therefore I can't see any purpose to copying the
archive to /tmp and back again when manipulating it.

(From OE-Core rev: 016e4a53e3251ffcdb3c260dd2837507b520ffa6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-10 14:12:17 +01:00
Ross Burton
e2a150b1f9 libc-package: remove obsolete do_configure_prepend
This fragment dates from when this class was used for more than just glibc
locale packaging, and as glibc-locale disables do_configure it can't have been
executed.

(From OE-Core rev: 6483fbe70e52ec9a53c918fe81162fd0c566f80f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-10 14:12:17 +01:00
Maxin B. John
8c95d2220f move directfb from oe-core
Remove the directfb recipe as we are moving directfb out of oe-core

[YOCTO #8489]

(From OE-Core rev: a30f259537fa99e71d8d93662988233e36373611)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-10 14:12:17 +01:00
Maxin B. John
78523811fb buildoptions.py: remove directfb image build test
removing this test since we move directfb out of oe-core

(From OE-Core rev: 2d8fda36ecfa1945f22b7139a2febd12ec59272b)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-10 14:12:17 +01:00
Maxin B. John
e7ddecce1b distro_alias.inc: remove directfb related references
remove directfb related references from distro_alias.inc as part of
moving directfb from oe-core

(From OE-Core rev: 203e6d1ee7a0cbf954ab52fc5f047da100b0a73f)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-10 14:12:17 +01:00
Maxin B. John
e91d0e83cb remove core-image-directfb.bb
remove core-image-directfb.bb as part of moving directfb
from oe-core

(From OE-Core rev: 8871fe1189776d78e5848b08edb9c990b9aebf2d)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-10 14:12:17 +01:00
Maxin B. John
a526c31dab remove packagegroup-core-directfb.bb
remove packagegroup-core-directfb.bb as part of moving directfb
from oe-core

(From OE-Core rev: 676f69118e34767dde87f65b5d5ba63116dc9255)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-10 14:12:17 +01:00
Ross Burton
3a6f0b66a5 db: use S/B more idiomatically
Instead of setting S to a directory inside the tarball and B to another
directory inside the tarball, use the default value of S and set
AUTOTOOLS_SCRIPT_PATH to the right path to find configure.  Update the patches
so they still apply, and clean up the recipe slightly.

Because something is not quite right regarding quilt and patching, add a PR bump
to the recipes to ensure that a clean work directory is used: for some reason
rebuilds will rarely fail to patch correctly.

(From OE-Core rev: dcbef72b8344c22617d65ea1e9f0fa7ad9a742bd)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-10 14:12:17 +01:00
Maxin B. John
b58c5dc787 libsolv: upgrade to 0.6.22
Update to version 0.6.22 and rename the recipe accordingly.

(From OE-Core rev: 1bb1ea2cdb86a022b157d66b2a480ea91593a021)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-10 14:12:16 +01:00
Maxin B. John
8501934c21 screen: upgrade to 4.4.0
Removed the following backported patch:
 * 0001-fix-for-multijob-build.patch
 * 0001-Fix-stack-overflow-due-to-too-deep-recursion.patch

(From OE-Core rev: d43792151b7974f1d35a445943f62ed685288d12)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-10 14:12:16 +01:00
Maxin B. John
3eb5cbadd5 libatomic-ops: upgrade to 7.4.4
(From OE-Core rev: 80fe4d6edd25bae7daa90ed172780b8f6152154c)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-10 14:12:16 +01:00
Maxin B. John
578bc2bfe6 ethtool: upgrade to 4.6
(From OE-Core rev: 95e6fb5d9248ae3b2bbf9ed2b0592a657d7568a4)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-10 14:12:16 +01:00
Alexander Kanavin
5d348399cb vala: update to 0.32.1
(From OE-Core rev: b2dde1d4e18e0f4a05706c50d5eec96946ad2a2b)

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>
2016-07-10 14:12:16 +01:00
Alexander Kanavin
82f83f6292 nss: update to 3.24
Drop merged 0001-Fix-build-failure-on-opensuse-13.1.patch

(From OE-Core rev: 755dda7f9a054c6069ef95e3ee4fe7d604378446)

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>
2016-07-10 14:12:16 +01:00
Alexander Kanavin
969ba57b42 mpg123: update to 1.23.5
(From OE-Core rev: cabee0028829f026018a1c13075aa2707153fece)

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>
2016-07-10 14:12:16 +01:00
Alexander Kanavin
a75183bc8d btrfs-tools: update to 4.6.1
(From OE-Core rev: db2041aeffc1d20fd78613ddf5a590a0693c15c9)

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>
2016-07-10 14:12:16 +01:00
Alexander Kanavin
b1413404ed gnutls: update to 3.5.1
Remove no longer supported --disable-crywrap option.
Add a checksum for the LICENSE file with licensing overview.

(From OE-Core rev: e8ef5912aac0104d9a47d6d10a95e64426d8840e)

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>
2016-07-10 14:12:16 +01:00
Alexander Kanavin
f31597a8b9 babeltrace: update to 1.4.0
Switch to using tarballs for upstream releases.

Drop merged patches.

Add a --disable-debug-info parameter to ./configure, as it otherwise
attempts to execute a small test binary. If this (new) feature is truly needed,
we can set up a qemu wrapper later, or patch autoconf macros.

(From OE-Core rev: 3c53af483d46d6fbc8ad5bd764c01897f2ed5c1b)

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>
2016-07-10 14:12:16 +01:00
Alexander Kanavin
c04d4a0697 libarchive: update to 3.2.1
Drop merged 0001-configure.ac-check-acl-libacl.h-and-sys-acl.h-based-.patch

(From OE-Core rev: 4d65a93d3e705cfb9b4cfe102e9d0cabaffe7a52)

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>
2016-07-10 14:12:16 +01:00
Alexander Kanavin
4d8a81616d ffmpeg: update to 3.1
(From OE-Core rev: b4d3eb40d1d454894de8752e48b5ee829f314ff3)

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>
2016-07-10 14:12:15 +01:00
Alexander Kanavin
5c4e3b5ba1 bdwgc: update to 7.4.4
Drop 0001-fix-build-with-musl.patch, the problem is fixed upstream.

(From OE-Core rev: d7063e11d2b5dad99e19759137fed734df2e06f5)

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>
2016-07-10 14:12:15 +01:00
Richard Purdie
d6abd75595 terminal: Drop gnome-terminal --disable-factory workarounds
With the new pid monitoring code we have for recent versions of
gnome-terminal we can just drop the --disable-factory code now since
the other solution handles this case as well.

(From OE-Core rev: ed4957c444a2982c19e2f1f96d9afb2a992c1daf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 10:50:18 +01:00
Richard Purdie
c706bfbabb terminal: Fix gnome-terminal to work with recent versions
Currently gnome-terminal just returns straight away, opening a terminal in a new
separate process we have no insight into. For patch resolution, this leads to
spawning many different terminal windows, for pydevshell, it just flashes a window
up and then closes.

We need to block until the command completes but gnome-terminal gives us no way
to do this. We therefore write the pid to a file using a "phonehome" wrapper
script, then monitor the pid until it exits.

[YOCTO #7254]
(also fixing do_devpyshell)

(From OE-Core rev: 76e8ab47c936674b8bb9bf1c48de53b30f5bf74a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 10:50:18 +01:00
Richard Purdie
9df3cdf42d pseudo: Upgrade to 1.8.1
* Drop patches where the changes exist upstream
* Fetch from git as no tarball is available for 1.8.1
* Move common code to pseudo.inc
* Update patchset in git recipe

(From OE-Core rev: 0c36984d4c501d12fa91cf7371511641585cc256)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 10:50:18 +01:00
Paul Eggleton
a14d30f7de oe-selftest: drop test_prepare_unexpected
This test refers to a function that no longer exists after the eSDK
install double execution of bitbake has been removed, and since
test_prepare_unexpected is the only test in this module, drop the
entire module. We can easily resurrect it if we have unit tests to add
in the future.

(From OE-Core rev: 7e792a22e62904ed2dafb1ea214911235e3f3efc)

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-07-08 10:29:44 +01:00
Michael Wood
8dc159dd93 bitbake: toaster: tests Add selenium test for layerdetails page
This tests:
 - Adding remove layer from project
 - Deleting layer
 - Editing layer fields

(Bitbake rev: cabe7e2459fcd561bced2d39ba5bd173576153e5)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:29 +01:00
Michael Wood
8813726f1d bitbake: toaster: add Layer delete front end feature to layerdetails
Add the front end feature to delete a layer from the layer details page.

[YOCO #9184]

(Bitbake rev: 91815229f60eb9deba7d299f05c69b52ff1df59c)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:29 +01:00
Michael Wood
e1ba2fd331 bitbake: toaster: api Add util function for returning the error response
Also clean up flake8 warnings in XhrBuildRequest

(Bitbake rev: aa0845242eda8650a97180bf6675551c26554cde)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:29 +01:00
Michael Wood
36dec688c7 bitbake: toaster: layerdetails api Fix saving of git revision of a layer
Update, clean up and move the api for updating a layerversion from the
views to api. Also update the layerdetails page to include the
layerversion id in the url getter.

[YOCTO #8952]

(Bitbake rev: 20f4e23bc86290f0a42881a7cac44c41eafa86fc)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Elliot Smith
903c3c2ef8 bitbake: buildinfohelper: ensure task datetimes are timezone-aware
When using toaster-eventreplay to run a bitbake event file
through toasterui/buildinfohelper, errors occur when the
tasks are updated with buildstats info:

  RuntimeWarning: DateTimeField Task.started received a naive
  datetime (2016-07-06 09:15:22.070000) while time zone support
  is active.

This is because a method in buildinfohelper returns a naive
datetime, but Django is expecting timezone-aware datetimes.

Ensure that datetimes used to set the started/ended times on
tasks are converted to timezone-aware datetimes.

(Bitbake rev: df9f4337bec87024ea6a43138c6080a755eb7fab)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Ed Bartosh
78b3fe6d5b bitbake: eventreplay: rewrite the script
Rewritten toaster-eventreplay to make code working as expected,
more compact and readable.

[YOCTO #9585]

(Bitbake rev: 45370a860b24a761d1b6e08ba752079cc45f54da)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Ed Bartosh
2b56c03264 bitbake: eventreplay: reorganize imports
Cleaned up module imports:
- Removed unused imports
- Removed import of print_function
- Removed duplicated imports
- Splitted importing bb.lib to 2 lines

(Bitbake rev: 332f5c9b20149e9f5757433df9458ce582ff32dd)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Ed Bartosh
9431a6f318 bitbake: eventreplay: replace MockConfigParameters with namedtuple
class MockConfigParameters has only one attribute and only __init__
method. Replacing it with namedtuple makes code less nested and more
readable.

[YOCTO #9585]

(Bitbake rev: 5d4df14b0d38f6c89ca16de6dada58b4bb015d71)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Ed Bartosh
70cc20daef bitbake: eventreplay: fix event loading code
Event objects are represented by base64-encoded strings in
the event file and can't be loaded by existing eventreplay code.

Fixed the code of loading events from file by decoding base64 strings
into the binary form and loading them with pickle.load.

[YOCTO #9585]

(Bitbake rev: a55c280c167f84caed6518119246e5a55f56cfd4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Ed Bartosh
2199ff5ce6 bitbake: eventprelay: implement setEventMask command
Stored event mask list as self.eventmask for future use.
Fixed Exception: Command setEventMask not implemented.

[YOCTO #9585]

(Bitbake rev: 2e09074c70e89402de8f883dd402cd729118fc7e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Ed Bartosh
a1ceb0f9cd bitbake: eventreplay: add MockConnection.getEventHandle method
Fixed AttributeError: 'MockConnection' object has no attribute
'getEventHandle'

[YOCTO #9585]

(Bitbake rev: 6deae30480a4288da0c8b3529e61f3495f260f24)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Elliot Smith
ed9c309e81 bitbake: toaster: fix layout for command-line builds in recent builds area
Command-line builds were displayed incorrectly, so that the
HTML elements for other builds were being "consumed" by the
command-line build elements due to incorrect positioning of
element end tags.

Fix by ensuring end tags close elements in the right places.

As the indentation was all over the place in the most recent
builds section template, it was almost impossible to see what the
problem was. So that was fixed, too.

[YOCTO #9842]

(Bitbake rev: 01659389813ad61d4f75b9f8d71528581322f0b0)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Ed Bartosh
7ed76e4c20 bitbake: bitbake-worker: don't reassign sys.stdout
Worker needs input stream in binary mode as it reads binary content
from it. Current code does it by detaching a buffer from sys.stdin
and assigning it back to sys.stdin.

Detached buffer is io.BufferedReader in binary mode. This operation
is implicit as its purpose is not easily understandable from the code.
Replacing it with fdopen(sys.stdin.fileno(), 'rb') should make the
code more understandable.

Assigning the buffer to sys.stdin is not needed as worker doesn't
use sys.stdin. Moreover, it leads to difficult to debug issues down
the stack. For example, devpyshell doesn't work without reopening
sys.stdin in text mode. This is not needed anymore after this fix as
sys.stdin is not changed in worker code and remains in text mode.

(Bitbake rev: b26bcff4c4d72775f1def7e769015464953b955c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Michael Wood
dab3b1b454 bitbake: toaster: views Fix most frequently built target in project reporting
Clean up and fix the most frequently built targets for the "Most built
recipes" section for the project configuration page.

[YOCTO #9846]

(Bitbake rev: 860475cfdd35301fb609ab3c89347566b0ca0adc)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Michael Wood
5018d5f095 bitbake: toaster: layerBtn avoid connecting handler to other build buttons
Some pages contain other build buttons which may have the same class
attached. Make sure that we only select the buttons in the tables where
layerBtn is used.

[YOCTO #9841]

(Bitbake rev: ec083fd943c6996307beb3be3421403870d2f2b7)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Sujith H
9d730f4747 bitbake: bitbake: toaster-tests: tests for project config
Add basic tests to validate the value, user types
in the text box for DL_DIR and SSTATE_DIR. Added
test case to validate the first char and inclusion
of space between the characters.

[YOCTO #9646]

(Bitbake rev: 1531e98c5ae1693d11d692c3589df29dff9364df)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Sujith H
dabb49be86 bitbake: toaster: fix validation checks for DL_DIR and SSTATE_DIR
Validation logic on the project configuration page
prevented a user from adding ${variable} to these paths.

Update validation so a user can see a better message
when they type characters into the text inputs.
Two types of validation are implemented.

Either:

* The value should start with a "/", to allow absolute paths.

or

* The value should start with a "$", to allow bitbake
   variables like ${TOPDIR}.

[YOCTO #9646]

(Bitbake rev: fca50153caef62a473d1812fd59ec7effe09f8c5)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Sujith H
be00eb29f3 bitbake: toaster: remove SSTATE_MIRRORS from projectconf
Remove SSTATE_MIRRORS from getting blacklisted. Hence the SSTATE_MIRRORS
should be removed from projectconf.html file so that users can know that
this variable is no more blacklisted.

[YOCTO #9598]

(Bitbake rev: b060eecae417521d8340748e7ace7a77488bd596)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Sujith H
f433664fa0 bitbake: toaster: remove SSTATE_MIRRORS from blacklists in views
Remove SSTATE_MIRRORS variable from blacklists in views.py
This helps user to point mirrors using SSTATE_MIRRORS with
toaster.

[#YOCTO 9598]

(Bitbake rev: c3dd4fb193c80ed9a6dbddf7f6a1eadd0964ac8c)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Richard Purdie
b301251668 bitbake: progress: Ensure missing start event is fired
The init function of the parent class fires a progress event for 0
progress rather than a start event. UI code was assuming that progress
events should always have a start event first. This change ensures that
the start event is correctly generated.

This fixes crashes that were seen in knotty in some configurations.

(Bitbake rev: 9841651e050a3e9f395ab3c62545c51197734584)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Richard Purdie
1b5688e0f0 bitbake: knotty: Handle process indicators more gracefully
Mistakes can happen with the generation of the progress events, change
knotty to be more tolerant of this rather than crashing, reporting to the
user when something unexpected happens. I haven't debugged why multiple
finish events appear to be triggered.

(Bitbake rev: 7dd06b1016b36420a9c55a45ff29dd64ae1dbcda)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Paul Eggleton
1b930b41a5 bitbake: runqueue: report progress for "Preparing RunQueue" step
When "Preparing RunQueue" shows up you can expect to wait up to 30
seconds while it works - which is a bit long to leave the user waiting
without any kind of output. Since the work being carried out during this
time is divided into stages such that it's practical to determine
internally how it's progressing, replace the message with a progress
bar.

Actually what happens during this time is two major steps rather than
just one - the runqueue preparation itself, followed by the
initialisation prior to running setscene tasks. I elected to have the
progress bar cover both as one (there doesn't appear to be much point in
doing otherwise from a user perspective). I did however describe it as
"initialising tasks".

(Bitbake rev: 591e9741e108487ff437e77cb439ef2dbca42e03)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Paul Eggleton
f3b62c1c2e bitbake: runqueue: add ability to enforce that tasks are setscened
Add the ability to enter a mode where only a specified whitelist of
tasks can be executed outright; everything else must be successfully
provided in the form of a setscene task (or covered by a setscene task).
Any setscene failure outside of the whitelist will cause the build to
fail immediately instead of running the real task, and any real tasks
that would execute outside of the whitelist cause an immediate build
failure when it comes to executing the runqueue as well.

The mode is enabled by setting BB_SETSCENE_ENFORCE="1", and the
whitelist is specified through BB_SETSCENE_ENFORCE_WHITELIST, consisting
of pn:taskname pairs. A single % character can be substituted for the pn
value to match any target explicitly specified on the bitbake command
line. Wildcards * and ? can also be used as per standard unix file name
matching for both pn and taskname.

Part of the implementation of [YOCTO #9367].

(Bitbake rev: 624722c067a7fdd0c0f5d8be611e1f6666ecc4a2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Paul Eggleton
76feac37ce bitbake: knotty: add quiet output mode
Quiet output mode disables printing most messages (below warnings) to
the console; however these messages still go to the console log file.
This is primarily for cases where bitbake is being launched
interactively from some other process, but where full console output is
not needed.

Because of the need to keep logging all normal events to the console
log, this functionality was implemented within the knotty UI rather
than in bb.msg (where verbose mode is implemented). We don't currently
have a means of registering command line options from the UI end, thus
the option actually has to be registered in main.py regardless of the
UI, however I didn't feel like it was worth setting up such a mechanism
just for this option.

(Bitbake rev: db95cdef08e339dec7462bfde3ad7d75c1c60dd8)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Paul Eggleton
465f93968f bitbake: knotty: show task progress bar
In addition to the "currently running n tasks (x of y)" message, show a
progress bar for another view on how much of the build is left. We have
to take care to reset it when moving from the scenequeue to the
runqueue, and explicitly don't include an ETA since not all tasks take
equal time and thus it isn't possible to estimate the time remaining
with the information available.

(Bitbake rev: de682015a3fefeff36ddc4197641a700f3fb558d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Paul Eggleton
8d56d596bb bitbake: knotty: add code to support showing progress for sstate object querying
Add support code on the BitBake side to allow sstate.bbclass in
OpenEmbedded to report progress when it is checking for availability of
artifacts from shared state mirrors.

Part of the implementation for [YOCTO #5853].

(Bitbake rev: 070ae856da0715dbaf4c560c837ea796ffc29f00)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Paul Eggleton
0e3281f68b bitbake: lib/bb/progress: add MultiStageProgressReporter
Add a class to help report progress in a task that consists of multiple
stages, some of which may have internal progress (do_rootfs within
OpenEmbedded is one example). Each stage is weighted to try to give
a reasonable representation of progress over time.

Part of the implementation for [YOCTO #5383].

(Bitbake rev: 751b75602872a89e8b1a7c03269bc0fdaa149c6f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Paul Eggleton
ac5e720575 bitbake: lib: implement basic task progress support
For long-running tasks where we have some output from the task that
gives us some idea of the progress of the task (such as a percentage
complete), provide the means to scrape the output for that progress
information and show it to the user in the default knotty terminal
output in the form of a progress bar. This is implemented using a new
TaskProgress event as well as some code we can insert to do output
scanning/filtering.

Any task can fire TaskProgress events; however, if you have a shell task
whose output you wish to scan for progress information, you just need to
set the "progress" varflag on the task. This can be set to:
 * "percent" to just look for a number followed by a % sign
 * "percent:<regex>" to specify your own regex matching a percentage
   value (must have a single group which matches the percentage number)
 * "outof:<regex>" to look for the specified regex matching x out of y
   items completed (must have two groups - first group needs to be x,
   second y).
We can potentially extend this in future but this should be a good
start.

Part of the implementation for [YOCTO #5383].

(Bitbake rev: 0d275fc5b6531957a6189069b04074065bb718a0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Paul Eggleton
1cf6e14a6c bitbake: knotty: import latest python-progressbar
Since we're going to make some minor extensions to it, it makes sense to
bring in the latest version of python-progressbar. Its structure has
changed a little but the API hasn't; however we do need to ensure our
overridden _needs_update() function's signature in BBProgress() matches
properly.

(Bitbake rev: c3e51d71b36cbc9e9ed1b35fb93d0978e24bc98a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Paul Eggleton
481048cd2a bitbake: knotty: provide a symlink to the latest console log
If you're looking to find the latest console log repeatedly it can be a bit
tedious - let's just create a symlink just as we do with other logs to
make it easy to find.

(Bitbake rev: e9f41c0507a6527bf2ed86506813d4d4a89f8ebf)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Ross Burton
312f1a5e74 bitbake: fetch2/wget: attempt checkstatus again if it fails
Some services such as SourceForge seem to struggle to keep up under load, with
the result that over half of the autobuilder checkuri runs fail with
sourceforge.net "connection timed out".

Attempt to mitigate this by re-attempting once the network operation on failure.

(Bitbake rev: 54b1961551511948e0cbd2ac39f19b39b9cee568)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Richard Purdie
1bbd580a37 oeqa/selftest/bbtests: Fix failing test after progress changes
The progress patches change the output slightly, update the test to
deal with this.

(From OE-Core rev: 90dbd838fa97c89ace5cb147aa5cff39b94178b1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Ross Burton
c7147ceec8 oeqa/runtime/systemd: fix typo in skipUnlessPassed decorator
(From OE-Core rev: f0420d8c934154a94957cabcfdc993f0eae92cd7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Christopher Larson
895353a48f service: obey CFLAGS, LDFLAGS
(From OE-Core rev: 8a227125991951c1ddd44bec0b6243474ebc363a)

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-07-08 09:57:26 +01:00
Igor Stoppa
d6a43d222d initramfs-framework: Add support for PartUUIDs
The rootfs can be addressed also by referring to the PartUUID
value from the GPT.
This patch enables such type of reference.

(From OE-Core rev: 1ab2ca141d3defe4b80212e28ac7c3f2271e2515)

Signed-off-by: Igor Stoppa <igor.stoppa@intel.com>
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Patrick Ohly
ee6a6c3461 initramfs-framework: add retry loop for slow boot devices (like USB)
On some hardware platforms (Gigabyte, qemu), detection of USB devices
by the kernel is slow enough such that it happens only after the first
attempt to mount the rootfs. We need to keep trying for a while
(default: 5s seconds, controlled by roottimeout=<seconds>) and sleep
between each attempt (default: one second, rootdelay=<seconds>).

This change intentionally splits finding the rootfs (in the new
"rootfs") and switching to it ("finish"). That is needed to keep udev
running while waiting for the rootfs, because it shuts down before
"finish" starts. It is also the direction that was discussed on the OE
mailing list for future changes to initramfs-framework (like
supporting a "live CD" module, which would replace or further augment
mounting of the rootfs).

(From OE-Core rev: 2a50bb9ee8838e3d026c82dc09aaccb880a264f4)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Ross Burton
e34eb01c0f lib/oe/path: remove oe.path.check_output
This was a copy-and-paste of subprocess.check_output() from when we supported
Python <2.7, so simply delete it and use subprocess.check_output() instead.

(From OE-Core rev: b1f2d9ed8d4dc89c9e669f43f546463ccc2a76b9)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:25 +01:00
Humberto Ibarra
6a2753bc35 scripts: Fixed typo in parameter that was causing exception
There is a typo in the logging parameters, "filname" is being used instead of "filename" for yocto-kernel, yocto-layer and wic scripts. This didn't cause issues before since python 2 didn't validate unused parameters but with python >= 3.4.3 an exception is thrown. This patch fixes this parameter name.

[YOCTO #9834]

(From OE-Core rev: 5d123a6ec0e97652b2ec4295428797a336ef357a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:25 +01:00
Maxin B. John
f8bdaf3878 rt-tests: move ptest to python3
convert python2 based ptest of rt-tests package to python3

(From OE-Core rev: 2767cbe014f84c9ad42ed8ef1eca7caa862e5196)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:25 +01:00
Ross Burton
6074ed6cd4 gcc: remove GCC 4.9
(From OE-Core rev: 615b784bd3d53a77b7e34e3879a72e7e51477db6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:25 +01:00
Ross Burton
14c9011828 gcc: remove unused patch
(From OE-Core rev: 8833e419e898d741900be3f03f8d8d4ef123aa1a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:25 +01:00
Khem Raj
7b6f66777e gcc-5.4: Fix hang with mmusl option on cmdline
When using -m32 -mmusl options in this order, gcc hangs
in parsing the options decode_cmdline_options_to_array()
the reason is that we have broken the link when adding
mmusl options, the order of specifying libc was not kept
in order as a result it was unable to contruct the array
correctly and ended in parse hang.

We fix the options to specify the order properly.

(From OE-Core rev: b362cf6ef6d7fa22a525cf3e1d17943e897bd8aa)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:25 +01:00
Davis, Michael
b45155b28a pulseaudio: Disable unit tests
(From OE-Core rev: 92cfdb2ba7e04e2b70986c6569f500dd2a48b5d1)

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>
2016-07-08 09:57:25 +01:00
Zhenhua Luo
ac0e5e2f39 socat: remove the hardcoded shifting offset
The hardcoded shifting offset causes the following runtime error:
| socat: xioinitialize.c:41: xioinitialize: Assertion `3 <<
| opt_crdly.arg3 == 00030000' failed.

(From OE-Core rev: 9dab6d1113e9aec9cbfce4c57ae5a85b1a032cbb)

Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:25 +01:00
Otavio Salvador
dc626e3bdc runqemu: Avoid duplicating custom QEMU options for AArch64
When detecting the second serial options we shouldn't append the
custom QEMU options otherwise we will end duplicating those.

(From OE-Core rev: 79798f20b2c0b98d84c3c4b14600635ff8ddfdad)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:25 +01:00
Kai Kang
e8e8d412e7 libpfm4: fix compile error
It fails to compile libpfm4 with misleading-indentation error:

| syst_count.c:346:3: error: this 'for' clause does not guard...  [-Werror=misleading-indentation]
|   for(c=cmin ; c < cmax; c++)
|      ^~~

Add clauses to fix it.

(From OE-Core rev: 2857658ff5e477cb436cf2778a78fa9f192caab8)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:25 +01:00
Paul Eggleton
23ae622a69 classes/populate_sdk_ext: exclude initramfs images from locked signatures
Tasks for image recipes cannot be locked - there's nothing to restore
from shared state to cover them and as a result, if you had "live" in
IMAGE_FSTYPES the build would fail with "taskhash mismatch" errors for
do_rootfs and do_image_complete for the initramfs image recipe, since it
had to try to run those. We should probably catch that issue earlier in
the build and produce a proper error, but for now at least exclude these
signatures from the locked-sigs.inc file so that extensible SDK
installers built when IMAGE_FSTYPES includes "live". (It turned out we
already had code to find other image tasks in the task list in order to
generate the list of install targets.)

Follow-up fix for [YOCTO #9826].

(From OE-Core rev: a7133bf6bb650b944d29d01129f36a56282acd2b)

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-07-08 09:57:25 +01:00
Paul Eggleton
c7ab9f3ca1 classes/populate_sdk_ext: ensure tasks to build the image are included
If you build an extensible SDK for an image and IMAGE_FSTYPES includes
"live" then the extensible SDK will fail to install with a bunch of
unexpected task execution errors, matching the missing items required to
build the live image. The issue was we were still depending on do_rootfs
rather than do_image_complete. The fix was slightly more complicated
than just changing the task name as do_image_complete's dependencies are
in the form of dependencies on tasks within the same recipe (represented
in the "deps" varflag rather than the "depends" varflag).

Fixes [YOCTO #9826].

(From OE-Core rev: 2b9c092e89b421bf7fd6a7c9604a83ae420d85ba)

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-07-08 09:57:24 +01:00
Paul Eggleton
1063622cc6 recipetool: create: drop unused convert_pkginfo() function
Code cleanup, no functional changes - this code was never used.

(From OE-Core rev: 397b76c7f26e38e761b94b1f7987aafd55048e10)

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-07-08 09:57:24 +01:00
Paul Eggleton
75f1a0ed42 recipetool: create: avoid decoding errors with Python 3
We're opening source files with the default encoding (utf-8) but we
can't necessarily be sure that they are UTF-8 clean - for example,
recipetool create ftp://mama.indstate.edu/linux/tree/tree-1.7.0.tgz
prior to this patch resulted in a UnicodeDecodeError. Use the
"surrogateescape" mode to avoid this.

Fixes [YOCTO #9822].

(From OE-Core rev: 50fcd9d1b9a20d49bc873467a82a071f2f2f8b5a)

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-07-08 09:57:24 +01:00
Zhenbo Gao
74c5cd0c2c autogen-native: fix script error when processing libguile
do_configure for autogen-native would fail if build directory path
contains '-I' characters, which is caused by the unsuitable sed script
when processing libguile.

Error log:
[snip]
checking for GUILE... yes
awk: fatal: cannot open file `/buildarea1/poky/build /libguile/version.h' for reading (No such file or directory)
configure: error: in `/buildarea1/poky/build-Ice/tmp/work/x86_64-linux/autogen-native/5.18.10-r0/build':
configure: error: cannot determine Guile version
[snip]

(From OE-Core rev: 2004307044e958cdf508b72f180e238a3e297179)

Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:24 +01:00
Joe Slater
e4224fb50d l3afpad: add check for GTK3DISTROFEATURES
We want world builds without GTK3DISTROFEATURES to work.

(From OE-Core rev: 0b2945588f7b539836369895dc7d3d2629abb431)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:24 +01:00
Chen Qi
dca5d9d218 gettext: fix for low-version recipe
Make gettext-native in 0.16.1 recipe provides virtual/gettext-native like
what gettext-native in 0.19.6 recipe does. Otherwise we would fail to start
to do a world build if gettext and gettext-native are set to the low version.
Error message is like below.

  ERROR: Multiple versions of gettext-native are due to be built

(From OE-Core rev: a0bdbd8f38d8d2ca0687f4353b715087f946247a)

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>
2016-07-08 09:57:24 +01:00
André Draszik
e1ca5d9929 libidn: add patch to build w/ -Wformat-security
While the file in question is a command line utility
only, let's be clean and still fix it.

(From OE-Core rev: 40636c1ef853be01541b89d9b6f1321bbeefe8f3)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:24 +01:00
Ross Burton
e49d337e84 meta: update patch metadata
Enforce the correct tag names across all of oe-core for consistency.

(From OE-Core rev: 606a43dc38a00cc243f933722db657aea4129f8e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:24 +01:00
Robert P. J. Day
e6ad36cb54 run-postinsts: Correct comment misspelling, "rpm-posinsts".
(From OE-Core rev: 45048442913687f2817ef9a52352fe3214f5f023)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:24 +01:00
Ed Bartosh
94fb1a57de oepydevshell-internal: python3: encode/decode pty content
As /dev/pty opened in binary mode its content has to
be decoded when reading from it and encoded when writing to it.

(From OE-Core rev: 211870ddbce5c966b2882e97cb2efe29b72a62a4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:24 +01:00
Ed Bartosh
e8feb1976a devpyshell: python3: flush stdout explicitly
Opening text stream in unbuffered mode raises the following
exception In Python 3:
    ValueError: can't have unbuffered text I/O

Fixed by leaving std* streams in text mode and flushing
stdout explicitly.

(From OE-Core rev: 732001cb268683f5b56e251e2964ec5b694a2147)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Ed Bartosh
250955ab8c devshell.bbclass: fix double unbuffering
stdout is already unbuffered in bitbake code. Attempt to
do it again in devshell.bbclass causes this crash when
running devpyshell:
  File "scripts/oepydevshell-internal.py", line 29, in <module>
      pty = open(sys.argv[1], "w+b", 0)
  IOError: [Errno 13] Permission denied: '/dev/pts/6'

(From OE-Core rev: 875910451e1ce97d0c42b41b1140c8160ed1f40a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Joshua Lock
16df2b6efa pseudo: drop recipe for old 1.6.7 version
(From OE-Core rev: 66cda3c6a281fd06e787ddbeb03f4796aae0feb8)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Paul Eggleton
4ebe0e1175 classes/cmake: enable progress for do_compile
cmake outputs percentage complete as part of its compilation process, so
we can enable BitBake's new progress scanning for do_compile here.

(From OE-Core rev: f77ea95ba5cd337f01f2a1b4fe9466feb6af9440)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Paul Eggleton
a702c68c5b classes/populate_sdk_ext: eliminate double execution on install
Use the new BB_SETSCENE_ENFORCE functionality to avoid having to run
bitbake twice on installing the extensible SDK - we can now do it all in
one invocation which not only takes less time, but we should also get
more meaningful errors for some types of failure, in particular where
downloading from an sstate mirror fails.

One result of this change is that you get the errors printed on the
console during normal output rather than this going to the
preparing_build_system.log file first. In OE-Core revision
227d2cbf9e0b8c35fa6644e3d72e0699db9607fa, we changed to always print the
contents of preparing_build_system.log on failure, but now at least the
error contents of that log is duplicated. Besides, I intentionally
didn't print out the contents of that log during normal usage because
it's quite verbose - the bug that we were attempting to fix was about
not getting this information when seeing failures in the automated
tests, thus I've moved printing the log to the test handling code
instead.

Part of the implementation of [YOCTO #9367].

(From OE-Core rev: e1390c1ef85862b91b067ab24f3c06ca506155ad)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Paul Eggleton
c24b6512d7 toolchain-shar-extract.sh: allow TERM through into SDK installer env
In order to show the task progress during the extensible SDK
installation, knotty needs to know it is using a terminal it can
support the "interactive" mode on (i.e. ncurses can be used), which
means it needs access to the TERM variable value, so allow that
through into the cleaned environment within the SDK installation
script.

Part of the implementation for [YOCTO #9613].

(From OE-Core rev: a8f11bc5ce07114b9ec7da7ad48da62e2026cd74)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Paul Eggleton
af4d7258b1 lib/oe/sstatesig: print locked sigs file message only when explicitly called
If we're building the extensible SDK we don't need to see the "Writing
locked sigs" message; it's only necessary when the user explicitly runs
bitbake -S none <target>.

(From OE-Core rev: 440a351ee13920045c9d3e51882908f7b3f01d35)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Paul Eggleton
ff41cfb508 classes/testsdk: print output correctly on failure
With Python 3 we get a bytes object from the command output and not a
string, which gives some ugly formatting for error messages unless you
decode it first.

(From OE-Core rev: 798bec6fe43116b51247284eb4e415337b2e8e04)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Paul Eggleton
6677dd37ad classes/sstate: add a mode to error if sstate package unavailable
If BB_SETSCENE_ENFORCE is set to "1" and an sstate package fails to
download outside of the whitelist specified by
BB_SETSCENE_ENFORCE_WHITELIST, then fail immediately so you can tell
that the problem was caused by failing to restore the task from sstate.

Part of the implementation of [YOCTO #9367].

(From OE-Core rev: 9e711b54487c3141d7264b8cf0d74f9465020190)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Paul Eggleton
e769dce794 classes/sstate: show progress during sstate object availability check
Show progress through bitbake's standard terminal UI when checking for
shared state object availability, since this can take some time if there
are a large number of tasks to be executed and/or the network connection
is slow.

Part of the implementation for [YOCTO #5853].

(From OE-Core rev: 1a064385d6921ec90b33c9064dafaab11a36267c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Paul Eggleton
40712171b2 classes/image: implement progress support for do_rootfs
Use the new task progress functionality to report progress during
do_rootfs. This is a little coarse and ideally we would have some
progress within the installation section, but it's better than
nothing.

(From OE-Core rev: 370f08d434480c1790950e40db8f7687da78cb14)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Paul Eggleton
8daa1b419f bitbake.conf: whitelist progress varflag
We don't want the value of this varflag in any signatures since it's
only there for the purpose of aiding display of task execution.

(From OE-Core rev: 1f33659a92b2d4b1514984183384fbdcf72ddb99)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:22 +01:00
Humberto Ibarra
4e889c04ba scripts/lib/bsp/help.py: Changed help of yocto-bsp to match latest syntax
With the changes to migrate from optparse to argparse there was a syntax change that needs an update in the help. This is basically just the change of 'properties' and 'property' from positional arguments to options. This patch makes the required changes.

[YOCTO #8321]

(From meta-yocto rev: b171379b5ca54d55ea763421794a651e71bbda91)

Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-07 13:38:13 +01:00
Humberto Ibarra
479d15b326 yocto-bsp: Refactor script to use argparse instead of optparse
Optparse is deprecated and should be avoided. The arparse library is better suited and has more tools to handling the parsing of arguments. This patch makes necessary changes to migrate to the better library and uses arparse subcommand feature to improve organization of this script.

[YOCTO #8321]

(From meta-yocto rev: 3f45993b96d4d960da0efe8672dc323c9db091a2)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-07 13:38:13 +01:00
Humberto Ibarra
4ab8650eeb scripts/yocto-bsp: Removing version from yocto-bsp
The version option is not maintained and is useless inside this script.
There is no reason for this script to have an independent version value.

[YOCTO #8321]

(From meta-yocto rev: 8f8790e56d00f2eaaf6508fb1909335f1fbef5ff)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-07 13:38:13 +01:00
Humberto Ibarra
4252ec78a4 scripts/lib/bsp/engine.py: Add error message for wrong input file
Format of properties file is expected to be a simple json detailing properties, if this format fails an exception is thrown. This patch adds a graceful error message to the case when the properties file has a wrong format.

[YOCTO #9750]

(From meta-yocto rev: 7e543aa19d0d4b2112e6316783fb31b76df3493e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-07 13:38:13 +01:00
Humberto Ibarra
71bc7fd8ce scripts/lib/bsp/help.py: Fixed pager for yocto-bsp help
Python3 requires strings to be encoded as bytes before sending them through a subprocess pipe. The help.py file is not considering this and fails when issuing paged help commands. This patch adds this encoding to solve the problem.

[YOCTO #9868]

(From meta-yocto rev: 35b487a47f0cbb99fdee2ec9cc8b56b814c8860e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-07 13:38:13 +01:00
Humberto Ibarra
21282724d8 scripts: Fixed typo in parameter that was causing exception
There is a typo in the logging parameters, "filname" is being used instead of "filename" for yocto-kernel, yocto-layer and wic scripts. This didn't cause issues before since python 2 didn't validate unused parameters but with python >= 3.4.3 an exception is thrown. This patch fixes this parameter name.

[YOCTO #9834]

(From meta-yocto rev: 844fbba63b146a2ded3fced0d62bf047bf844af3)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-07 13:38:13 +01:00
Robert P. J. Day
3f8fbdb342 meta-yocto: Delete PREFERRED_VERSION for obsolete version of U-Boot.
The OE recipe for U-Boot v2013.07 was deleted in 2014, so remove this
reference to it.

(From meta-yocto rev: a864e357f8d02ba52a38a96fd8b03f01c60888e8)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-07 13:38:13 +01:00
Paul Eggleton
9d0e39195d local.conf.sample.extended: drop RPM4 example
We don't have RPM4 support anymore, so there's no point including this.

(From meta-yocto rev: 81fc11e65c4fb189cc91422018aec5041f44ae02)

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-07-07 13:28:56 +01:00
Joshua Lock
11af659530 poky: drop unsupported distros
We're no longer building CentOS 6, Debian 7 or Fedora 21 on the
Autobuilder cluster.

(From meta-yocto rev: e4d81d1bcd8aa3ecdd247b8c05a015a87f10cb5e)

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-07-07 13:28:56 +01:00
Ross Burton
5c11e365e1 lib/oeqa: add Galculator to SDK and runtime tests
This is a GTK+3 application, so we don't need to ship GTK+ 2 in Sato just for
the SDK test suite.

[ YOCTO #9780 ]

(From OE-Core rev: 53fcfe4348a2ca727844f2b0bd3fca2902cbdda0)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:48 +01:00
Ross Burton
b305564028 oeqa/runtime/syslog: remove redundant skipUnlessPassed
The test test_syslog_help doesn't exist, so skipping unless it passed just
produced a warning.

(From OE-Core rev: 9856fe02bf30cd9e834a7d324e357070f4d7735f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:48 +01:00
Ross Burton
e0bcf333df toolchain-scripts: add sysroot/usr/share/pkgconfig to PKG_CONFIG_PATH
Otherwise architecture-independent pkg-config files such as wayland-protocols
won't be found in the SDK.

(From OE-Core rev: 1bea760f3f462fdcc3eefc0d8597688d61447ddd)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:48 +01:00
Ross Burton
076a93eed7 oeqa/utils/commands: fix single-character variable matching in get_bb_vars()
(From OE-Core rev: 2f7e4d0636ce1647edf2d82c65b82be0eb2c1db1)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:48 +01:00
Bruce Ashfield
8f82db78a9 linux-yocto: bxt and input configuration changes
Merging the following two configuration changes:

  Author: Rebecca Chang Swee Fun <rebecca.swee.fun.chang@intel.com>
  Date:   Mon Jun 27 15:11:04 2016 +0800

    broxton: set CONFIG_GPIO_GENERIC_PLATFORM instead of CONFIG_GPIO_GENERIC

    CONFIG_GPIO_GENERIC option is tristate, this will ensure we
    enable by selecting CONFIG_GPIO_GENERIC_PLATFORM.

    This addresses the following message:

    Value requested for CONFIG_GPIO_GENERIC not in final ".config"
    Requested value: "CONFIG_GPIO_GENERIC=y"
    Actual value set: ""

    Signed-off-by: Rebecca Chang Swee Fun <rebecca.swee.fun.chang@intel.com>

  Author: California Sullivan <california.l.sullivan@intel.com>
  Date:   Mon Jun 27 17:15:53 2016 -0700

    features/input: Add keyboard-gpio feature

    This feature adds keyboard-gpio support to the kernel. We also add a
    specific implementation by default. More can be added as necessary.

    Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
    Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>

(From OE-Core rev: 358fa56efa2db2a5276a910676e2e6093fe2da0f)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:48 +01:00
Bruce Ashfield
76332d91da linux-yocto/4.x: vfat feature cleanup
From Tom:

  This is a small patchset for yocto-4.4 that removes open-coded VFAT_FS
  and enables defaults that should be enabled along with it.

(From OE-Core rev: 0eb474575a96a525755c1d679015af49d7667283)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:48 +01:00
Bruce Ashfield
b80b5433a3 linux-yocto/4.1/4.4: tpm, telemetry, acpi and cpuid changes
Backporting mainline and development commits to for various subystems.

linux-yocto: 4.4:
  ae6a527d93f i2c: add support for ACPI reconfigure notifications
  f2422e12af53 acpi: add support for ACPI reconfiguration notifiers
  bc87718fdb56 acpi: fix enumeration (visited) flags for bus rescans

linux-yocto: 4.1:
  9f166e918f63 platform:x86 decouple telemetry driver from the optional IPC resources
  adfc21c1f156 tpm: update PPI documentation to address the location change.
  661b0190e412 x86 tsc: enumerate BXT tsc_khz via CPUID
  78be69fa9d15 x86 tsc: enumerate SKL cpu_khz and tsc_khz via CPUID

(From OE-Core rev: fdde7061108f04b04a82ba76205ce85afc543a6f)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Yu, Ong Hock <ong.hock.yu@intel.com>
Signed-off-by: Yong, Jonathan <jonathan.yong@intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:48 +01:00
Markus Lehtonen
678a02e112 scripts/contrib: introduce build-perf-test-wrapper.sh
A shell script wrapper around oe-build-perf-test script. The purpose of
this wrapper is to act as a executor script, making it possible to run
the tests with a single command. The wrapper script initializes the
build environment, runs oe-build-perf-test and archives the results.

(From OE-Core rev: 946a076c2ce20dd8f7cfa1acbdab1268d406d3e1)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:48 +01:00
Markus Lehtonen
0c92770ed2 oe-build-perf-test: add --out-dir command line argument
The new option defines the output directory for the test result data.

(From OE-Core rev: bc865b5cb5a9a76048ee9c55a29f5e1a926bb543)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:48 +01:00
Markus Lehtonen
c3ee14ef38 oe-build-perf-test: enable locking
Makes it possible to guard that multiple tests are not run in parallel.

(From OE-Core rev: 181e92e7a1bccf678b3eb1bf547608a142784f97)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:47 +01:00
Markus Lehtonen
eb36f00002 oe-build-perf-test: implement --globalres-file option
Using this option the script appends test results into a 'global results
file'. A CSV-formatted output of the results. This option is to provide
compatibility with the old build-perf-test.sh.

(From OE-Core rev: e9f18e63220e452f2b0c878998e57d944ae83980)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:47 +01:00
Markus Lehtonen
8c596369dd oeqa.buildperf: add git revision and branch to result data
BuildPerfTestRunner determines these from the Git repository under which
it is being run (i.e. where the build directory exists). The branch and
revision may be defined/overridden with OE_BUILDPERFTEST_GIT_BRANCH
and OE_BUILDPERFTEST_GIT_BRANCH environment variables, if needed. This
makes it possible to run the build performance test script even if the
top directory is not a git repository clone, for example.

(From OE-Core rev: e6004582454d8c6a18f617c12e6e408ded5be8df)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:47 +01:00
Markus Lehtonen
964fffa514 oeqa.utils: add git module
A new helper module for easier interaction with Git repositories.
Provides GitRepo class that represents one local Git repository clone.
The GitRepo class currently only has one method, run_cmd(), for running
arbitrary git commands in the repository. More specialized methods for
commonly used git operations can be added later.

(From OE-Core rev: 4eaf434f885afbda03fe67ab6e9ff291c7a9c77e)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:47 +01:00
Markus Lehtonen
8329d56cd4 oe-build-perf-test: enable logging into file
(From OE-Core rev: d5bbcdaf332b2a15382672d6a40b2d2b807b9dde)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:47 +01:00
Markus Lehtonen
5599645d33 oeqa.buildperf: archive build/conf into test results
Have the build/conf directory as part of test results.

(From OE-Core rev: ea32a8a65f668450e0ec0e80483bd5e8c91b8a18)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:47 +01:00
Markus Lehtonen
da3b9242fc oeqa.buildperf: add test Test4
Re-implement "test4" from build-perf-test.sh which measures eSDK metrics.

(From OE-Core rev: c449ca1b062426380a0572aed2da4ee4a83281f5)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:47 +01:00
Markus Lehtonen
fe24b5a597 oeqa.buildperf: add test Test3
Re-implement "test3" from build-perf-test.sh which measures
bitbake parsing time.

(From OE-Core rev: 388c7160b90247df9c78d8803083821402c13af5)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:47 +01:00
Markus Lehtonen
0b2fae81fd oeqa.buildperf: add test Test2
Re-implement "test2" from build-perf-test.sh which measures
'bitbake core-image-sato -c rootfs'.

(From OE-Core rev: 8cb322d6a5be08f0bb2c9e5d3b73161b20d737a3)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:47 +01:00
Markus Lehtonen
1701a34f14 oeqa.buildperf: add test Test1P3
Re-implement "test1_p3" from build-perf-test.sh which measures
'bitbake core-image-sato' with rm_work enabled.

(From OE-Core rev: bfe48d343e8a281760da0b6744c08d47039f93e0)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:47 +01:00
Markus Lehtonen
b5ca437714 oeqa.buildperf: add test Test1P2
Re-implement "test1_p2" from build-perf-test.sh which measures
'bitbake virtual/kernel'.

(From OE-Core rev: 5ff82c6e2b0ff41a9bfdd49c99e84a982cf6e467)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:47 +01:00
Markus Lehtonen
2c1b87482c oeqa.buildperf: add test Test1P1
Re-implement "test1_p1" from build-perf-test.sh which measures
'bitbake core-image-sato'.

(From OE-Core rev: 1ddd4a8ce4e2053def0e946d4e4b4b97bdc28e61)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:47 +01:00
Markus Lehtonen
1d88659ef6 oeqa.buildperf: implement BuildPerfTestRunner class
The new class is responsible for actually running the tests and
processing their results. This commit also adds a decorator function for
adding new tests. No automatic test discovery, at least yet.

(From OE-Core rev: bf90aecb7e150d6bfac7240286c797b79d26528b)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:46 +01:00
Markus Lehtonen
6512d6956b oeqa.buildperf: add method for saving buildstats
(From OE-Core rev: 15b44a484ce408b0a1acfb907e2b12ebc6cce296)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:46 +01:00
Markus Lehtonen
45c6a04a37 oeqa.buildperf: add method for measuring file disk usage
Add a new method to BuildPerfTest class for measuring the disk usage of
a file of directory.

(From OE-Core rev: 85cdc240e75d481e93238fbf75f8b8431da05f19)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:46 +01:00
Markus Lehtonen
1a0e20546e oeqa.buildperf: add method to log shell commands
Add new methods to BuildPerfTest class for running a shell
command and logging its output.

(From OE-Core rev: 8f0b11ba1266f9c650cf34d9b394d72009ee7207)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:46 +01:00
Markus Lehtonen
6e27b2ae0e oeqa.buildperf: method for measuring system resource usage
Extend BuildPerfTest class with a new method for measuring the system
resource usage of a shell command to BuildPerfTest class.  For now,
easurement of the elapsed time is done with the Gnu time utility,
similarly to the build-perf-test.sh shell script. And, it currently only
records the elapsed (wall clock).

The measured values (currently, only the elapsed time) is actually a
dictionary, making it possible to extend it with additional resource
values, e.g. cpu time or i/o usage, in the future.  In addition to the
actual values of the measurement each record contains a 'name' and
'legend' where name is supposed to function as a common key or id over
test runs, making comparison and trending easier, for example. Legend is
supposed to be a short human readable description.

(From OE-Core rev: ced156bfea4a6649d201f41275641a633f218322)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:46 +01:00
Markus Lehtonen
1b10ded015 oeqa.buildperf: add BuildPerfTest class
The new class will be used as an abstract base class for build
performance tests. This implementation contains some common
functionality used in multiple tests, "copied" from the
build-perf-test.sh shell script.

(From OE-Core rev: 35cd7363759a286e80ddca0d028db3d2bf524b17)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:46 +01:00
Markus Lehtonen
cee685ca0d oeqa.buildperf: functionality to drop kernel caches
Add a new utility class for dropping Linux kernel caches.  It uses sudo
and tee to write to the drop_caches file. Checking if the user has the
permissions to drop caches (without a password) is done by trying to
writing an invalid value to the drop_caches file. This way, we will find
if writing (with tee) is possible but not really dropping caches, yet.

User can avoid giving the password by adding something like:
<user> ALL = NOPASSWD: /usr/bin/tee /proc/sys/vm/drop_caches
to the system sudoers file.

(From OE-Core rev: c9cb248429ced50c96d11ba5361c272d4c9b9323)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:46 +01:00
Markus Lehtonen
7d42ceae3a oe-build-perf-test: introduce oeqa.buildperf module
Wireframe of a new Python module for containing build performance tests
and utility functions.

(From OE-Core rev: b44af9051a9da8d2cddc7b071a896331967f15cc)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:46 +01:00
Markus Lehtonen
c855cb807d oe-build-perf-test: add pre-run sanity check
The script will be required to be run in an initialized bitbake build
environment.

(From OE-Core rev: 1bce7b10283255a4498d11ead920c1f3b1dec4de)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:46 +01:00
Markus Lehtonen
14108a88ab scripts: introduce oe-build-perf-test
Initial wireframe for re-writing build-perf-test.sh in Python.

(From OE-Core rev: 764eb2d011305b84501cc183531a2a5353b0b5ab)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:46 +01:00
Markus Lehtonen
ec8be2039e oeqa.utils.commands: runCmd: return stderr output, too
Useful if one wants to separate stdout and stderr.

(From OE-Core rev: de9744c91a997a5ab0e7a19dbe13d8def8d62800)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:46 +01:00
Markus Lehtonen
cf4c8980d7 oeqa.utils.commands: use get_bb_vars() in get_bb_var()
Get rid of duplicate code.

(From OE-Core rev: cdd6b7386afd460337705d8117a4328d4993ecef)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:45 +01:00
Markus Lehtonen
c9639e6523 oeqa.utils.commands: Introduce get_bb_vars()
A new function for getting values of multiple bitbake variables at the
same time.

(From OE-Core rev: fe3039322e2f846b336ac5af5177e9da27d79695)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:45 +01:00
Bill Randle
58643b74ee lib/oe/package_manager: keep platform_extra and default_platform_extra lists ordered
In RpmPM:insert_feeds_uris, the paths are kept in sets, which are unordered,
but they are later used to set the priority for the Smart channels, so
unexpected results could occur. Change the sets to lists and use the same
code as in create_configs() to add items to the list, rather than the set
operators.

[YOCTO #9717]

(From OE-Core rev: ce4137f4bb955207fede0c4ef338835d9a461f59)

Signed-off-by: Bill Randle <william.c.randle@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:45 +01:00
Patrick Williams
6d2bcc2473 linux-libc-headers: Update doc for recipe depends
The previous documentation has not been accurate since at least
commit 6a1ff0e.  Recipes that follow the old documentation will
not correctly build when sstate is enabled because the kernel
source will not actually be available.

(From OE-Core rev: 8e7522aae65b3ab0a2ded257d5c82e030fe2d710)

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:45 +01:00
Maxin B. John
aa2da21138 gstreamer1.0-libav_git: bump version to 1.8.2
Upgrade _git version to 1.8.2 release

(From OE-Core rev: 7687a028f5ce599e86c764892a099ed3bc26c2cd)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:45 +01:00
Maxin B. John
2f5737c5b3 gstreamer1.0-plugins-ugly_git: bump version to 1.8.2
Upgrade _git version to 1.8.2 release

(From OE-Core rev: 2e4b136cd2d50e8926564b394ea750c25224aab4)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:45 +01:00
Maxin B. John
345edd489f gstreamer1.0-plugins-base_git: bump version to 1.8.2
Upgrade _git version to 1.8.2 release

(From OE-Core rev: 8e5774960f0ad18b3d2f4e5ca46accfc3fb12200)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:45 +01:00
Maxin B. John
5e22094c76 gstreamer1.0-plugins-bad_git: bump version to 1.8.2
Upgrade _git version to 1.8.2 release

(From OE-Core rev: 6197957b259d76965bdcb03c0eac1ef798a405e2)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:45 +01:00
Maxin B. John
b4fc653c11 gstreamer1.0-plugins-good_git: bump version to 1.8.2
Upgrade _git version to 1.8.2 release

(From OE-Core rev: a52963e2827cf2ad4f50c64d24d64c5cfb012197)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:45 +01:00
Maxin B. John
869ad200d0 gstreamer1.0_git: bump to 1.8.2
Upgrade _git version to 1.8.2 release

(From OE-Core rev: d79ecfcab42d6ff382c0b89cd90c32747925db91)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:45 +01:00
Khem Raj
6bfec952cd gstreamer1.0: Upgrade to 1.8.2
[ fix gstreamer1.0-libav checksum - RB ]

(From OE-Core rev: 6f98d0ce55e781a53c57fecbd3e44de5e083225f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:45 +01:00
Ricardo Neri
3e74ef223c kernel-module-split.bbclass: add a prefix for module package name pattern
When splitting kernel modules into individual packages, such packages take
their names from the module name. This is OK under most of the circumstances.
However, it may lead to package naming collisions if there exists two
modules with the same name.

Situations like this can occur when building testing modules. For instance,
there exists testing versions of the modules for non-volatile memory that
are built with different linker options but bear the same module name. If
one wants to package such modules, it is be good to be able to name
packages differently. This can be done by prefixing the package name with
a KERNEL_MODULE_PACKAGE_PREFIX that can be set by the recipes that inherit
from module.bbclass.

Cc: Megha Dey <megha.dey@intel.com>
(From OE-Core rev: 4f941e8c5ee8e95291c3beff0a2798aa13f8dfc8)

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:45 +01:00
Khem Raj
fff33f1c22 watchdog: Fix build with musl
A similar patch has been submitted upstream

(From OE-Core rev: f6f531e7795dceefa8a42246cb9ed4efbffca2dd)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:44 +01:00
Khem Raj
1bf0944925 gcc5: Upgrade to gcc 5.4
Drop patches which has been applied to gcc5 branch
until 5.4 release

(From OE-Core rev: 42487843f846ae61f8bd1b2278d148ff37f0d667)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:44 +01:00
André Draszik
0412b6d90d uclibc: re-enable verbose compilation
uClibc-ng swapped the meaning of V=1 and V=2 in 2015 before
the 1.0.3 release.

Before that, V=2 printed the full commands while V=1 printed the
abbreviated versions.

This recipe was never updated to follow the change and we since
see brief build output only.

At the same time, convert V from an environment variable to
a make variable by adding to EXTRA_OEMAKE, so as to be in
line with how things are done in other recipes that use
kbuild.

(From OE-Core rev: 4ff37b9a55b1239e339e7d93a2ad6e0c71971345)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:44 +01:00
André Draszik
c1dafd10d8 uclibc: backport patch to fix gdb 7.11 compilation
[YOCTO #9781]

(From OE-Core rev: 89cbf98fda3eb5d75eb03b3781bd86506ec2b126)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:44 +01:00
André Draszik
820a9d0cb6 classes/kernel: fix symlink logic when bundling initramfs images
If linkpath points to the a file in KERNEL_OUTPUT_DIR, rather than
outside, then symlink creation for the bundled initramfs image files
fails.

This is because in that case $linkpath.initramfs and $realpath.initramfs
are in the same directory, KERNEL_OUTPUT_DIR, and hence are the same.
Since we just created $realpath.initramfs, creating a symlink with the
same name will fail.

Given that $linkpath is not necessarily the same as the kernel image type,
just removing this symlink creation is not the right thing to do, as
in that case kernel_do_deploy() wouldn't find the bundled file.

What we really want is a symlink from the name of the initramfs-bundled
kernel image type to the real initramfs-bundled kernel image, as that is
what is actually used later in do_deploy().

This brings the code path for when $KERNEL_OUTPUT_DIR/$type is a symlink
in line with when it is not.

(From OE-Core rev: 7585ebbbe4e95870ab7475737ed5b94255351c72)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:44 +01:00
André Draszik
1b29aff0e0 binutils: backport patch to fix mipsel (malta) kernel compile
This fixes the following compilation error when building a mipsel
yocto kernel for qemu:

|   CC      arch/mips/mm/sc-ip22.o
| {standard input}: Assembler messages:
| {standard input}:128: Error: number (0x9000000080000000) larger than 32 bits
| {standard input}:151: Error: number (0x9000000080000000) larger than 32 bits
| {standard input}:186: Error: number (0x9000000080000000) larger than 32 bits

We leave out the testsuite bits and the changelog in this
backport.

(From OE-Core rev: 8b378a17bf6d6c43f097b9df491e5c6ec59bf316)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:44 +01:00
André Draszik
aa9fb3f5d4 glib: disable valgrind support when compiling in mips16e mode
| mipsel-poky-linux-uclibc-gcc -mel -mabi=32 -msoft-float \
|   -march=mips32r2 -mips16 -minterlink-compressed -mtune=24kec \
|   -mdsp --sysroot=<sysroot> -DHAVE_CONFIG_H -I. \
|   -I<glib>/glib -I.. -I.. -I../glib -I<glib>/glib -I<glib> \
|   -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DGLIB_COMPILATION \
|   -DPCRE_STATIC -pthread -Wall -Wstrict-prototypes \
|   -Werror=declaration-after-statement -Werror=missing-prototypes \
|   -Werror=implicit-function-declaration -Werror=pointer-arith \
|   -Werror=init-self -Werror=format=2 -Werror=missing-include-dirs \
|   -fvisibility=hidden -O2 -pipe -g -feliminate-unused-debug-types \
|   -c <glib>/glib/gslice.c  -fPIC -DPIC -o .libs/libglib_2_0_la-gslice.o
| {standard input}: Assembler messages:
| {standard input}:2485: Error: invalid operands `move $11,$8'
| {standard input}:2487: Error: invalid operands `srl $0,$0,13'
| {standard input}:2488: Error: invalid operands `srl $0,$0,29'
| {standard input}:2489: Error: invalid operands `srl $0,$0,3'
| {standard input}:2490: Error: invalid operands `srl $0,$0,19'
| {standard input}:2491: Error: invalid operands `or $13,$13,$13'
| Makefile:2076: recipe for target 'libglib_2_0_la-gslice.lo' failed

The alternative would probably be to force compilation in normal mips
mode for all of glib (as is done for armv4 and armv5). While that
would retain the valgrind support, valgrind support itself shouldn't
be needed on the target device, and we rather keep the mips16e mode.

(From OE-Core rev: 50be6f861a6c1076ace0fdd3f4381706351987ba)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:44 +01:00
André Draszik
fc97ef905d libffi: don't compile in mips16e mode
libffi contains hand-written assembly which is not compatible with
the MIPS16e mode.

(From OE-Core rev: 27467ca354801aeb6d7e3a658cff3dda37db971a)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:44 +01:00
André Draszik
90bb7c1a96 uclibc: don't compile in mips16e mode
uClibc contains hand-written assembly which is not compatible with
the MIPS16e mode.

(From OE-Core rev: 5a32f23210ecb90ca97e4e861146208c88762209)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:44 +01:00
André Draszik
2c80ebf8df gmp: don't compile in mips16e mode
gmp contains hand-written assembly which is not compatible with
the MIPS16e mode.

(From OE-Core rev: 217729318b42ab378e1cc70db7726022a5837b49)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:44 +01:00
André Draszik
d81b9185a1 json-c: backport patch to fix uClibc link issues
We need to link against libm as we get linker errors otherwise:

<sysroot>/usr/lib/libjson-c.so.2: undefined reference to `__isnan'
<sysroot>/usr/lib/libjson-c.so.2: undefined reference to `__isinf'
collect2: error: ld returned 1 exit status

Backport the upstream patch.

(From OE-Core rev: 964456b0a2b9404ea54d6905a418ecf52b522bca)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:44 +01:00
André Draszik
15c3c3e54c libidn: fix QA warning (uClibc)
WARNING: libidn-1.32-r0 do_package_qa: QA Issue: libidn rdepends on libiconv, but it isn't a build dependency, missing libiconv in DEPENDS or PACKAGECONFIG? [build-deps]

We already have virtual/libiconv which is set appropriately
in all environments, so let's use it to fix the issue.

(From OE-Core rev: 181918f5a3ce662f7df333c584c11f1c261f0269)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:43 +01:00
André Draszik
83444bbe2d classes/kernel: fix symlink creation in DEPLOYDIR for bundled initramfs
If multiple kernel image types have been specified, only the very first
one would receive a symlink in DEPLOYDIR.

The reason is that we're looping over the list of image types and check
if a bundled initramfs images exists using a relative path. As part of
the loop we're changing the current directory, hence all additional
iterations fail to see the files we're looking for, and hence no symlinks
are being created.

Fix by not changing the directory and adjusting the ln invocation instead.

(From OE-Core rev: 2a6ac8ca71b669b8653eb19417faf58575385a21)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:43 +01:00
Khem Raj
dc1b016636 musl: Upgrade to tip
Rich Felker (4):
      fix undefined pointer arithmetic in CMSG_NXTHDR macro
      fix a64l undefined behavior on ILP32 archs, wrong results on LP64 archs
      avoid padding gaps in struct sockaddr_storage
      remove comments on copyright status from UTF-8 implementation files

Szabolcs Nagy (8):
      fix the use of uninitialized value in regcomp
      add preadv2 and pwritev2 syscall numbers for linux v4.6
      add SO_CNX_ADVICE to sys/socket.h, new in linux v4.6
      add ETH_P_MACSEC netinet/if_ether.h, new in linux v4.6
      update siginfo struct for linux v4.6
      add CLONE_NEWCGROUP clone flag, new in linux v4.6
      add new tcp_info fields from linux v4.6
      update sys/socket.h to linux v4.6

(From OE-Core rev: d81bb8c6362d59a124bbe9b3a60cb259733b120d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:43 +01:00
Alexander Kanavin
b84875f423 pythonnative.bbclass, python3native.bbclass: use DEPENDS_append instead of DEPENDS +=
Otherwise -native variants of recipes that use these classes don't get a proper python[3]-native
dependency for some reason.

(From OE-Core rev: 834514198f9e39ce323270567e3ce744f763b637)

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>
2016-07-01 16:22:43 +01:00
Nathan Lynch
98121ad2a5 recipetool: recognize less common makefile names
GNU make looks for "makefile" and "GNUmakefile" in addition to
"Makefile", so add these other names to the heuristic for detecting a
make-based project.

(From OE-Core rev: 204d19b02265e5b2241888e4c92c0a730f3d3472)

Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:43 +01:00
Chen Qi
77b572800e systemd: upgrade to 230
Patches are rebased or removed for the latest version.

Python testing scripts are removed for systemd-ptest as systemd is
configured with '--without-python'.

systemd-bootchart is now seprated from systemd, thus removing the
related configuration items. And we add systemd-bootchart recipe.

[ systemd-bootchart: add missing distro features check - RB ]

(From OE-Core rev: 70d782eee573fe46ec512bf59ac6f41e53a99b1b)

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>
2016-07-01 16:22:43 +01:00
Chen Qi
f4008338c9 bash-completion: delete files util-linux provides
(From OE-Core rev: ae4e994b7a23ceeef00137110a35fbe0e509caec)

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>
2016-07-01 16:22:42 +01:00
Chen Qi
73dcfb6f10 util-linux: upgrade to 2.28
Related patches are rebased.

util-linux-ng-2.16-mount_lock_path.patch is removed because there's
no _PATH_MOUNTED_LOCK in the latest codes.

util-linux-native.patch is removed because 2.28 version of util-linux
has taken mkostemp into consideration and provide fallback if mkostemp
fails.

avoid_unsupported_sleep_param.patch is removed and coreutils is added
as a runtime dependency to util-linux-ptest to solve the same problem.

avoid_unsupported_grep_opts.patch is removed and grep is added as a
runtime dependency to util-linux-ptest to solve the sanme problem.

(From OE-Core rev: fccf99d9130f3c5ce358c97c97c52cd74deef25c)

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>
2016-07-01 16:22:42 +01:00
Martin Jansa
52adfed684 test-dependencies.sh: Strip also '\.bb; .*' before adding failed recipe to list of failed
* format of bitbake tasks changed in:
  2c88afb   taskdata/runqueue: Rewrite without use of ID indirection

-ERROR: Task 4 (/OE/build/oe-core/openembedded-core/meta/recipes-devtools/rpm/sftp.bb, do_fetch) failed with exit code '1'
+ERROR: Task /OE/build/oe-core/openembedded-core/meta/recipes-devtools/rpm/sftp.bb:do_fetch (/OE/build/oe-core/openembedded-core/meta/recipes-devtools/rpm/sftp.bb:do_fetch) failed with exit code '1'

  so strip not only '\.bb, .*' used before, but also '\.bb;.*' to drop
  the task name to get recipe name.

* for more details see:
  http://lists.openembedded.org/pipermail/openembedded-core/2016-June/123132.html

* without this change you can see test-dependencies.sh trying to rebuild packages
  like:
  Building recipe: fbprogress (6/21)
  Building recipe: fbprogress.bb:do (7/21)
  where the later of course doesn't exist as a recipe

(From OE-Core rev: b7d6d4203cf2021ee2b9b84c8faf15198bfb536d)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:42 +01:00
Roy Li
3b208bc24b libcap: fix the libcap-native building failure on CentOS 6.7
(From OE-Core rev: a80656588a5122b0930a0d8a574c6633118f78d4)

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:42 +01:00
Andrew F. Davis
0658935795 libsdl2: Add missing comma typo
(From OE-Core rev: e1c1893228160b9620cbff0967424ddb3a2fb380)

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:42 +01:00
Alexander Kanavin
cf1af6b384 pythonnative.bbclass, python3native.bbclass: export STAGING_INCDIR, STAGING_LIBDIR, PYTHON variables
We patch Python's distutils modules to access STAGING_INCDIR/LIBDIR, so when
they are not set, scripts that utilize distutils (e.g. python-config) fail.
Several recipes need to export those manually to prevent such failures,
so let's do that in the class instead.

PYTHON variable is exported because otherwise autotools' python.m4
macro will pick up its own internal default, which may not be the version
that we want.

glib recipe in particular was previously using Python 2.x during build due to python.m4
defaulting to it - now it's using Python 3.x, and so needs a small fix in
deletion of *.pyc files.

(From OE-Core rev: c1e0eb62f2d89b10b187016200018830b1c77945)

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>
2016-07-01 16:22:42 +01:00
Alexander Kanavin
83b11dcd55 gdb-cross: do not hardcode the use of Python 2
This was overlooked in the move to Python 3

(From OE-Core rev: 2ec8db434c6da54333cbdc54763bb5561b6e4d10)

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>
2016-07-01 16:22:42 +01:00
Jussi Kukkonen
a3869bfe91 connman-gnome: StatusIcon adapts to size changes
Update the Gtk3 patch to make the StatusIcon load pixbufs at (more)
correct sizes -- Gtk3 does not seem to reliably position the icon
otherwise.

(From OE-Core rev: 708cd88608d2407db3d679cb6489dcdad58af5b7)

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-07-01 16:22:42 +01:00
Jussi Kukkonen
0cef80f7b1 vte: don't build test app
(From OE-Core rev: 23045bf89d9859d756310899052e9dd1aad302ce)

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-07-01 16:22:42 +01:00
Jussi Kukkonen
2ebd11747c gsettings-desktop-schemas: inherit upstream-version-is-even
(From OE-Core rev: e4cbd734657f0d30aa837216d54b3eaf757868dc)

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-07-01 16:22:42 +01:00
Jussi Kukkonen
d818cde5ab cairo: inherit upstream-version-is-even
Even versions are releases, odd are "snapshots".

(From OE-Core rev: 16983a7256411053d6126af9b70710056ae1ce2c)

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-07-01 16:22:41 +01:00
Jussi Kukkonen
fd7a8b2f3f puzzles: Keep building even with deprecation warnings
(From OE-Core rev: f4811d056b9c8f22deef902bc3cc3c1dc7bd10b4)

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-07-01 16:22:41 +01:00
Jussi Kukkonen
ad439cefc3 clutter-gtk-1.0: Upgrade 1.6.6 -> 1.8.0
(From OE-Core rev: e36e4167e66a74cd5612458a3377ec00d8355e32)

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-07-01 16:22:41 +01:00
Jussi Kukkonen
e889651eda at-spi2-atk: Upgrade 2.18.1 -> 2.20.1
(From OE-Core rev: cc4cc96215007c69109064998521a87ceab0d771)

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-07-01 16:22:41 +01:00
Jussi Kukkonen
169fbdbeee at-spi2-core: Upgrade 2.18.3 -> 2.20.2
Add systemd unit, patch in a configure flag to set the correct dir.

(From OE-Core rev: 02cbcd7a94ff90d72443241915496d1f00345b69)

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-07-01 16:22:41 +01:00
Jussi Kukkonen
478d446e85 atk: Upgrade 2.18.0 -> 2.20.0
(From OE-Core rev: 8d379193edf59cc88fd173814cad6019714c5376)

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-07-01 16:22:41 +01:00
Jussi Kukkonen
33226ae5b3 gtk+3: Upgrade 3.18.8 -> 3.20.6
* Remove a patch that's no longer needed (as we don't
  have a problem with client side decorations anymore)
* Wayland build now depends on wayland-protocols:
  Use same WAYLAND_PROTOCOLS_SYSROOT_DIR trick as weston so
  protocols are found and multilib build does not break
* Add new binary gtk-query-settings to -dev package
* Rebase patches
* Modify 0003-Add-disable-opengl-configure-option.patch so
  that gdkx.h really is generated whenever it changes

* Depend on wayland-protocols in gtk+3-dev if Wayland is enabled as otherwise
  the pkg-config files can't be used - RB

(From OE-Core rev: b610145b1aadb093ced72a7958d8df00ef1250b6)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>

gtk+3: depend on wayland-protocols if wayland enabled
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:41 +01:00
Joshua Lock
ef8bbc7869 openssl: prevent warnings from openssl-c_rehash.sh
The openssl-c_rehash.sh script reports duplicate files and files which
don't contain a certificate or CRL by echoing a WARNING to stdout.
This warning gets picked up by the log checker during rootfs and results
in several warnings getting reported to the console during an image build.

To prevent the log from being overrun by warnings related to certificates
change these messages in openssl-c_rehash.sh to be prefixed with NOTE not
WARNING.

(From OE-Core rev: 88c25318db9f8091719b317bacd636b03d50a411)

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-07-01 16:22:41 +01:00
Richard Purdie
2fcece7ade bitbake.conf: Drop BUILDSDK_LDFLAGS rpath, rpath-link
The SDK used to work differently and didn't include its own libc/loader.
In that case, these options were needed to correctly handle the different
library locations. With the modern relocatable SDK, we don't need these
options any more as the default paths in the dynamic loader are good enough.
They just given potential for errors so drop them.

(From OE-Core rev: 35f24931072bc60df50abe2fa3955dde5096f272)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:40 +01:00
Ross Burton
2ef717dda7 qemu: add PACKAGECONFIG stanza for bzip2
This is just for reading bzip-compressed DMG files, so disable it by default.

(From OE-Core rev: 0aad5d1888549a134968f7f6d0c9d64b3e158e1e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:40 +01:00
Ting Liu
ec64c9c02f u-boot: extend UBOOT_CONFIG format to support different binary name
When using UBOOT_CONFIG format, the final u-boot binary for each config
may have different names. Extend UBOOT_CONFIG format to support different
binary to be copied.

The new format is supposed to be compatible with old one as ${UBOOT_BINARY}
is copied by default, and images,binary can be empty.

An example format to specify it, in the machine, is:
UBOOT_CONFIG ??= "sdcard-ifc sdcard-qspi lpuart qspi secure-boot nor"
UBOOT_CONFIG[nor] = "ls1021atwr_nor_config,,u-boot-dtb.bin"
UBOOT_CONFIG[sdcard-ifc] = "ls1021atwr_sdcard_ifc_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[sdcard-qspi] = "ls1021atwr_sdcard_qspi_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[lpuart] = "ls1021atwr_nor_lpuart_config,,u-boot-dtb.bin"
UBOOT_CONFIG[qspi] = "ls1021atwr_qspi_config,,u-boot-dtb.bin"
UBOOT_CONFIG[secure-boot] = "ls1021atwr_nor_SECURE_BOOT_config"

(From OE-Core rev: 2a5c484f314ddc75cab5f0d01b0215d7fc405b6b)

Signed-off-by: Ting Liu <ting.liu@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:40 +01:00
Hongxu Jia
f91a01be70 e2fsprogs: tweak mke2fs ext4 features
While e2fsprogs upgraded to 1.43, it dropped the patch
Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch,
we get it back and rebase for 1.43 to fix invoking grub-probe
failed.

Without the fix:
...
root@localhost:~# mkfs.ext4 /dev/sda3
[skip]
root@localhost:~# grub-probe --target=fs -d /dev/sda3
grub-probe: error: unknown filesystem.
...

After apply the fix:
...
root@localhost:~# mkfs.ext4 /dev/sda3
[skip]
root@localhost:~# grub-probe --target=fs -d /dev/sda3
ext2
...

(From OE-Core rev: a96ad733cf80716e26882889a130c87a78e5f576)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:40 +01:00
Ross Burton
13eb4a832b gst-player: upgrade to latest HEAD
Update to the latest revision now that we have gst-plugins-bad 1.8.x which has
integrated the GstPlayer object.  This upstream is now just the user interface,
so remove all redundant items from the packaging and package the binaries in PN
instead of PN-bin.

(From OE-Core rev: 646c366c2566bd8dd6f73681cea9f5b021589a56)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-27 14:08:43 +01:00
Robert Yang
c6d50b2729 bitbake: lib/bb/build.py: remove task flag in deltask()
Otherwise the function like d.getVarFlag(e, 'task', True) which is used by
do_listtasks will still get it, and list the deleted tasks.

(Bitbake rev: 779d73619daf59f76f5b0313e7fb5409f6e82553)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:33 +01:00
Ross Burton
6ae96f7129 puzzles: fix Samba conflict, clean up recipe
The impetus for this was that puzzles-extra contains /usr/bin/net which
conflicts with Samba.  Hopefully it's not controversial to say that Samba has
priority here, so rename the binary in this recipe to puzzles-net.

Also fix the out-of-tree build problems (just run mkfiles in ${S}) so
autotools-brokensep doesn't need to be used.

Modernise the anonymous Python block.

Use ${bindir} instead of ${prefix}/bin.

Use autotools do_install and append instead of brokenly replicating the install
logic.

(From OE-Core rev: afb40bf179a58b7f3a8e365d87510ba2c54437d0)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:17 +01:00
Bruce Ashfield
8375252712 linux-yocto/4.4: sensor driver backports
Backporting the following mainline commits to make additional sensor
drivers available:

 iio: st-accel: add support for lis2dh12
 iio: accel: add Freescale MMA7455L/MMA7456L 3-axis accelerometer driver

(From OE-Core rev: 952fdf647ee0223df2189bbb87437befcb0c2707)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:17 +01:00
Bruce Ashfield
f28c266bea linux-yocto/4.1: pstate backports
Backporting the following pstate changes:

  fb0153332a1f intel_pstate: Add SKY-S support
  7eb5c7e382a8 intel_pstate: enable HWP per CPU
  d73ee41f9786 x86/mm: Decouple <linux/vmalloc.h> from <asm/io.h>
  f447e3d661f7 intel_pstate: Force setting target pstate when required
  7db69b864737 intel_pstate: change some inconsistent debug information
  367ff9c73d83 intel_pstate: Add tsc collection and keep previous target pstate

(From OE-Core rev: acd05ec90cfa4c43b24904117e69c805892e2544)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:17 +01:00
Bruce Ashfield
f775c270fc linux-yocto/4.1: driver, mmc and power backports
Backporting the following changes from the mainline kernel for improved
power, driver core and mmc support:

  x86 tsc_msr: Remove irqoff around MSR-based TSC enumeration
  x86 tsc_msr: Add Airmont reference clock values
  x86 tsc_msr: Correct Silvermont reference clock values
  x86 tsc_msr: Update comments, expand definitions
  x86 tsc_msr: Remove debugging messages
  x86 tsc_msr: Identify Intel-specific code
  mmc: block: Pause re-tuning while switched to the RPMB partition
  mmc: block: Always switch back to main area after RPMB access
  mmc: core: Add a facility to "pause" re-tuning
  mmc: block: Add new ioctl to send multi commands
  cpuidle: powernv/pseries: Auto-promotion of snooze to deeper idle state
  cpuidle: Do not use CPUIDLE_DRIVER_STATE_START in cpuidle.c
  cpuidle: Select a different state on tick_broadcast_enter() failures
  sched / idle: Call default_idle_call() from cpuidle_enter_state()
  sched / idle: Call idle_set_state() from cpuidle_enter_state()
  cpuidle: Fix the kerneldoc comment for cpuidle_enter_state()
  sched / idle: Eliminate the "reflect" check from cpuidle_idle_call()
  cpuidle: Check the sign of index in cpuidle_reflect()
  sched / idle: Move the default idle call code to a separate function
  powercap / RAPL: Add support for Broadwell-H
  module: add extra argument for parse_params() callback
  Driver core: wakeup the parent device before trying probe
  base:dd - Fix for typo in comment to function driver_deferred_probe_trigger().

(From OE-Core rev: 10c7d7747ec4e97d1770cc8e40883da25c37a709)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:17 +01:00
Bruce Ashfield
48d7ebc9c3 linux-yocto/4.1: SPI, MFD, alsa and perf backports
Backporting the following mainline support for enhanced/improved support
on BXT based platforms.

  spi: pxa2xx: Fix too early chipselect deassert
  spi: pxa2xx: Update comment in int_transfer_complete()
  spi: pxa2xx: Print actual DMA/PIO transfer mode in debug messages
  spi: atmel: remove warning when !CONFIG_PM_SLEEP
  spi: fix kernel-doc warnings in spi.h
  spi: expose spi_master and spi_device statistics via sysfs
  spi: meson: Fix module autoload for OF platform driver
  spi: bcm2835: BUG: fix wrong use of PAGE_MASK
  spi: bcm2835: fix overflow in calculation of transfer time
  spi: bcm2835: bcm2835_dma_release() can be static
  spi: bcm2835: fix kbuild compile warnings/errors and a typo
  spi: bcm2835: enable dma modes for transfers meeting certain conditions
  spi: bcm2835: fallback to interrupt for polling timeouts exceeding 2 jiffies
  spi: spi-pxa2xx: Remove unused legacy null dma buffer and allocation for it
  mfd: intel-lpss: Save register context on suspend
  mfd: intel-lpss: Pass I2C configuration via properties on BXT
  perf/x86: Fix time_shift in perf_event_mmap_page
  perf/x86: Improve accuracy of perf/sched clock
  ALSA: hda - Move send_cmd / get_response to hdac_bus_ops
  ALSA: hda - Merge codec and controller helpers
  ALSA: hda - moved alloc/free stream pages function to controller library
  ALSA: hda - Add DSP loader to core library code
  ALSA: hda - Add the controller helper codes to hda-core module
  ALSA: hda - Handle error from get_response bus ops directly
  Revert "ALSA: hda - fix number of devices query on hotplug"

(From OE-Core rev: 1ee07350eac47f389d6ef769c054d0ab2c258dd4)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:17 +01:00
Bruce Ashfield
deced08e86 linux-yocto/4.1: tpm2, pinctrl, powercap and watchdog backports
Backporting the following changes from the mainline kernel to enhance/add
support for tpm2, pinctrl, powercap and watchdog:

   634eecdb20b watchdog: omap_wdt: fix null pointer dereference
   79dcc6dabe63 Watchdog: Fix parent of watchdog_devices
   94a2e8f1d47e watchdog: st_wdt: Update IP layout information to include Clocksource
   3a74938a9610 watchdog: st_wdt: Add new driver for ST's LPC Watchdog
   fb6b94faa82c watchdog: digicolor: driver for Conexant Digicolor CX92755 SoC
   22fb7b1353dd watchdog: omap_wdt: early_enable module parameter
   aa70c2480483 watchdog: omap_wdt: implement get_timeleft
   47b7a1a5f70f watchdog: docs: omap_wdt also understands nowayout
   9d833b82f706 watchdog: omap: put struct watchdog_device into driver data
   87ded7189286 watchdog: omap: use watchdog_init_timeout instead of open coding it
   abccc104fcad watchdog: da9062: DA9062 watchdog driver
   95f8b1024989 pinctrl: intel: fix offset calculation issue of register PAD_OWN
   8e6606474fa0 pinctrl: intel: fix bug of register offset calculation
   2423468cb317 MAINTAINERS: add new maintainer for TPM DEVICE DRIVER
   cf94113f05a6 sysfs: added __compat_only_sysfs_link_entry_to_kobj()
   cdb63d5cd801 tpm: fix missing migratable flag in sealing functionality for TPM2
   95f738feaafe keys, trusted: seal/unseal with TPM 2.0 chips
   92eb9052fd50 tpm: seal/unseal for TPM 2.0
   d9c7bb89ec85 keys, trusted: move struct trusted_key_options to trusted-type.h
   a3b394e91b31 tpm: introduce tpm_buf
   bd68d3a21139 tpm: move the PPI attributes to character device directory.
   54fb01659b83 tpm, tpm_crb: fix unaligned read of the command buffer address
   0ab522f5ef11 powercap / RAPL: disable the 2nd power limit properly
   9ba8c36e9ea7 thermal/powerclamp: remove cpu whitelist
   2971561c8fc9 thermal/powerclamp: add cpu id for Skylake u/y
   cec457da34d0 thermal/powerclamp: add cpu id for denlow platform
   fc30ea2abdc5 thermal/powerclamp: add cpu id for skylake h/s
   3eea18356747 intel powerclamp: support Knights Landing

(From OE-Core rev: ecb1fa6ed2366a031ba374d16d4ccbbd8b7fc7e6)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:17 +01:00
Otavio Salvador
2f9b8e9134 initramfs-framework: base: Ensures /run/lock is available
Depending on the module we use, the /run/lock may be required. This
creates it as part of initial setup and thus makes it available for
every sub module.

(From OE-Core rev: 1cf288a0514ae9365fe55a0ff90b5abe35042cef)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:16 +01:00
Otavio Salvador
9623b237ce initramfs-framework: mdev: Add a runtime dependency on busybox-mdev
The mdev support relies on the mdev support inside busybox, which thus
builds the busybox-mdev package. Adding the runtime dependency ensures
its installation fails if mdev support is disabled.

(From OE-Core rev: 48dbdc0317db6836cfeba083844910c15d5beb77)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:16 +01:00
Christopher Clark
0c8b264e03 linux-firmware: add iwlwifi-misc package for remaining iwlwifi firmware
Package all remaining iwlwifi firmwares that are not individually
packaged into a single package. This is distinct from the virtual
linux-firmware-iwlwifi package so that the -misc firmwares can be
installed without pulling in all other firmwares via dependencies.

(From OE-Core rev: 9eeb4a479e1c85219e56272c66d7fc8aabc33574)

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:16 +01:00
Christopher Clark
c4067634eb linux-firmware: add iwlwifi virtual package of all iwlwifi firmwares
Depends upon all available iwlwifi firmware packages at build time.
Fix typo in ALLOW_EMPTY of earlier version.

Motivation: simplifies inclusion of all Intel wifi firmwares.

(From OE-Core rev: 610f821261a99411725b6c850fd16a397e58ada6)

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:16 +01:00
Christopher Clark
5f854c231b linux-firmware: fix typo in RDEPENDS line for iwlwifi-6000g2b-5
(From OE-Core rev: ed46f5a37e136317ad02d985ea235208f7bc2855)

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:16 +01:00
Christopher Clark
4c46ca16ee linux-firmware: add LICENSE line for iwlwifi-license package
(From OE-Core rev: 5a91dca352f40476a3bb4cfcb6d66012415b5ba3)

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:16 +01:00
Christopher Clark
87dbb6b382 linux-firmware: fix typo in LICENSE line for iwlwifi-6000g2b-5
(From OE-Core rev: 692adfab015f76178ab10947f150115846bbfa16)

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:16 +01:00
Ross Burton
1960abc96c oeqa/targetbuild: use os.path.join instead of string concatenation
(From OE-Core rev: 1d40f6e3d85d0cd3be6dd784677686ed4dec89c4)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:16 +01:00
Ross Burton
40268fe27a oeqa/targetbuild: add extra_cmds argument to run_configure
Some upstreams need more than just gnu-configize ran before ./configure works,
such as ./autogen.sh or autoreconf.  Add extra_args (defaulting to
gnu-configize) so that this can be done in test cases.

(From OE-Core rev: 7096f2889f1623ce97a6696f6f4c7217f0efb972)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:16 +01:00
Ross Burton
0aa028f5a9 oeqa/targetbuild: fix folder name estimate logic
The re.sub() used to transform a tarball into a best guess folder name wasn't
right, as there isn't enough escaping and tar.xz was missing.

(From OE-Core rev: ac99135b009a1066486ed2afb2f298d0a5a3a854)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:16 +01:00
Armin Kuster
c844230ba9 tzdata: update to 2016e
Changes affecting future time stamps

Africa/Cairo observes DST in 2016 from July 7 to the end of October.
Guess October 27 and 24:00 transitions. (Thanks to Steffen Thorsen.)
For future years, guess April's last Thursday to October's last
Thursday except for Ramadan.

Changes affecting past time stamps

Locations while uninhabited now use '-00', not 'zzz', as a
placeholder time zone abbreviation.  This is inspired by Internet
RFC 3339 and is more consistent with numeric time zone
abbreviations already used elsewhere.  The change affects several
arctic and antarctic locations, e.g., America/Cambridge_Bay before
1920 and Antarctica/Troll before 2005.

Asia/Baku's 1992-09-27 transition from +04 (DST) to +04 (non-DST) was
at 03:00, not 23:00 the previous day.  (Thanks to Michael Deckers.)

(From OE-Core rev: ddcf128e76ed0678ce42416531f4ecb309c57439)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:16 +01:00
Armin Kuster
4bd8e679e7 tzcode: update to 2016e
V2: typo in title (jet lagged)
Changes to code

zic now outputs a dummy transition at time 2**31 - 1 in zones
whose POSIX-style TZ strings contain a '<'.  This mostly works
around Qt bug 53071 <https://bugreports.qt.io/browse/QTBUG-53071>.
(Thanks to Zhanibek Adilbekov for reporting the Qt bug.)

Changes affecting documentation and commentary

tz-link.htm says why governments should give plenty of notice for
time zone or DST changes, and refers to Matt Johnson's blog post.
tz-link.htm mentions Tzdata for Elixir.  (Thanks to Matt Johnson.)

(From OE-Core rev: 5f3340e5c966f4233e0cd4ec468b20a1fd5a7346)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:15 +01:00
Jussi Kukkonen
313ae0a769 qemu: Use Gtk+3, add configure patch to find vte
(From OE-Core rev: 0474412a1d2b6b8a35931bb03fa58e31a48133e1)

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-06-23 14:26:15 +01:00
Alexander Kanavin
d8afd0c9f2 libmad: remove recipe
[YOCTO #6020]

(From OE-Core rev: e689b7dc8bddb2211e6cc964d40b59687158cdca)

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>
2016-06-23 14:26:15 +01:00
Alexander Kanavin
00fea48bd3 gstreamer1.0-plugins-ugly: disable mad, enable mpg123
(From OE-Core rev: 7691d048ccbb1cbde5ffba7977c799a91349cb3d)

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>
2016-06-23 14:26:15 +01:00
Alexander Kanavin
6085ce0b1d mpg123: add a recipe from meta-oe
The recipe is updated to latest upstream release.
Also audiofile dependency is dropped as it's not actually used anywhere.

[YOCTO #6020]

(From OE-Core rev: e136525f3443f365ecbfdb8bb618f89c3f38da5b)

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>
2016-06-23 14:26:15 +01:00
Alexander Kanavin
ec96025bc3 security_flags.inc: add python3-pycairo and libnewt-python to no-pie exception list
(From OE-Core rev: 0bfbc3e901067b0fee09c55d203b850a258fbbe3)

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>
2016-06-23 14:26:15 +01:00
Alexander Kanavin
0881208168 security_flags.inc: add SECURITY_NO_PIE_CFLAGS to libgcc and gcc-sanitizers
These recipes no longer seem to need full exclusion from security hardening.

The rest (glibc, gcc-runtime, valgrind, grub, grub-efi, uclibc) still do.

[YOCTO #9489]

(From OE-Core rev: b3d7aae42550fb92bcb82fdee7e518b04bdf49b4)

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>
2016-06-23 14:26:15 +01:00
Ross Burton
95cd78a7b5 bitbake.conf: don't set CCACHE_DIR to $HOME by default
If the user hasn't inherited ccache.bbclass then CCACHE_DIR is set to $HOME.

This was to work around a bug (#2554) for some users where if ccache < 3.1.10
(released 2014-10-19) was installed and enabled by default (i.e. /usr/bin/gcc is
a symlink to ccache) and ccache.bbclass wasn't being inherited then autogen
would fail to build because it sets $HOME to /dev/null during the build and
ccache (prior to 3.1.10) would always create CCACHE_DIR even if it was disabled.
As the default is $HOME/.ccache, this results in ccache attempting to create
/dev/null/.ccache.

However there was a mistake in this assignment of CCACHE_DIR - it should be
$HOME/.ccache - as ccache will do cleanup inside CCACHE_DIR which will result in
it deleting $HOME/tmp.  In the future when we can assume that everyone has
ccache 3.1.10 onwards this assignment can be deleted, but as of now we still
support OpenSUSE 13.2 which ships with 3.1.9 so fix the assignment to be
$HOME/.ccache.

[ YOCTO #9798 ]

(From OE-Core rev: 15eaf9cb1fa19036fe4442905876dae94070b04d)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:15 +01:00
Andre McCurdy
51059ee20d binutils: configure with --enable-deterministic-archives
Causes ar to use zero for timestamps and uids/gids by default when
creating static archives, which helps make builds deterministic.

  https://bugzilla.redhat.com/show_bug.cgi?id=1124342
  https://wiki.debian.org/ReproducibleBuilds/TimestampsInStaticLibraries

(From OE-Core rev: df0d525c02780b5a0bd7a177a249c55f41797476)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:15 +01:00
Chen Qi
1bf1af525a dbus/dbus-test: upgrade to 1.10.8
0001-configure.ac-support-large-file-for-stat64.patch is removed as it's
a backported patch and is already in the latest codes.

(From OE-Core rev: ba0493391207c5e170548a58c49ca593b4d61e08)

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>
2016-06-23 14:26:15 +01:00
Alejandro del Castillo
1137709119 opkg: upgrade to v0.3.2
* Drop merged patches
* Update libsolv PACKAGECONFIG config option

(From OE-Core rev: f88b51e10620075cb370a11f9aabac746df67fe5)

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:15 +01:00
Matthew Campbell
772ba8d865 openssh: fix init script restart with read-only-rootfs
restart in the init script uses the check_config() function which doesn't have
the $SSHD_OPTS passed through. This causes it to check the wrong config (and
fail when read-only-rootfs is enabled.

(From OE-Core rev: cb6f78072deb8b8c22baf5c31c3bd19d7e0af236)

Signed-off-by: Matthew Campbell <mcampbell@izotope.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:14 +01:00
Ross Burton
e6faa3d0bb packagegroups: use new gst-player package name
The package that the gst-player binary is in has changed from gst-player-bin to
gst-player.

(From OE-Core rev: 6580c7b0f55b4682523886d885bbaa86f0107430)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:14 +01:00
Khem Raj
79ca8d031e gstreamer1.0-plugins-bad: Upgrade to 1.8.1
(From OE-Core rev: 6a326f2b37b0b49e1144428becda32400498c024)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:14 +01:00
Yi Zhao
a02911390c expat: CVE-2016-0718
Fix CVE-2016-0718: expat XML parser crashes on malformed input

External References:
https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-0718
https://bugzilla.redhat.com/show_bug.cgi?id=1296102
https://bugzilla.suse.com/show_bug.cgi?id=979441

Patch from:
https://bugzilla.redhat.com/show_bug.cgi?id=1296102

(From OE-Core rev: 6589de727ba9c9901fdd53d31bd88ad0f17f3905)

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:14 +01:00
Saul Wold
c0238cb902 linux-firmware: add iwlwifi-8000C-19 version
This version is required for certain iwlwifi hardware
can not use the most recent firmware blob.

[YOCTO #9771]

(From OE-Core rev: 8b3d3ac84f787bf4ecccdcbcb97f2dac56acd45c)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:14 +01:00
Ross Burton
bf54af3802 sysprof: fix pkgconfig packaging
pkgconfig files need to be in -dev.

(From OE-Core rev: eca3347fef3d6010176c7569f181a16f0abe01d4)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:14 +01:00
Ross Burton
e04da4b954 autotools: ensure Makefile exists in do_compile
If a recipe is using the autotools class then presumably it is using Makefiles.
However the default do_compile() is forgiving and silently handles a missing
makefile, which means that if a recipe is using a hand-coded static Makefile
(e.g. git) but doesn't use brokensep the recipe will fail in do_install.

To make debugging this easier, override do_compile in autotools so that it fails
if a Makefile isn't present.

(From OE-Core rev: 14839515301754e0b512fe3054d95dabc77ad829)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:14 +01:00
Chen Qi
c2acd4e27d package_manager.py: specify tmpdir for opkg
Specify tmpdir for opkg via '-t' option so that opkg does not use
the default 'TMPDIR' which usually is '/tmp' on build host.

This would solve race problems like below.

  sh: /tmp/opkg-rOG6Tl/opkg-intercept-iPoEp5/depmod: Permission denied

(From OE-Core rev: 5665e284b7e7ee071201664dc50a3412bd4ac8cd)

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>
2016-06-23 14:26:14 +01:00
Ross Burton
675843d540 oeqa: fix hasPackage, add hasPackageMatch
hasPackage() was looking for the string provided as an RE substring in the
manifest, which resulted in a large number of false positives (i.e. libgtkfoo
would match "gtk+").

Rewrite the manifest loader to parse the files into a proper data structure,
change hasPackage to do full string matches, and add hasPackageMatch which does
RE substring matches.

(From OE-Core rev: b9409863af71899e02275439949e3f4cdfaf2d0f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:14 +01:00
Ross Burton
c65cf8ede2 xcb-proto: use python3 instead of python2
We previously patched configure to stop looking around for a Python to use, and
to use the Python binary and install paths that we specify.  Now that we depend
on Python 3 its possible that bitbake is being built on a machine without Python
2 installed, so hardcode the python3 interpreter instead.

(From OE-Core rev: bb5a43f049c1a7cffb5516b1c3d0264dea68ea3f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:14 +01:00
Ed Bartosh
1096a95897 toasterconf: exclude releases Toaster can't build
Due to the switch to Python 3, Toaster master can only build
with master and not with earlier releases.

Removed references to "jethro" and "krogoth" from toasterconf.

(From meta-yocto rev: dc458077de015ce5e66ab7c95d67238ae348e494)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:01 +01:00
Alexander Kanavin
5e866822a4 maintainers.inc: remove libmad, add mpg123
(From meta-yocto rev: ef70c62548bba6f656a3259d4ac41de3507fc9ff)

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>
2016-06-23 14:26:01 +01:00
Alexander Kanavin
922294d611 maintainers.inc: reassign vala recipe
(From meta-yocto rev: 9a662fc7d6b0f164319bd510df645554c59198ca)

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>
2016-06-23 14:26:01 +01:00
706 changed files with 11135 additions and 15689 deletions

View File

@@ -436,8 +436,7 @@ class BitbakeWorker(object):
self.build_pipes[pipe].read()
try:
sys.stdin = sys.stdin.detach()
worker = BitbakeWorker(sys.stdin)
worker = BitbakeWorker(os.fdopen(sys.stdin.fileno(), 'rb'))
if not profiling:
worker.serve()
else:

View File

@@ -21,154 +21,106 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
This command takes a filename as a single parameter. The filename is read
as a build eventlog, and the ToasterUI is used to process events in the file
and log data in the database
"""
# This command takes a filename as a single parameter. The filename is read
# as a build eventlog, and the ToasterUI is used to process events in the file
# and log data in the database
from __future__ import print_function
import os
import sys, logging
import sys
import json
import pickle
import codecs
from collections import namedtuple
# mangle syspath to allow easy import of modules
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
'lib'))
from os.path import join, dirname, abspath
sys.path.insert(0, join(dirname(dirname(abspath(__file__))), 'lib'))
import bb.cooker
from bb.ui import toasterui
import sys
import logging
import json, pickle
class EventPlayer:
"""Emulate a connection to a bitbake server."""
def __init__(self, eventfile, variables):
self.eventfile = eventfile
self.variables = variables
self.eventmask = []
class FileReadEventsServerConnection():
""" Emulates a connection to a bitbake server that feeds
events coming actually read from a saved log file.
"""
def waitEvent(self, _timeout):
"""Read event from the file."""
line = self.eventfile.readline().strip()
if not line:
return
try:
event_str = json.loads(line)['vars'].encode('utf-8')
event = pickle.loads(codecs.decode(event_str, 'base64'))
event_name = "%s.%s" % (event.__module__, event.__class__.__name__)
if event_name not in self.eventmask:
return
return event
except ValueError as err:
print("Failed loading ", line)
raise err
class MockConnection():
""" fill-in for the proxy to the server. we just return generic data
def runCommand(self, command_line):
"""Emulate running a command on the server."""
name = command_line[0]
if name == "getVariable":
var_name = command_line[1]
variable = self.variables.get(var_name)
if variable:
return variable['v'], None
return None, "Missing variable %s" % var_name
elif name == "getAllKeysWithFlags":
dump = {}
flaglist = command_line[1]
for key, val in self.variables.items():
try:
if not key.startswith("__"):
dump[key] = {
'v': val['v'],
'history' : val['history'],
}
for flag in flaglist:
dump[key][flag] = val[flag]
except Exception as err:
print(err)
return (dump, None)
elif name == 'setEventMask':
self.eventmask = command_line[-1]
return True, None
else:
raise Exception("Command %s not implemented" % command_line[0])
def getEventHandle(self):
"""
def __init__(self, sc):
self._sc = sc
This method is called by toasterui.
The return value is passed to self.runCommand but not used there.
"""
pass
def runCommand(self, commandArray):
""" emulates running a command on the server; only read-only commands are accepted """
command_name = commandArray[0]
def main(argv):
with open(argv[-1]) as eventfile:
# load variables from the first line
variables = json.loads(eventfile.readline().strip())['allvariables']
if command_name == "getVariable":
if commandArray[1] in self._sc._variables:
return (self._sc._variables[commandArray[1]]['v'], None)
return (None, "Missing variable")
elif command_name == "getAllKeysWithFlags":
dump = {}
flaglist = commandArray[1]
for k in self._sc._variables.keys():
try:
if not k.startswith("__"):
v = self._sc._variables[k]['v']
dump[k] = {
'v' : v ,
'history' : self._sc._variables[k]['history'],
}
for d in flaglist:
dump[k][d] = self._sc._variables[k][d]
except Exception as e:
print(e)
return (dump, None)
else:
raise Exception("Command %s not implemented" % commandArray[0])
def terminateServer(self):
""" do not do anything """
pass
class EventReader():
def __init__(self, sc):
self._sc = sc
self.firstraise = 0
def _create_event(self, line):
def _import_class(name):
assert len(name) > 0
assert "." in name, name
components = name.strip().split(".")
modulename = ".".join(components[:-1])
moduleklass = components[-1]
module = __import__(modulename, fromlist=[str(moduleklass)])
return getattr(module, moduleklass)
# we build a toaster event out of current event log line
try:
event_data = json.loads(line.strip())
event_class = _import_class(event_data['class'])
event_object = pickle.loads(json.loads(event_data['vars']))
except ValueError as e:
print("Failed loading ", line)
raise e
if not isinstance(event_object, event_class):
raise Exception("Error loading objects %s class %s ", event_object, event_class)
return event_object
def waitEvent(self, timeout):
nextline = self._sc._eventfile.readline()
if len(nextline) == 0:
# the build data ended, while toasterui still waits for events.
# this happens when the server was abruptly stopped, so we simulate this
self.firstraise += 1
if self.firstraise == 1:
raise KeyboardInterrupt()
else:
return None
else:
self._sc.lineno += 1
return self._create_event(nextline)
def _readVariables(self, variableline):
self._variables = json.loads(variableline.strip())['allvariables']
def __init__(self, file_name):
self.connection = FileReadEventsServerConnection.MockConnection(self)
self._eventfile = open(file_name, "r")
# we expect to have the variable dump at the start of the file
self.lineno = 1
self._readVariables(self._eventfile.readline())
self.events = FileReadEventsServerConnection.EventReader(self)
class MockConfigParameters():
""" stand-in for cookerdata.ConfigParameters; as we don't really config a cooker, this
serves just to supply needed interfaces for the toaster ui to work """
def __init__(self):
self.observe_only = True # we can only read files
params = namedtuple('ConfigParams', ['observe_only'])(True)
player = EventPlayer(eventfile, variables)
return toasterui.main(player, player, params)
# run toaster ui on our mock bitbake class
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: %s event.log " % sys.argv[0])
if len(sys.argv) != 2:
print("Usage: %s <event file>" % os.path.basename(sys.argv[0]))
sys.exit(1)
file_name = sys.argv[-1]
mock_connection = FileReadEventsServerConnection(file_name)
configParams = MockConfigParameters()
# run the main program and set exit code to the returned value
sys.exit(toasterui.main(mock_connection.connection, mock_connection.events, configParams))
sys.exit(main(sys.argv))

View File

@@ -670,8 +670,8 @@
The <filename>module</filename> and <filename>vob</filename>
options are combined to create the <filename>load</filename> rule in
the view config spec.
As an example, consider the <filename>vob</filename> and
<filename>module</filename> values from the
As an example, consider the <filename>vob</filename> and
<filename>module</filename> values from the
<filename>SRC_URI</filename> statement at the start of this section.
Combining those values results in the following:
<literallayout class='monospaced'>
@@ -716,6 +716,68 @@
</para>
</section>
<section id='perforce-fetcher'>
<title>Perforce Fetcher (<filename>p4://</filename>)</title>
<para>
This fetcher submodule fetches code from the
<ulink url='https://www.perforce.com/'>Perforce</ulink>
source control system.
The executable used is specified by
<filename>FETCHCMD_p4</filename>, which defaults
to "p4".
The fetcher's temporary working directory is set by
<link linkend='var-P4DIR'><filename>P4DIR</filename></link>,
which defaults to "DL_DIR/p4".
</para>
<para>
To use this fetcher, make sure your recipe has proper
<link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>,
<link linkend='var-SRCREV'><filename>SRCREV</filename></link>, and
<link linkend='var-PV'><filename>PV</filename></link> values.
The p4 executable is able to use the config file defined by your
system's <filename>P4CONFIG</filename> environment variable in
order to define the Perforce server URL and port, username, and
password if you do not wish to keep those values in a recipe
itself.
If you choose not to use <filename>P4CONFIG</filename>,
or to explicitly set variables that <filename>P4CONFIG</filename>
can contain, you can specify the <filename>P4PORT</filename> value,
which is the server's URL and port number, and you can
specify a username and password directly in your recipe within
<filename>SRC_URI</filename>.
</para>
<para>
Here is an example that relies on <filename>P4CONFIG</filename>
to specify the server URL and port, username, and password, and
fetches the Head Revision:
<literallayout class='monospaced'>
SRC_URI = "p4://example-depot/main/source/..."
SRCREV = "${AUTOREV}"
PV = "p4-${SRCPV}"
S = "${WORKDIR}/p4"
</literallayout>
</para>
<para>
Here is an example that specifies the server URL and port,
username, and password, and fetches a Revision based on a Label:
<literallayout class='monospaced'>
P4PORT = "tcp:p4server.example.net:1666"
SRC_URI = "p4://user:passwd@example-depot/main/source/..."
SRCREV = "release-1.0"
PV = "p4-${SRCPV}"
S = "${WORKDIR}/p4"
</literallayout>
<note>
You should always set <filename>S</filename>
to <filename>"${WORKDIR}/p4"</filename> in your recipe.
</note>
</para>
</section>
<section id='other-fetchers'>
<title>Other Fetchers</title>
@@ -725,9 +787,6 @@
<listitem><para>
Bazaar (<filename>bzr://</filename>)
</para></listitem>
<listitem><para>
Perforce (<filename>p4://</filename>)
</para></listitem>
<listitem><para>
Trees using Git Annex (<filename>gitannex://</filename>)
</para></listitem>

View File

@@ -634,6 +634,44 @@
</para>
</section>
<section id='executing-a-list-of-task-and-recipe-combinations'>
<title>Executing a List of Task and Recipe Combinations</title>
<para>
The BitBake command line supports specifying different
tasks for individual targets when you specify multiple
targets.
For example, suppose you had two targets (or recipes)
<filename>myfirstrecipe</filename> and
<filename>mysecondrecipe</filename> and you needed
BitBake to run <filename>taskA</filename> for the first
recipe and <filename>taskB</filename> for the second
recipe:
<literallayout class='monospaced'>
$ bitbake myfirstrecipe recipe:do_taskA mysecondrecipe recipe:do_taskB
</literallayout>
</para>
</section>
<section id='executing-a-list-of-task-and-recipe-combinations'>
<title>Executing a List of Task and Recipe Combinations</title>
<para>
The BitBake command line supports specifying different
tasks for individual targets when you specify multiple
targets.
For example, suppose you had two targets (or recipes)
<filename>myfirstrecipe</filename> and
<filename>mysecondrecipe</filename> and you needed
BitBake to run <filename>taskA</filename> for the first
recipe and <filename>taskB</filename> for the second
recipe:
<literallayout class='monospaced'>
$ bitbake myfirstrecipe recipe:do_taskA mysecondrecipe recipe:do_taskB
</literallayout>
</para>
</section>
<section id='generating-dependency-graphs'>
<title>Generating Dependency Graphs</title>

View File

@@ -1624,15 +1624,32 @@
<title>Dependencies</title>
<para>
To allow for efficient operation given multiple processes
executing in parallel, BitBake handles dependencies at
the task level.
BitBake supports a robust method to handle these dependencies.
</para>
To allow for efficient parallel processing, BitBake handles
dependencies at the task level.
Dependencies can exist both between tasks within a single recipe
and between tasks in different recipes.
Following are examples of each:
<itemizedlist>
<listitem><para>For tasks within a single recipe, a
recipe's <filename>do_configure</filename>
task might need to complete before its
<filename>do_compile</filename> task can run.
</para></listitem>
<listitem><para>For tasks in different recipes, one
recipe's <filename>do_configure</filename>
task might require another recipe's
<filename>do_populate_sysroot</filename>
task to finish first such that the libraries and headers
provided by the other recipe are available.
</para></listitem>
</itemizedlist>
</para>
<para>
This section describes several types of dependency mechanisms.
</para>
<para>
This section describes several ways to declare dependencies.
Remember, even though dependencies are declared in different ways, they
are all simply dependencies between tasks.
</para>
<section id='dependencies-internal-to-the-bb-file'>
<title>Dependencies Internal to the <filename>.bb</filename> File</title>
@@ -1653,6 +1670,40 @@
task.
And, the <filename>do_build</filename> depends on the completion
of the <filename>printdate</filename> task.
<note>
Recipes are built by having their
<filename>do_build</filename> (not to be confused with
<filename>do_compile</filename>) tasks executed.
For a task to run when a recipe is built, the task must
therefore be a direct or indirect dependency of
<filename>do_build</filename>.
For illustration, here are some examples:
<itemizedlist>
<listitem><para>
The directive
<filename>addtask mytask before do_build</filename>
causes <filename>mytask</filename> to run when the
recipe is built.
In this example, <filename>mytask</filename> is run
at an unspecified time relative to other tasks within
the recipe, since <filename>after</filename> is not used.
</para></listitem>
<listitem><para>
The directive
<filename>addtask mytask after do_configure</filename>
by itself does not cause <filename>mytask</filename>
to run when the recipe is built.
The task can still be run manually using the following:
<literallayout class='monospaced'>
$ bitbake <replaceable>recipe</replaceable> -c mytask
</literallayout>
<filename>mytask</filename> could also be declared as
a dependency of some other task.
Regardless, the task is run after
<filename>do_configure</filename>.
</para></listitem>
</itemizedlist>
</note>
</para>
</section>
@@ -1721,6 +1772,20 @@
and added.
</para>
<para>
The "recrdeptask" flag is most commonly used in high-level
recipes that need to wait for some task to finish "globally".
For example, <filename>image.bbclass</filename> has the following:
<literallayout class='monospaced'>
do_rootfs[recrdeptask] += "do_packagedata"
</literallayout>
This statement says that the <filename>do_packagedata</filename>
task of the current recipe and all recipes reachable
(by way of dependencies) from the
image recipe must run before the <filename>do_rootfs</filename>
task can run.
</para>
<para>
You might want to not only have BitBake look for
dependencies of those tasks, but also have BitBake look
@@ -1785,9 +1850,9 @@
</thead>
<tbody>
<row>
<entry align="left"><filename>d.getVar("X", expand=False)</filename></entry>
<entry align="left"><filename>d.getVar("X", expand)</filename></entry>
<entry align="left">Returns the value of variable "X".
Using "expand=True" expands the value.</entry>
Using "expand=True" expands the value.</entry>
</row>
<row>
<entry align="left"><filename>d.setVar("X", "value")</filename></entry>
@@ -1810,9 +1875,9 @@
<entry align="left">Renames the variable "X" to "Y".</entry>
</row>
<row>
<entry align="left"><filename>d.getVarFlag("X", flag, expand=False)</filename></entry>
<entry align="left">Gets then named flag from the variable "X".
Using "expand=True" expands the named flag.</entry>
<entry align="left"><filename>d.getVarFlag("X", flag, expand)</filename></entry>
<entry align="left">Returns the value of variable "X".
Using "expand=True" expands the value.</entry>
</row>
<row>
<entry align="left"><filename>d.setVarFlag("X", flag, "value")</filename></entry>

View File

@@ -52,7 +52,7 @@
<link linkend='var-MIRRORS'>M</link>
<!-- <link linkend='var-glossary-n'>N</link> -->
<link linkend='var-OVERRIDES'>O</link>
<link linkend='var-PACKAGES'>P</link>
<link linkend='var-P4DIR'>P</link>
<!-- <link linkend='var-QMAKE_PROFILES'>Q</link> -->
<link linkend='var-RDEPENDS'>R</link>
<link linkend='var-SECTION'>S</link>
@@ -986,6 +986,29 @@
BBCLASSEXTEND =+ "native nativesdk"
BBCLASSEXTEND =+ "multilib:<replaceable>multilib_name</replaceable>"
</literallayout>
<note>
<para>
Internally, the <filename>BBCLASSEXTEND</filename>
mechanism generates recipe variants by rewriting
variable values and applying overrides such as
<filename>_class-native</filename>.
For example, to generate a native version of a recipe,
a
<link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
on "foo" is rewritten to a <filename>DEPENDS</filename>
on "foo-native".
</para>
<para>
Even when using <filename>BBCLASSEXTEND</filename>, the
recipe is only parsed once.
Parsing once adds some limitations.
For example, it is not possible to
include a different file depending on the variant,
since <filename>include</filename> statements are
processed when the recipe is parsed.
</para>
</note>
</para>
</glossdef>
</glossentry>
@@ -994,7 +1017,7 @@
<glossdef>
<para>
Sets the BitBake debug output level to a specific value
as incremented by the <filename>-d</filename> command line
as incremented by the <filename>-D</filename> command line
option.
<note>
You must set this variable in the external environment
@@ -1748,6 +1771,15 @@
<glossdiv id='var-glossary-p'><title>P</title>
<glossentry id='var-P4DIR'><glossterm>P4DIR</glossterm>
<glossdef>
<para>
The directory in which a local copy of a Perforce depot
is stored when it is fetched.
</para>
</glossdef>
</glossentry>
<glossentry id='var-PACKAGES'><glossterm>PACKAGES</glossterm>
<glossdef>
<para>The list of packages the recipe creates.

View File

@@ -35,6 +35,7 @@ import stat
import bb
import bb.msg
import bb.process
import bb.progress
from bb import data, event, utils
bblogger = logging.getLogger('BitBake')
@@ -137,6 +138,25 @@ class TaskInvalid(TaskBase):
super(TaskInvalid, self).__init__(task, None, metadata)
self._message = "No such task '%s'" % task
class TaskProgress(event.Event):
"""
Task made some progress that could be reported to the user, usually in
the form of a progress bar or similar.
NOTE: this class does not inherit from TaskBase since it doesn't need
to - it's fired within the task context itself, so we don't have any of
the context information that you do in the case of the other events.
The event PID can be used to determine which task it came from.
The progress value is normally 0-100, but can also be negative
indicating that progress has been made but we aren't able to determine
how much.
The rate is optional, this is simply an extra string to display to the
user if specified.
"""
def __init__(self, progress, rate=None):
self.progress = progress
self.rate = rate
event.Event.__init__(self)
class LogTee(object):
def __init__(self, logger, outfile):
@@ -168,6 +188,11 @@ class LogTee(object):
def exec_func(func, d, dirs = None, pythonexception=False):
"""Execute a BB 'function'"""
try:
oldcwd = os.getcwd()
except:
oldcwd = None
body = d.getVar(func, False)
if not body:
if body is None:
@@ -191,9 +216,7 @@ def exec_func(func, d, dirs = None, pythonexception=False):
bb.utils.mkdirhier(adir)
adir = dirs[-1]
else:
adir = d.getVar('B', True)
bb.utils.mkdirhier(adir)
adir = None
ispython = flags.get('python')
lockflag = flags.get('lockfiles')
@@ -237,6 +260,13 @@ def exec_func(func, d, dirs = None, pythonexception=False):
else:
exec_func_shell(func, d, runfile, cwd=adir)
if oldcwd and os.getcwd() != oldcwd:
try:
bb.warn("Task %s changed cwd to %s" % (func, os.getcwd()))
os.chdir(oldcwd)
except:
pass
_functionfmt = """
{function}(d)
"""
@@ -252,7 +282,8 @@ def exec_func_python(func, d, runfile, cwd=None, pythonexception=False):
if cwd:
try:
olddir = os.getcwd()
except OSError:
except OSError as e:
bb.warn("%s: Cannot get cwd: %s" % (func, e))
olddir = None
os.chdir(cwd)
@@ -278,8 +309,8 @@ def exec_func_python(func, d, runfile, cwd=None, pythonexception=False):
if cwd and olddir:
try:
os.chdir(olddir)
except OSError:
pass
except OSError as e:
bb.warn("%s: Cannot restore cwd %s: %s" % (func, olddir, e))
def shell_trap_code():
return '''#!/bin/sh\n
@@ -340,11 +371,28 @@ exit $ret
else:
logfile = sys.stdout
progress = d.getVarFlag(func, 'progress', True)
if progress:
if progress == 'percent':
# Use default regex
logfile = bb.progress.BasicProgressHandler(d, outfile=logfile)
elif progress.startswith('percent:'):
# Use specified regex
logfile = bb.progress.BasicProgressHandler(d, regex=progress.split(':', 1)[1], outfile=logfile)
elif progress.startswith('outof:'):
# Use specified regex
logfile = bb.progress.OutOfProgressHandler(d, regex=progress.split(':', 1)[1], outfile=logfile)
else:
bb.warn('%s: invalid task progress varflag value "%s", ignoring' % (func, progress))
def readfifo(data):
lines = data.split(b'\0')
for line in lines:
# Just skip empty commands
if not line:
continue
splitval = line.split(b' ', 1)
cmd = splitval[0]
cmd = splitval[0].decode("utf-8")
if len(splitval) > 1:
value = splitval[1].decode("utf-8")
else:
@@ -368,7 +416,8 @@ exit $ret
level = int(splitval[0])
value = splitval[1]
bb.debug(level, value)
else:
bb.warn("Unrecognised command '%s' on FIFO" % cmd)
tempdir = d.getVar('T', True)
fifopath = os.path.join(tempdir, 'fifo.%s' % os.getpid())
if os.path.exists(fifopath):
@@ -778,6 +827,7 @@ def deltask(task, d):
bbtasks = d.getVar('__BBTASKS', False) or []
if task in bbtasks:
bbtasks.remove(task)
d.delVarFlag(task, 'task')
d.setVar('__BBTASKS', bbtasks)
d.delVarFlag(task, 'deps')

View File

@@ -744,7 +744,7 @@ class BBCooker:
for dep in rq.rqdata.runtaskentries[tid].depends:
depfn = bb.runqueue.fn_from_tid(dep)
deppn = self.recipecache.pkg_fn[depfn]
dotname = "%s.%s" % (pn, bb.runqueue.taskname_from_tid(dep))
dotname = "%s.%s" % (pn, bb.runqueue.taskname_from_tid(tid))
if not dotname in depend_tree["tdepends"]:
depend_tree["tdepends"][dotname] = []
depend_tree["tdepends"][dotname].append("%s.%s" % (deppn, bb.runqueue.taskname_from_tid(dep)))

View File

@@ -647,6 +647,33 @@ class MetadataEvent(Event):
self.type = eventtype
self._localdata = eventdata
class ProcessStarted(Event):
"""
Generic process started event (usually part of the initial startup)
where further progress events will be delivered
"""
def __init__(self, processname, total):
Event.__init__(self)
self.processname = processname
self.total = total
class ProcessProgress(Event):
"""
Generic process progress event (usually part of the initial startup)
"""
def __init__(self, processname, progress):
Event.__init__(self)
self.processname = processname
self.progress = progress
class ProcessFinished(Event):
"""
Generic process finished event (usually part of the initial startup)
"""
def __init__(self, processname):
Event.__init__(self)
self.processname = processname
class SanityCheck(Event):
"""
Event to run sanity checks, either raise errors or generate events as return status.

View File

@@ -779,7 +779,7 @@ def localpath(url, d):
fetcher = bb.fetch2.Fetch([url], d)
return fetcher.localpath(url)
def runfetchcmd(cmd, d, quiet=False, cleanup=None):
def runfetchcmd(cmd, d, quiet=False, cleanup=None, log=None):
"""
Run cmd returning the command output
Raise an error if interrupted or cmd fails
@@ -821,7 +821,7 @@ def runfetchcmd(cmd, d, quiet=False, cleanup=None):
error_message = ""
try:
(output, errors) = bb.process.run(cmd, shell=True, stderr=subprocess.PIPE)
(output, errors) = bb.process.run(cmd, log=log, shell=True, stderr=subprocess.PIPE)
success = True
except bb.process.NotFoundError as e:
error_message = "Fetch command %s" % (e.command)

View File

@@ -71,11 +71,53 @@ import os
import re
import bb
import errno
import bb.progress
from bb import data
from bb.fetch2 import FetchMethod
from bb.fetch2 import runfetchcmd
from bb.fetch2 import logger
class GitProgressHandler(bb.progress.LineFilterProgressHandler):
"""Extract progress information from git output"""
def __init__(self, d):
self._buffer = ''
self._count = 0
super(GitProgressHandler, self).__init__(d)
# Send an initial progress event so the bar gets shown
self._fire_progress(-1)
def write(self, string):
self._buffer += string
stages = ['Counting objects', 'Compressing objects', 'Receiving objects', 'Resolving deltas']
stage_weights = [0.2, 0.05, 0.5, 0.25]
stagenum = 0
for i, stage in reversed(list(enumerate(stages))):
if stage in self._buffer:
stagenum = i
self._buffer = ''
break
self._status = stages[stagenum]
percs = re.findall(r'(\d+)%', string)
if percs:
progress = int(round((int(percs[-1]) * stage_weights[stagenum]) + (sum(stage_weights[:stagenum]) * 100)))
rates = re.findall(r'([\d.]+ [a-zA-Z]*/s+)', string)
if rates:
rate = rates[-1]
else:
rate = None
self.update(progress, rate)
else:
if stagenum == 0:
percs = re.findall(r': (\d+)', string)
if percs:
count = int(percs[-1])
if count > self._count:
self._count = count
self._fire_progress(-count)
super(GitProgressHandler, self).write(string)
class Git(FetchMethod):
"""Class to fetch a module or modules from git repositories"""
def init(self, d):
@@ -196,10 +238,11 @@ class Git(FetchMethod):
# We do this since git will use a "-l" option automatically for local urls where possible
if repourl.startswith("file://"):
repourl = repourl[7:]
clone_cmd = "%s clone --bare --mirror %s %s" % (ud.basecmd, repourl, ud.clonedir)
clone_cmd = "LANG=C %s clone --bare --mirror %s %s --progress" % (ud.basecmd, repourl, ud.clonedir)
if ud.proto.lower() != 'file':
bb.fetch2.check_network_access(d, clone_cmd)
runfetchcmd(clone_cmd, d)
progresshandler = GitProgressHandler(d)
runfetchcmd(clone_cmd, d, log=progresshandler)
os.chdir(ud.clonedir)
# Update the checkout if needed
@@ -214,10 +257,11 @@ class Git(FetchMethod):
logger.debug(1, "No Origin")
runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d)
fetch_cmd = "%s fetch -f --prune %s refs/*:refs/*" % (ud.basecmd, repourl)
fetch_cmd = "LANG=C %s fetch -f --prune --progress %s refs/*:refs/*" % (ud.basecmd, repourl)
if ud.proto.lower() != 'file':
bb.fetch2.check_network_access(d, fetch_cmd, ud.url)
runfetchcmd(fetch_cmd, d)
progresshandler = GitProgressHandler(d)
runfetchcmd(fetch_cmd, d, log=progresshandler)
runfetchcmd("%s prune-packed" % ud.basecmd, d)
runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
try:

View File

@@ -31,6 +31,7 @@ import subprocess
import os
import logging
import bb
import bb.progress
import urllib.request, urllib.parse, urllib.error
from bb import data
from bb.fetch2 import FetchMethod
@@ -41,6 +42,27 @@ from bb.utils import export_proxies
from bs4 import BeautifulSoup
from bs4 import SoupStrainer
class WgetProgressHandler(bb.progress.LineFilterProgressHandler):
"""
Extract progress information from wget output.
Note: relies on --progress=dot (with -v or without -q/-nv) being
specified on the wget command line.
"""
def __init__(self, d):
super(WgetProgressHandler, self).__init__(d)
# Send an initial progress event so the bar gets shown
self._fire_progress(0)
def writeline(self, line):
percs = re.findall(r'(\d+)%\s+([\d.]+[A-Z])', line)
if percs:
progress = int(percs[-1][0])
rate = percs[-1][1] + '/s'
self.update(progress, rate)
return False
return True
class Wget(FetchMethod):
"""Class to fetch urls via 'wget'"""
def supports(self, ud, d):
@@ -66,13 +88,15 @@ class Wget(FetchMethod):
if not ud.localfile:
ud.localfile = data.expand(urllib.parse.unquote(ud.host + ud.path).replace("/", "."), d)
self.basecmd = d.getVar("FETCHCMD_wget", True) or "/usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate"
self.basecmd = d.getVar("FETCHCMD_wget", True) or "/usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate"
def _runwget(self, ud, d, command, quiet):
progresshandler = WgetProgressHandler(d)
logger.debug(2, "Fetching %s using command '%s'" % (ud.url, command))
bb.fetch2.check_network_access(d, command)
runfetchcmd(command, d, quiet)
runfetchcmd(command + ' --progress=dot -v', d, quiet, log=progresshandler)
def download(self, ud, d):
"""Fetch urls"""
@@ -104,7 +128,7 @@ class Wget(FetchMethod):
return True
def checkstatus(self, fetch, ud, d):
def checkstatus(self, fetch, ud, d, try_again=True):
import urllib.request, urllib.error, urllib.parse, socket, http.client
from urllib.response import addinfourl
from bb.fetch2 import FetchConnectionCache
@@ -278,9 +302,13 @@ class Wget(FetchMethod):
r.get_method = lambda: "HEAD"
opener.open(r)
except urllib.error.URLError as e:
# debug for now to avoid spamming the logs in e.g. remote sstate searches
logger.debug(2, "checkstatus() urlopen failed: %s" % e)
return False
if try_again:
logger.debug(2, "checkstatus: trying again")
return self.checkstatus(fetch, ud, d, False)
else:
# debug for now to avoid spamming the logs in e.g. remote sstate searches
logger.debug(2, "checkstatus() urlopen failed: %s" % e)
return False
return True
def _parse_path(self, regex, s):

View File

@@ -179,6 +179,9 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
parser.add_option("-D", "--debug", action="count", dest="debug", default=0,
help="Increase the debug level. You can specify this more than once.")
parser.add_option("-q", "--quiet", action="store_true", dest="quiet", default=False,
help="Output less log message data to the terminal.")
parser.add_option("-n", "--dry-run", action="store_true", dest="dry_run", default=False,
help="Don't execute, just go through the motions.")
@@ -244,9 +247,16 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
help="Run bitbake without a UI, only starting a server "
"(cooker) process.")
parser.add_option("", "--foreground", action="store_true",
help="Run bitbake server in foreground.")
parser.add_option("-B", "--bind", action="store", dest="bind", default=False,
help="The name/address for the bitbake server to bind to.")
parser.add_option("-T", "--idle-timeout", type=int,
default=int(os.environ.get("BBTIMEOUT", "0")),
help="Set timeout to unload bitbake server due to inactivity")
parser.add_option("", "--no-setscene", action="store_true",
dest="nosetscene", default=False,
help="Do not run any setscene tasks. sstate will be ignored and "
@@ -279,6 +289,12 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
options, targets = parser.parse_args(argv)
if options.quiet and options.verbose:
parser.error("options --quiet and --verbose are mutually exclusive")
if options.quiet and options.debug:
parser.error("options --quiet and --debug are mutually exclusive")
# use configuration files from environment variables
if "BBPRECONF" in os.environ:
options.prefile.append(os.environ["BBPRECONF"])
@@ -294,8 +310,10 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
# if BBSERVER says to autodetect, let's do that
if options.remote_server:
[host, port] = options.remote_server.split(":", 2)
port = int(port)
port = -1
if options.remote_server != 'autostart':
host, port = options.remote_server.split(":", 2)
port = int(port)
# use automatic port if port set to -1, means read it from
# the bitbake.lock file; this is a bit tricky, but we always expect
# to be in the base of the build directory if we need to have a
@@ -312,17 +330,19 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
lf.close()
options.remote_server = remotedef
except Exception as e:
raise BBMainException("Failed to read bitbake.lock (%s), invalid port" % str(e))
if options.remote_server != 'autostart':
raise BBMainException("Failed to read bitbake.lock (%s), invalid port" % str(e))
return options, targets[1:]
def start_server(servermodule, configParams, configuration, features):
server = servermodule.BitBakeServer()
single_use = not configParams.server_only
single_use = not configParams.server_only and os.getenv('BBSERVER') != 'autostart'
if configParams.bind:
(host, port) = configParams.bind.split(':')
server.initServer((host, int(port)), single_use)
server.initServer((host, int(port)), single_use=single_use,
idle_timeout=configParams.idle_timeout)
configuration.interface = [server.serverImpl.host, server.serverImpl.port]
else:
server.initServer(single_use=single_use)
@@ -345,7 +365,8 @@ def start_server(servermodule, configParams, configuration, features):
if isinstance(event, logging.LogRecord):
logger.handle(event)
raise
server.detach()
if not configParams.foreground:
server.detach()
cooker.lock.close()
return server
@@ -386,6 +407,10 @@ def bitbake_main(configParams, configuration):
("the BBSERVER environment variable" if "BBSERVER" in os.environ \
else "the '--remote-server' option"))
elif configParams.foreground:
raise BBMainException("FATAL: The '--foreground' option can only be used "
"with --server-only.\n")
if configParams.bind and configParams.servertype != "xmlrpc":
raise BBMainException("FATAL: If '-B' or '--bind' is defined, we must "
"set the servertype as 'xmlrpc'.\n")
@@ -436,6 +461,14 @@ def bitbake_main(configParams, configuration):
server = start_server(servermodule, configParams, configuration, featureset)
bb.event.ui_queue = []
else:
if os.getenv('BBSERVER') == 'autostart':
if configParams.remote_server == 'autostart' or \
not servermodule.check_connection(configParams.remote_server, timeout=2):
configParams.bind = 'localhost:0'
srv = start_server(servermodule, configParams, configuration, featureset)
configParams.remote_server = '%s:%d' % tuple(configuration.interface)
bb.event.ui_queue = []
# we start a stub server that is actually a XMLRPClient that connects to a real server
server = servermodule.BitBakeXMLRPCClient(configParams.observe_only,
configParams.xmlrpctoken)
@@ -475,6 +508,8 @@ def bitbake_main(configParams, configuration):
else:
print("Bitbake server address: %s, server port: %s" % (server.serverImpl.host,
server.serverImpl.port))
if configParams.foreground:
server.serverImpl.serve_forever()
return 0
return 1

View File

@@ -182,9 +182,12 @@ def constructLogOptions():
debug_domains["BitBake.%s" % domainarg] = logging.DEBUG - dlevel + 1
return level, debug_domains
def addDefaultlogFilter(handler, cls = BBLogFilter):
def addDefaultlogFilter(handler, cls = BBLogFilter, forcelevel=None):
level, debug_domains = constructLogOptions()
if forcelevel is not None:
level = forcelevel
cls(handler, level, debug_domains)
#

273
bitbake/lib/bb/progress.py Normal file
View File

@@ -0,0 +1,273 @@
"""
BitBake progress handling code
"""
# Copyright (C) 2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import sys
import re
import time
import inspect
import bb.event
import bb.build
class ProgressHandler(object):
"""
Base class that can pretend to be a file object well enough to be
used to build objects to intercept console output and determine the
progress of some operation.
"""
def __init__(self, d, outfile=None):
self._progress = 0
self._data = d
self._lastevent = 0
if outfile:
self._outfile = outfile
else:
self._outfile = sys.stdout
def _fire_progress(self, taskprogress, rate=None):
"""Internal function to fire the progress event"""
bb.event.fire(bb.build.TaskProgress(taskprogress, rate), self._data)
def write(self, string):
self._outfile.write(string)
def flush(self):
self._outfile.flush()
def update(self, progress, rate=None):
ts = time.time()
if progress > 100:
progress = 100
if progress != self._progress or self._lastevent + 1 < ts:
self._fire_progress(progress, rate)
self._lastevent = ts
self._progress = progress
class LineFilterProgressHandler(ProgressHandler):
"""
A ProgressHandler variant that provides the ability to filter out
the lines if they contain progress information. Additionally, it
filters out anything before the last line feed on a line. This can
be used to keep the logs clean of output that we've only enabled for
getting progress, assuming that that can be done on a per-line
basis.
"""
def __init__(self, d, outfile=None):
self._linebuffer = ''
super(LineFilterProgressHandler, self).__init__(d, outfile)
def write(self, string):
self._linebuffer += string
while True:
breakpos = self._linebuffer.find('\n') + 1
if breakpos == 0:
break
line = self._linebuffer[:breakpos]
self._linebuffer = self._linebuffer[breakpos:]
# Drop any line feeds and anything that precedes them
lbreakpos = line.rfind('\r') + 1
if lbreakpos:
line = line[lbreakpos:]
if self.writeline(line):
super(LineFilterProgressHandler, self).write(line)
def writeline(self, line):
return True
class BasicProgressHandler(ProgressHandler):
def __init__(self, d, regex=r'(\d+)%', outfile=None):
super(BasicProgressHandler, self).__init__(d, outfile)
self._regex = re.compile(regex)
# Send an initial progress event so the bar gets shown
self._fire_progress(0)
def write(self, string):
percs = self._regex.findall(string)
if percs:
progress = int(percs[-1])
self.update(progress)
super(BasicProgressHandler, self).write(string)
class OutOfProgressHandler(ProgressHandler):
def __init__(self, d, regex, outfile=None):
super(OutOfProgressHandler, self).__init__(d, outfile)
self._regex = re.compile(regex)
# Send an initial progress event so the bar gets shown
self._fire_progress(0)
def write(self, string):
nums = self._regex.findall(string)
if nums:
progress = (float(nums[-1][0]) / float(nums[-1][1])) * 100
self.update(progress)
super(OutOfProgressHandler, self).write(string)
class MultiStageProgressReporter(object):
"""
Class which allows reporting progress without the caller
having to know where they are in the overall sequence. Useful
for tasks made up of python code spread across multiple
classes / functions - the progress reporter object can
be passed around or stored at the object level and calls
to next_stage() and update() made whereever needed.
"""
def __init__(self, d, stage_weights, debug=False):
"""
Initialise the progress reporter.
Parameters:
* d: the datastore (needed for firing the events)
* stage_weights: a list of weight values, one for each stage.
The value is scaled internally so you only need to specify
values relative to other values in the list, so if there
are two stages and the first takes 2s and the second takes
10s you would specify [2, 10] (or [1, 5], it doesn't matter).
* debug: specify True (and ensure you call finish() at the end)
in order to show a printout of the calculated stage weights
based on timing each stage. Use this to determine what the
weights should be when you're not sure.
"""
self._data = d
total = sum(stage_weights)
self._stage_weights = [float(x)/total for x in stage_weights]
self._stage = -1
self._base_progress = 0
# Send an initial progress event so the bar gets shown
self._fire_progress(0)
self._debug = debug
self._finished = False
if self._debug:
self._last_time = time.time()
self._stage_times = []
self._stage_total = None
self._callers = []
def _fire_progress(self, taskprogress):
bb.event.fire(bb.build.TaskProgress(taskprogress), self._data)
def next_stage(self, stage_total=None):
"""
Move to the next stage.
Parameters:
* stage_total: optional total for progress within the stage,
see update() for details
NOTE: you need to call this before the first stage.
"""
self._stage += 1
self._stage_total = stage_total
if self._stage == 0:
# First stage
if self._debug:
self._last_time = time.time()
else:
if self._stage < len(self._stage_weights):
self._base_progress = sum(self._stage_weights[:self._stage]) * 100
if self._debug:
currtime = time.time()
self._stage_times.append(currtime - self._last_time)
self._last_time = currtime
self._callers.append(inspect.getouterframes(inspect.currentframe())[1])
elif not self._debug:
bb.warn('ProgressReporter: current stage beyond declared number of stages')
self._base_progress = 100
self._fire_progress(self._base_progress)
def update(self, stage_progress):
"""
Update progress within the current stage.
Parameters:
* stage_progress: progress value within the stage. If stage_total
was specified when next_stage() was last called, then this
value is considered to be out of stage_total, otherwise it should
be a percentage value from 0 to 100.
"""
if self._stage_total:
stage_progress = (float(stage_progress) / self._stage_total) * 100
if self._stage < 0:
bb.warn('ProgressReporter: update called before first call to next_stage()')
elif self._stage < len(self._stage_weights):
progress = self._base_progress + (stage_progress * self._stage_weights[self._stage])
else:
progress = self._base_progress
if progress > 100:
progress = 100
self._fire_progress(progress)
def finish(self):
if self._finished:
return
self._finished = True
if self._debug:
import math
self._stage_times.append(time.time() - self._last_time)
mintime = max(min(self._stage_times), 0.01)
self._callers.append(None)
stage_weights = [int(math.ceil(x / mintime)) for x in self._stage_times]
bb.warn('Stage weights: %s' % stage_weights)
out = []
for stage_weight, caller in zip(stage_weights, self._callers):
if caller:
out.append('Up to %s:%d: %d' % (caller[1], caller[2], stage_weight))
else:
out.append('Up to finish: %d' % stage_weight)
bb.warn('Stage times:\n %s' % '\n '.join(out))
class MultiStageProcessProgressReporter(MultiStageProgressReporter):
"""
Version of MultiStageProgressReporter intended for use with
standalone processes (such as preparing the runqueue)
"""
def __init__(self, d, processname, stage_weights, debug=False):
self._processname = processname
MultiStageProgressReporter.__init__(self, d, stage_weights, debug)
def start(self):
bb.event.fire(bb.event.ProcessStarted(self._processname, 100), self._data)
def _fire_progress(self, taskprogress):
if taskprogress == 0:
self.start()
return
bb.event.fire(bb.event.ProcessProgress(self._processname, taskprogress), self._data)
def finish(self):
MultiStageProgressReporter.finish(self)
bb.event.fire(bb.event.ProcessFinished(self._processname), self._data)
class DummyMultiStageProcessProgressReporter(MultiStageProgressReporter):
"""
MultiStageProcessProgressReporter that takes the calls and does nothing
with them (to avoid a bunch of "if progress_reporter:" checks)
"""
def __init__(self):
MultiStageProcessProgressReporter.__init__(self, "", None, [])
def _fire_progress(self, taskprogress, rate=None):
pass
def start(self):
pass
def next_stage(self, stage_total=None):
pass
def update(self, stage_progress):
pass
def finish(self):
pass

View File

@@ -240,6 +240,8 @@ class RunQueueData:
self.stampwhitelist = cfgData.getVar("BB_STAMP_WHITELIST", True) or ""
self.multi_provider_whitelist = (cfgData.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split()
self.setscenewhitelist = get_setscene_enforce_whitelist(cfgData)
self.init_progress_reporter = bb.progress.DummyMultiStageProcessProgressReporter()
self.reset()
@@ -431,7 +433,8 @@ class RunQueueData:
# Nothing to do
return 0
logger.info("Preparing RunQueue")
self.init_progress_reporter.start()
self.init_progress_reporter.next_stage()
# Step A - Work out a list of tasks to run
#
@@ -561,8 +564,9 @@ class RunQueueData:
# e.g. do_sometask[recrdeptask] = "do_someothertask"
# (makes sure sometask runs after someothertask of all DEPENDS, RDEPENDS and intertask dependencies, recursively)
# We need to do this separately since we need all of runtaskentries[*].depends to be complete before this is processed
self.init_progress_reporter.next_stage(len(recursivetasks))
extradeps = {}
for tid in recursivetasks:
for taskcounter, tid in enumerate(recursivetasks):
extradeps[tid] = set(self.runtaskentries[tid].depends)
tasknames = recursivetasks[tid]
@@ -584,6 +588,7 @@ class RunQueueData:
if tid in recursiveitasks:
for dep in recursiveitasks[tid]:
generate_recdeps(dep)
self.init_progress_reporter.update(taskcounter)
# Remove circular references so that do_a[recrdeptask] = "do_a do_b" can work
for tid in recursivetasks:
@@ -599,6 +604,8 @@ class RunQueueData:
logger.debug(2, "Task %s contains self reference!", tid)
self.runtaskentries[tid].depends.remove(tid)
self.init_progress_reporter.next_stage()
# Step B - Mark all active tasks
#
# Start with the tasks we were asked to run and mark all dependencies
@@ -663,6 +670,8 @@ class RunQueueData:
else:
mark_active(tid, 1)
self.init_progress_reporter.next_stage()
# Step C - Prune all inactive tasks
#
# Once all active tasks are marked, prune the ones we don't need.
@@ -673,6 +682,8 @@ class RunQueueData:
del self.runtaskentries[tid]
delcount += 1
self.init_progress_reporter.next_stage()
#
# Step D - Sanity checks and computation
#
@@ -688,11 +699,15 @@ class RunQueueData:
logger.verbose("Assign Weightings")
self.init_progress_reporter.next_stage()
# Generate a list of reverse dependencies to ease future calculations
for tid in self.runtaskentries:
for dep in self.runtaskentries[tid].depends:
self.runtaskentries[dep].revdeps.add(tid)
self.init_progress_reporter.next_stage()
# Identify tasks at the end of dependency chains
# Error on circular dependency loops (length two)
endpoints = []
@@ -708,10 +723,14 @@ class RunQueueData:
logger.verbose("Compute totals (have %s endpoint(s))", len(endpoints))
self.init_progress_reporter.next_stage()
# Calculate task weights
# Check of higher length circular dependencies
self.runq_weight = self.calculate_task_weights(endpoints)
self.init_progress_reporter.next_stage()
# Sanity Check - Check for multiple tasks building the same provider
prov_list = {}
seen_fn = []
@@ -803,6 +822,8 @@ class RunQueueData:
else:
logger.error(msg)
self.init_progress_reporter.next_stage()
# Create a whitelist usable by the stamp checks
stampfnwhitelist = []
for entry in self.stampwhitelist.split():
@@ -812,6 +833,8 @@ class RunQueueData:
stampfnwhitelist.append(fn)
self.stampfnwhitelist = stampfnwhitelist
self.init_progress_reporter.next_stage()
# Iterate over the task list looking for tasks with a 'setscene' function
self.runq_setscene_tids = []
if not self.cooker.configuration.nosetscene:
@@ -836,6 +859,8 @@ class RunQueueData:
logger.verbose("Invalidate task %s, %s", taskname, fn)
bb.parse.siggen.invalidate_task(taskname, self.dataCache, fn)
self.init_progress_reporter.next_stage()
# Invalidate task if force mode active
if self.cooker.configuration.force:
for (fn, target) in self.target_pairs:
@@ -849,6 +874,8 @@ class RunQueueData:
st = "do_%s" % st
invalidate_task(fn, st, True)
self.init_progress_reporter.next_stage()
# Create and print to the logs a virtual/xxxx -> PN (fn) table
virtmap = taskData.get_providermap(prefix="virtual/")
virtpnmap = {}
@@ -858,6 +885,8 @@ class RunQueueData:
if hasattr(bb.parse.siggen, "tasks_resolved"):
bb.parse.siggen.tasks_resolved(virtmap, virtpnmap, self.dataCache)
self.init_progress_reporter.next_stage()
# Iterate over the task list and call into the siggen code
dealtwith = set()
todeal = set(self.runtaskentries)
@@ -1095,14 +1124,25 @@ class RunQueue:
if self.state is runQueuePrepare:
self.rqexe = RunQueueExecuteDummy(self)
# NOTE: if you add, remove or significantly refactor the stages of this
# process then you should recalculate the weightings here. This is quite
# easy to do - just change the next line temporarily to pass debug=True as
# the last parameter and you'll get a printout of the weightings as well
# as a map to the lines where next_stage() was called. Of course this isn't
# critical, but it helps to keep the progress reporting accurate.
self.rqdata.init_progress_reporter = bb.progress.MultiStageProcessProgressReporter(self.cooker.data,
"Initialising tasks",
[43, 967, 4, 3, 1, 5, 3, 7, 13, 1, 2, 1, 1, 246, 35, 1, 38, 1, 35, 2, 338, 204, 142, 3, 3, 37, 244])
if self.rqdata.prepare() == 0:
self.state = runQueueComplete
else:
self.state = runQueueSceneInit
self.rqdata.init_progress_reporter.next_stage()
# we are ready to run, emit dependency info to any UI or class which
# needs it
depgraph = self.cooker.buildDependTree(self, self.rqdata.taskData)
self.rqdata.init_progress_reporter.next_stage()
bb.event.fire(bb.event.DepTreeGenerated(depgraph), self.cooker.data)
if self.state is runQueueSceneInit:
@@ -1115,7 +1155,9 @@ class RunQueue:
self.write_diffscenetasks(invalidtasks)
self.state = runQueueComplete
else:
self.rqdata.init_progress_reporter.next_stage()
self.start_worker()
self.rqdata.init_progress_reporter.next_stage()
self.rqexe = RunQueueExecuteScenequeue(self)
if self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp]:
@@ -1128,6 +1170,8 @@ class RunQueue:
if self.cooker.configuration.setsceneonly:
self.state = runQueueComplete
else:
# Just in case we didn't setscene
self.rqdata.init_progress_reporter.finish()
logger.info("Executing RunQueue Tasks")
self.rqexe = RunQueueExecuteTasks(self)
self.state = runQueueRunning
@@ -1175,8 +1219,8 @@ class RunQueue:
pass
self.state = runQueueComplete
raise
except:
logger.error("An uncaught exception occured in runqueue, please see the failure below:")
except Exception as err:
logger.exception("An uncaught exception occurred in runqueue")
try:
self.teardown_workers()
except:
@@ -1596,8 +1640,51 @@ class RunQueueExecuteTasks(RunQueueExecute):
Run the tasks in a queue prepared by rqdata.prepare()
"""
self.rq.read_workers()
if self.rqdata.setscenewhitelist:
# Check tasks that are going to run against the whitelist
def check_norun_task(tid, showerror=False):
fn = fn_from_tid(tid)
taskname = taskname_from_tid(tid)
# Ignore covered tasks
if tid in self.rq.scenequeue_covered:
return False
# Ignore stamped tasks
if self.rq.check_stamp_task(tid, taskname, cache=self.stampcache):
return False
# Ignore noexec tasks
taskdep = self.rqdata.dataCache.task_deps[fn]
if 'noexec' in taskdep and taskname in taskdep['noexec']:
return False
pn = self.rqdata.dataCache.pkg_fn[fn]
if not check_setscene_enforce_whitelist(pn, taskname, self.rqdata.setscenewhitelist):
if showerror:
if tid in self.rqdata.runq_setscene_tids:
logger.error('Task %s.%s attempted to execute unexpectedly and should have been setscened' % (pn, taskname))
else:
logger.error('Task %s.%s attempted to execute unexpectedly' % (pn, taskname))
return True
return False
# Look to see if any tasks that we think shouldn't run are going to
unexpected = False
for tid in self.rqdata.runtaskentries:
if check_norun_task(tid):
unexpected = True
break
if unexpected:
# Run through the tasks in the rough order they'd have executed and print errors
# (since the order can be useful - usually missing sstate for the last few tasks
# is the cause of the problem)
task = self.sched.next()
while task is not None:
check_norun_task(task, showerror=True)
self.task_skip(task, 'Setscene enforcement check')
task = self.sched.next()
self.rq.state = runQueueCleanUp
return True
self.rq.read_workers()
if self.stats.total == 0:
# nothing to do
@@ -1725,6 +1812,8 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
# therefore aims to collapse the huge runqueue dependency tree into a smaller one
# only containing the setscene functions.
self.rqdata.init_progress_reporter.next_stage()
# First process the chains up to the first setscene task.
endpoints = {}
for tid in self.rqdata.runtaskentries:
@@ -1734,6 +1823,8 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
#bb.warn("Added endpoint %s" % (tid))
endpoints[tid] = set()
self.rqdata.init_progress_reporter.next_stage()
# Secondly process the chains between setscene tasks.
for tid in self.rqdata.runq_setscene_tids:
#bb.warn("Added endpoint 2 %s" % (tid))
@@ -1743,6 +1834,8 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
#bb.warn(" Added endpoint 3 %s" % (dep))
endpoints[dep].add(tid)
self.rqdata.init_progress_reporter.next_stage()
def process_endpoints(endpoints):
newendpoints = {}
for point, task in endpoints.items():
@@ -1767,6 +1860,8 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
process_endpoints(endpoints)
self.rqdata.init_progress_reporter.next_stage()
# Build a list of setscene tasks which are "unskippable"
# These are direct endpoints referenced by the build
endpoints2 = {}
@@ -1803,7 +1898,9 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
if sq_revdeps_new2[tid]:
self.unskippable.append(tid)
for tid in self.rqdata.runtaskentries:
self.rqdata.init_progress_reporter.next_stage(len(self.rqdata.runtaskentries))
for taskcounter, tid in enumerate(self.rqdata.runtaskentries):
if tid in self.rqdata.runq_setscene_tids:
deps = set()
for dep in sq_revdeps_new[tid]:
@@ -1811,6 +1908,9 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
sq_revdeps_squash[tid] = deps
elif len(sq_revdeps_new[tid]) != 0:
bb.msg.fatal("RunQueue", "Something went badly wrong during scenequeue generation, aborting. Please report this problem.")
self.rqdata.init_progress_reporter.update(taskcounter)
self.rqdata.init_progress_reporter.next_stage()
# Resolve setscene inter-task dependencies
# e.g. do_sometask_setscene[depends] = "targetname:do_someothertask_setscene"
@@ -1838,10 +1938,14 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
# Have to zero this to avoid circular dependencies
sq_revdeps_squash[deptid] = set()
self.rqdata.init_progress_reporter.next_stage()
for task in self.sq_harddeps:
for dep in self.sq_harddeps[task]:
sq_revdeps_squash[dep].add(task)
self.rqdata.init_progress_reporter.next_stage()
#for tid in sq_revdeps_squash:
# for dep in sq_revdeps_squash[tid]:
# data = data + "\n %s" % dep
@@ -1857,6 +1961,8 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
for dep in self.sq_revdeps[tid]:
self.sq_deps[dep].add(tid)
self.rqdata.init_progress_reporter.next_stage()
for tid in self.sq_revdeps:
if len(self.sq_revdeps[tid]) == 0:
self.runq_buildable.add(tid)
@@ -1912,6 +2018,8 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
logger.debug(2, 'No package found, so skipping setscene task %s', tid)
self.outrightfail.append(tid)
self.rqdata.init_progress_reporter.finish()
logger.info('Executing SetScene Tasks')
self.rq.state = runQueueSceneRun
@@ -1940,6 +2048,16 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
self.scenequeue_covered.add(task)
self.scenequeue_updatecounters(task)
def check_taskfail(self, task):
if self.rqdata.setscenewhitelist:
realtask = task.split('_setscene')[0]
fn = fn_from_tid(realtask)
taskname = taskname_from_tid(realtask)
pn = self.rqdata.dataCache.pkg_fn[fn]
if not check_setscene_enforce_whitelist(pn, taskname, self.rqdata.setscenewhitelist):
logger.error('Task %s.%s failed' % (pn, taskname + "_setscene"))
self.rq.state = runQueueCleanUp
def task_complete(self, task):
self.stats.taskCompleted()
bb.event.fire(sceneQueueTaskCompleted(task, self.stats, self.rq), self.cfgData)
@@ -1950,6 +2068,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
bb.event.fire(sceneQueueTaskFailed(task, self.stats, result, self), self.cfgData)
self.scenequeue_notcovered.add(task)
self.scenequeue_updatecounters(task, True)
self.check_taskfail(task)
def task_failoutright(self, task):
self.runq_running.add(task)
@@ -2231,3 +2350,27 @@ class runQueuePipe():
if len(self.queue) > 0:
print("Warning, worker left partial message: %s" % self.queue)
self.input.close()
def get_setscene_enforce_whitelist(d):
if d.getVar('BB_SETSCENE_ENFORCE', True) != '1':
return None
whitelist = (d.getVar("BB_SETSCENE_ENFORCE_WHITELIST", True) or "").split()
outlist = []
for item in whitelist[:]:
if item.startswith('%:'):
for target in sys.argv[1:]:
if not target.startswith('-'):
outlist.append(target.split(':')[0] + ':' + item.split(':')[1])
else:
outlist.append(item)
return outlist
def check_setscene_enforce_whitelist(pn, taskname, whitelist):
import fnmatch
if whitelist:
item = '%s:%s' % (pn, taskname)
for whitelist_item in whitelist:
if fnmatch.fnmatch(item, whitelist_item):
return True
return False
return True

View File

@@ -85,6 +85,23 @@ def _create_server(host, port, timeout = 60):
s = xmlrpc.client.ServerProxy("http://%s:%d/" % (host, port), transport=t, allow_none=True, use_builtin_types=True)
return s, t
def check_connection(remote, timeout):
try:
host, port = remote.split(":")
port = int(port)
except Exception as e:
bb.warn("Failed to read remote definition (%s)" % str(e))
raise e
server, _transport = _create_server(host, port, timeout)
try:
ret, err = server.runCommand(['getVariable', 'TOPDIR'])
if err or not ret:
return False
except ConnectionError:
return False
return True
class BitBakeServerCommands():
def __init__(self, server):
@@ -188,7 +205,7 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
# remove this when you're done with debugging
# allow_reuse_address = True
def __init__(self, interface, single_use=False):
def __init__(self, interface, single_use=False, idle_timeout=0):
"""
Constructor
"""
@@ -206,6 +223,10 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
self.commands = BitBakeServerCommands(self)
self.autoregister_all_functions(self.commands, "")
self.interface = interface
self.time = time.time()
self.idle_timeout = idle_timeout
if idle_timeout:
self.register_idle_function(self.handle_idle_timeout, self)
def addcooker(self, cooker):
BaseImplServer.addcooker(self, cooker)
@@ -221,6 +242,12 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
if name.startswith(prefix):
self.register_function(method, name[len(prefix):])
def handle_idle_timeout(self, server, data, abort):
if not abort:
if time.time() - server.time > server.idle_timeout:
server.quit = True
print("Server idle timeout expired")
return []
def serve_forever(self):
# Start the actual XMLRPC server
@@ -263,6 +290,8 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
try:
fd_sets = select.select(fds, [], [], socktimeout)
if fd_sets[0] and self in fd_sets[0]:
if self.idle_timeout:
self.time = time.time()
self._handle_request_noblock()
except IOError:
# we ignore interrupted calls
@@ -334,9 +363,10 @@ class BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection):
pass
class BitBakeServer(BitBakeBaseServer):
def initServer(self, interface = ("localhost", 0), single_use = False):
def initServer(self, interface = ("localhost", 0),
single_use = False, idle_timeout=0):
self.interface = interface
self.serverImpl = XMLRPCServer(interface, single_use)
self.serverImpl = XMLRPCServer(interface, single_use, idle_timeout)
def detach(self):
daemonize.createDaemon(self.serverImpl.serve_forever, "bitbake-cookerdaemon.log")

View File

@@ -37,7 +37,7 @@ os.environ["DJANGO_SETTINGS_MODULE"] =\
django.setup()
from orm.models import Build, Task, Recipe, Layer_Version, Layer, Target, LogMessage, HelpText
from orm.models import Target_Image_File, BuildArtifact
from orm.models import Target_Image_File, TargetKernelFile, TargetSDKFile
from orm.models import Variable, VariableHistory
from orm.models import Package, Package_File, Target_Installed_Package, Target_File
from orm.models import Task_Dependency, Package_Dependency
@@ -121,11 +121,27 @@ class ORMWrapper(object):
return vars(self)[dictname][key]
def get_similar_target_with_image_files(self, target):
"""
Get a Target object "similar" to target; i.e. with the same target
name ('core-image-minimal' etc.) and machine.
"""
return target.get_similar_target_with_image_files()
def get_similar_target_with_sdk_files(self, target):
return target.get_similar_target_with_sdk_files()
def clone_image_artifacts(self, target_from, target_to):
target_to.clone_image_artifacts_from(target_from)
def clone_sdk_artifacts(self, target_from, target_to):
target_to.clone_sdk_artifacts_from(target_from)
def _timestamp_to_datetime(self, secs):
"""
Convert timestamp in seconds to Python datetime
"""
return datetime(1970, 1, 1) + timedelta(seconds=secs)
return timezone.make_aware(datetime(1970, 1, 1) + timedelta(seconds=secs))
# pylint: disable=no-self-use
# we disable detection of no self use in functions because the methods actually work on the object
@@ -194,6 +210,10 @@ class ORMWrapper(object):
@staticmethod
def get_or_create_targets(target_info):
"""
NB get_or_create() is used here because for Toaster-triggered builds,
we already created the targets when the build was triggered.
"""
result = []
for target in target_info['targets']:
task = ''
@@ -203,13 +223,10 @@ class ORMWrapper(object):
task = task[3:]
if task == 'build':
task = ''
obj, created = Target.objects.get_or_create(build=target_info['build'],
target=target)
if created:
obj.is_image = False
if task:
obj.task = task
obj.save()
obj, _ = Target.objects.get_or_create(build=target_info['build'],
target=target,
task=task)
result.append(obj)
return result
@@ -239,6 +256,10 @@ class ORMWrapper(object):
target.license_manifest_path = license_manifest_path
target.save()
def update_target_set_package_manifest(self, target, package_manifest_path):
target.package_manifest_path = package_manifest_path
target.save()
def update_task_object(self, build, task_name, recipe_name, task_stats):
"""
Find the task for build which matches the recipe and task name
@@ -674,20 +695,23 @@ class ORMWrapper(object):
logger.warning("buildinfohelper: target_package_info could not identify recipes: \n%s", errormsg)
def save_target_image_file_information(self, target_obj, file_name, file_size):
Target_Image_File.objects.create( target = target_obj,
file_name = file_name,
file_size = file_size)
Target_Image_File.objects.create(target=target_obj,
file_name=file_name, file_size=file_size)
def save_artifact_information(self, build_obj, file_name, file_size):
# we skip the image files from other builds
if Target_Image_File.objects.filter(file_name = file_name).count() > 0:
return
def save_target_kernel_file(self, target_obj, file_name, file_size):
"""
Save kernel file (bzImage, modules*) information for a Target target_obj.
"""
TargetKernelFile.objects.create(target=target_obj,
file_name=file_name, file_size=file_size)
# do not update artifacts found in other builds
if BuildArtifact.objects.filter(file_name = file_name).count() > 0:
return
BuildArtifact.objects.create(build = build_obj, file_name = file_name, file_size = file_size)
def save_target_sdk_file(self, target_obj, file_name, file_size):
"""
Save SDK artifacts to the database, associating them with a
Target object.
"""
TargetSDKFile.objects.create(target=target_obj, file_name=file_name,
file_size=file_size)
def create_logmessage(self, log_information):
assert 'build' in log_information
@@ -855,6 +879,11 @@ class BuildInfoHelper(object):
Keeps in memory all data that needs matching before writing it to the database
"""
# tasks which produce image files; note we include '', as we set
# the task for a target to '' (i.e. 'build') if no target is
# explicitly defined
IMAGE_GENERATING_TASKS = ['', 'build', 'image', 'populate_sdk_ext']
# pylint: disable=protected-access
# the code will look into the protected variables of the event; no easy way around this
# pylint: disable=bad-continuation
@@ -1061,36 +1090,10 @@ class BuildInfoHelper(object):
return self.brbe
def update_target_image_file(self, event):
evdata = BuildInfoHelper._get_data_from_event(event)
for t in self.internal_state['targets']:
if t.is_image == True:
output_files = list(evdata.keys())
for output in output_files:
if t.target in output and 'rootfs' in output and not output.endswith(".manifest"):
self.orm_wrapper.save_target_image_file_information(t, output, evdata[output])
def update_artifact_image_file(self, event):
evdata = BuildInfoHelper._get_data_from_event(event)
for artifact_path in evdata.keys():
self.orm_wrapper.save_artifact_information(self.internal_state['build'], artifact_path, evdata[artifact_path])
def update_build_information(self, event, errors, warnings, taskfailures):
if 'build' in self.internal_state:
self.orm_wrapper.update_build_object(self.internal_state['build'], errors, warnings, taskfailures)
def store_license_manifest_path(self, event):
deploy_dir = BuildInfoHelper._get_data_from_event(event)['deploy_dir']
image_name = BuildInfoHelper._get_data_from_event(event)['image_name']
path = deploy_dir + "/licenses/" + image_name + "/license.manifest"
for target in self.internal_state['targets']:
if target.target in image_name:
self.orm_wrapper.update_target_set_license_manifest(target, path)
def store_started_task(self, event):
assert isinstance(event, (bb.runqueue.sceneQueueTaskStarted, bb.runqueue.runQueueTaskStarted, bb.runqueue.runQueueTaskSkipped))
assert 'taskfile' in vars(event)
@@ -1241,11 +1244,16 @@ class BuildInfoHelper(object):
logger.warning("KeyError in save_target_package_information"
"%s ", e)
try:
self.orm_wrapper.save_target_file_information(self.internal_state['build'], target, filedata)
except KeyError as e:
logger.warning("KeyError in save_target_file_information"
"%s ", e)
# only try to find files in the image if the task for this
# target is one which produces image files; otherwise, the old
# list of files in the files-in-image.txt file will be
# appended to the target even if it didn't produce any images
if target.task in BuildInfoHelper.IMAGE_GENERATING_TASKS:
try:
self.orm_wrapper.save_target_file_information(self.internal_state['build'], target, filedata)
except KeyError as e:
logger.warning("KeyError in save_target_file_information"
"%s ", e)
@@ -1506,6 +1514,304 @@ class BuildInfoHelper(object):
self.orm_wrapper.create_logmessage(log_information)
def _get_filenames_from_image_license(self, image_license_manifest_path):
"""
Find the FILES line in the image_license.manifest file,
which has the basenames of the bzImage and modules files
in this format:
FILES: bzImage--4.4.11+git0+3a5f494784_53e84104c5-r0-qemux86-20160603165040.bin modules--4.4.11+git0+3a5f494784_53e84104c5-r0-qemux86-20160603165040.tgz
"""
files = []
with open(image_license_manifest_path) as image_license:
for line in image_license:
if line.startswith('FILES'):
files_str = line.split(':')[1].strip()
files_str = re.sub(r' {2,}', ' ', files_str)
files = files_str.split(' ')
return files
def _endswith(self, str_to_test, endings):
"""
Returns True if str ends with one of the strings in the list
endings, False otherwise
"""
endswith = False
for ending in endings:
if str_to_test.endswith(ending):
endswith = True
break
return endswith
def _get_image_files(self, deploy_dir_image, image_name, image_file_extensions):
"""
Find files in deploy_dir_image whose basename starts with the
string image_name and ends with one of the strings in
image_file_extensions.
Returns a list of file dictionaries like
[
{
'path': '/path/to/image/file',
'size': <file size in bytes>
}
]
"""
image_files = []
for dirpath, _, filenames in os.walk(deploy_dir_image):
for filename in filenames:
if filename.startswith(image_name) and \
self._endswith(filename, image_file_extensions):
image_file_path = os.path.join(dirpath, filename)
image_file_size = os.stat(image_file_path).st_size
image_files.append({
'path': image_file_path,
'size': image_file_size
})
return image_files
def scan_image_artifacts(self):
"""
Scan for built image artifacts in DEPLOY_DIR_IMAGE and associate them
with a Target object in self.internal_state['targets'].
We have two situations to handle:
1. This is the first time a target + machine has been built, so
add files from the DEPLOY_DIR_IMAGE to the target.
OR
2. There are no new files for the target (they were already produced by
a previous build), so copy them from the most recent previous build with
the same target, task and machine.
"""
deploy_dir_image = \
self.server.runCommand(['getVariable', 'DEPLOY_DIR_IMAGE'])[0]
# if there's no DEPLOY_DIR_IMAGE, there aren't going to be
# any image artifacts, so we can return immediately
if not deploy_dir_image:
return
buildname = self.server.runCommand(['getVariable', 'BUILDNAME'])[0]
machine = self.server.runCommand(['getVariable', 'MACHINE'])[0]
image_name = self.server.runCommand(['getVariable', 'IMAGE_NAME'])[0]
# location of the manifest files for this build;
# note that this file is only produced if an image is produced
license_directory = \
self.server.runCommand(['getVariable', 'LICENSE_DIRECTORY'])[0]
# file name extensions for image files
image_file_extensions_unique = {}
image_fstypes = self.server.runCommand(
['getVariable', 'IMAGE_FSTYPES'])[0]
if image_fstypes != None:
image_types_str = image_fstypes.strip()
image_file_extensions = re.sub(r' {2,}', ' ', image_types_str)
image_file_extensions_unique = set(image_file_extensions.split(' '))
targets = self.internal_state['targets']
# filter out anything which isn't an image target
image_targets = [target for target in targets if target.is_image]
for image_target in image_targets:
# this is set to True if we find at least one file relating to
# this target; if this remains False after the scan, we copy the
# files from the most-recent Target with the same target + machine
# onto this Target instead
has_files = False
# we construct this because by the time we reach
# BuildCompleted, this has reset to
# 'defaultpkgname-<MACHINE>-<BUILDNAME>';
# we need to change it to
# <TARGET>-<MACHINE>-<BUILDNAME>
real_image_name = re.sub(r'^defaultpkgname', image_target.target,
image_name)
image_license_manifest_path = os.path.join(
license_directory,
real_image_name,
'image_license.manifest')
image_package_manifest_path = os.path.join(
license_directory,
real_image_name,
'image_license.manifest')
# if image_license.manifest exists, we can read the names of bzImage
# and modules files for this build from it, then look for them
# in the DEPLOY_DIR_IMAGE; note that this file is only produced
# if an image file was produced
if os.path.isfile(image_license_manifest_path):
has_files = True
basenames = self._get_filenames_from_image_license(
image_license_manifest_path)
for basename in basenames:
artifact_path = os.path.join(deploy_dir_image, basename)
artifact_size = os.stat(artifact_path).st_size
# note that the artifact will only be saved against this
# build if it hasn't been already
self.orm_wrapper.save_target_kernel_file(image_target,
artifact_path, artifact_size)
# store the license manifest path on the target
# (this file is also created any time an image file is created)
license_manifest_path = os.path.join(license_directory,
real_image_name, 'license.manifest')
self.orm_wrapper.update_target_set_license_manifest(
image_target, license_manifest_path)
# store the package manifest path on the target (this file
# is created any time an image file is created)
package_manifest_path = os.path.join(deploy_dir_image,
real_image_name + '.rootfs.manifest')
if os.path.exists(package_manifest_path):
self.orm_wrapper.update_target_set_package_manifest(
image_target, package_manifest_path)
# scan the directory for image files relating to this build
# (via real_image_name); note that we don't have to set
# has_files = True, as searching for the license manifest file
# will already have set it to true if at least one image file was
# produced; note that the real_image_name includes BUILDNAME, which
# in turn includes a timestamp; so if no files were produced for
# this timestamp (i.e. the build reused existing image files already
# in the directory), no files will be recorded against this target
image_files = self._get_image_files(deploy_dir_image,
real_image_name, image_file_extensions_unique)
for image_file in image_files:
self.orm_wrapper.save_target_image_file_information(
image_target, image_file['path'], image_file['size'])
if not has_files:
# copy image files and build artifacts from the
# most-recently-built Target with the
# same target + machine as this Target; also copy the license
# manifest path, as that is not treated as an artifact and needs
# to be set separately
similar_target = \
self.orm_wrapper.get_similar_target_with_image_files(
image_target)
if similar_target:
logger.info('image artifacts for target %s cloned from ' \
'target %s' % (image_target.pk, similar_target.pk))
self.orm_wrapper.clone_image_artifacts(similar_target,
image_target)
def _get_sdk_targets(self):
"""
Return targets which could generate SDK artifacts, i.e.
"do_populate_sdk" and "do_populate_sdk_ext".
"""
return [target for target in self.internal_state['targets'] \
if target.task in ['populate_sdk', 'populate_sdk_ext']]
def scan_sdk_artifacts(self, event):
"""
Note that we have to intercept an SDKArtifactInfo event from
toaster.bbclass (via toasterui) to get hold of the SDK variables we
need to be able to scan for files accurately: this is because
variables like TOOLCHAIN_OUTPUTNAME have reset to None by the time
BuildCompleted is fired by bitbake, so we have to get those values
while the build is still in progress.
For populate_sdk_ext, this runs twice, with two different
TOOLCHAIN_OUTPUTNAME settings, each of which will capture some of the
files in the SDK output directory.
"""
sdk_vars = BuildInfoHelper._get_data_from_event(event)
toolchain_outputname = sdk_vars['TOOLCHAIN_OUTPUTNAME']
# targets which might have created SDK artifacts
sdk_targets = self._get_sdk_targets()
# location of SDK artifacts
tmpdir = self.server.runCommand(['getVariable', 'TMPDIR'])[0]
sdk_dir = os.path.join(tmpdir, 'deploy', 'sdk')
# all files in the SDK directory
artifacts = []
for dir_path, _, filenames in os.walk(sdk_dir):
for filename in filenames:
full_path = os.path.join(dir_path, filename)
if not os.path.islink(full_path):
artifacts.append(full_path)
for sdk_target in sdk_targets:
# find files in the SDK directory which haven't already been
# recorded against a Target and whose basename matches
# TOOLCHAIN_OUTPUTNAME
for artifact_path in artifacts:
basename = os.path.basename(artifact_path)
toolchain_match = basename.startswith(toolchain_outputname)
# files which match the name of the target which produced them;
# for example,
# poky-glibc-x86_64-core-image-sato-i586-toolchain-ext-2.1+snapshot.sh
target_match = re.search(sdk_target.target, basename)
# targets which produce "*-nativesdk-*" files
is_ext_sdk_target = sdk_target.task in \
['do_populate_sdk_ext', 'populate_sdk_ext']
# SDK files which don't match the target name, i.e.
# x86_64-nativesdk-libc.*
# poky-glibc-x86_64-buildtools-tarball-i586-buildtools-nativesdk-standalone-2.1+snapshot*
is_ext_sdk_file = re.search('-nativesdk-', basename)
file_from_target = (toolchain_match and target_match) or \
(is_ext_sdk_target and is_ext_sdk_file)
if file_from_target:
# don't record the file if it's already been added to this
# target
matching_files = TargetSDKFile.objects.filter(
target=sdk_target, file_name=artifact_path)
if matching_files.count() == 0:
artifact_size = os.stat(artifact_path).st_size
self.orm_wrapper.save_target_sdk_file(
sdk_target, artifact_path, artifact_size)
def clone_required_sdk_artifacts(self):
"""
If an SDK target doesn't have any SDK artifacts, this means that
the postfuncs of populate_sdk or populate_sdk_ext didn't fire, which
in turn means that the targets of this build didn't generate any new
artifacts.
In this case, clone SDK artifacts for targets in the current build
from existing targets for this build.
"""
sdk_targets = self._get_sdk_targets()
for sdk_target in sdk_targets:
# only clone for SDK targets which have no TargetSDKFiles yet
if sdk_target.targetsdkfile_set.all().count() == 0:
similar_target = \
self.orm_wrapper.get_similar_target_with_sdk_files(
sdk_target)
if similar_target:
logger.info('SDK artifacts for target %s cloned from ' \
'target %s' % (sdk_target.pk, similar_target.pk))
self.orm_wrapper.clone_sdk_artifacts(similar_target,
sdk_target)
def close(self, errorcode):
if self.brbe is not None:
self._store_build_done(errorcode)

View File

@@ -40,10 +40,13 @@ logger = logging.getLogger("BitBake")
interactive = sys.stdout.isatty()
class BBProgress(progressbar.ProgressBar):
def __init__(self, msg, maxval):
def __init__(self, msg, maxval, widgets=None):
self.msg = msg
widgets = [progressbar.Percentage(), ' ', progressbar.Bar(), ' ',
progressbar.ETA()]
self.extrapos = -1
if not widgets:
widgets = [progressbar.Percentage(), ' ', progressbar.Bar(), ' ',
progressbar.ETA()]
self.extrapos = 4
try:
self._resize_default = signal.getsignal(signal.SIGWINCH)
@@ -51,23 +54,44 @@ class BBProgress(progressbar.ProgressBar):
self._resize_default = None
progressbar.ProgressBar.__init__(self, maxval, [self.msg + ": "] + widgets, fd=sys.stdout)
def _handle_resize(self, signum, frame):
def _handle_resize(self, signum=None, frame=None):
progressbar.ProgressBar._handle_resize(self, signum, frame)
if self._resize_default:
self._resize_default(signum, frame)
def finish(self):
progressbar.ProgressBar.finish(self)
if self._resize_default:
signal.signal(signal.SIGWINCH, self._resize_default)
def setmessage(self, msg):
self.msg = msg
self.widgets[0] = msg
def setextra(self, extra):
if extra:
extrastr = str(extra)
if extrastr[0] != ' ':
extrastr = ' ' + extrastr
if extrastr[-1] != ' ':
extrastr += ' '
else:
extrastr = ' '
self.widgets[self.extrapos] = extrastr
def _need_update(self):
# We always want the bar to print when update() is called
return True
class NonInteractiveProgress(object):
fobj = sys.stdout
def __init__(self, msg, maxval):
self.msg = msg
self.maxval = maxval
self.finished = False
def start(self):
def start(self, update=True):
self.fobj.write("%s..." % self.msg)
self.fobj.flush()
return self
@@ -76,8 +100,11 @@ class NonInteractiveProgress(object):
pass
def finish(self):
if self.finished:
return
self.fobj.write("done.\n")
self.fobj.flush()
self.finished = True
def new_progress(msg, maxval):
if interactive:
@@ -134,7 +161,7 @@ class TerminalFilter(object):
cr = (25, 80)
return cr
def __init__(self, main, helper, console, errconsole, format):
def __init__(self, main, helper, console, errconsole, format, quiet):
self.main = main
self.helper = helper
self.cuu = None
@@ -142,6 +169,7 @@ class TerminalFilter(object):
self.interactive = sys.stdout.isatty()
self.footer_present = False
self.lastpids = []
self.quiet = quiet
if not self.interactive:
return
@@ -181,6 +209,8 @@ class TerminalFilter(object):
console.addFilter(InteractConsoleLogFilter(self, format))
errconsole.addFilter(InteractConsoleLogFilter(self, format))
self.main_progress = None
def clearFooter(self):
if self.footer_present:
lines = self.footer_present
@@ -195,28 +225,69 @@ class TerminalFilter(object):
activetasks = self.helper.running_tasks
failedtasks = self.helper.failed_tasks
runningpids = self.helper.running_pids
if self.footer_present and (self.lastcount == self.helper.tasknumber_current) and (self.lastpids == runningpids):
if self.footer_present and not self.helper.needUpdate:
return
self.helper.needUpdate = False
if self.footer_present:
self.clearFooter()
if (not self.helper.tasknumber_total or self.helper.tasknumber_current == self.helper.tasknumber_total) and not len(activetasks):
return
tasks = []
for t in runningpids:
tasks.append("%s (pid %s)" % (activetasks[t]["title"], t))
progress = activetasks[t].get("progress", None)
if progress is not None:
pbar = activetasks[t].get("progressbar", None)
rate = activetasks[t].get("rate", None)
start_time = activetasks[t].get("starttime", None)
if not pbar or pbar.bouncing != (progress < 0):
if progress < 0:
pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100, widgets=[progressbar.BouncingSlider()])
pbar.bouncing = True
else:
pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100)
pbar.bouncing = False
activetasks[t]["progressbar"] = pbar
tasks.append((pbar, progress, rate, start_time))
else:
tasks.append("%s (pid %s)" % (activetasks[t]["title"], t))
if self.main.shutdown:
content = "Waiting for %s running tasks to finish:" % len(activetasks)
elif not len(activetasks):
content = "No currently running tasks (%s of %s)" % (self.helper.tasknumber_current, self.helper.tasknumber_total)
else:
content = "Currently %s running tasks (%s of %s):" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total)
print(content)
lines = 1 + int(len(content) / (self.columns + 1))
for tasknum, task in enumerate(tasks[:(self.rows - 2)]):
content = "%s: %s" % (tasknum, task)
print(content)
lines = lines + 1 + int(len(content) / (self.columns + 1))
else:
if not len(activetasks):
content = "No currently running tasks (%s of %s)" % (self.helper.tasknumber_current, self.helper.tasknumber_total)
else:
content = "Currently %2s running tasks (%s of %s)" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total)
maxtask = self.helper.tasknumber_total + 1
if not self.main_progress or self.main_progress.maxval != maxtask:
widgets = [' ', progressbar.Percentage(), ' ', progressbar.Bar()]
self.main_progress = BBProgress("Running tasks", maxtask, widgets=widgets)
self.main_progress.start(False)
self.main_progress.setmessage(content)
self.main_progress.update(self.helper.tasknumber_current)
print('')
lines = 1 + int(len(content) / (self.columns + 1))
if not self.quiet:
for tasknum, task in enumerate(tasks[:(self.rows - 2)]):
if isinstance(task, tuple):
pbar, progress, rate, start_time = task
if not pbar.start_time:
pbar.start(False)
if start_time:
pbar.start_time = start_time
pbar.setmessage('%s:%s' % (tasknum, pbar.msg.split(':', 1)[1]))
if progress > -1:
pbar.setextra(rate)
output = pbar.update(progress)
else:
output = pbar.update(1)
if not output or (len(output) <= pbar.term_width):
print('')
else:
content = "%s: %s" % (tasknum, task)
print(content)
lines = lines + 1 + int(len(content) / (self.columns + 1))
self.footer_present = lines
self.lastpids = runningpids[:]
self.lastcount = self.helper.tasknumber_current
@@ -249,7 +320,8 @@ _evt_list = [ "bb.runqueue.runQueueExitWait", "bb.event.LogExecTTY", "logging.Lo
"bb.command.CommandExit", "bb.command.CommandCompleted", "bb.cooker.CookerExit",
"bb.event.MultipleProviders", "bb.event.NoProvider", "bb.runqueue.sceneQueueTaskStarted",
"bb.runqueue.runQueueTaskStarted", "bb.runqueue.runQueueTaskFailed", "bb.runqueue.sceneQueueTaskFailed",
"bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent"]
"bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent",
"bb.build.TaskProgress", "bb.event.ProcessStarted", "bb.event.ProcessProgress", "bb.event.ProcessFinished"]
def main(server, eventHandler, params, tf = TerminalFilter):
@@ -266,7 +338,10 @@ def main(server, eventHandler, params, tf = TerminalFilter):
errconsole = logging.StreamHandler(sys.stderr)
format_str = "%(levelname)s: %(message)s"
format = bb.msg.BBLogFormatter(format_str)
bb.msg.addDefaultlogFilter(console, bb.msg.BBLogFilterStdOut)
if params.options.quiet:
bb.msg.addDefaultlogFilter(console, bb.msg.BBLogFilterStdOut, bb.msg.BBLogFormatter.WARNING)
else:
bb.msg.addDefaultlogFilter(console, bb.msg.BBLogFilterStdOut)
bb.msg.addDefaultlogFilter(errconsole, bb.msg.BBLogFilterStdErr)
console.setFormatter(format)
errconsole.setFormatter(format)
@@ -287,6 +362,12 @@ def main(server, eventHandler, params, tf = TerminalFilter):
bb.msg.addDefaultlogFilter(consolelog)
consolelog.setFormatter(conlogformat)
logger.addHandler(consolelog)
loglink = os.path.join(os.path.dirname(consolelogfile), 'console-latest.log')
bb.utils.remove(loglink)
try:
os.symlink(os.path.basename(consolelogfile), loglink)
except OSError:
pass
llevel, debug_domains = bb.msg.constructLogOptions()
server.runCommand(["setEventMask", server.getEventHandle(), llevel, debug_domains, _evt_list])
@@ -323,7 +404,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
warnings = 0
taskfailures = []
termfilter = tf(main, helper, console, errconsole, format)
termfilter = tf(main, helper, console, errconsole, format, params.options.quiet)
atexit.register(termfilter.finish)
while True:
@@ -415,15 +496,19 @@ def main(server, eventHandler, params, tf = TerminalFilter):
parseprogress = new_progress("Parsing recipes", event.total).start()
continue
if isinstance(event, bb.event.ParseProgress):
parseprogress.update(event.current)
if parseprogress:
parseprogress.update(event.current)
else:
bb.warn("Got ParseProgress event for parsing that never started?")
continue
if isinstance(event, bb.event.ParseCompleted):
if not parseprogress:
continue
parseprogress.finish()
print(("Parsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors."
% ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors)))
pasreprogress = None
if not params.options.quiet:
print(("Parsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors."
% ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors)))
continue
if isinstance(event, bb.event.CacheLoadStarted):
@@ -434,7 +519,8 @@ def main(server, eventHandler, params, tf = TerminalFilter):
continue
if isinstance(event, bb.event.CacheLoadCompleted):
cacheprogress.finish()
print("Loaded %d entries from dependency cache." % event.num_entries)
if not params.options.quiet:
print("Loaded %d entries from dependency cache." % event.num_entries)
continue
if isinstance(event, bb.command.CommandFailed):
@@ -518,6 +604,22 @@ def main(server, eventHandler, params, tf = TerminalFilter):
if isinstance(event, bb.event.DepTreeGenerated):
continue
if isinstance(event, bb.event.ProcessStarted):
parseprogress = new_progress(event.processname, event.total)
parseprogress.start(False)
continue
if isinstance(event, bb.event.ProcessProgress):
if parseprogress:
parseprogress.update(event.progress)
else:
bb.warn("Got ProcessProgress event for someting that never started?")
continue
if isinstance(event, bb.event.ProcessFinished):
if parseprogress:
parseprogress.finish()
parseprogress = None
continue
# ignore
if isinstance(event, (bb.event.BuildBase,
bb.event.MetadataEvent,
@@ -529,7 +631,8 @@ def main(server, eventHandler, params, tf = TerminalFilter):
bb.event.OperationStarted,
bb.event.OperationCompleted,
bb.event.OperationProgress,
bb.event.DiskFull)):
bb.event.DiskFull,
bb.build.TaskProgress)):
continue
logger.error("Unknown event: %s", event)
@@ -582,7 +685,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
if return_value and errors:
summary += pluralise("\nSummary: There was %s ERROR message shown, returning a non-zero exit code.",
"\nSummary: There were %s ERROR messages shown, returning a non-zero exit code.", errors)
if summary:
if summary and not params.options.quiet:
print(summary)
if interrupted:

View File

@@ -363,6 +363,9 @@ def main(server, eventHandler, params):
errors += 1
errorcode = 1
logger.error("Command execution failed: %s", event.error)
elif isinstance(event, bb.event.BuildCompleted):
buildinfohelper.scan_image_artifacts()
buildinfohelper.clone_required_sdk_artifacts()
# turn off logging to the current build log
_close_build_log(build_log)
@@ -410,12 +413,8 @@ def main(server, eventHandler, params):
buildinfohelper.store_target_package_data(event)
elif event.type == "MissedSstate":
buildinfohelper.store_missed_state_tasks(event)
elif event.type == "ImageFileSize":
buildinfohelper.update_target_image_file(event)
elif event.type == "ArtifactFileSize":
buildinfohelper.update_artifact_image_file(event)
elif event.type == "LicenseManifestPath":
buildinfohelper.store_license_manifest_path(event)
elif event.type == "SDKArtifactInfo":
buildinfohelper.scan_sdk_artifacts(event)
elif event.type == "SetBRBE":
buildinfohelper.brbe = buildinfohelper._get_data_from_event(event)
elif event.type == "OSErrorException":

View File

@@ -18,6 +18,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import bb.build
import time
class BBUIHelper:
def __init__(self):
@@ -31,7 +32,7 @@ class BBUIHelper:
def eventHandler(self, event):
if isinstance(event, bb.build.TaskStarted):
self.running_tasks[event.pid] = { 'title' : "%s %s" % (event._package, event._task) }
self.running_tasks[event.pid] = { 'title' : "%s %s" % (event._package, event._task), 'starttime' : time.time() }
self.running_pids.append(event.pid)
self.needUpdate = True
if isinstance(event, bb.build.TaskSucceeded):
@@ -52,6 +53,11 @@ class BBUIHelper:
self.tasknumber_current = event.stats.completed + event.stats.active + event.stats.failed + 1
self.tasknumber_total = event.stats.total
self.needUpdate = True
if isinstance(event, bb.build.TaskProgress):
if event.pid > 0:
self.running_tasks[event.pid]['progress'] = event.progress
self.running_tasks[event.pid]['rate'] = event.rate
self.needUpdate = True
def getTasks(self):
self.needUpdate = False

View File

@@ -250,6 +250,7 @@ def explode_dep_versions2(s):
if not (i in r and r[i]):
r[lastdep] = []
r = collections.OrderedDict(sorted(r.items(), key=lambda x: x[0]))
return r
def explode_dep_versions(s):
@@ -574,6 +575,7 @@ def preserved_envvars_exported():
'TERM',
'USER',
'LC_ALL',
'BBSERVER',
]
def preserved_envvars():
@@ -598,7 +600,6 @@ def filter_environment(good_vars):
continue
removed_vars[key] = os.environ[key]
os.unsetenv(key)
del os.environ[key]
# If we spawn a python process, we need to have a UTF-8 locale, else python's file
@@ -1444,9 +1445,8 @@ def set_process_name(name):
# This is nice to have for debugging, not essential
try:
libc = cdll.LoadLibrary('libc.so.6')
buff = create_string_buffer(len(name)+1)
buff.value = name
libc.prctl(15, byref(buff), 0, 0, 0)
buf = create_string_buffer(bytes(name, 'utf-8'))
libc.prctl(15, byref(buf), 0, 0, 0)
except:
pass

View File

@@ -1,384 +0,0 @@
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
#
# progressbar - Text progressbar library for python.
# Copyright (c) 2005 Nilton Volpato
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""Text progressbar library for python.
This library provides a text mode progressbar. This is typically used
to display the progress of a long running operation, providing a
visual clue that processing is underway.
The ProgressBar class manages the progress, and the format of the line
is given by a number of widgets. A widget is an object that may
display diferently depending on the state of the progress. There are
three types of widget:
- a string, which always shows itself;
- a ProgressBarWidget, which may return a diferent value every time
it's update method is called; and
- a ProgressBarWidgetHFill, which is like ProgressBarWidget, except it
expands to fill the remaining width of the line.
The progressbar module is very easy to use, yet very powerful. And
automatically supports features like auto-resizing when available.
"""
from __future__ import division
__author__ = "Nilton Volpato"
__author_email__ = "first-name dot last-name @ gmail.com"
__date__ = "2006-05-07"
__version__ = "2.3-dev"
import sys, time, os
from array import array
try:
from fcntl import ioctl
import termios
except ImportError:
pass
import signal
try:
basestring
except NameError:
basestring = (str,)
class ProgressBarWidget(object):
"""This is an element of ProgressBar formatting.
The ProgressBar object will call it's update value when an update
is needed. It's size may change between call, but the results will
not be good if the size changes drastically and repeatedly.
"""
def update(self, pbar):
"""Returns the string representing the widget.
The parameter pbar is a reference to the calling ProgressBar,
where one can access attributes of the class for knowing how
the update must be made.
At least this function must be overriden."""
pass
class ProgressBarWidgetHFill(object):
"""This is a variable width element of ProgressBar formatting.
The ProgressBar object will call it's update value, informing the
width this object must the made. This is like TeX \\hfill, it will
expand to fill the line. You can use more than one in the same
line, and they will all have the same width, and together will
fill the line.
"""
def update(self, pbar, width):
"""Returns the string representing the widget.
The parameter pbar is a reference to the calling ProgressBar,
where one can access attributes of the class for knowing how
the update must be made. The parameter width is the total
horizontal width the widget must have.
At least this function must be overriden."""
pass
class ETA(ProgressBarWidget):
"Widget for the Estimated Time of Arrival"
def format_time(self, seconds):
return time.strftime('%H:%M:%S', time.gmtime(seconds))
def update(self, pbar):
if pbar.currval == 0:
return 'ETA: --:--:--'
elif pbar.finished:
return 'Time: %s' % self.format_time(pbar.seconds_elapsed)
else:
elapsed = pbar.seconds_elapsed
eta = elapsed * pbar.maxval / pbar.currval - elapsed
return 'ETA: %s' % self.format_time(eta)
class FileTransferSpeed(ProgressBarWidget):
"Widget for showing the transfer speed (useful for file transfers)."
def __init__(self, unit='B'):
self.unit = unit
self.fmt = '%6.2f %s'
self.prefixes = ['', 'K', 'M', 'G', 'T', 'P']
def update(self, pbar):
if pbar.seconds_elapsed < 2e-6:#== 0:
bps = 0.0
else:
bps = pbar.currval / pbar.seconds_elapsed
spd = bps
for u in self.prefixes:
if spd < 1000:
break
spd /= 1000
return self.fmt % (spd, u + self.unit + '/s')
class RotatingMarker(ProgressBarWidget):
"A rotating marker for filling the bar of progress."
def __init__(self, markers='|/-\\'):
self.markers = markers
self.curmark = -1
def update(self, pbar):
if pbar.finished:
return self.markers[0]
self.curmark = (self.curmark + 1) % len(self.markers)
return self.markers[self.curmark]
class Percentage(ProgressBarWidget):
"Just the percentage done."
def update(self, pbar):
return '%3d%%' % pbar.percentage()
class SimpleProgress(ProgressBarWidget):
"Returns what is already done and the total, e.g.: '5 of 47'"
def __init__(self, sep=' of '):
self.sep = sep
def update(self, pbar):
return '%d%s%d' % (pbar.currval, self.sep, pbar.maxval)
class Bar(ProgressBarWidgetHFill):
"The bar of progress. It will stretch to fill the line."
def __init__(self, marker='#', left='|', right='|'):
self.marker = marker
self.left = left
self.right = right
def _format_marker(self, pbar):
if isinstance(self.marker, basestring):
return self.marker
else:
return self.marker.update(pbar)
def update(self, pbar, width):
percent = pbar.percentage()
cwidth = width - len(self.left) - len(self.right)
marked_width = int(percent * cwidth // 100)
m = self._format_marker(pbar)
bar = (self.left + (m * marked_width).ljust(cwidth) + self.right)
return bar
class ReverseBar(Bar):
"The reverse bar of progress, or bar of regress. :)"
def update(self, pbar, width):
percent = pbar.percentage()
cwidth = width - len(self.left) - len(self.right)
marked_width = int(percent * cwidth // 100)
m = self._format_marker(pbar)
bar = (self.left + (m*marked_width).rjust(cwidth) + self.right)
return bar
default_widgets = [Percentage(), ' ', Bar()]
class ProgressBar(object):
"""This is the ProgressBar class, it updates and prints the bar.
A common way of using it is like:
>>> pbar = ProgressBar().start()
>>> for i in xrange(100):
... # do something
... pbar.update(i+1)
...
>>> pbar.finish()
You can also use a progressbar as an iterator:
>>> progress = ProgressBar()
>>> for i in progress(some_iterable):
... # do something
...
But anything you want to do is possible (well, almost anything).
You can supply different widgets of any type in any order. And you
can even write your own widgets! There are many widgets already
shipped and you should experiment with them.
The term_width parameter must be an integer or None. In the latter case
it will try to guess it, if it fails it will default to 80 columns.
When implementing a widget update method you may access any
attribute or function of the ProgressBar object calling the
widget's update method. The most important attributes you would
like to access are:
- currval: current value of the progress, 0 <= currval <= maxval
- maxval: maximum (and final) value of the progress
- finished: True if the bar has finished (reached 100%), False o/w
- start_time: the time when start() method of ProgressBar was called
- seconds_elapsed: seconds elapsed since start_time
- percentage(): percentage of the progress [0..100]. This is a method.
The attributes above are unlikely to change between different versions,
the other ones may change or cease to exist without notice, so try to rely
only on the ones documented above if you are extending the progress bar.
"""
__slots__ = ('currval', 'fd', 'finished', 'last_update_time', 'maxval',
'next_update', 'num_intervals', 'seconds_elapsed',
'signal_set', 'start_time', 'term_width', 'update_interval',
'widgets', '_iterable')
_DEFAULT_MAXVAL = 100
def __init__(self, maxval=None, widgets=default_widgets, term_width=None,
fd=sys.stderr):
self.maxval = maxval
self.widgets = widgets
self.fd = fd
self.signal_set = False
if term_width is not None:
self.term_width = term_width
else:
try:
self._handle_resize(None, None)
signal.signal(signal.SIGWINCH, self._handle_resize)
self.signal_set = True
except (SystemExit, KeyboardInterrupt):
raise
except:
self.term_width = int(os.environ.get('COLUMNS', 80)) - 1
self.currval = 0
self.finished = False
self.start_time = None
self.last_update_time = None
self.seconds_elapsed = 0
self._iterable = None
def __call__(self, iterable):
try:
self.maxval = len(iterable)
except TypeError:
# If the iterable has no length, then rely on the value provided
# by the user, otherwise fail.
if not (isinstance(self.maxval, (int, long)) and self.maxval > 0):
raise RuntimeError('Could not determine maxval from iterable. '
'You must explicitly provide a maxval.')
self._iterable = iter(iterable)
self.start()
return self
def __iter__(self):
return self
def next(self):
try:
next = self._iterable.next()
self.update(self.currval + 1)
return next
except StopIteration:
self.finish()
raise
def _handle_resize(self, signum, frame):
h, w = array('h', ioctl(self.fd, termios.TIOCGWINSZ, '\0' * 8))[:2]
self.term_width = w
def percentage(self):
"Returns the percentage of the progress."
return self.currval * 100.0 / self.maxval
def _format_widgets(self):
r = []
hfill_inds = []
num_hfill = 0
currwidth = 0
for i, w in enumerate(self.widgets):
if isinstance(w, ProgressBarWidgetHFill):
r.append(w)
hfill_inds.append(i)
num_hfill += 1
elif isinstance(w, basestring):
r.append(w)
currwidth += len(w)
else:
weval = w.update(self)
currwidth += len(weval)
r.append(weval)
for iw in hfill_inds:
widget_width = int((self.term_width - currwidth) // num_hfill)
r[iw] = r[iw].update(self, widget_width)
return r
def _format_line(self):
return ''.join(self._format_widgets()).ljust(self.term_width)
def _next_update(self):
return int((int(self.num_intervals *
(self.currval / self.maxval)) + 1) *
self.update_interval)
def _need_update(self):
"""Returns true when the progressbar should print an updated line.
You can override this method if you want finer grained control over
updates.
The current implementation is optimized to be as fast as possible and
as economical as possible in the number of updates. However, depending
on your usage you may want to do more updates. For instance, if your
progressbar stays in the same percentage for a long time, and you want
to update other widgets, like ETA, then you could return True after
some time has passed with no updates.
Ideally you could call self._format_line() and see if it's different
from the previous _format_line() call, but calling _format_line() takes
around 20 times more time than calling this implementation of
_need_update().
"""
return self.currval >= self.next_update
def update(self, value):
"Updates the progress bar to a new value."
assert 0 <= value <= self.maxval, '0 <= %d <= %d' % (value, self.maxval)
self.currval = value
if not self._need_update():
return
if self.start_time is None:
raise RuntimeError('You must call start() before calling update()')
now = time.time()
self.seconds_elapsed = now - self.start_time
self.next_update = self._next_update()
self.fd.write(self._format_line() + '\r')
self.last_update_time = now
def start(self):
"""Starts measuring time, and prints the bar at 0%.
It returns self so you can use it like this:
>>> pbar = ProgressBar().start()
>>> for i in xrange(100):
... # do something
... pbar.update(i+1)
...
>>> pbar.finish()
"""
if self.maxval is None:
self.maxval = self._DEFAULT_MAXVAL
assert self.maxval > 0
self.num_intervals = max(100, self.term_width)
self.update_interval = self.maxval / self.num_intervals
self.next_update = 0
self.start_time = self.last_update_time = time.time()
self.update(0)
return self
def finish(self):
"""Used to tell the progress is finished."""
self.finished = True
self.update(self.maxval)
self.fd.write('\n')
if self.signal_set:
signal.signal(signal.SIGWINCH, signal.SIG_DFL)

View File

@@ -0,0 +1,52 @@
You can redistribute and/or modify this library under the terms of the
GNU LGPL license or BSD license (or both).
---
progressbar - Text progress bar library for python.
Copyright (C) 2005 Nilton Volpato
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
---
progressbar - Text progress bar library for python
Copyright (c) 2008 Nilton Volpato
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
a. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
b. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
c. Neither the name of the author nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

View File

@@ -0,0 +1,49 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# progressbar - Text progress bar library for Python.
# Copyright (c) 2005 Nilton Volpato
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""Text progress bar library for Python.
A text progress bar is typically used to display the progress of a long
running operation, providing a visual cue that processing is underway.
The ProgressBar class manages the current progress, and the format of the line
is given by a number of widgets. A widget is an object that may display
differently depending on the state of the progress bar. There are three types
of widgets:
- a string, which always shows itself
- a ProgressBarWidget, which may return a different value every time its
update method is called
- a ProgressBarWidgetHFill, which is like ProgressBarWidget, except it
expands to fill the remaining width of the line.
The progressbar module is very easy to use, yet very powerful. It will also
automatically enable features like auto-resizing when the system supports it.
"""
__author__ = 'Nilton Volpato'
__author_email__ = 'first-name dot last-name @ gmail.com'
__date__ = '2011-05-14'
__version__ = '2.3'
from .compat import *
from .widgets import *
from .progressbar import *

View File

@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
#
# progressbar - Text progress bar library for Python.
# Copyright (c) 2005 Nilton Volpato
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""Compatibility methods and classes for the progressbar module."""
# Python 3.x (and backports) use a modified iterator syntax
# This will allow 2.x to behave with 3.x iterators
try:
next
except NameError:
def next(iter):
try:
# Try new style iterators
return iter.__next__()
except AttributeError:
# Fallback in case of a "native" iterator
return iter.next()
# Python < 2.5 does not have "any"
try:
any
except NameError:
def any(iterator):
for item in iterator:
if item: return True
return False

View File

@@ -0,0 +1,315 @@
# -*- coding: utf-8 -*-
#
# progressbar - Text progress bar library for Python.
# Copyright (c) 2005 Nilton Volpato
#
# (With some small changes after importing into BitBake)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""Main ProgressBar class."""
from __future__ import division
import math
import os
import signal
import sys
import time
try:
from fcntl import ioctl
from array import array
import termios
except ImportError:
pass
from .compat import * # for: any, next
from . import widgets
class UnknownLength: pass
class ProgressBar(object):
"""The ProgressBar class which updates and prints the bar.
A common way of using it is like:
>>> pbar = ProgressBar().start()
>>> for i in range(100):
... # do something
... pbar.update(i+1)
...
>>> pbar.finish()
You can also use a ProgressBar as an iterator:
>>> progress = ProgressBar()
>>> for i in progress(some_iterable):
... # do something
...
Since the progress bar is incredibly customizable you can specify
different widgets of any type in any order. You can even write your own
widgets! However, since there are already a good number of widgets you
should probably play around with them before moving on to create your own
widgets.
The term_width parameter represents the current terminal width. If the
parameter is set to an integer then the progress bar will use that,
otherwise it will attempt to determine the terminal width falling back to
80 columns if the width cannot be determined.
When implementing a widget's update method you are passed a reference to
the current progress bar. As a result, you have access to the
ProgressBar's methods and attributes. Although there is nothing preventing
you from changing the ProgressBar you should treat it as read only.
Useful methods and attributes include (Public API):
- currval: current progress (0 <= currval <= maxval)
- maxval: maximum (and final) value
- finished: True if the bar has finished (reached 100%)
- start_time: the time when start() method of ProgressBar was called
- seconds_elapsed: seconds elapsed since start_time and last call to
update
- percentage(): progress in percent [0..100]
"""
__slots__ = ('currval', 'fd', 'finished', 'last_update_time',
'left_justify', 'maxval', 'next_update', 'num_intervals',
'poll', 'seconds_elapsed', 'signal_set', 'start_time',
'term_width', 'update_interval', 'widgets', '_time_sensitive',
'__iterable')
_DEFAULT_MAXVAL = 100
_DEFAULT_TERMSIZE = 80
_DEFAULT_WIDGETS = [widgets.Percentage(), ' ', widgets.Bar()]
def __init__(self, maxval=None, widgets=None, term_width=None, poll=1,
left_justify=True, fd=sys.stderr):
"""Initializes a progress bar with sane defaults."""
# Don't share a reference with any other progress bars
if widgets is None:
widgets = list(self._DEFAULT_WIDGETS)
self.maxval = maxval
self.widgets = widgets
self.fd = fd
self.left_justify = left_justify
self.signal_set = False
if term_width is not None:
self.term_width = term_width
else:
try:
self._handle_resize(None, None)
signal.signal(signal.SIGWINCH, self._handle_resize)
self.signal_set = True
except (SystemExit, KeyboardInterrupt): raise
except Exception as e:
print("DEBUG 5 %s" % e)
self.term_width = self._env_size()
self.__iterable = None
self._update_widgets()
self.currval = 0
self.finished = False
self.last_update_time = None
self.poll = poll
self.seconds_elapsed = 0
self.start_time = None
self.update_interval = 1
self.next_update = 0
def __call__(self, iterable):
"""Use a ProgressBar to iterate through an iterable."""
try:
self.maxval = len(iterable)
except:
if self.maxval is None:
self.maxval = UnknownLength
self.__iterable = iter(iterable)
return self
def __iter__(self):
return self
def __next__(self):
try:
value = next(self.__iterable)
if self.start_time is None:
self.start()
else:
self.update(self.currval + 1)
return value
except StopIteration:
if self.start_time is None:
self.start()
self.finish()
raise
# Create an alias so that Python 2.x won't complain about not being
# an iterator.
next = __next__
def _env_size(self):
"""Tries to find the term_width from the environment."""
return int(os.environ.get('COLUMNS', self._DEFAULT_TERMSIZE)) - 1
def _handle_resize(self, signum=None, frame=None):
"""Tries to catch resize signals sent from the terminal."""
h, w = array('h', ioctl(self.fd, termios.TIOCGWINSZ, '\0' * 8))[:2]
self.term_width = w
def percentage(self):
"""Returns the progress as a percentage."""
if self.currval >= self.maxval:
return 100.0
return (self.currval * 100.0 / self.maxval) if self.maxval else 100.00
percent = property(percentage)
def _format_widgets(self):
result = []
expanding = []
width = self.term_width
for index, widget in enumerate(self.widgets):
if isinstance(widget, widgets.WidgetHFill):
result.append(widget)
expanding.insert(0, index)
else:
widget = widgets.format_updatable(widget, self)
result.append(widget)
width -= len(widget)
count = len(expanding)
while count:
portion = max(int(math.ceil(width * 1. / count)), 0)
index = expanding.pop()
count -= 1
widget = result[index].update(self, portion)
width -= len(widget)
result[index] = widget
return result
def _format_line(self):
"""Joins the widgets and justifies the line."""
widgets = ''.join(self._format_widgets())
if self.left_justify: return widgets.ljust(self.term_width)
else: return widgets.rjust(self.term_width)
def _need_update(self):
"""Returns whether the ProgressBar should redraw the line."""
if self.currval >= self.next_update or self.finished: return True
delta = time.time() - self.last_update_time
return self._time_sensitive and delta > self.poll
def _update_widgets(self):
"""Checks all widgets for the time sensitive bit."""
self._time_sensitive = any(getattr(w, 'TIME_SENSITIVE', False)
for w in self.widgets)
def update(self, value=None):
"""Updates the ProgressBar to a new value."""
if value is not None and value is not UnknownLength:
if (self.maxval is not UnknownLength
and not 0 <= value <= self.maxval):
raise ValueError('Value out of range')
self.currval = value
if not self._need_update(): return
if self.start_time is None:
raise RuntimeError('You must call "start" before calling "update"')
now = time.time()
self.seconds_elapsed = now - self.start_time
self.next_update = self.currval + self.update_interval
output = self._format_line()
self.fd.write(output + '\r')
self.fd.flush()
self.last_update_time = now
return output
def start(self, update=True):
"""Starts measuring time, and prints the bar at 0%.
It returns self so you can use it like this:
>>> pbar = ProgressBar().start()
>>> for i in range(100):
... # do something
... pbar.update(i+1)
...
>>> pbar.finish()
"""
if self.maxval is None:
self.maxval = self._DEFAULT_MAXVAL
self.num_intervals = max(100, self.term_width)
self.next_update = 0
if self.maxval is not UnknownLength:
if self.maxval < 0: raise ValueError('Value out of range')
self.update_interval = self.maxval / self.num_intervals
self.start_time = time.time()
if update:
self.last_update_time = self.start_time
self.update(0)
else:
self.last_update_time = 0
return self
def finish(self):
"""Puts the ProgressBar bar in the finished state."""
if self.finished:
return
self.finished = True
self.update(self.maxval)
self.fd.write('\n')
if self.signal_set:
signal.signal(signal.SIGWINCH, signal.SIG_DFL)

View File

@@ -0,0 +1,391 @@
# -*- coding: utf-8 -*-
#
# progressbar - Text progress bar library for Python.
# Copyright (c) 2005 Nilton Volpato
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""Default ProgressBar widgets."""
from __future__ import division
import datetime
import math
try:
from abc import ABCMeta, abstractmethod
except ImportError:
AbstractWidget = object
abstractmethod = lambda fn: fn
else:
AbstractWidget = ABCMeta('AbstractWidget', (object,), {})
def format_updatable(updatable, pbar):
if hasattr(updatable, 'update'): return updatable.update(pbar)
else: return updatable
class Widget(AbstractWidget):
"""The base class for all widgets.
The ProgressBar will call the widget's update value when the widget should
be updated. The widget's size may change between calls, but the widget may
display incorrectly if the size changes drastically and repeatedly.
The boolean TIME_SENSITIVE informs the ProgressBar that it should be
updated more often because it is time sensitive.
"""
TIME_SENSITIVE = False
__slots__ = ()
@abstractmethod
def update(self, pbar):
"""Updates the widget.
pbar - a reference to the calling ProgressBar
"""
class WidgetHFill(Widget):
"""The base class for all variable width widgets.
This widget is much like the \\hfill command in TeX, it will expand to
fill the line. You can use more than one in the same line, and they will
all have the same width, and together will fill the line.
"""
@abstractmethod
def update(self, pbar, width):
"""Updates the widget providing the total width the widget must fill.
pbar - a reference to the calling ProgressBar
width - The total width the widget must fill
"""
class Timer(Widget):
"""Widget which displays the elapsed seconds."""
__slots__ = ('format_string',)
TIME_SENSITIVE = True
def __init__(self, format='Elapsed Time: %s'):
self.format_string = format
@staticmethod
def format_time(seconds):
"""Formats time as the string "HH:MM:SS"."""
return str(datetime.timedelta(seconds=int(seconds)))
def update(self, pbar):
"""Updates the widget to show the elapsed time."""
return self.format_string % self.format_time(pbar.seconds_elapsed)
class ETA(Timer):
"""Widget which attempts to estimate the time of arrival."""
TIME_SENSITIVE = True
def update(self, pbar):
"""Updates the widget to show the ETA or total time when finished."""
if pbar.currval == 0:
return 'ETA: --:--:--'
elif pbar.finished:
return 'Time: %s' % self.format_time(pbar.seconds_elapsed)
else:
elapsed = pbar.seconds_elapsed
eta = elapsed * pbar.maxval / pbar.currval - elapsed
return 'ETA: %s' % self.format_time(eta)
class AdaptiveETA(Timer):
"""Widget which attempts to estimate the time of arrival.
Uses a weighted average of two estimates:
1) ETA based on the total progress and time elapsed so far
2) ETA based on the progress as per the last 10 update reports
The weight depends on the current progress so that to begin with the
total progress is used and at the end only the most recent progress is
used.
"""
TIME_SENSITIVE = True
NUM_SAMPLES = 10
def _update_samples(self, currval, elapsed):
sample = (currval, elapsed)
if not hasattr(self, 'samples'):
self.samples = [sample] * (self.NUM_SAMPLES + 1)
else:
self.samples.append(sample)
return self.samples.pop(0)
def _eta(self, maxval, currval, elapsed):
return elapsed * maxval / float(currval) - elapsed
def update(self, pbar):
"""Updates the widget to show the ETA or total time when finished."""
if pbar.currval == 0:
return 'ETA: --:--:--'
elif pbar.finished:
return 'Time: %s' % self.format_time(pbar.seconds_elapsed)
else:
elapsed = pbar.seconds_elapsed
currval1, elapsed1 = self._update_samples(pbar.currval, elapsed)
eta = self._eta(pbar.maxval, pbar.currval, elapsed)
if pbar.currval > currval1:
etasamp = self._eta(pbar.maxval - currval1,
pbar.currval - currval1,
elapsed - elapsed1)
weight = (pbar.currval / float(pbar.maxval)) ** 0.5
eta = (1 - weight) * eta + weight * etasamp
return 'ETA: %s' % self.format_time(eta)
class FileTransferSpeed(Widget):
"""Widget for showing the transfer speed (useful for file transfers)."""
FORMAT = '%6.2f %s%s/s'
PREFIXES = ' kMGTPEZY'
__slots__ = ('unit',)
def __init__(self, unit='B'):
self.unit = unit
def update(self, pbar):
"""Updates the widget with the current SI prefixed speed."""
if pbar.seconds_elapsed < 2e-6 or pbar.currval < 2e-6: # =~ 0
scaled = power = 0
else:
speed = pbar.currval / pbar.seconds_elapsed
power = int(math.log(speed, 1000))
scaled = speed / 1000.**power
return self.FORMAT % (scaled, self.PREFIXES[power], self.unit)
class AnimatedMarker(Widget):
"""An animated marker for the progress bar which defaults to appear as if
it were rotating.
"""
__slots__ = ('markers', 'curmark')
def __init__(self, markers='|/-\\'):
self.markers = markers
self.curmark = -1
def update(self, pbar):
"""Updates the widget to show the next marker or the first marker when
finished"""
if pbar.finished: return self.markers[0]
self.curmark = (self.curmark + 1) % len(self.markers)
return self.markers[self.curmark]
# Alias for backwards compatibility
RotatingMarker = AnimatedMarker
class Counter(Widget):
"""Displays the current count."""
__slots__ = ('format_string',)
def __init__(self, format='%d'):
self.format_string = format
def update(self, pbar):
return self.format_string % pbar.currval
class Percentage(Widget):
"""Displays the current percentage as a number with a percent sign."""
def update(self, pbar):
return '%3d%%' % pbar.percentage()
class FormatLabel(Timer):
"""Displays a formatted label."""
mapping = {
'elapsed': ('seconds_elapsed', Timer.format_time),
'finished': ('finished', None),
'last_update': ('last_update_time', None),
'max': ('maxval', None),
'seconds': ('seconds_elapsed', None),
'start': ('start_time', None),
'value': ('currval', None)
}
__slots__ = ('format_string',)
def __init__(self, format):
self.format_string = format
def update(self, pbar):
context = {}
for name, (key, transform) in self.mapping.items():
try:
value = getattr(pbar, key)
if transform is None:
context[name] = value
else:
context[name] = transform(value)
except: pass
return self.format_string % context
class SimpleProgress(Widget):
"""Returns progress as a count of the total (e.g.: "5 of 47")."""
__slots__ = ('sep',)
def __init__(self, sep=' of '):
self.sep = sep
def update(self, pbar):
return '%d%s%d' % (pbar.currval, self.sep, pbar.maxval)
class Bar(WidgetHFill):
"""A progress bar which stretches to fill the line."""
__slots__ = ('marker', 'left', 'right', 'fill', 'fill_left')
def __init__(self, marker='#', left='|', right='|', fill=' ',
fill_left=True):
"""Creates a customizable progress bar.
marker - string or updatable object to use as a marker
left - string or updatable object to use as a left border
right - string or updatable object to use as a right border
fill - character to use for the empty part of the progress bar
fill_left - whether to fill from the left or the right
"""
self.marker = marker
self.left = left
self.right = right
self.fill = fill
self.fill_left = fill_left
def update(self, pbar, width):
"""Updates the progress bar and its subcomponents."""
left, marked, right = (format_updatable(i, pbar) for i in
(self.left, self.marker, self.right))
width -= len(left) + len(right)
# Marked must *always* have length of 1
if pbar.maxval:
marked *= int(pbar.currval / pbar.maxval * width)
else:
marked = ''
if self.fill_left:
return '%s%s%s' % (left, marked.ljust(width, self.fill), right)
else:
return '%s%s%s' % (left, marked.rjust(width, self.fill), right)
class ReverseBar(Bar):
"""A bar which has a marker which bounces from side to side."""
def __init__(self, marker='#', left='|', right='|', fill=' ',
fill_left=False):
"""Creates a customizable progress bar.
marker - string or updatable object to use as a marker
left - string or updatable object to use as a left border
right - string or updatable object to use as a right border
fill - character to use for the empty part of the progress bar
fill_left - whether to fill from the left or the right
"""
self.marker = marker
self.left = left
self.right = right
self.fill = fill
self.fill_left = fill_left
class BouncingBar(Bar):
def update(self, pbar, width):
"""Updates the progress bar and its subcomponents."""
left, marker, right = (format_updatable(i, pbar) for i in
(self.left, self.marker, self.right))
width -= len(left) + len(right)
if pbar.finished: return '%s%s%s' % (left, width * marker, right)
position = int(pbar.currval % (width * 2 - 1))
if position > width: position = width * 2 - position
lpad = self.fill * (position - 1)
rpad = self.fill * (width - len(marker) - len(lpad))
# Swap if we want to bounce the other way
if not self.fill_left: rpad, lpad = lpad, rpad
return '%s%s%s%s%s' % (left, lpad, marker, rpad, right)
class BouncingSlider(Bar):
"""
A slider that bounces back and forth in response to update() calls
without reference to the actual value. Based on a combination of
BouncingBar from a newer version of this module and RotatingMarker.
"""
def __init__(self, marker='<=>'):
self.curmark = -1
self.forward = True
Bar.__init__(self, marker=marker)
def update(self, pbar, width):
left, marker, right = (format_updatable(i, pbar) for i in
(self.left, self.marker, self.right))
width -= len(left) + len(right)
if width < 0:
return ''
if pbar.finished: return '%s%s%s' % (left, width * '=', right)
self.curmark = self.curmark + 1
position = int(self.curmark % (width * 2 - 1))
if position + len(marker) > width:
self.forward = not self.forward
self.curmark = 1
position = 1
lpad = ' ' * (position - 1)
rpad = ' ' * (width - len(marker) - len(lpad))
if not self.forward:
temp = lpad
lpad = rpad
rpad = temp
return '%s%s%s%s%s' % (left, lpad, marker, rpad, right)

View File

@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orm', '0007_auto_20160523_1446'),
]
operations = [
migrations.CreateModel(
name='TargetKernelFile',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
('file_name', models.FilePathField()),
('file_size', models.IntegerField()),
('target', models.ForeignKey(to='orm.Target')),
],
),
migrations.CreateModel(
name='TargetSDKFile',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
('file_name', models.FilePathField()),
('file_size', models.IntegerField()),
('target', models.ForeignKey(to='orm.Target')),
],
),
migrations.RemoveField(
model_name='buildartifact',
name='build',
),
migrations.DeleteModel(
name='BuildArtifact',
),
]

View File

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orm', '0008_refactor_artifact_models'),
]
operations = [
migrations.AddField(
model_name='target',
name='package_manifest_path',
field=models.CharField(null=True, max_length=500),
),
]

View File

@@ -22,7 +22,7 @@
from __future__ import unicode_literals
from django.db import models, IntegrityError
from django.db.models import F, Q, Avg, Max, Sum
from django.db.models import F, Q, Avg, Max, Sum, Count
from django.utils import timezone
from django.utils.encoding import force_bytes
@@ -436,58 +436,62 @@ class Build(models.Model):
eta += ((eta - self.started_on)*(100-completeper))/completeper
return eta
def has_images(self):
"""
Returns True if at least one of the targets for this build has an
image file associated with it, False otherwise
"""
targets = Target.objects.filter(build_id=self.id)
has_images = False
for target in targets:
if target.has_images():
has_images = True
break
return has_images
def has_image_recipes(self):
"""
Returns True if a build has any targets which were built from
image recipes.
"""
image_recipes = self.get_image_recipes()
return len(image_recipes) > 0
def get_image_file_extensions(self):
"""
Get list of file name extensions for images produced by this build
Get string of file name extensions for images produced by this build;
note that this is the actual list of extensions stored on Target objects
for this build, and not the value of IMAGE_FSTYPES.
Returns comma-separated string, e.g. "vmdk, ext4"
"""
targets = Target.objects.filter(build_id = self.id)
extensions = []
# pattern to match against file path for building extension string
pattern = re.compile('\.([^\.]+?)$')
targets = Target.objects.filter(build_id = self.id)
for target in targets:
if (not target.is_image):
if not target.is_image:
continue
target_image_files = Target_Image_File.objects.filter(target_id = target.id)
target_image_files = Target_Image_File.objects.filter(
target_id=target.id)
for target_image_file in target_image_files:
file_name = os.path.basename(target_image_file.file_name)
suffix = ''
extensions.append(target_image_file.suffix)
continue_matching = True
# incrementally extract the suffix from the file path,
# checking it against the list of valid suffixes at each
# step; if the path is stripped of all potential suffix
# parts without matching a valid suffix, this returns all
# characters after the first '.' in the file name
while continue_matching:
matches = pattern.search(file_name)
if None == matches:
continue_matching = False
suffix = re.sub('^\.', '', suffix)
continue
else:
suffix = matches.group(1) + suffix
if suffix in Target_Image_File.SUFFIXES:
continue_matching = False
continue
else:
# reduce the file name and try to find the next
# segment from the path which might be part
# of the suffix
file_name = re.sub('.' + matches.group(1), '', file_name)
suffix = '.' + suffix
if not suffix in extensions:
extensions.append(suffix)
extensions = list(set(extensions))
extensions.sort()
return ', '.join(extensions)
def get_image_fstypes(self):
"""
Get the IMAGE_FSTYPES variable value for this build as a de-duplicated
list of image file suffixes.
"""
image_fstypes = Variable.objects.get(
build=self, variable_name='IMAGE_FSTYPES').variable_value
return list(set(re.split(r' {1,}', image_fstypes)))
def get_sorted_target_list(self):
tgts = Target.objects.filter(build_id = self.id).order_by( 'target' );
return( tgts );
@@ -600,28 +604,6 @@ class Build(models.Model):
def __str__(self):
return "%d %s %s" % (self.id, self.project, ",".join([t.target for t in self.target_set.all()]))
# an Artifact is anything that results from a Build, and may be of interest to the user, and is not stored elsewhere
class BuildArtifact(models.Model):
build = models.ForeignKey(Build)
file_name = models.FilePathField()
file_size = models.IntegerField()
def get_local_file_name(self):
try:
deploydir = Variable.objects.get(build = self.build, variable_name="DEPLOY_DIR").variable_value
return self.file_name[len(deploydir)+1:]
except:
raise
return self.file_name
def get_basename(self):
return os.path.basename(self.file_name)
def is_available(self):
return self.build.buildrequest.environment.has_artifact(self.file_name)
class ProjectTarget(models.Model):
project = models.ForeignKey(Project)
target = models.CharField(max_length=100)
@@ -635,6 +617,7 @@ class Target(models.Model):
is_image = models.BooleanField(default = False)
image_size = models.IntegerField(default=0)
license_manifest_path = models.CharField(max_length=500, null=True)
package_manifest_path = models.CharField(max_length=500, null=True)
def package_count(self):
return Target_Installed_Package.objects.filter(target_id__exact=self.id).count()
@@ -642,6 +625,171 @@ class Target(models.Model):
def __unicode__(self):
return self.target
def get_similar_targets(self):
"""
Get target sfor the same machine, task and target name
(e.g. 'core-image-minimal') from a successful build for this project
(but excluding this target).
Note that we only look for targets built by this project because
projects can have different configurations from each other, and put
their artifacts in different directories.
The possibility of error when retrieving candidate targets
is minimised by the fact that bitbake will rebuild artifacts if MACHINE
(or various other variables) change. In this case, there is no need to
clone artifacts from another target, as those artifacts will have
been re-generated for this target anyway.
"""
query = ~Q(pk=self.pk) & \
Q(target=self.target) & \
Q(build__machine=self.build.machine) & \
Q(build__outcome=Build.SUCCEEDED) & \
Q(build__project=self.build.project)
return Target.objects.filter(query)
def get_similar_target_with_image_files(self):
"""
Get the most recent similar target with Target_Image_Files associated
with it, for the purpose of cloning those files onto this target.
"""
similar_target = None
candidates = self.get_similar_targets()
if candidates.count() == 0:
return similar_target
task_subquery = Q(task=self.task)
# we can look for a 'build' task if this task is a 'populate_sdk_ext'
# task, as the latter also creates images; and vice versa; note that
# 'build' targets can have their task set to '';
# also note that 'populate_sdk' does not produce image files
image_tasks = [
'', # aka 'build'
'build',
'image',
'populate_sdk_ext'
]
if self.task in image_tasks:
task_subquery = Q(task__in=image_tasks)
# annotate with the count of files, to exclude any targets which
# don't have associated files
candidates = candidates.annotate(num_files=Count('target_image_file'))
query = task_subquery & Q(num_files__gt=0)
candidates = candidates.filter(query)
if candidates.count() > 0:
candidates.order_by('build__completed_on')
similar_target = candidates.last()
return similar_target
def get_similar_target_with_sdk_files(self):
"""
Get the most recent similar target with TargetSDKFiles associated
with it, for the purpose of cloning those files onto this target.
"""
similar_target = None
candidates = self.get_similar_targets()
if candidates.count() == 0:
return similar_target
# annotate with the count of files, to exclude any targets which
# don't have associated files
candidates = candidates.annotate(num_files=Count('targetsdkfile'))
query = Q(task=self.task) & Q(num_files__gt=0)
candidates = candidates.filter(query)
if candidates.count() > 0:
candidates.order_by('build__completed_on')
similar_target = candidates.last()
return similar_target
def clone_image_artifacts_from(self, target):
"""
Make clones of the Target_Image_Files and TargetKernelFile objects
associated with Target target, then associate them with this target.
Note that for Target_Image_Files, we only want files from the previous
build whose suffix matches one of the suffixes defined in this
target's build's IMAGE_FSTYPES configuration variable. This prevents the
Target_Image_File object for an ext4 image being associated with a
target for a project which didn't produce an ext4 image (for example).
Also sets the license_manifest_path and package_manifest_path
of this target to the same path as that of target being cloned from, as
the manifests are also build artifacts but are treated differently.
"""
image_fstypes = self.build.get_image_fstypes()
# filter out any image files whose suffixes aren't in the
# IMAGE_FSTYPES suffixes variable for this target's build
image_files = [target_image_file \
for target_image_file in target.target_image_file_set.all() \
if target_image_file.suffix in image_fstypes]
for image_file in image_files:
image_file.pk = None
image_file.target = self
image_file.save()
kernel_files = target.targetkernelfile_set.all()
for kernel_file in kernel_files:
kernel_file.pk = None
kernel_file.target = self
kernel_file.save()
self.license_manifest_path = target.license_manifest_path
self.package_manifest_path = target.package_manifest_path
self.save()
def clone_sdk_artifacts_from(self, target):
"""
Clone TargetSDKFile objects from target and associate them with this
target.
"""
sdk_files = target.targetsdkfile_set.all()
for sdk_file in sdk_files:
sdk_file.pk = None
sdk_file.target = self
sdk_file.save()
def has_images(self):
"""
Returns True if this target has one or more image files attached to it.
"""
return self.target_image_file_set.all().count() > 0
# kernel artifacts for a target: bzImage and modules*
class TargetKernelFile(models.Model):
target = models.ForeignKey(Target)
file_name = models.FilePathField()
file_size = models.IntegerField()
@property
def basename(self):
return os.path.basename(self.file_name)
# SDK artifacts for a target: sh and manifest files
class TargetSDKFile(models.Model):
target = models.ForeignKey(Target)
file_name = models.FilePathField()
file_size = models.IntegerField()
@property
def basename(self):
return os.path.basename(self.file_name)
class Target_Image_File(models.Model):
# valid suffixes for image files produced by a build
SUFFIXES = {
@@ -658,6 +806,13 @@ class Target_Image_File(models.Model):
@property
def suffix(self):
"""
Suffix for image file, minus leading "."
"""
for suffix in Target_Image_File.SUFFIXES:
if self.file_name.endswith(suffix):
return suffix
filename, suffix = os.path.splitext(self.file_name)
suffix = suffix.lstrip('.')
return suffix

View File

@@ -27,179 +27,8 @@
Helper methods for creating Toaster Selenium tests which run within
the context of Django unit tests.
"""
import os
import time
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import NoSuchElementException, \
StaleElementReferenceException, TimeoutException
from tests.browser.selenium_helpers_base import SeleniumTestCaseBase
def create_selenium_driver(browser='chrome'):
# set default browser string based on env (if available)
env_browser = os.environ.get('TOASTER_TESTS_BROWSER')
if env_browser:
browser = env_browser
if browser == 'chrome':
return webdriver.Chrome(
service_args=["--verbose", "--log-path=selenium.log"]
)
elif browser == 'firefox':
return webdriver.Firefox()
elif browser == 'ie':
return webdriver.Ie()
elif browser == 'phantomjs':
return webdriver.PhantomJS()
else:
msg = 'Selenium driver for browser %s is not available' % browser
raise RuntimeError(msg)
class Wait(WebDriverWait):
"""
Subclass of WebDriverWait with predetermined timeout and poll
frequency. Also deals with a wider variety of exceptions.
"""
_TIMEOUT = 10
_POLL_FREQUENCY = 0.5
def __init__(self, driver):
super(Wait, self).__init__(driver, self._TIMEOUT, self._POLL_FREQUENCY)
def until(self, method, message=''):
"""
Calls the method provided with the driver as an argument until the
return value is not False.
"""
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except NoSuchElementException:
pass
except StaleElementReferenceException:
pass
time.sleep(self._poll)
if time.time() > end_time:
break
raise TimeoutException(message)
def until_not(self, method, message=''):
"""
Calls the method provided with the driver as an argument until the
return value is False.
"""
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if not value:
return value
except NoSuchElementException:
return True
except StaleElementReferenceException:
pass
time.sleep(self._poll)
if time.time() > end_time:
break
raise TimeoutException(message)
class SeleniumTestCase(StaticLiveServerTestCase):
"""
NB StaticLiveServerTestCase is used as the base test case so that
static files are served correctly in a Selenium test run context; see
https://docs.djangoproject.com/en/1.9/ref/contrib/staticfiles/#specialized-test-case-to-support-live-testing
"""
@classmethod
def setUpClass(cls):
""" Create a webdriver driver at the class level """
super(SeleniumTestCase, cls).setUpClass()
# instantiate the Selenium webdriver once for all the test methods
# in this test case
cls.driver = create_selenium_driver()
cls.driver.maximize_window()
@classmethod
def tearDownClass(cls):
""" Clean up webdriver driver """
cls.driver.quit()
super(SeleniumTestCase, cls).tearDownClass()
def get(self, url):
"""
Selenium requires absolute URLs, so convert Django URLs returned
by resolve() or similar to absolute ones and get using the
webdriver instance.
url: a relative URL
"""
abs_url = '%s%s' % (self.live_server_url, url)
self.driver.get(abs_url)
def find(self, selector):
""" Find single element by CSS selector """
return self.driver.find_element_by_css_selector(selector)
def find_all(self, selector):
""" Find all elements matching CSS selector """
return self.driver.find_elements_by_css_selector(selector)
def focused_element(self):
""" Return the element which currently has focus on the page """
return self.driver.switch_to.active_element
def wait_until_present(self, selector):
""" Wait until element matching CSS selector is on the page """
is_present = lambda driver: self.find(selector)
msg = 'An element matching "%s" should be on the page' % selector
element = Wait(self.driver).until(is_present, msg)
return element
def wait_until_visible(self, selector):
""" Wait until element matching CSS selector is visible on the page """
is_visible = lambda driver: self.find(selector).is_displayed()
msg = 'An element matching "%s" should be visible' % selector
Wait(self.driver).until(is_visible, msg)
return self.find(selector)
def wait_until_focused(self, selector):
""" Wait until element matching CSS selector has focus """
is_focused = \
lambda driver: self.find(selector) == self.focused_element()
msg = 'An element matching "%s" should be focused' % selector
Wait(self.driver).until(is_focused, msg)
return self.find(selector)
def enter_text(self, selector, value):
""" Insert text into element matching selector """
# note that keyup events don't occur until the element is clicked
# (in the case of <input type="text"...>, for example), so simulate
# user clicking the element before inserting text into it
field = self.click(selector)
field.send_keys(value)
return field
def click(self, selector):
""" Click on element which matches CSS selector """
element = self.wait_until_visible(selector)
element.click()
return element
def get_page_source(self):
""" Get raw HTML for the current page """
return self.driver.page_source
class SeleniumTestCase(SeleniumTestCaseBase, StaticLiveServerTestCase):
pass

View File

@@ -48,6 +48,10 @@ class TestBuildDashboardPage(SeleniumTestCase):
started_on=now,
completed_on=now)
self.build3 = Build.objects.create(project=project,
started_on=now,
completed_on=now)
# exception
msg1 = 'an exception was thrown'
self.exception_message = LogMessage.objects.create(
@@ -71,6 +75,11 @@ class TestBuildDashboardPage(SeleniumTestCase):
layer=layer, build=self.build1
)
# non-image recipes related to a build, for testing the new custom
# image button
layer_version2 = Layer_Version.objects.create(layer=layer,
build=self.build3)
# image recipes
self.image_recipe1 = Recipe.objects.create(
name='recipeA',
@@ -248,3 +257,14 @@ class TestBuildDashboardPage(SeleniumTestCase):
]
self._check_labels_in_modal(modal, expected_recipes)
def test_new_custom_image_button_no_image(self):
"""
Check that a build which builds non-image recipes doesn't show
the new custom image button on the dashboard.
"""
self._get_build_dashboard(self.build3)
selector = '[data-role="new-custom-image-trigger"]'
self.assertFalse(self.element_exists(selector),
'new custom image button should not show for builds which ' \
'don\'t have any image recipes')

View File

@@ -0,0 +1,217 @@
#! /usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013-2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.core.urlresolvers import reverse
from django.utils import timezone
from tests.browser.selenium_helpers import SeleniumTestCase
from orm.models import Project, Release, BitbakeVersion, Build, Target, Package
from orm.models import Target_Image_File, TargetSDKFile, TargetKernelFile
from orm.models import Target_Installed_Package
class TestBuildDashboardPageArtifacts(SeleniumTestCase):
""" Tests for artifacts on the build dashboard /build/X """
def setUp(self):
bbv = BitbakeVersion.objects.create(name='bbv1', giturl='/tmp/',
branch='master', dirpath="")
release = Release.objects.create(name='release1',
bitbake_version=bbv)
self.project = Project.objects.create_project(name='test project',
release=release)
def _get_build_dashboard(self, build):
"""
Navigate to the build dashboard for build
"""
url = reverse('builddashboard', args=(build.id,))
self.get(url)
def _has_build_artifacts_heading(self):
"""
Check whether the "Build artifacts" heading is visible (True if it
is, False otherwise).
"""
return self.element_exists('[data-heading="build-artifacts"]')
def _has_images_menu_option(self):
"""
Try to get the "Images" list element from the left-hand menu in the
build dashboard, and return True if it is present, False otherwise.
"""
return self.element_exists('li.nav-header[data-menu-heading="images"]')
def test_no_artifacts(self):
"""
If a build produced no artifacts, the artifacts heading and images
menu option shouldn't show.
"""
now = timezone.now()
build = Build.objects.create(project=self.project,
started_on=now, completed_on=now, outcome=Build.SUCCEEDED)
Target.objects.create(is_image=False, build=build, task='',
target='mpfr-native')
self._get_build_dashboard(build)
# check build artifacts heading
msg = 'Build artifacts heading should not be displayed for non-image' \
'builds'
self.assertFalse(self._has_build_artifacts_heading(), msg)
# check "Images" option in left-hand menu (should not be there)
msg = 'Images option should not be shown in left-hand menu'
self.assertFalse(self._has_images_menu_option(), msg)
def test_sdk_artifacts(self):
"""
If a build produced SDK artifacts, they should be shown, but the section
for image files and the images menu option should be hidden.
The packages count and size should also be hidden.
"""
now = timezone.now()
build = Build.objects.create(project=self.project,
started_on=now, completed_on=timezone.now(),
outcome=Build.SUCCEEDED)
target = Target.objects.create(is_image=True, build=build,
task='populate_sdk', target='core-image-minimal')
sdk_file1 = TargetSDKFile.objects.create(target=target,
file_size=100000,
file_name='/home/foo/core-image-minimal.toolchain.sh')
sdk_file2 = TargetSDKFile.objects.create(target=target,
file_size=120000,
file_name='/home/foo/x86_64.toolchain.sh')
self._get_build_dashboard(build)
# check build artifacts heading
msg = 'Build artifacts heading should be displayed for SDK ' \
'builds which generate artifacts'
self.assertTrue(self._has_build_artifacts_heading(), msg)
# check "Images" option in left-hand menu (should not be there)
msg = 'Images option should not be shown in left-hand menu for ' \
'builds which didn\'t generate an image file'
self.assertFalse(self._has_images_menu_option(), msg)
# check links to SDK artifacts
sdk_artifact_links = self.find_all('[data-links="sdk-artifacts"] li')
self.assertEqual(len(sdk_artifact_links), 2,
'should be links to 2 SDK artifacts')
# package count and size should not be visible, no link on
# target name
selector = '[data-value="target-package-count"]'
self.assertFalse(self.element_exists(selector),
'package count should not be shown for non-image builds')
selector = '[data-value="target-package-size"]'
self.assertFalse(self.element_exists(selector),
'package size should not be shown for non-image builds')
selector = '[data-link="target-packages"]'
self.assertFalse(self.element_exists(selector),
'link to target packages should not be on target heading')
def test_image_artifacts(self):
"""
If a build produced image files, kernel artifacts, and manifests,
they should all be shown, as well as the image link in the left-hand
menu.
The packages count and size should be shown, with a link to the
package display page.
"""
now = timezone.now()
build = Build.objects.create(project=self.project,
started_on=now, completed_on=timezone.now(),
outcome=Build.SUCCEEDED)
target = Target.objects.create(is_image=True, build=build,
task='', target='core-image-minimal',
license_manifest_path='/home/foo/license.manifest',
package_manifest_path='/home/foo/package.manifest')
image_file = Target_Image_File.objects.create(target=target,
file_name='/home/foo/core-image-minimal.ext4', file_size=9000)
kernel_file1 = TargetKernelFile.objects.create(target=target,
file_name='/home/foo/bzImage', file_size=2000)
kernel_file2 = TargetKernelFile.objects.create(target=target,
file_name='/home/foo/bzImage', file_size=2000)
package = Package.objects.create(build=build, name='foo', size=1024,
installed_name='foo1')
installed_package = Target_Installed_Package.objects.create(
target=target, package=package)
self._get_build_dashboard(build)
# check build artifacts heading
msg = 'Build artifacts heading should be displayed for image ' \
'builds'
self.assertTrue(self._has_build_artifacts_heading(), msg)
# check "Images" option in left-hand menu (should be there)
msg = 'Images option should be shown in left-hand menu for image builds'
self.assertTrue(self._has_images_menu_option(), msg)
# check link to image file
selector = '[data-links="image-artifacts"] li'
self.assertTrue(self.element_exists(selector),
'should be a link to the image file (selector %s)' % selector)
# check links to kernel artifacts
kernel_artifact_links = \
self.find_all('[data-links="kernel-artifacts"] li')
self.assertEqual(len(kernel_artifact_links), 2,
'should be links to 2 kernel artifacts')
# check manifest links
selector = 'a[data-link="license-manifest"]'
self.assertTrue(self.element_exists(selector),
'should be a link to the license manifest (selector %s)' % selector)
selector = 'a[data-link="package-manifest"]'
self.assertTrue(self.element_exists(selector),
'should be a link to the package manifest (selector %s)' % selector)
# check package count and size, link on target name
selector = '[data-value="target-package-count"]'
element = self.find(selector)
self.assertEquals(element.text, '1',
'package count should be shown for image builds')
selector = '[data-value="target-package-size"]'
element = self.find(selector)
self.assertEquals(element.text, '1.0 KB',
'package size should be shown for image builds')
selector = '[data-link="target-packages"]'
self.assertTrue(self.element_exists(selector),
'link to target packages should be on target heading')

View File

@@ -0,0 +1,190 @@
#! /usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013-2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.core.urlresolvers import reverse
from tests.browser.selenium_helpers import SeleniumTestCase
from orm.models import Layer, Layer_Version, Project, LayerSource, Release
from orm.models import BitbakeVersion
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
class TestLayerDetailsPage(SeleniumTestCase):
""" Test layerdetails page works correctly """
def __init__(self, *args, **kwargs):
super(TestLayerDetailsPage, self).__init__(*args, **kwargs)
self.initial_values = None
self.url = None
self.imported_layer_version = None
def setUp(self):
release = Release.objects.create(
name='baz',
bitbake_version=BitbakeVersion.objects.create(name='v1')
)
# project to add new custom images to
self.project = Project.objects.create(name='foo', release=release)
layer_source = LayerSource.objects.create(
sourcetype=LayerSource.TYPE_IMPORTED)
name = "meta-imported"
vcs_url = "git://example.com/meta-imported"
subdir = "/layer"
gitrev = "d33d"
summary = "A imported layer"
description = "This was imported"
imported_layer = Layer.objects.create(name=name,
vcs_url=vcs_url,
summary=summary,
description=description)
self.imported_layer_version = Layer_Version.objects.create(
layer=imported_layer,
layer_source=layer_source,
branch=gitrev,
commit=gitrev,
dirpath=subdir,
project=self.project)
self.initial_values = [name, vcs_url, subdir, gitrev, summary,
description]
self.url = reverse('layerdetails',
args=(self.project.pk,
self.imported_layer_version.pk))
def test_edit_layerdetails(self):
""" Edit all the editable fields for the layer refresh the page and
check that the new values exist"""
self.get(self.url)
self.click("#add-remove-layer-btn")
# Open every edit box
for btn in self.find_all("dd .glyphicon-edit"):
btn.click()
self.wait_until_visible("dd input")
# Edit each value
for inputs in self.find_all("dd input[type=text]") + \
self.find_all("dd textarea"):
# ignore the tt inputs (twitter typeahead input)
if "tt-" in inputs.get_attribute("class"):
continue
value = inputs.get_attribute("value")
self.assertTrue(value in self.initial_values,
"Expecting any of \"%s\"but got \"%s\"" %
(self.initial_values, value))
inputs.send_keys("-edited")
for save_btn in self.find_all(".change-btn"):
save_btn.click()
# Refresh the page to see if the new values are returned
self.get(self.url)
new_values = ["%s-edited" % old_val
for old_val in self.initial_values]
for inputs in self.find_all("dd input[type=text]") + \
self.find_all("dd textarea"):
# ignore the tt inputs (twitter typeahead input)
if "tt-" in inputs.get_attribute("class"):
continue
value = inputs.get_attribute("value")
self.assertTrue(value in new_values,
"Expecting any of \"%s\"but got \"%s\"" %
(self.initial_values, value))
def test_delete_layer(self):
""" Delete the layer """
self.get(self.url)
# Wait for the tables to load to avoid a race condition where the
# toaster tables have made an async request. If the layer is deleted
# before the request finishes it will cause an exception and fail this
# test.
wait = WebDriverWait(self.driver, 30)
wait.until(EC.text_to_be_present_in_element(
(By.CLASS_NAME,
"table-count-recipestable"), "0"))
wait.until(EC.text_to_be_present_in_element(
(By.CLASS_NAME,
"table-count-machinestable"), "0"))
self.click('a[data-target="#delete-layer-modal"]')
self.wait_until_visible("#delete-layer-modal")
self.click("#layer-delete-confirmed")
notification = self.wait_until_visible("#change-notification-msg")
expected_text = "You have deleted 1 layer from your project: %s" % \
self.imported_layer_version.layer.name
self.assertTrue(expected_text in notification.text,
"Expected notification text \"%s\" not found instead"
"it was \"%s\"" %
(expected_text, notification.text))
def test_addrm_to_project(self):
self.get(self.url)
# Add the layer
self.click("#add-remove-layer-btn")
notification = self.wait_until_visible("#change-notification-msg")
expected_text = "You have added 1 layer to your project: %s" % \
self.imported_layer_version.layer.name
self.assertTrue(expected_text in notification.text,
"Expected notification text %s not found was "
" \"%s\" instead" %
(expected_text, notification.text))
# Remove the layer
self.click("#add-remove-layer-btn")
notification = self.wait_until_visible("#change-notification-msg")
expected_text = "You have removed 1 layer from your project: %s" % \
self.imported_layer_version.layer.name
self.assertTrue(expected_text in notification.text,
"Expected notification text %s not found was "
" \"%s\" instead" %
(expected_text, notification.text))

View File

@@ -31,6 +31,9 @@ class TestProjectConfigsPage(SeleniumTestCase):
""" Test data at /project/X/builds is displayed correctly """
PROJECT_NAME = 'test project'
INVALID_PATH_START_TEXT = 'The directory path should either start with a /'
INVALID_PATH_CHAR_TEXT = 'The directory path cannot include spaces or ' \
'any of these characters'
def setUp(self):
bbv = BitbakeVersion.objects.create(name='bbv1', giturl='/tmp/',
@@ -116,3 +119,113 @@ class TestProjectConfigsPage(SeleniumTestCase):
checkbox.click()
self.assertTrue(("cpio" not in element.text),
"Image still present in the textbox")
def test_set_download_dir(self):
"""
Validate the allowed and disallowed types in the directory field for
DL_DIR
"""
ProjectVariable.objects.get_or_create(project=self.project1,
name='DL_DIR')
url = reverse('projectconf', args=(self.project1.id,))
self.get(url)
# activate the input to edit download dir
self.click('#change-dl_dir-icon')
self.wait_until_visible('#new-dl_dir')
# downloads dir path doesn't start with / or ${...}
self.enter_text('#new-dl_dir', 'home/foo')
element = self.wait_until_visible('#hintError-initialChar-dl_dir')
msg = 'downloads directory path starts with invalid character but ' \
'treated as valid'
self.assertTrue((self.INVALID_PATH_START_TEXT in element.text), msg)
# downloads dir path has a space
self.driver.find_element_by_id('new-dl_dir').clear()
self.enter_text('#new-dl_dir', '/foo/bar a')
element = self.wait_until_visible('#hintError-dl_dir')
msg = 'downloads directory path characters invalid but treated as valid'
self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg)
# downloads dir path starts with ${...} but has a space
self.driver.find_element_by_id('new-dl_dir').clear()
self.enter_text('#new-dl_dir', '${TOPDIR}/down foo')
element = self.wait_until_visible('#hintError-dl_dir')
msg = 'downloads directory path characters invalid but treated as valid'
self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg)
# downloads dir path starts with /
self.driver.find_element_by_id('new-dl_dir').clear()
self.enter_text('#new-dl_dir', '/bar/foo')
hidden_element = self.driver.find_element_by_id('hintError-dl_dir')
self.assertEqual(hidden_element.is_displayed(), False,
'downloads directory path valid but treated as invalid')
# downloads dir path starts with ${...}
self.driver.find_element_by_id('new-dl_dir').clear()
self.enter_text('#new-dl_dir', '${TOPDIR}/down')
hidden_element = self.driver.find_element_by_id('hintError-dl_dir')
self.assertEqual(hidden_element.is_displayed(), False,
'downloads directory path valid but treated as invalid')
def test_set_sstate_dir(self):
"""
Validate the allowed and disallowed types in the directory field for
SSTATE_DIR
"""
ProjectVariable.objects.get_or_create(project=self.project1,
name='SSTATE_DIR')
url = reverse('projectconf', args=(self.project1.id,))
self.get(url)
self.click('#change-sstate_dir-icon')
self.wait_until_visible('#new-sstate_dir')
# path doesn't start with / or ${...}
self.enter_text('#new-sstate_dir', 'home/foo')
element = self.wait_until_visible('#hintError-initialChar-sstate_dir')
msg = 'sstate directory path starts with invalid character but ' \
'treated as valid'
self.assertTrue((self.INVALID_PATH_START_TEXT in element.text), msg)
# path has a space
self.driver.find_element_by_id('new-sstate_dir').clear()
self.enter_text('#new-sstate_dir', '/foo/bar a')
element = self.wait_until_visible('#hintError-sstate_dir')
msg = 'sstate directory path characters invalid but treated as valid'
self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg)
# path starts with ${...} but has a space
self.driver.find_element_by_id('new-sstate_dir').clear()
self.enter_text('#new-sstate_dir', '${TOPDIR}/down foo')
element = self.wait_until_visible('#hintError-sstate_dir')
msg = 'sstate directory path characters invalid but treated as valid'
self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg)
# path starts with /
self.driver.find_element_by_id('new-sstate_dir').clear()
self.enter_text('#new-sstate_dir', '/bar/foo')
hidden_element = self.driver.find_element_by_id('hintError-sstate_dir')
self.assertEqual(hidden_element.is_displayed(), False,
'sstate directory path valid but treated as invalid')
# paths starts with ${...}
self.driver.find_element_by_id('new-sstate_dir').clear()
self.enter_text('#new-sstate_dir', '${TOPDIR}/down')
hidden_element = self.driver.find_element_by_id('hintError-sstate_dir')
self.assertEqual(hidden_element.is_displayed(), False,
'sstate directory path valid but treated as invalid')

View File

@@ -20,11 +20,17 @@
# Temporary home for the UI's misc API
import re
from orm.models import Project, ProjectTarget, Build
from orm.models import Project, ProjectTarget, Build, Layer_Version
from orm.models import LayerVersionDependency, LayerSource, ProjectLayer
from bldcontrol.models import BuildRequest
from bldcontrol import bbcontroller
from django.http import HttpResponse, JsonResponse
from django.views.generic import View
from django.core.urlresolvers import reverse
def error_response(error):
return JsonResponse({"error": error})
class XhrBuildRequest(View):
@@ -78,20 +84,24 @@ class XhrBuildRequest(View):
br.save()
except BuildRequest.DoesNotExist:
return JsonResponse({'error':'No such build id %s' % i})
return error_response('No such build id %s' % i)
return JsonResponse({'error': 'ok'})
return error_response('ok')
if 'buildDelete' in request.POST:
for i in request.POST['buildDelete'].strip().split(" "):
try:
BuildRequest.objects.select_for_update().get(project = project, pk = i, state__lte = BuildRequest.REQ_DELETED).delete()
BuildRequest.objects.select_for_update().get(
project=project,
pk=i,
state__lte=BuildRequest.REQ_DELETED).delete()
except BuildRequest.DoesNotExist:
pass
return JsonResponse({'error': 'ok' })
return error_response("ok")
if 'targets' in request.POST:
ProjectTarget.objects.filter(project = project).delete()
ProjectTarget.objects.filter(project=project).delete()
s = str(request.POST['targets'])
for t in re.sub(r'[;%|"]', '', s).split(" "):
if ":" in t:
@@ -99,13 +109,104 @@ class XhrBuildRequest(View):
else:
target = t
task = ""
ProjectTarget.objects.create(project = project,
target = target,
task = task)
ProjectTarget.objects.create(project=project,
target=target,
task=task)
project.schedule_build()
return JsonResponse({'error': 'ok' })
return error_response('ok')
response = HttpResponse()
response.status_code = 500
return response
class XhrLayer(View):
""" Get and Update Layer information """
def post(self, request, *args, **kwargs):
"""
Update a layer
Entry point: /xhr_layer/<layerversion_id>
Method: POST
Args:
vcs_url, dirpath, commit, up_branch, summary, description
add_dep = append a layerversion_id as a dependency
rm_dep = remove a layerversion_id as a depedency
Returns:
{"error": "ok"}
or
{"error": <error message>}
"""
try:
# We currently only allow Imported layers to be edited
layer_version = Layer_Version.objects.get(
id=kwargs['layerversion_id'],
project=kwargs['pid'],
layer_source__sourcetype=LayerSource.TYPE_IMPORTED)
except Layer_Version.DoesNotExist:
return error_response("Cannot find imported layer to update")
if "vcs_url" in request.POST:
layer_version.layer.vcs_url = request.POST["vcs_url"]
if "dirpath" in request.POST:
layer_version.dirpath = request.POST["dirpath"]
if "commit" in request.POST:
layer_version.commit = request.POST["commit"]
layer_version.branch = request.POST["commit"]
if "up_branch" in request.POST:
layer_version.up_branch_id = int(request.POST["up_branch"])
if "summary" in request.POST:
layer_version.layer.summary = request.POST["summary"]
if "description" in request.POST:
layer_version.layer.description = request.POST["description"]
if "add_dep" in request.POST:
lvd = LayerVersionDependency(
layer_version=layer_version,
depends_on_id=request.POST["add_dep"])
lvd.save()
if "rm_dep" in request.POST:
rm_dep = LayerVersionDependency.objects.get(
layer_version=layer_version,
depends_on_id=request.POST["rm_dep"])
rm_dep.delete()
try:
layer_version.layer.save()
layer_version.save()
except Exception as e:
return error_response("Could not update layer version entry: %s"
% e)
return JsonResponse({"error": "ok"})
def delete(self, request, *args, **kwargs):
try:
# We currently only allow Imported layers to be deleted
layer_version = Layer_Version.objects.get(
id=kwargs['layerversion_id'],
project=kwargs['pid'],
layer_source__sourcetype=LayerSource.TYPE_IMPORTED)
except Layer_Version.DoesNotExist:
return error_response("Cannot find imported layer to delete")
try:
ProjectLayer.objects.get(project=kwargs['pid'],
layercommit=layer_version).delete()
except ProjectLayer.DoesNotExist:
pass
layer_version.layer.delete()
layer_version.delete()
return JsonResponse({
"error": "ok",
"redirect": reverse('project', args=(kwargs['pid'],))
})

View File

@@ -55,8 +55,8 @@ function layerBtnsInit() {
});
});
$(".build-recipe-btn").unbind('click');
$(".build-recipe-btn").click(function(e){
$("td .build-recipe-btn").unbind('click');
$("td .build-recipe-btn").click(function(e){
e.preventDefault();
var recipe = $(this).data('recipe-name');

View File

@@ -397,6 +397,26 @@ function layerDetailsPageInit (ctx) {
$(this).parents("form").submit();
});
$("#layer-delete-confirmed").click(function(){
$.cookie("layer-deleted", ctx.layerVersion.name, { path: '/'});
$.ajax({
type: "DELETE",
url: ctx.xhrUpdateLayerUrl,
headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
success: function(data) {
if (data.error != "ok") {
console.warn(data.error);
} else {
window.location = data.redirect + "?notify=layer-deleted";
}
},
error: function(data) {
console.warn("Call failed");
console.warn(data);
}
});
});
layerDepsList.find(".glyphicon-trash").click(layerDepRemoveClick);
layerDepsList.find("a").tooltip();

View File

@@ -58,12 +58,30 @@ function projectPageInit(ctx) {
case 'layer-imported':
layerImportedNotification();
break;
case 'layer-deleted':
layerDeletedNotification();
default:
break;
}
}
})();
/* Layer deleted notification */
function layerDeletedNotification(){
var layer = $.cookie("layer-deleted");
if (!layer)
return;
var message = "You have deleted <strong>1</strong> layer from your ";
message += "project: <strong>" + layer + "</strong>";
libtoaster.showChangeNotification(message);
$.removeCookie("layer-deleted", { path: "/"});
}
/* Layer imported notification */
function layerImportedNotification(){
var imported = $.cookie("layer-imported-alert");

View File

@@ -33,7 +33,7 @@
$("#build-menu li a").each(function(){
/* Set the page active state in the Build menu */
var currentUrl = window.location.href.split('?')[0];
var currentUrl = window.location.href.split('?')[0];
if (currentUrl === $(this).prop("href")){
$(this).parent().addClass("active");
} else {
@@ -62,11 +62,13 @@
{% endif %} >
<a href="{% url 'builddashboard' build.pk %}">Build summary</a>
</li>
{% if build.target_set.all.0.is_image and build.outcome == 0 %}
<li class="nav-header">Images</li>
{% if build.has_images and build.outcome == build.SUCCEEDED %}
<li class="nav-header" data-menu-heading="images">Images</li>
{% block nav-target %}
{% for t in build.get_sorted_target_list %}
<li id="menu-{{t.target}}"><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
{% if t.has_images %}
<li id="menu-{{t.target}}"><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
{% endif %}
{% endfor %}
{% endblock %}
{% endif %}
@@ -115,30 +117,32 @@
{% endwith %}
<!-- new custom image from image recipe in this build -->
<button class="btn btn-default btn-block navbar-btn" data-role="new-custom-image-trigger">New custom image</button>
{% include 'newcustomimage_modal.html' %}
<script>
// imageRecipes includes both custom image recipes and built-in
// image recipes, any of which can be used as the basis for a
// new custom image
var imageRecipes = {{ build.get_image_recipes | objects_to_dictionaries:"id,name" | json }};
{% if build.has_image_recipes %}
<button class="btn btn-default btn-block navbar-btn" data-role="new-custom-image-trigger">New custom image</button>
{% include 'newcustomimage_modal.html' %}
<script>
// imageRecipes includes both custom image recipes and built-in
// image recipes, any of which can be used as the basis for a
// new custom image
var imageRecipes = {{ build.get_image_recipes | objects_to_dictionaries:"id,name" | json }};
$(document).ready(function () {
var newCustomImageModal = $('#new-custom-image-modal');
var newCustomImageTrigger = $('[data-role="new-custom-image-trigger"]');
$(document).ready(function () {
var newCustomImageModal = $('#new-custom-image-modal');
var newCustomImageTrigger = $('[data-role="new-custom-image-trigger"]');
// show create new custom image modal to select an image built
// during this build as the basis for the custom recipe
newCustomImageTrigger.click(function () {
if (!imageRecipes.length) {
return;
}
// show create new custom image modal to select an image built
// during this build as the basis for the custom recipe
newCustomImageTrigger.click(function () {
if (!imageRecipes.length) {
return;
}
newCustomImageModalSetRecipes(imageRecipes);
newCustomImageModal.modal('show');
newCustomImageModalSetRecipes(imageRecipes);
newCustomImageModal.modal('show');
});
});
});
</script>
</script>
{% endif %}
</ul>
</div>

View File

@@ -1,8 +1,9 @@
{% extends "basebuildpage.html" %}
{% load humanize %}
{% load projecttags %}
{% load field_values_filter %}
{% block title %} {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %}
{% block title %} {{build.get_sorted_target_list|field_values:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %}
{% block parentbreadcrumb %}
{% if build.get_sorted_target_list.count > 0 %}
{{build.get_sorted_target_list.0.target}}
@@ -15,7 +16,7 @@
<!-- page title -->
<div class="col-md-10">
<div class="page-header build-data">
<h1>{{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}}</h1>
<h1>{{build.get_sorted_target_list|field_values:"target"|join:", "}} {{build.machine}}</h1>
</div>
<!-- build result bar -->
@@ -68,52 +69,58 @@
{%if build.outcome == build.SUCCEEDED%}
<!-- built images -->
{% if hasImages %}
<h2>Images</h2>
{% if hasArtifacts %}
<h2 data-heading="build-artifacts">Build artifacts</h2>
{% for target in targets %}
{% if target.target.is_image %}
<div class="well well-transparent dashboard-section">
<h3><a href="{% url 'target' build.pk target.target.pk %}">{{target.target}}</a></h3>
<dl class="dl-horizontal">
<dt>Packages included</dt>
<dd><a href="{% url 'target' build.pk target.target.pk %}">{{target.npkg}}</a></dd>
<dt>Total package size</dt>
<dd>{{target.pkgsz|filtered_filesizeformat}}</dd>
{% if target.targetHasNoImages %}
</dl>
<div class="row">
<div class="col-md-7">
<div class="alert alert-info">
<p>
<strong>This build did not create any image files</strong>
</p>
<p>
This is probably because valid image and license manifest
files from a previous build already exist in your
<code>build/tmp/deploy</code>
directory. You can
also <a href="{% url 'target' build.pk target.target.pk %}">view the
license manifest information</a> in Toaster.
</p>
</div>
</div>
</div>
<div class="well well-transparent dashboard-section" data-artifacts-for-target="{{target.target.pk}}">
{% if target.npkg > 0 %}
<h3>
<a href="{% url 'target' build.pk target.target.pk %}" data-link="target-packages">
{{target.target.target}}
</a>
</h3>
<dl class="dl-horizontal">
<dt>Packages included</dt>
<dd>
<a href="{% url 'target' build.pk target.target.pk %}">
<span data-value="target-package-count">{{target.npkg}}</span>
</a>
</dd>
<dt>Total package size</dt>
<dd>
<span data-value="target-package-size">{{target.pkgsz|filtered_filesizeformat}}</span>
</dd>
</dl>
{% else %}
<dt>
<span class="glyphicon glyphicon-question-sign get-help" title="The location in disk of the license manifest, a document listing all packages installed in your image and their licenses"></span>
<h3>{{target.target.target}}</h3>
{% endif %}
License manifest
{% if target.targetHasImages %}
<dl class="dl-horizontal">
<dt>
Manifests
</dt>
<dd>
<a href="{% url 'target' build.pk target.target.pk %}">View in Toaster</a> |
<a href="{% url 'build_artifact' build.pk 'licensemanifest' target.target.pk %}">Download</a></dd>
<a data-link="license-manifest" href="{% url 'build_artifact' build.pk 'licensemanifest' target.target.pk %}">License manifest</a>
</dd>
{% if target.target.package_manifest_path %}
<dd>
<a data-link="package-manifest" href="{% url 'build_artifact' build.pk 'packagemanifest' target.target.pk %}">Package manifest</a>
</dd>
{% endif %}
</dl>
<dl class="dl-horizontal">
<dt>
<span class="glyphicon glyphicon-question-sign get-help" title="Image files are stored in <code>build/tmp/deploy/images/</code>"></span>
Image files
</dt>
<dd>
<ul class="list-unstyled">
{% for i in target.imageFiles %}
<ul class="list-unstyled" data-links="image-artifacts">
{% for i in target.imageFiles|dictsort:"suffix" %}
<li>
<a href="{% url 'build_artifact' build.pk 'imagefile' i.id %}">
{{i.suffix}}
@@ -123,12 +130,42 @@
{% endfor %}
</ul>
</dd>
</dl>
<dt>
Kernel artifacts
</dt>
<dd>
<ul class="list-unstyled" data-links="kernel-artifacts">
{% for artifact in target.target_kernel_artifacts|dictsort:"basename" %}
<li>
<a href="{% url 'build_artifact' build.id 'targetkernelartifact' artifact.id %}">{{artifact.basename}}</a>
({{artifact.file_size|filtered_filesizeformat}})
</li>
{% endfor %}
</ul>
</dd>
</dl>
{% endif %}
{% if target.target_sdk_artifacts_count > 0 %}
<dl class="dl-horizontal">
<dt>
SDK artifacts
</dt>
<dd>
<ul class="list-unstyled" data-links="sdk-artifacts">
{% for artifact in target.target_sdk_artifacts|dictsort:"basename" %}
<li>
<a href="{% url 'build_artifact' build.id 'targetsdkartifact' artifact.id %}">{{artifact.basename}}</a>
({{artifact.file_size|filtered_filesizeformat}})
</li>
{% endfor %}
</ul>
</dd>
</dl>
{% endif %}
</div>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{%else%}
<!-- error dump -->
@@ -261,7 +298,7 @@
if (location.href.search('#warnings') > -1) {
$('#warning-info').addClass('in');
}
//show warnings section when requested from the build outcome
$(".show-warnings").click(function() {
$('#warning-info').addClass('in');

View File

@@ -6,6 +6,20 @@
{% block title %} {{layerversion.layer.name}} - {{project.name}} - Toaster {% endblock %}
{% block pagecontent %}
<div id="delete-layer-modal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
Are you sure you want to delete the <strong>{{layerversion.layer.name}}</strong> layer?
</div>
<div class="modal-footer">
<button type="button" id="layer-delete-confirmed" class="btn btn-primary">Delete</button>
<button type="button" class="btn btn-default btn-link" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<ul class="breadcrumb">
@@ -44,7 +58,7 @@
$(document).ready(function(){
var ctx = {
xhrUpdateLayerUrl : "{% url 'xhr_updatelayer' %}",
xhrUpdateLayerUrl : "{% url 'xhr_layer' project.id layerversion.pk %}",
layerVersion : {
name : "{{layerversion.layer.name}}",
id : {{layerversion.id}},
@@ -271,6 +285,10 @@
</dd>
{% endif %}
</dl>
{% if layerversion.layer_source_id and layerversion.layer_source.sourcetype == layerversion.layer_source.TYPE_IMPORTED %}
<i class="icon-trash text-danger"></i>
<a href="#delete-layer-modal" role="button" class="text-danger" data-toggle="modal" data-target="#delete-layer-modal">Delete {{layerversion.layer.name}}</a>
{% endif %}
</div>
</div>
</div>

View File

@@ -3,6 +3,7 @@
{% load project_url_tag %}
{% load humanize %}
<script src="{% static 'js/mrbsection.js' %}"></script>
<script>
$(document).ready(function () {
var ctx = {
@@ -18,165 +19,163 @@
});
</script>
{%if mru %}
{% if mru %}
{%if mrb_type == 'project' %}
<h2>
Latest project builds
{% if mrb_type == 'project' %}
<h2>
Latest project builds
{% if project.is_default %}
<span class="glyphicon glyphicon-question-sign get-help heading-help" title="" data-original-title="Builds in this project cannot be started from Toaster: they are started from the command line"></span>
{% endif %}
</h2>
{% if project.is_default %}
<span class="glyphicon glyphicon-question-sign get-help heading-help" data-original-title="Builds in this project cannot be started from Toaster: they are started from the command line"></span>
{% endif %}
</h2>
{% else %}
<div class="page-header">
<h1>
Latest builds
</h1>
<h1>Latest builds</h1>
</div>
{% endif %}
<div id="latest-builds">
{% for build in mru %}
<div data-latest-build-result="{{ build.id }}" class="alert build-result {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-danger{%else%}alert-info{%endif%}">
{% for build in mru %}
<div data-latest-build-result="{{build.id}}" class="alert build-result {% if build.outcome == build.SUCCEEDED %}alert-success{% elif build.outcome == build.FAILED %}alert-danger{% else %}alert-info{% endif %}">
{% if mrb_type != 'project' %}
<div class="row project-name">
<div class="col-md-12">
<small>
<a class="alert-link text-uppercase" href={% project_url build.project %}>{{build.project.name}}</a>
</small>
<div class="row project-name">
<div class="col-md-12">
<small>
<a class="alert-link text-uppercase" href={% project_url build.project %}>{{build.project.name}}</a>
</small>
</div>
</div>
</div>
{% endif %}
<div class="row">
<div class="col-md-3">
{%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
<a href="{%url 'builddashboard' build.pk%}" class="alert-link">
{% endif %}
{% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
<a href="{% url 'builddashboard' build.pk %}" class="alert-link">
{% endif %}
{% if build.target_set.all.count > 0 %}
<span data-toggle="tooltip"
{% if build.target_set.all.count > 1 %}
{{build.get_sorted_target_list.0.target}}
title="Recipes:
{% for target in build.get_sorted_target_list %}
{% if target.task %}
{{target.target}}:{{target.task}}
{% else %}
{{target.target}}
{% endif %}
{% endfor %}"
{% endif %}
>
{% if build.target_set.all.0.task %}
{{build.get_sorted_target_list.0.target}}:{{build.target_set.all.0.task}}
{% else %}
{{build.get_sorted_target_list.0.target}}
{% endif %}
<span data-toggle="tooltip"
{% if build.target_set.all.count > 1 %}
(+{{build.target_set.all.count|add:"-1"}})
{{build.get_sorted_target_list.0.target}}
title="Recipes:
{% for target in build.get_sorted_target_list %}
{% if target.task %}
{{target.target}}:{{target.task}}
{% else %}
{{target.target}}
{% endif %}
{% endfor %}"
{% endif %}
</span>
{% endif %}
{%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
</a>
{% endif %}
</div>
{% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
<div class="col-md-2">
{% if build.completed_on|format_build_date %}
{{ build.completed_on|date:'d/m/y H:i' }}
>
{% if build.target_set.all.0.task %}
{{build.get_sorted_target_list.0.target}}:{{build.target_set.all.0.task}}
{% else %}
{{ build.completed_on|date:'H:i' }}
{{build.get_sorted_target_list.0.target}}
{% endif %}
</div>
{% endif %}
{%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
{% if build.target_set.all.count > 1 %}
(+{{build.target_set.all.count|add:"-1"}})
{% endif %}
</span>
{% endif %}
{% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
</a>
{% endif %}
</div>
{% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
<div class="col-md-2">
{% if build.errors.count %}
{% if build.completed_on|format_build_date %}
{{build.completed_on|date:'d/m/y H:i'}}
{% else %}
{{ build.completed_on|date:'H:i' }}
{% endif %}
</div>
{% endif %}
{% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
<div class="col-md-2">
{% if build.errors.count %}
<span class="glyphicon glyphicon-minus-sign"></span>
<a href="{%url 'builddashboard' build.pk%}#errors" class="alert-link">{{build.errors.count}} error{{build.errors.count|pluralize}}</a>
{% endif %}
<a href="{%url 'builddashboard' build.pk%}#errors" class="alert-link">
{{build.errors.count}} error{{build.errors.count|pluralize}}
</a>
{% endif %}
</div>
<div class="col-md-2">
{% if build.warnings.count %}
{% if build.warnings.count %}
<span class="glyphicon glyphicon-warning-sign build-warnings"></span>
<a href="{%url 'builddashboard' build.pk%}#warnings" class="alert-link build-warnings">{{build.warnings.count}} warning{{build.warnings.count|pluralize}}</a>
{% endif %}
<a href="{%url 'builddashboard' build.pk%}#warnings" class="alert-link build-warnings">
{{build.warnings.count}} warning{{build.warnings.count|pluralize}}
</a>
{% endif %}
</div>
<div class="col-md-3">
Build time: <a class="alert-link" href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}
</a>
{% if build.project.is_default %}
<span class="pull-right glyphicon glyphicon-question-sign get-help
{% if build.outcome == build.SUCCEEDED %}
get-help-green
{% elif build.outcome == build.FAILED %}
get-help-red
{% else %}
get-help-blue
{% endif %}
" title="Builds in this project cannot be started from Toaster: they are started from the command line">
</span>
<span class="pull-right glyphicon glyphicon-question-sign get-help {% if build.outcome == build.SUCCEEDED %}get-help-green{% elif build.outcome == build.FAILED %}get-help-red{% else %}get-help-blue{% endif %}"
title="Builds in this project cannot be started from Toaster: they are started from the command line">
</span>
{% else %}
<a href="#" class="run-again-btn alert-link
{% if build.outcome == build.SUCCEEDED %}
success
{% elif build.outcome == build.FAILED %}
danger
{% else %}
info
{%endif%}
pull-right"
data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
data-target='{{build.target_set.all|get_tasks|json}}'>
<span class="glyphicon glyphicon-repeat"></span>
Rebuild
</a>
<a href="#" class="run-again-btn alert-link {% if build.outcome == build.SUCCEEDED %}success{% elif build.outcome == build.FAILED %}danger{% else %}info{% endif %} pull-right"
data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
data-target='{{build.target_set.all|get_tasks|json}}'>
<span class="glyphicon glyphicon-repeat"></span>
Rebuild
</a>
{% endif %}
</div>
{%endif%}
{% endif %}
{%if build.outcome == build.IN_PROGRESS %}
<div class="col-md-4" style="display:none" id="cancelling-msg-{{build.buildrequest.pk}}">
Cancelling the build ...
</div>
<div class="col-md-4 col-md-offset-1 progress-info">
<div class="progress" id="build-pc-done-title-{{build.pk}}">
<div id="build-pc-done-bar-{{build.pk}}" style="width: {{build.completeper}}%;" class="progress-bar"></div>
{% if build.outcome == build.IN_PROGRESS %}
<div class="col-md-4" style="display:none" id="cancelling-msg-{{build.buildrequest.pk}}">
Cancelling the build ...
</div>
<div class="col-md-4 col-md-offset-1 progress-info">
<div class="progress" id="build-pc-done-title-{{build.pk}}">
<div id="build-pc-done-bar-{{build.pk}}" style="width: {{build.completeper}}%;" class="progress-bar">
</div>
</div>
</div>
<div class="col-md-4 progress-info">
<span id="build-pc-done-{{build.pk}}">{{build.completeper}}</span>% of tasks complete
{# No build cancel for command line builds project #}
{% if build.project.is_default %}
<span class="glyphicon glyphicon-question-sign get-help get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>
{% else %}
<a href="#" class="cancel-build-btn pull-right alert-link"
data-buildrequest-id={{build.buildrequest.pk}}
data-request-url="{% url 'xhr_buildrequest' build.project.pk %}">
<span class="glyphicon glyphicon-remove-circle"></span>
Cancel
</a>
{% endif %}
</div>
{% endif %} {# end if in progress #}
{% if build.outcome == build.CANCELLED %}
<div class="col-md-6">
Build cancelled
</div>
<div class="col-md-3">
<a href="#" class="info pull-right run-again-btn alert-link"
data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
data-target='{{build.target_set.all|get_tasks|json}}'>
<span class="glyphicon glyphicon-repeat"></span>
Rebuild
</a>
</div>
{% endif %}
</div>
</div>
</div>
<div class="col-md-4 progress-info"><span id="build-pc-done-{{build.pk}}">{{build.completeper}}</span>% of tasks complete
{# No build cancel for command line builds project #}
{% if build.project.is_default %}
<span class="glyphicon glyphicon-question-sign get-help get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>
{% else %}
<a href="#" class="cancel-build-btn pull-right alert-link"
data-buildrequest-id={{build.buildrequest.pk}}
data-request-url="{% url 'xhr_buildrequest' build.project.pk %}" >
<span class="glyphicon glyphicon-remove-circle"></span>
Cancel
</a>
</div>
{% endif %}
{%endif%} {# end if in progress #}
{% if build.outcome == build.CANCELLED %}
<div class="col-md-6">
Build cancelled
</div>
<div class="col-md-3">
<a href="#" class="info pull-right run-again-btn alert-link"
data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
data-target='{{build.target_set.all|get_tasks|json}}'>
<span class="glyphicon glyphicon-repeat"></span>
Rebuild
</a>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endfor %}
</div>
{%endif%}
{% endif %}

View File

@@ -41,7 +41,8 @@
</div>
<button id="apply-change-dl_dir" class="btn btn-default" type="button">Save</button>
<button id="cancel-change-dl_dir" type="button" class="btn btn-link">Cancel</button>
<p class="help-block" id="hintError-dl_dir">A valid directory cannot include spaces or any of these characters: . \ ? % * : | " " < ></p>
<p class="help-block" id="hintError-dl_dir" style="display:none;">The directory path cannot include spaces or any of these characters: . \ ? % * : | " " &lt; &gt;</p>
<p class="help-block" id="hintError-initialChar-dl_dir" style="display:none;">The directory path should either start with a /, e.g. /home/toaster/downloads; or with a variable, e.g. ${TOPDIR}/downloads.</p>
</form>
</dd>
{% endif %}
@@ -88,7 +89,7 @@
<input type="text" class="form-control" id="new-image_install" placeholder="Type one or more package names">
</div>
<button id="apply-change-image_install" class="btn btn-default" type="button">Save</button>
<button id="cancel-change-image_install" type="button" class="btn btn-link">Cancel</button>
<button id="cancel-change-image_install" type="button" class="btn btn-link">Cancel</button>
</form>
</dd>
{% endif %}
@@ -149,7 +150,8 @@
</div>
<button id="apply-change-sstate_dir" class="btn btn-default" type="button">Save</button>
<button id="cancel-change-sstate_dir" type="button" class="btn btn-link">Cancel</button>
<p class="help-block" id="hintError-sstate_dir">A valid directory cannot include spaces or any of these characters: . \ ? % * : | " " < ></p>
<p class="help-block" id="hintError-sstate_dir" style="display:none;">The directory path cannot include spaces or any of these characters: . \ ? % * : | " " &lt; &gt;</p>
<p class="help-block" id="hintError-initialChar-sstate_dir" style="display:none;">The directory path should either start with a /, e.g. /home/toaster/sstate-cache; or with a variable, e.g. ${TOPDIR}/sstate-cache.</p>
</form>
</dd>
{% endif %}
@@ -203,7 +205,6 @@
<code>CVS_PROXY_HOST</code>
<code>CVS_PROXY_PORT</code>
<code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-PARALLEL_MAKE" target="_blank">PARALLEL_MAKE</a></code>
<code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-SSTATE_MIRRORS" target="_blank">SSTATE_MIRRORS</a></code>
<code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-TMPDIR" target="_blank">TMPDIR</a></code></p>
<p>Plus the following standard shell environment variables:</p>
<p><code>http_proxy</code> <code>ftp_proxy</code> <code>https_proxy</code> <code>all_proxy</code></p>
@@ -369,8 +370,8 @@ function setEventHandlersForDynamicElements() {
$("#new-config_var_"+pk).val(current_val);
if ( $("#new-config_var_"+pk).val().length ) {
$("#apply-change-config_var_"+pk).removeAttr("disabled");
}
else {
}
else {
$("#apply-change-config_var_"+pk).attr("disabled");
}
});
@@ -410,7 +411,7 @@ function setEventHandlersForDynamicElements() {
var pk = $(this).attr("x-data");
// fade out the variable+value div, then refresh the variable list
$(this).fadeOut();
$(this).fadeOut();
$(this).tooltip("hide");
$("config_var_entry_"+pk).fadeOut();
$('#config_var_value_'+pk).parent("dd").fadeOut();
@@ -553,7 +554,6 @@ $(document).ready(function() {
// change DL_DIR variable
$('#change-dl_dir-icon').click(function() {
$('#hintError-dl_dir').hide();
$('#change-dl_dir-form').removeClass('has-error');
// preset the edit value
var current_val = $("#dl_dir").text().trim();
@@ -575,6 +575,8 @@ $(document).ready(function() {
});
$('#cancel-change-dl_dir').click(function(){
$("#hintError-dl_dir").hide();
$("#hintError-initialChar-dl_dir").hide();
$("#change-dl_dir-form").slideUp(function() {
$('#dl_dir, #change-dl_dir-icon').show();
});
@@ -583,20 +585,31 @@ $(document).ready(function() {
$("#new-dl_dir").on('input', function(){
if ($(this).val().trim().length == 0) {
$("#apply-change-dl_dir").attr("disabled","disabled");
$('#change-dl_dir-form').addClass('has-error');
$('#hintError-dl_dir').hide();
$('#hintError-initialChar-dl_dir').hide();
}
else {
var input = $(this);
var re = /^\/([^ <>\\|":\.%\?\*]+)$/;
var reBeginWithSlash = /^\//;
var reCheckVariable = /^\$/;
var re = /([ <>\\|":\.%\?\*]+)/;
var invalidDir = re.test(input.val());
console.log(invalidDir);
if ( invalidDir ) {
$('#change-dl_dir-form').removeClass('has-error');
$("#apply-change-dl_dir").removeAttr("disabled");
$('#hintError-dl_dir').hide();
} else {
var invalidSlash = reBeginWithSlash.test(input.val());
var invalidVar = reCheckVariable.test(input.val());
if (!invalidSlash && !invalidVar) {
$('#change-dl_dir-form').addClass('has-error');
$("#apply-change-dl_dir").attr("disabled","disabled");
$('#hintError-initialChar-dl_dir').show();
} else if (invalidDir) {
$('#change-dl_dir-form').addClass('has-error');
$("#apply-change-dl_dir").attr("disabled","disabled");
$('#hintError-dl_dir').show();
} else {
$('#change-dl_dir-form').removeClass('has-error');
$("#apply-change-dl_dir").removeAttr("disabled");
$('#hintError-dl_dir').hide();
$('#hintError-initialChar-dl_dir').hide();
}
}
});
@@ -905,7 +918,7 @@ $(document).ready(function() {
// change SSTATE_DIR variable
$('#change-sstate_dir-icon').click(function() {
$('#hintError-sstate_dir').hide();
$('#change-sstate_dir-form').removeClass('has-error');
// preset the edit value
var current_val = $("span#sstate_dir").text().trim();
if (current_val == "Not set") {
@@ -927,6 +940,8 @@ $(document).ready(function() {
});
$('#cancel-change-sstate_dir').click(function(){
$("#hintError-sstate_dir").hide();
$("#hintError-initialChar-sstate_dir").hide();
$("#change-sstate_dir-form").slideUp(function() {
$('#sstate_dir, #change-sstate_dir-icon').show();
});
@@ -935,20 +950,31 @@ $(document).ready(function() {
$("#new-sstate_dir").on('input', function(){
if ($(this).val().trim().length == 0) {
$("#apply-change-sstate_dir").attr("disabled","disabled");
$('#change-sstate_dir-form').addClass('has-error');
$('#hintError-sstate_dir').hide();
$('#hintError-initialChar-sstate_dir').hide();
}
else {
var input = $(this);
var re = /^\/([^ <>\\|":\.%\?\*]+)$/;
var reBeginWithSlash = /^\//;
var reCheckVariable = /^\$/;
var re = /([ <>\\|":\.%\?\*]+)/;
var invalidDir = re.test(input.val());
console.log(invalidDir);
if ( invalidDir ) {
var invalidSlash = reBeginWithSlash.test(input.val());
var invalidVar = reCheckVariable.test(input.val());
if (!invalidSlash && !invalidVar) {
$('#change-sstate_dir-form').addClass('has-error');
$("#apply-change-sstate_dir").attr("disabled","disabled");
$('#hintError-initialChar-sstate_dir').show();
} else if (invalidDir) {
$('#change-sstate_dir-form').addClass('has-error');
$("#apply-change-sstate_dir").attr("disabled","disabled");
$('#hintError-sstate_dir').show();
} else {
$('#change-sstate_dir-form').removeClass('has-error');
$("#apply-change-sstate_dir").removeAttr("disabled");
$('#hintError-sstate_dir').hide();
} else {
$('#change-sstate_dir-form').addClass('has-error');
$("#apply-change-sstate_dir").attr("disabled","disabled");
$('#hintError-sstate_dir').show();
$('#hintError-initialChar-sstate_dir').hide();
}
}
});

View File

@@ -0,0 +1,18 @@
from django import template
register = template.Library()
def field_values(iterable, field):
"""
Convert an iterable of models into a list of strings, one for each model,
where the string for each model is the value of the field "field".
"""
objects = []
if field:
for item in iterable:
objects.append(getattr(item, field))
return objects
register.filter('field_values', field_values)

View File

@@ -190,7 +190,10 @@ urlpatterns = patterns('toastergui.views',
name='xhr_configvaredit'),
url(r'^xhr_importlayer/$', 'xhr_importlayer', name='xhr_importlayer'),
url(r'^xhr_updatelayer/$', 'xhr_updatelayer', name='xhr_updatelayer'),
url(r'^xhr_layer/(?P<pid>\d+)/(?P<layerversion_id>\d+)$',
api.XhrLayer.as_view(),
name='xhr_layer'),
# JS Unit tests
url(r'^js-unit-tests/$', 'jsunittests', name='js-unit-tests'),

View File

@@ -30,7 +30,8 @@ from django.db import IntegrityError, Error
from django.shortcuts import render, redirect, get_object_or_404
from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable
from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency
from orm.models import Target_Installed_Package, Target_File, Target_Image_File, BuildArtifact, CustomImagePackage
from orm.models import Target_Installed_Package, Target_File, Target_Image_File, CustomImagePackage
from orm.models import TargetKernelFile, TargetSDKFile
from orm.models import BitbakeVersion, CustomImageRecipe
from bldcontrol import bbcontroller
from django.views.decorators.cache import cache_control
@@ -470,46 +471,58 @@ def builddashboard( request, build_id ):
recipeCount = Recipe.objects.filter( layer_version__id__in = layerVersionId ).count( );
tgts = Target.objects.filter( build_id = build_id ).order_by( 'target' );
##
# set up custom target list with computed package and image data
#
targets = [ ]
targets = []
ntargets = 0
hasImages = False
targetHasNoImages = False
# True if at least one target for this build has an SDK artifact
# or image file
has_artifacts = False
for t in tgts:
elem = { }
elem[ 'target' ] = t
if t.is_image:
hasImages = True
elem = {}
elem['target'] = t
target_has_images = False
image_files = []
npkg = 0
pkgsz = 0
package = None
for package in Package.objects.filter(id__in = [x.package_id for x in t.target_installed_package_set.all()]):
pkgsz = pkgsz + package.size
if ( package.installed_name ):
if package.installed_name:
npkg = npkg + 1
elem[ 'npkg' ] = npkg
elem[ 'pkgsz' ] = pkgsz
ti = Target_Image_File.objects.filter( target_id = t.id )
imageFiles = [ ]
elem['npkg'] = npkg
elem['pkgsz'] = pkgsz
ti = Target_Image_File.objects.filter(target_id = t.id)
for i in ti:
ndx = i.file_name.rfind( '/' )
if ( ndx < 0 ):
ndx = i.file_name.rfind('/')
if ndx < 0:
ndx = 0;
f = i.file_name[ ndx + 1: ]
imageFiles.append({
f = i.file_name[ndx + 1:]
image_files.append({
'id': i.id,
'path': f,
'size': i.file_size,
'suffix': i.suffix
})
if t.is_image and (len(imageFiles) <= 0 or len(t.license_manifest_path) <= 0):
targetHasNoImages = True
elem[ 'imageFiles' ] = imageFiles
elem[ 'targetHasNoImages' ] = targetHasNoImages
targets.append( elem )
if len(image_files) > 0:
target_has_images = True
elem['targetHasImages'] = target_has_images
elem['imageFiles'] = image_files
elem['target_kernel_artifacts'] = t.targetkernelfile_set.all()
target_sdk_files = t.targetsdkfile_set.all()
target_sdk_artifacts_count = target_sdk_files.count()
elem['target_sdk_artifacts_count'] = target_sdk_artifacts_count
elem['target_sdk_artifacts'] = target_sdk_files
if target_has_images or target_sdk_artifacts_count > 0:
has_artifacts = True
targets.append(elem)
##
# how many packages in this build - ignore anonymous ones
@@ -526,7 +539,7 @@ def builddashboard( request, build_id ):
context = {
'build' : build,
'project' : build.project,
'hasImages' : hasImages,
'hasArtifacts' : has_artifacts,
'ntargets' : ntargets,
'targets' : targets,
'recipecount' : recipeCount,
@@ -1404,15 +1417,37 @@ if True:
pid = prj.id
from collections import Counter
freqtargets = []
try:
btargets = sum(build.target_set.all() for build in Build.objects.filter(project=prj, outcome__lt=Build.IN_PROGRESS))
brtargets = sum(br.brtarget_set.all() for br in BuildRequest.objects.filter(project = prj, state = BuildRequest.REQ_FAILED))
freqtargets = [x.target for x in btargets] + [x.target for x in brtargets]
except TypeError:
pass
freqtargets = Counter(freqtargets)
freqtargets = sorted(freqtargets, key = lambda x: freqtargets[x], reverse=True)
freqtargets = Counter(Target.objects.filter(
Q(build__project=prj),
~Q(build__outcome=Build.IN_PROGRESS)
).order_by("target").values_list("target", flat=True))
freqtargets = freqtargets.most_common(5)
# We now have the targets in order of frequency but if there are two
# with the same frequency then we need to make sure those are in
# alphabetical order without losing the frequency ordering
tmp = []
switch = None
for i, freqtartget in enumerate(freqtargets):
target, count = freqtartget
try:
target_next, count_next = freqtargets[i+1]
if count == count_next and target > target_next:
switch = target
continue
except IndexError:
pass
tmp.append(target)
if switch:
tmp.append(switch)
switch = None
freqtargets = tmp
layers = [{"id": x.layercommit.pk, "orderid": x.pk, "name" : x.layercommit.layer.name,
"vcs_url": x.layercommit.layer.vcs_url, "vcs_reference" : x.layercommit.get_vcs_reference(),
@@ -1432,7 +1467,7 @@ if True:
"layers" : layers,
"targets" : [{"target" : x.target, "task" : x.task, "pk": x.pk} for x in prj.projecttarget_set.all()],
"variables": [(x.name, x.value) for x in prj.projectvariable_set.all()],
"freqtargets": freqtargets[:5],
"freqtargets": freqtargets,
"releases": [{"id": x.pk, "name": x.name, "description":x.description} for x in Release.objects.all()],
"project_html": 1,
"recipesTypeAheadUrl": reverse('xhr_recipestypeahead', args=(prj.pk,)),
@@ -1533,11 +1568,16 @@ if True:
def xhr_configvaredit(request, pid):
try:
prj = Project.objects.get(id = pid)
# There are cases where user can add variables which hold values
# like http://, file:/// etc. In such case a simple split(":")
# would fail. One example is SSTATE_MIRRORS variable. So we use
# max_split var to handle them.
max_split = 1
# add conf variables
if 'configvarAdd' in request.POST:
t=request.POST['configvarAdd'].strip()
if ":" in t:
variable, value = t.split(":")
variable, value = t.split(":", max_split)
else:
variable = t
value = ""
@@ -1547,7 +1587,7 @@ if True:
if 'configvarChange' in request.POST:
t=request.POST['configvarChange'].strip()
if ":" in t:
variable, value = t.split(":")
variable, value = t.split(":", max_split)
else:
variable = t
value = ""
@@ -1712,49 +1752,6 @@ if True:
return HttpResponse(jsonfilter(json_response), content_type = "application/json")
def xhr_updatelayer(request):
def error_response(error):
return HttpResponse(jsonfilter({"error": error}), content_type = "application/json")
if "layer_version_id" not in request.POST:
return error_response("Please specify a layer version id")
try:
layer_version_id = request.POST["layer_version_id"]
layer_version = Layer_Version.objects.get(id=layer_version_id)
except Layer_Version.DoesNotExist:
return error_response("Cannot find layer to update")
if "vcs_url" in request.POST:
layer_version.layer.vcs_url = request.POST["vcs_url"]
if "dirpath" in request.POST:
layer_version.dirpath = request.POST["dirpath"]
if "commit" in request.POST:
layer_version.commit = request.POST["commit"]
if "up_branch" in request.POST:
layer_version.up_branch_id = int(request.POST["up_branch"])
if "add_dep" in request.POST:
lvd = LayerVersionDependency(layer_version=layer_version, depends_on_id=request.POST["add_dep"])
lvd.save()
if "rm_dep" in request.POST:
rm_dep = LayerVersionDependency.objects.get(layer_version=layer_version, depends_on_id=request.POST["rm_dep"])
rm_dep.delete()
if "summary" in request.POST:
layer_version.layer.summary = request.POST["summary"]
if "description" in request.POST:
layer_version.layer.description = request.POST["description"]
try:
layer_version.layer.save()
layer_version.save()
except Exception as e:
return error_response("Could not update layer version entry: %s" % e)
return HttpResponse(jsonfilter({"error": "ok",}), content_type = "application/json")
@xhr_response
def xhr_customrecipe(request):
@@ -2210,7 +2207,7 @@ if True:
vars_blacklist = {
'PARALLEL_MAKE','BB_NUMBER_THREADS',
'BB_DISKMON_DIRS','BB_NUMBER_THREADS','CVS_PROXY_HOST','CVS_PROXY_PORT',
'PARALLEL_MAKE','SSTATE_MIRRORS','TMPDIR',
'PARALLEL_MAKE','TMPDIR',
'all_proxy','ftp_proxy','http_proxy ','https_proxy'
}
@@ -2307,12 +2304,20 @@ if True:
elif artifact_type == "imagefile":
file_name = Target_Image_File.objects.get(target__build = build, pk = artifact_id).file_name
elif artifact_type == "buildartifact":
file_name = BuildArtifact.objects.get(build = build, pk = artifact_id).file_name
elif artifact_type == "targetkernelartifact":
target = TargetKernelFile.objects.get(pk=artifact_id)
file_name = target.file_name
elif artifact_type == "targetsdkartifact":
target = TargetSDKFile.objects.get(pk=artifact_id)
file_name = target.file_name
elif artifact_type == "licensemanifest":
file_name = Target.objects.get(build = build, pk = artifact_id).license_manifest_path
elif artifact_type == "packagemanifest":
file_name = Target.objects.get(build = build, pk = artifact_id).package_manifest_path
elif artifact_type == "tasklogfile":
file_name = Task.objects.get(build = build, pk = artifact_id).logfile

View File

@@ -7611,13 +7611,18 @@
</para>
<para>
As described below in the
"<link linkend='runtime-package-management-target-ipk'>Using IPK</link>"
section, if you are using IPK as your package format, you
can make use of the
<filename>distro-feed-configs</filename> recipe provided
by <filename>meta-oe</filename> in order to configure your
target to use your IPK databases.
You can use the
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_ARCHS'><filename>PACKAGE_FEED_ARCHS</filename></ulink>,
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_BASE_PATHS'><filename>PACKAGE_FEED_BASE_PATHS</filename></ulink>,
and
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_URIS'><filename>PACKAGE_FEED_URIS</filename></ulink>
variables to pre-configure target images to use a package
feed.
If you do not define these variables, then manual steps
as described in the subsequent sections are necessary to
configure the target.
You should set these variables before building the image
in order to produce a correctly configured image.
</para>
<para>
@@ -7686,7 +7691,13 @@
The <filename>smart</filename> application performs
runtime package management of RPM packages.
You must perform an initial setup for
<filename>smart</filename> on the target machine.
<filename>smart</filename> on the target machine
if the
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_ARCHS'><filename>PACKAGE_FEED_ARCHS</filename></ulink>,
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_BASE_PATHS'><filename>PACKAGE_FEED_BASE_PATHS</filename></ulink>, and
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_URIS'><filename>PACKAGE_FEED_URIS</filename></ulink>
variables have not been set or the target image was
built before the variables were set.
</para>
<para>
@@ -7720,7 +7731,13 @@
The <filename>opkg</filename> application performs
runtime package management of IPK packages.
You must perform an initial setup for
<filename>opkg</filename> on the target machine.
<filename>opkg</filename> on the target machine
if the
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_ARCHS'><filename>PACKAGE_FEED_ARCHS</filename></ulink>,
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_BASE_PATHS'><filename>PACKAGE_FEED_BASE_PATHS</filename></ulink>, and
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_URIS'><filename>PACKAGE_FEED_URIS</filename></ulink>
variables have not been set or the target image was
built before the variables were set.
</para>
<para>
@@ -7769,7 +7786,13 @@
This application uses a source list file to find
available package databases.
You must perform an initial setup for
<filename>apt</filename> on the target machine.
<filename>apt</filename> on the target machine
if the
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_ARCHS'><filename>PACKAGE_FEED_ARCHS</filename></ulink>,
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_BASE_PATHS'><filename>PACKAGE_FEED_BASE_PATHS</filename></ulink>, and
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_URIS'><filename>PACKAGE_FEED_URIS</filename></ulink>
variables have not been set or the target image was
built before the variables were set.
</para>
<para>
@@ -9378,7 +9401,7 @@
A JSON file is used to define the packages needed by a test.
This file must be in the same path as the file used to define
the tests.
Furthermore, the filename must map directory to the test
Furthermore, the filename must map directly to the test
module name with a <filename>.json</filename> extension.
</para>
@@ -9411,7 +9434,7 @@
DUT.
<literallayout class='monospaced'>
{
"": {
"foo": {
"pkg": "bar"
},
"foobar": [

View File

@@ -1209,6 +1209,131 @@
which includes the environment setup script.
</para>
</section>
<section id='setscene-tasks-and-shared-state'>
<title>Setscene Tasks and Shared State</title>
<para>
The description of tasks so far assumes that BitBake needs to
build everything and there are no prebuilt objects available.
BitBake does support skipping tasks if prebuilt objects are
available.
These objects are usually made available in the form of a
shared state (sstate) cache.
<note>
For information on variables affecting sstate, see the
<link linkend='var-SSTATE_DIR'><filename>SSTATE_DIR</filename></link>
and
<link linkend='var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></link>
variables.
</note>
</para>
<para>
The idea of a setscene task (i.e
<filename>do_</filename><replaceable>taskname</replaceable><filename>_setscene</filename>)
is a version of the task where
instead of building something, BitBake can skip to the end
result and simply place a set of files into specific locations
as needed.
In some cases, it makes sense to have a setscene task variant
(e.g. generating package files in the
<filename>do_package_write_*</filename> task).
In other cases, it does not make sense, (e.g. a
<link linkend='ref-tasks-patch'><filename>do_patch</filename></link>
task or
<link linkend='ref-tasks-unpack'><filename>do_unpack</filename></link>
task) since the work involved would be equal to or greater than
the underlying task.
</para>
<para>
In the OpenEmbedded build system, the common tasks that have
setscene variants are <link linkend='ref-tasks-package'><filename>do_package</filename></link>,
<filename>do_package_write_*</filename>,
<link linkend='ref-tasks-deploy'><filename>do_deploy</filename></link>,
<link linkend='ref-tasks-packagedata'><filename>do_packagedata</filename></link>,
and
<link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>.
Notice that these are most of the tasks whose output is an
end result.
</para>
<para>
The OpenEmbedded build system has knowledge of the relationship
between these tasks and other tasks that precede them.
For example, if BitBake runs
<filename>do_populate_sysroot_setscene</filename> for
something, there is little point in running any of the
<filename>do_fetch</filename>, <filename>do_unpack</filename>,
<filename>do_patch</filename>,
<filename>do_configure</filename>,
<filename>do_compile</filename>, and
<filename>do_install</filename> tasks.
However, if <filename>do_package</filename> needs to be run,
BitBake would need to run those other tasks.
</para>
<para>
It becomes more complicated if everything can come from an
sstate cache because some objects are simply not required at
all.
For example, you do not need a compiler or native tools, such
as quilt, if there is nothing to compile or patch.
If the <filename>do_package_write_*</filename> packages are
available from sstate, BitBake does not need the
<filename>do_package</filename> task data.
</para>
<para>
To handle all these complexities, BitBake runs in two phases.
The first is the "setscene" stage.
During this stage, BitBake first checks the sstate cache for
any targets it is planning to build.
BitBake does a fast check to see if the object exists rather
than a complete download.
If nothing exists, the second phase, which is the setscene
stage, completes and the main build proceeds.
</para>
<para>
If objects are found in the sstate cache, the OpenEmbedded
build system works backwards from the end targets specified
by the user.
For example, if an image is being built, the OpenEmbedded build
system first looks for the packages needed for that image and
the tools needed to construct an image.
If those are available, the compiler is not needed.
Thus, the compiler is not even downloaded.
If something was found to be unavailable, or the download or
setscene task fails, the OpenEmbedded build system then tries
to install dependencies, such as the compiler, from the cache.
</para>
<para>
The availability of objects in the sstate cache is handled by
the function specified by the
<ulink url='&YOCTO_DOCS_BB_URL;#var-BB_HASHCHECK_FUNCTION'><filename>BB_HASHCHECK_FUNCTION</filename></ulink>
variable and returns a list of the objects that are available.
The function specified by the
<ulink url='&YOCTO_DOCS_BB_URL;#var-BB_SETSCENE_DEPVALID'><filename>BB_SETSCENE_DEPVALID</filename></ulink>
variable is the function that determines whether a given
dependency needs to be followed, and whether for any given
relationship the function needs to be passed.
The function returns a True or False value.
</para>
<para>
Once the setscene process completes, the OpenEmbedded build
system has a list of tasks that it believes it can "accelerate"
and therefore does not need to run.
There is a final function call to the function specified by the
<ulink url='&YOCTO_DOCS_BB_URL;#var-BB_SETSCENE_VERIFY_FUNCTION'><filename>BB_SETSCENE_VERIFY_FUNCTION</filename></ulink>
variable that is able to require the tasks to be run that
that the OpenEmbedded build system initially was going to
skip.
</para>
</section>
</section>
<section id='images-dev-environment'>

View File

@@ -146,7 +146,25 @@
bluetooth support (integrated BT only).</para></listitem>
<listitem><para><emphasis>bluez5:</emphasis> Include
BlueZ Version 5, which provides core Bluetooth layers and
protocols support.</para></listitem>
protocols support.
<note>
The default value for the
<link linkend='var-DISTRO_FEATURES'><filename>DISTRO FEATURES</filename></link>
variable includes "bluetooth", which causes bluez5
to be backfilled in for bluetooth support.
If you do not want bluez5 backfilled and would rather
use bluez4, you need to use the
<link linkend='var-DISTRO_FEATURES_BACKFILL_CONSIDERED'><filename>DISTRO_FEATURES_BACKFILL_CONSIDERED</filename></link>
variable as follows:
<literallayout class='monospaced'>
DISTRO_FEATURES_BACKFILL_CONSIDERED = "bluez5"
</literallayout>
Setting this variable tells the OpenEmbedded build
system that you have considered but ruled
out using the bluez5 feature and that bluez4 will be
used.
</note>
</para></listitem>
<listitem><para><emphasis>cramfs:</emphasis> Include CramFS
support.</para></listitem>
<listitem><para><emphasis>directfb:</emphasis>

View File

@@ -19,6 +19,10 @@
<para>
The following sections describe normal tasks associated with building
a recipe.
For more information on tasks and dependencies, see the
"<ulink url='&YOCTO_DOCS_BB_URL;#tasks'>Tasks</ulink>" and
"<ulink url='&YOCTO_DOCS_BB_URL;#dependencies'>Dependencies</ulink>"
sections in the BitBake User Manual.
</para>
<section id='ref-tasks-build'>

View File

@@ -995,6 +995,29 @@
BBCLASSEXTEND =+ "native nativesdk"
BBCLASSEXTEND =+ "multilib:<replaceable>multilib_name</replaceable>"
</literallayout>
<note>
<para>
Internally, the <filename>BBCLASSEXTEND</filename>
mechanism generates recipe variants by rewriting
variable values and applying overrides such as
<filename>_class-native</filename>.
For example, to generate a native version of a recipe,
a
<link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
on "foo" is rewritten to a <filename>DEPENDS</filename>
on "foo-native".
</para>
<para>
Even when using <filename>BBCLASSEXTEND</filename>, the
recipe is only parsed once.
Parsing once adds some limitations.
For example, it is not possible to
include a different file depending on the variant,
since <filename>include</filename> statements are
processed when the recipe is parsed.
</para>
</note>
</para>
</glossdef>
</glossentry>
@@ -2770,12 +2793,56 @@
task of recipe "b".
This means anything that recipe "b" puts into sysroot
is available when recipe "a" is configuring itself.
<note>
<title>Notes</title>
<itemizedlist>
<listitem><para>
<filename>DEPENDS</filename> is a list of
recipe names.
Or, to be more precise, it is a list of
<link linkend='var-PROVIDES'><filename>PROVIDES</filename></link>
names, which usually match recipe names.
Putting a package name such as "foo-dev" in
<filename>DEPENDS</filename> does not make
sense.
Use "foo" instead, as this will put files
from all the packages that make up
<filename>foo</filename>, which includes
those from <filename>foo-dev</filename>, into
the sysroot.
</para></listitem>
<listitem><para>
Counterintuitively,
<filename>DEPENDS</filename> is often necessary
even for recipes that install precompiled
components.
For example, if <filename>libfoo</filename>
is a precompiled library that links against
<filename>libbar</filename>, then
linking against <filename>libfoo</filename>
requires both <filename>libfoo</filename>
and <filename>libbar</filename> to be available
in the sysroot.
Without a <filename>DEPENDS</filename> from the
recipe that installs <filename>libfoo</filename>
to the recipe that installs
<filename>libbar</filename>, other recipes might
fail to link against
<filename>libfoo</filename>.
</para></listitem>
</itemizedlist>
</note>
</para>
<para>
For information on runtime dependencies, see the
<link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
variable.
You can also see the
"<ulink url='&YOCTO_DOCS_BB_URL;#tasks'>Tasks</ulink>" and
"<ulink url='&YOCTO_DOCS_BB_URL;#dependencies'>Dependencies</ulink>"
sections in the BitBake User Manual for additional
information on tasks and dependencies.
</para>
</glossdef>
</glossentry>
@@ -9571,8 +9638,48 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
<glossdef>
<para role="glossdeffirst">
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
The revision of the recipe.
The default value for this variable is "r0".
The revision of the recipe. The default value for this
variable is "r0".
Subsequent revisions of the recipe conventionally have the
values "r1", "r2", and so forth.
When
<link linkend='var-PV'><filename>PV</filename></link>
increases, <filename>PR</filename> is conventionally reset
to "r0".
<note>
The OpenEmbedded build system does not need the aid of
<filename>PR</filename> to know when to rebuild a
recipe.
The build system uses
<link linkend='var-STAMP'><filename>STAMP</filename></link>
and the
<link linkend='shared-state-cache'>shared state cache</link>
mechanisms.
</note>
The <filename>PR</filename> variable primarily becomes
significant when a package manager dynamically installs
packages on an already built image.
In this case, <filename>PR</filename>, which is the default
value of
<link linkend='var-PKGR'><filename>PKGR</filename></link>,
helps the package manager distinguish which package is the
most recent one in cases where many packages have the same
<filename>PV</filename> (i.e. <filename>PKGV</filename>).
A component having many packages with the same
<filename>PV</filename> usually means that the packages all
install the same upstream version, but with later
(<filename>PR</filename>) version packages including
packaging fixes.
<note>
<filename>PR</filename> does not need to be increased
for changes that do not change the package contents or
metadata.
</note>
Because manually managing <filename>PR</filename> can be
cumbersome and error-prone, an automated solution exists.
See the
"<ulink url='&YOCTO_DOCS_DEV_URL;#working-with-a-pr-service'>Working With a PR Service</ulink>"
section for more information.
</para>
</glossdef>
</glossentry>
@@ -10088,14 +10195,20 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
<filename>RDEPENDS</filename> since some automatic
handling occurs:
<itemizedlist>
<listitem><para><emphasis><filename>shlibdeps</filename></emphasis>: If
a runtime package contains a shared library
(<filename>.so</filename>), the build
processes the library in order to determine other
libraries to which it is dynamically linked.
The build process adds these libraries to
<filename>RDEPENDS</filename> when creating the runtime
package.</para></listitem>
<listitem><para><emphasis><filename>shlibdeps</filename></emphasis>:
If a runtime package contains a compiled binary,
the build processes the binary in order to
determine any shared libraries
(<filename>.so</filename> files) to which it is
dynamically linked.
The build process adds the packages containing
these libraries to <filename>RDEPENDS</filename>
when creating the runtime package.
In addition, if the shared library is versioned,
the dependency will have the version appended to it
in order to force an upgrade to the appropriate
version if needed.
</para></listitem>
<listitem><para><emphasis><filename>pcdeps</filename></emphasis>: If
the package ships a <filename>pkg-config</filename>
information file, the build process uses this file
@@ -10135,6 +10248,35 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
For information on build-time dependencies, see the
<link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
variable.
You can also see the
"<ulink url='&YOCTO_DOCS_BB_URL;#tasks'>Tasks</ulink>" and
"<ulink url='&YOCTO_DOCS_BB_URL;#dependencies'>Dependencies</ulink>"
sections in the BitBake User Manual for additional
information on tasks and dependencies.
</para>
</glossdef>
</glossentry>
<glossentry id='var-REMOVE_PKG_SUPPORT'><glossterm>REMOVE_PKG_SUPPORT</glossterm>
<info>
REMOVE_PKG_SUPPORT[doc] = "Allows for removal of supporting packages for images that do not contain a package manager."
</info>
<glossdef>
<para role="glossdeffirst">
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
For images not containing a package manager,
<filename>REMOVE_PKG_SUPPORT</filename> allows the removal
of supporting packages.
Packages that will be uninstalled include:
<filename>update-rc.d</filename>,
<filename>base-passwd</filename>,
<filename>shadow</filename>,
<filename>run-postinsts</filename>, and
<filename>update-alternatives</filename>.
</para>
<para>
Set the variable to "1" to remove these packages.
</para>
</glossdef>
</glossentry>

View File

@@ -690,6 +690,123 @@
addtask do_deploy_setscene
do_deploy[dirs] = "${DEPLOYDIR} ${B}"
</literallayout>
The following list explains the previous example:
<itemizedlist>
<listitem><para>
Adding "do_deploy" to <filename>SSTATETASKS</filename>
adds some required sstate-related processing, which is
implemented in the
<link linkend='ref-classes-sstate'><filename>sstate</filename></link>
class, to before and after the
<link linkend='ref-tasks-deploy'><filename>do_deploy</filename></link>
task.
</para></listitem>
<listitem><para>
The
<filename>do_deploy[sstate-inputdirs] = "${DEPLOYDIR}"</filename>
declares that <filename>do_deploy</filename> places its
output in <filename>${DEPLOYDIR}</filename> when run
normally (i.e. when not using the sstate cache).
This output becomes the input to the shared state cache.
</para></listitem>
<listitem><para>
The
<filename>do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"</filename>
line causes the contents of the shared state cache to be
copied to <filename>${DEPLOY_DIR_IMAGE}</filename>.
<note>
If <filename>do_deploy</filename> is not already in
the shared state cache or if its input checksum
(signature) has changed from when the output was
cached, the task will be run to populate the shared
state cache, after which the contents of the shared
state cache is copied to
<filename>${DEPLOY_DIR_IMAGE}</filename>.
If <filename>do_deploy</filename> is in the shared
state cache and its signature indicates that the
cached output is still valid (i.e. if no
relevant task inputs have changed), then the contents
of the shared state cache will be copied directly to
<filename>${DEPLOY_DIR_IMAGE}</filename> by the
<filename>do_deploy_setscene</filename> task instead,
skipping the <filename>do_deploy</filename> task.
</note>
</para></listitem>
<listitem><para>
The following task definition is glue logic needed to make
the previous settings effective:
<literallayout class='monospaced'>
python do_deploy_setscene () {
sstate_setscene(d)
}
addtask do_deploy_setscene
</literallayout>
<filename>sstate_setscene()</filename> takes the flags
above as input and accelerates the
<filename>do_deploy</filename> task through the
shared state cache if possible.
If the task was accelerated,
<filename>sstate_setscene()</filename> returns True.
Otherwise, it returns False, and the normal
<filename>do_deploy</filename> task runs.
For more information, see the
"<ulink url='&YOCTO_DOCS_BB_URL;#setscene'>setscene</ulink>"
section in the BitBake User Manual.
</para></listitem>
<listitem><para>
The
<filename>do_deploy[dirs] = "${DEPLOYDIR} ${B}"</filename>
line creates <filename>${DEPLOYDIR}</filename> and
<filename>${B}</filename> before the
<filename>do_deploy</filename> task runs.
For more information, see the
"<ulink url='&YOCTO_DOCS_BB_URL;#variable-flags'>Variable Flags</ulink>"
section in the BitBake User Manual.
<note>
In cases where
<filename>sstate-inputdirs</filename> and
<filename>sstate-outputdirs</filename> would be the
same, you can use
<filename>sstate-plaindirs</filename>.
For example, to preserve the
<filename>${PKGD}</filename> and
<filename>${PKGDEST}</filename> output from the
<link linkend='ref-tasks-package'><filename>do_package</filename></link>
task, use the following:
<literallayout class='monospaced'>
do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST}"
</literallayout>
</note>
</para></listitem>
<listitem><para>
<filename>sstate-inputdirs</filename> and
<filename>sstate-outputdirs</filename> can also be used
with multiple directories.
For example, the following declares
<filename>PKGDESTWORK</filename> and
<filename>SHLIBWORK</filename> as shared state
input directories, which populates the shared state
cache, and <filename>PKGDATA_DIR</filename> and
<filename>SHLIBSDIR</filename> as the corresponding
shared state output directories:
<literallayout class='monospaced'>
do_package[sstate-inputdirs] = "${PKGDESTWORK} ${SHLIBSWORKDIR}"
do_package[sstate-outputdirs] = "${PKGDATA_DIR} ${SHLIBSDIR}"
</literallayout>
</para></listitem>
<listitem><para>
These methods also include the ability to take a lockfile
when manipulating shared state directory structures,
for cases where file additions or removals are sensitive:
<literallayout class='monospaced'>
do_package[sstate-lockfile] = "${PACKAGELOCK}"
</literallayout>
</para></listitem>
</itemizedlist>
</para>
<!--
<para>
In this example, we add some extra flags to the task, a name field ("deploy"), an
input directory where the task sends data, and the output
directory where the data from the task should eventually be copied.
@@ -713,6 +830,7 @@
shared state directory structures since some cases are sensitive to file
additions or removals.
</para>
-->
<para>
Behind the scenes, the shared state code works by looking in

View File

@@ -356,23 +356,63 @@
<section id='recipe-logging-mechanisms'>
<title>Recipe Logging Mechanisms</title>
<para>
Best practices exist while writing recipes that both log build progress and
act on build conditions such as warnings and errors.
Both Python and Bash language bindings exist for the logging mechanism:
Best practices exist while writing recipes that both log build
progress and act on build conditions such as warnings and errors.
For Python functions, the following logging functions exist.
All of these functions log to
<filename>${T}/log.do_</filename><replaceable>task</replaceable>,
and can also log to standard output (stdout) with the right
settings:
<itemizedlist>
<listitem><para><emphasis>Python:</emphasis> For Python functions, BitBake
supports several loglevels: <filename>bb.fatal</filename>,
<filename>bb.error</filename>, <filename>bb.warn</filename>,
<filename>bb.note</filename>, <filename>bb.plain</filename>,
and <filename>bb.debug</filename>.</para></listitem>
<listitem><para><emphasis>Bash:</emphasis> For Bash functions, the same set
of loglevels exist and are accessed with a similar syntax:
<filename>bbfatal</filename>, <filename>bberror</filename>,
<filename>bbwarn</filename>, <filename>bbnote</filename>,
<filename>bbplain</filename>, and <filename>bbdebug</filename>.</para></listitem>
<listitem><para>
<filename>bb.plain(</filename><replaceable>msg</replaceable><filename>)</filename>:
Writes <replaceable>msg</replaceable> as is to the log while
also logging to stdout.
</para></listitem>
<listitem><para>
<filename>bb.note(</filename><replaceable>msg</replaceable><filename>)</filename>:
Writes "NOTE: <replaceable>msg</replaceable>" to the log.
Also logs to stdout if BitBake is called with "-v".
</para></listitem>
<listitem><para>
<filename>bb.debug(</filename><replaceable>level</replaceable><filename>,&nbsp;</filename><replaceable>msg</replaceable><filename>)</filename>:
Writes "DEBUG: <replaceable>msg</replaceable>" to the log.
Also logs to stdout if the log level is greater than or
equal to <replaceable>level</replaceable>.
See the
"<ulink url='&YOCTO_DOCS_BB_URL;#usage-and-syntax'>-D</ulink>"
option in the BitBake User Manual for more information.
</para></listitem>
<listitem><para>
<filename>bb.warn(</filename><replaceable>msg</replaceable><filename>)</filename>:
Writes "WARNING: <replaceable>msg</replaceable>" to the log
while also logging to stdout.
</para></listitem>
<listitem><para>
<filename>bb.error(</filename><replaceable>msg</replaceable><filename>)</filename>:
Writes "ERROR: <replaceable>msg</replaceable>" to the log
while also logging to stdout.
<note>
Calling this function does not cause the task to fail.
</note>
</para></listitem>
<listitem><para>
<filename>bb.fatal(</filename><replaceable>msg</replaceable><filename>)</filename>:
This logging function is similar to
<filename>bb.error(</filename><replaceable>msg</replaceable><filename>)</filename>
but also causes the calling task to fail.
</para></listitem>
</itemizedlist>
</para>
<para>
The same logging functions are also available in shell functions,
under the names
<filename>bbplain</filename>, <filename>bbnote</filename>,
<filename>bbdebug</filename>, <filename>bbwarn</filename>,
<filename>bberror</filename>, and <filename>bbfatal</filename>.
</para>
<para>
For guidance on how logging is handled in both Python and Bash recipes, see the
<filename>logging.bbclass</filename> file in the

View File

@@ -31,7 +31,7 @@
<filename>poky/build</filename>), start Toaster using this
command:
<literallayout class='monospaced'>
$ source ../bitbake/bin/toaster
$ source toaster start
</literallayout>
You can now run your builds from the command line, or with
Toaster as explained in section
@@ -56,7 +56,23 @@
set a different port.
For example, the following command sets the port to "8400":
<literallayout class='monospaced'>
$ source ../bitbake/bin/toaster webport=8400
$ source toaster start webport=8400
</literallayout>
</para>
</section>
<section id='setting-a-different-address'>
<title>Setting a Different Address</title>
<para>
By default, Toaster binds to the loop back address
(i.e. localhost).
You can use the <filename>WEBPORT</filename> parameter to
set a different host.
For example, the following command sets the host and port
to "0.0.0.0:8400":
<literallayout class='monospaced'>
$ source toaster start webport=0.0.0.0:8400
</literallayout>
</para>
</section>
@@ -116,12 +132,14 @@
create a superuser by following these steps:
<orderedlist>
<listitem><para>
If you used <filename>virtualenv</filename>, which is
If you used <filename>pip3</filename>, which is
recommended, to set up the Toaster system dependencies,
you need be sure the virtual environment is activated.
To activate this environment, use the following command:
you need be sure the local user path is in your
<filename>PATH</filename> list.
To append the pip3 local user path, use the following
command:
<literallayout class='monospaced'>
$ source venv/bin/activate
$ export PATH=$PATH:$HOME/.local/bin
</literallayout>
</para></listitem>
<listitem><para>
@@ -211,16 +229,23 @@
Use the Mysql database server.
</para></listitem>
<listitem><para>
If you are using Ubuntu 14.04.3, run the following:
If you are using Ubuntu 16.04, run the following:
<literallayout class='monospaced'>
$ sudo apt-get install apache2 libapache2-mod-wsgi mysql-server virtualenv libmysqlclient-dev
$ sudo apt-get install apache2 libapache2-mod-wsgi-py3 mysql-server python3-pip libmysqlclient-dev
</literallayout>
</para></listitem>
<listitem><para>
If you are using Fedora 22 or a RedHat distribution, run
If you are using Fedora 24 or a RedHat distribution, run
the following:
<literallayout class='monospaced'>
$ sudo dnf install httpd mod_wsgi python-virtualenv gcc mysql-devel
$ sudo dnf install httpd python3-mod_wsgi python3-pip mariadb-server mariadb-devel python3-devel
</literallayout>
</para></listitem>
<listitem><para>
If you are using openSUSE Leap 42.1, run
the following:
<literallayout class='monospaced'>
$ sudo zypper install apache2 apache2-mod_wsgi-python3 python3-pip mariadb mariadb-client python3-devel
</literallayout>
</para></listitem>
</itemizedlist>
@@ -233,29 +258,32 @@
<para>
Perform the following steps to install Toaster:
<orderedlist>
<listitem><para>
Create toaster user and set its home directory to
<filename>/var/www/toaster</filename>:
<literallayout class='monospaced'>
$ sudo /usr/sbin/useradd toaster -md /var/www/toaster -s /bin/false
$ sudo su - toaster -s /bin/bash
</literallayout>
</para></listitem>
<listitem><para>
Checkout a copy of <filename>poky</filename>
into the web server directory.
You will be using <filename>/var/www/toaster</filename>:
<literallayout class='monospaced'>
$ mkdir -p /var/www/toaster
$ cd /var/www/toaster/
$ git clone git://git.yoctoproject.org/poky
$ git checkout &DISTRO_NAME_NO_CAP;
</literallayout>
</para></listitem>
<listitem><para>
Initialize a virtual environment and install Toaster
dependencies.
Using a virtual environment keeps the Python packages
Install Toaster
dependencies using the --user flag which
keeps the Python packages
isolated from your system-provided packages:
<literallayout class='monospaced'>
$ cd /var/www/toaster/
$ virtualenv venv
$ source ./venv/bin/activate
$ pip install -r ./poky/bitbake/toaster-requirements.txt
$ pip install mysql
$ pip install MySQL-python
$ pip3 install --user -r ./poky/bitbake/toaster-requirements.txt
$ pip3 install --user mysqlclient
</literallayout>
<note>
Isolating these packages is not required but is
@@ -270,7 +298,9 @@
as follows:
<itemizedlist>
<listitem><para>
Edit the <filename>DATABASE</filename> settings:
Edit the
<ulink url='http://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-SECRET_KEY'>DATABASE</ulink>
settings:
<literallayout class='monospaced'>
DATABASES = {
'default': {
@@ -285,13 +315,15 @@
</literallayout>
</para></listitem>
<listitem><para>
Edit the <filename>SECRET_KEY</filename>:
Edit the
<ulink url='http://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-SECRET_KEY'>SECRET_KEY</ulink>:
<literallayout class='monospaced'>
SECRET_KEY = '<replaceable>your_secret_key</replaceable>'
</literallayout>
</para></listitem>
<listitem><para>
Edit the <filename>STATIC_ROOT</filename>:
Edit the
<ulink url='http://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-SECRET_KEY'>STATIC_ROOT</ulink>:
<literallayout class='monospaced'>
STATIC_ROOT = '/var/www/toaster/static_files/'
</literallayout>
@@ -314,9 +346,9 @@
default data, and gather the statically-served files:
<literallayout class='monospaced'>
$ cd /var/www/toaster/poky/
$ ./bitbake/lib/toaster/manage.py syncdb
$ ./bitbake/lib/toaster/manage.py migrate
$ TOASTER_DIR=`pwd` TOASTER_CONF=./meta-poky/conf/toasterconf.json ./bitbake/lib/toaster/manage.py checksettings
$ TOASTER_DIR=`pwd` TOASTER_CONF=./meta-poky/conf/toasterconf.json \
./bitbake/lib/toaster/manage.py checksettings
$ ./bitbake/lib/toaster/manage.py collectstatic
</literallayout>
</para>
@@ -324,8 +356,8 @@
<para>
For the above set of commands, after moving to the
<filename>poky</filename> directory,
the <filename>syncdb</filename> and <filename>migrate</filename>
commands ensure the database
the <filename>migrate</filename>
command ensures the database
schema has had changes propagated correctly (i.e.
migrations).
</para>
@@ -365,7 +397,8 @@
Finally, the <filename>collectstatic</filename> command
is a Django framework command that collects all the
statically served files into a designated directory to
be served up by the Apache web server.
be served up by the Apache web server as defined by
<filename>STATIC_ROOT</filename>.
</para></listitem>
<listitem><para>
Add an Apache configuration file for Toaster to your Apache web
@@ -377,22 +410,36 @@
If you are using Fedora or RedHat, put it here:
<literallayout class='monospaced'>
/etc/httpd/conf.d/toaster.conf
</literallayout>
If you are using OpenSUSE, put it here:
<literallayout class='monospaced'>
/etc/apache2/conf.d/toaster.conf
</literallayout>
Following is a sample Apache configuration for Toaster
you can follow:
<literallayout class='monospaced'>
Alias /static /var/www/toaster/static_files
&lt;Directory /var/www/toaster/static_files&gt;
Order allow,deny
Allow from all
Require all granted
&lt;IfModule mod_access_compat.c&gt;
Order allow,deny
Allow from all
&lt;/IfModule&gt;
&lt;IfModule !mod_access_compat.c&gt;
Require all granted
&lt;/IfModule&gt;
&lt;/Directory&gt;
WSGIDaemonProcess toaster_wsgi python-path=/var/www/toaster/poky/bitbake/lib/toaster:/var/www/toaster/venv/lib/python2.7/site-packages
&lt;Directory /var/www/toaster/poky/bitbake/lib/toaster/toastermain&gt;
&lt;Files "wsgi.py"&gt;
Require all granted
&lt;/Files&gt;
&lt;/Directory&gt;
WSGIDaemonProcess toaster_wsgi python-path=/var/www/toaster/poky/bitbake/lib/toaster:/var/www/toaster/.local/lib/python3.4/site-packages
WSGIScriptAlias / "/var/www/toaster/poky/bitbake/lib/toaster/toastermain/wsgi.py"
&lt;Location /&gt;
WSGIProcessGroup toastern_wsgi
WSGIProcessGroup toaster_wsgi
&lt;/Location&gt;
</literallayout>
If you are using Ubuntu or Debian,
@@ -404,7 +451,7 @@
</literallayout>
Finally, restart Apache to make sure all new configuration
is loaded.
For Ubuntu and Debian use:
For Ubuntu, Debian, and OpenSUSE use:
<literallayout class='monospaced'>
$ sudo service apache2 restart
</literallayout>
@@ -414,22 +461,53 @@
</literallayout>
</para></listitem>
<listitem><para>
Install the build runner service.
This service needs to be running in order to dispatch
builds.
Use this command:
Prepare the systemd service to run Toaster builds.
Here is a sample configuration file for the service:
<literallayout class='monospaced'>
/var/www/toaster/poky/bitbake/lib/toaster/manage.py runbuilds
[Unit]
Description=Toaster runbuilds
[Service]
Type=forking
User=toaster
ExecStart=/usr/bin/screen -d -m -S runbuilds /var/www/toaster/poky/bitbake/lib/toaster/runbuilds-service.sh start
ExecStop=/usr/bin/screen -S runbuilds -X quit
WorkingDirectory=/var/www/toaster/poky
[Install]
WantedBy=multi-user.target
</literallayout>
Here is an example:
Prepare the <filename>runbuilds-service.sh</filename>
script that you need to place in the
<filename>/var/www/toaster/poky/bitbake/lib/toaster/</filename>
directory by setting up executable permissions:
<literallayout class='monospaced'>
#!/bin/sh
# toaster run builds dispatcher
cd /var/www/toaster/
source ./venv/bin/activate
./bitbake/lib/toaster/manage.py runbuilds
#!/bin/bash
#export http_proxy=http://proxy.host.com:8080
#export https_proxy=http://proxy.host.com:8080
#export GIT_PROXY_COMMAND=$HOME/bin/gitproxy
cd ~/poky/
source ./oe-init-build-env build
source ../bitbake/bin/toaster $1 noweb
[ "$1" == 'start' ] &amp;&amp; /bin/bash
</literallayout>
</para></listitem>
<listitem><para>
Run the service:
<literallayout class='monospaced'>
# service runbuilds start
</literallayout>
Since the service is running in a detached screen
session, you can attach to it using this command:
<literallayout class='monospaced'>
$ sudo su - toaster
$ screen -rS runbuilds
</literallayout>
You can detach from the service again using "Ctrl-a"
followed by "d" key combination.
</para></listitem>
</orderedlist>
You can now open up a browser and start using Toaster.
</para>

View File

@@ -22,6 +22,11 @@
and
"<ulink url='&YOCTO_DOCS_QS_URL;#releases'>Yocto Project Release</ulink>"
sections in the Yocto Project Quick Start.
For Ubuntu/Debian, you might also need to do an additional install
of pip3.
<literallayout class='monospaced'>
$ sudo apt-get install python3-pip
</literallayout>
</para>
</section>
@@ -42,56 +47,6 @@
install-compatible format.
</para>
<section id='toaster-virtual-environment'>
<title>Set Up a Python Virtual Environment</title>
<para>
Set up a Python virtual environment that allows you
to maintain a dedicated Python executable and its own
set of installed modules.
Doing so separates the executable from Python and the
modules provided by the operating system.
This separation avoids any version conflicts.
<note>
Creating a virtual environment is not absolutely
necessary.
However, doing so is highly recommended.
</note>
</para>
<para>
Follow these steps to set up your virtual environment.
These steps assume a Ubuntu distribution:
<orderedlist>
<listitem><para><emphasis>Install <filename>virtualenv</filename>:</emphasis>
Install the supported
<filename>python-virtualenv</filename> package from your
distribution rather than using <filename>pip</filename>.
<literallayout class='monospaced'>
$ sudo apt-get install python-virtualenv
</literallayout>
</para></listitem>
<listitem><para><emphasis>Create and Activate a Virtual Environment:</emphasis>
<literallayout class='monospaced'>
$ virtualenv venv
$ source venv/bin/activate
</literallayout>
</para></listitem>
</orderedlist>
<note>
After setting up a virtual environment in
which to run Toaster, you must initialize that
virtual environment each time you want to start
Toaster.
Use the following to initialize the environment just
before you start Toaster:
<literallayout class='monospaced'>
$ source venv/bin/activate
</literallayout>
</note>
</para>
</section>
<section id='toaster-load-packages'>
<title>Install Toaster Packages</title>
@@ -99,7 +54,21 @@
You need to install the packages that Toaster requires.
Use this command:
<literallayout class='monospaced'>
$ pip install -r bitbake/toaster-requirements.txt
$ $ pip3 install --user -r bitbake/toaster-requirements.txt
</literallayout>
The previous command installs the necessary Toaster modules
into a local python 3 cache in your
<filename>$HOME</filename> directory.
The caches is actually located in
<filename>$HOME/.local</filename>.
To see what packages have been installed into your
<filename>$HOME</filename> directory, do the following:
<literallayout class='monospaced'>
$ pip3 list installed --local
</literallayout>
If you need to remove something, the following works:
<literallayout class='monospaced'>
$ pip3 uninstall PackageNameToUninstall
</literallayout>
</para>
</section>

View File

@@ -367,7 +367,6 @@ RECIPE_MAINTAINER_pn-libidn = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-libinput = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-libjson = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-libksba = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-libmad = "Tanu Kaskinen <tanuk@iki.fi>"
RECIPE_MAINTAINER_pn-libmatchbox = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-libmpc = "Richard Purdie <richard.purdie@linuxfoundation.org>"
RECIPE_MAINTAINER_pn-libnewt = "Hongxu Jia <hongxu.jia@windriver.com>"
@@ -520,6 +519,7 @@ RECIPE_MAINTAINER_pn-mobile-broadband-provider-info = "Alexander Kanavin <alexan
RECIPE_MAINTAINER_pn-modutils-initscripts = "Robert Yang <liezhi.yang@windriver.com>"
RECIPE_MAINTAINER_pn-mpeg2dec = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-mpfr = "Richard Purdie <richard.purdie@linuxfoundation.org>"
RECIPE_MAINTAINER_pn-mpg123 = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-msmtp = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-mtd-utils = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-mtdev = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
@@ -759,7 +759,7 @@ RECIPE_MAINTAINER_pn-usbutils = "Alexander Kanavin <alexander.kanavin@intel.com>
RECIPE_MAINTAINER_pn-util-linux = "Chen Qi <Qi.Chen@windriver.com>"
RECIPE_MAINTAINER_pn-util-macros = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-v86d = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-vala = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-vala = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-valgrind = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-videoproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-volatile-binds = "Chen Qi <Qi.Chen@windriver.com>"

View File

@@ -78,12 +78,9 @@ SANITY_TESTED_DISTROS ?= " \
Ubuntu-15.04 \n \
Ubuntu-15.10 \n \
Ubuntu-16.04 \n \
Fedora-21 \n \
Fedora-22 \n \
Fedora-23 \n \
CentOS-6.* \n \
CentOS-7.* \n \
Debian-7.* \n \
Debian-8.* \n \
openSUSE-project-13.2 \n \
"

View File

@@ -371,16 +371,6 @@
#IPK_HIERARCHICAL_FEED = "1"
#
# Using RPM4
#
# Currently the rootfs_rpm code has a hard depends on rpmresolve:do_populate_sysroot,
# when using rpm4 the rpmresolve code will not compile due to a missing header file.
# That dependency needs to be removed when using RPM4, also the PREFERRED_VERSION needs
# to be set. This example shows how to enable rpm4
# PREFERRED_VERSION_rpm = "4.11.2"
# PREFERRED_VERSION_rpm-native = "4.11.2"
# RPMROOTFSDEPENDS_remove = "rpmresolve-native:do_populate_sysroot"
#
# Use busybox/mdev for system initialization
#

View File

@@ -40,13 +40,13 @@
"name": "OpenEmbedded",
"sourcetype": "layerindex",
"apiurl": "http://layers.openembedded.org/layerindex/api/",
"branches": ["master", "jethro", "krogoth"]
"branches": ["master"]
},
{
"name": "Imported layers",
"sourcetype": "imported",
"apiurl": "",
"branches": ["master", "jethro", "krogoth", "HEAD"]
"branches": ["master", "HEAD"]
}
],
@@ -57,18 +57,6 @@
"branch": "master",
"dirpath": "bitbake"
},
{
"name": "jethro",
"giturl": "remote:origin",
"branch": "jethro",
"dirpath": "bitbake"
},
{
"name": "krogoth",
"giturl": "remote:origin",
"branch": "krogoth",
"dirpath": "bitbake"
},
{
"name": "HEAD",
"giturl": "remote:origin",
@@ -89,24 +77,6 @@
"layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
"helptext": "Toaster will run your builds using the tip of the <a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/\">Yocto Project master branch</a>, where active development takes place. This is not a stable branch, so your builds might not work as expected."
},
{
"name": "jethro",
"description": "Yocto Project 2.0 Jethro",
"bitbake": "jethro",
"branch": "jethro",
"defaultlayers": [ "openembedded-core", "meta-yocto", "meta-yocto-bsp"],
"layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
"helptext": "Toaster will run your builds with the tip of the <a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=jethro\">Yocto Project 2.0 \"Jethro\"</a> branch."
},
{
"name": "krogoth",
"description": "Yocto Project 2.1 Krogoth",
"bitbake": "krogoth",
"branch": "krogoth",
"defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
"layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
"helptext": "Toaster will run your builds with the tip of the <a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=krogoth\">Yocto Project 2.1 \"Krogoth\"</a> branch."
},
{
"name": "local",
"description": "Local Yocto Project",

View File

@@ -9,7 +9,7 @@ SRC_URI = "file://skeleton \
"
do_compile () {
${CC} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/skeleton-test
${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/skeleton-test
}
do_install () {

View File

@@ -22,7 +22,6 @@ XSERVER ?= "xserver-xorg \
xf86-input-evdev \
xf86-video-fbdev"
PREFERRED_VERSION_u-boot ?= "v2013.07%"
UBOOT_ENTRYPOINT = "0x00000000"
KERNEL_DEVICETREE = "mpc8315erdb.dtb"

View File

@@ -7,8 +7,8 @@ KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
KMACHINE_genericx86 ?= "common-pc"
KMACHINE_genericx86-64 ?= "common-pc-64"
SRCREV_machine_genericx86 ?= "9ba8c36e9ea7419d06accab5311e7fb0d56513ff"
SRCREV_machine_genericx86-64 ?= "9ba8c36e9ea7419d06accab5311e7fb0d56513ff"
SRCREV_machine_genericx86 ?= "75d56a13f86fc48002e4a3f9ed60546db30432b7"
SRCREV_machine_genericx86-64 ?= "75d56a13f86fc48002e4a3f9ed60546db30432b7"
SRCREV_machine_edgerouter ?= "403eda4633e9037fb715d0d1e8ae847b2bd0651a"
SRCREV_machine_beaglebone ?= "859aecf685fcd9d30490a6da459fb76b48947075"
SRCREV_machine_mpc8315e-rdb ?= "403eda4633e9037fb715d0d1e8ae847b2bd0651a"

View File

@@ -7,8 +7,8 @@ KBRANCH_edgerouter = "standard/edgerouter"
KBRANCH_beaglebone = "standard/beaglebone"
KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
SRCREV_machine_genericx86 ?= "bc64c8124504681545cb97a22b69a4e4bfeb55e2"
SRCREV_machine_genericx86-64 ?= "bc64c8124504681545cb97a22b69a4e4bfeb55e2"
SRCREV_machine_genericx86 ?= "0e30a74f2cbbab0c7014561fe4eab1c9d8bfe560"
SRCREV_machine_genericx86-64 ?= "0e30a74f2cbbab0c7014561fe4eab1c9d8bfe560"
SRCREV_machine_edgerouter ?= "628bf627561c6285d99fb978e11d4c15fc29324b"
SRCREV_machine_beaglebone ?= "628bf627561c6285d99fb978e11d4c15fc29324b"
SRCREV_machine_mpc8315e-rdb ?= "94ac8da44990afd2d43c0ccd713420fb1cfa0792"

View File

@@ -312,6 +312,10 @@ autotools_do_configure() {
fi
}
autotools_do_compile() {
oe_runmake
}
autotools_do_install() {
oe_runmake 'DESTDIR=${D}' install
# Info dir listing isn't interesting at this point so remove it if it exists.
@@ -322,6 +326,6 @@ autotools_do_install() {
inherit siteconfig
EXPORT_FUNCTIONS do_configure do_install
EXPORT_FUNCTIONS do_configure do_compile do_install
B = "${WORKDIR}/build"

View File

@@ -30,7 +30,11 @@ python buildstats_summary () {
header_printed = True
bb.note("Build completion summary:")
bb.note(" {0}: {1}% sstate reuse ({2} setscene, {3} scratch)".format(t, 100*len(sstate)/(len(sstate)+len(no_sstate)), len(sstate), len(no_sstate)))
sstate_count = len(sstate)
no_sstate_count = len(no_sstate)
total_count = sstate_count + no_sstate_count
bb.note(" {0}: {1:.1f}% sstate reuse({2} setscene, {3} scratch)".format(
t, round(100 * sstate_count / total_count, 1), sstate_count, no_sstate_count))
}
addhandler buildstats_summary
buildstats_summary[eventmask] = "bb.event.BuildCompleted"

View File

@@ -124,6 +124,7 @@ cmake_do_configure() {
-Wno-dev
}
do_compile[progress] = "percent"
cmake_do_compile() {
cd ${B}
base_do_compile VERBOSE=1

View File

@@ -65,9 +65,6 @@ def devpyshell(d):
os.dup2(m, sys.stdout.fileno())
os.dup2(m, sys.stderr.fileno())
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
sys.stdin = os.fdopen(sys.stdin.fileno(), 'r', 0)
bb.utils.nonblockingfd(sys.stdout)
bb.utils.nonblockingfd(sys.stderr)
bb.utils.nonblockingfd(sys.stdin)
@@ -93,6 +90,7 @@ def devpyshell(d):
else:
prompt = ps1
sys.stdout.write(prompt)
sys.stdout.flush()
# Restore Ctrl+C since bitbake masks this
def signal_handler(signal, frame):
@@ -114,6 +112,7 @@ def devpyshell(d):
continue
except EOFError as e:
sys.stdout.write("\n")
sys.stdout.flush()
except (OSError, IOError) as e:
if e.errno == 11:
continue

View File

@@ -24,11 +24,6 @@ DEPENDS_append_class-target = " gobject-introspection gobject-introspection-nati
DEPENDS_append_class-native = " gobject-introspection-native"
DEPENDS_append_class-nativesdk = " gobject-introspection-native"
# This is necessary for python scripts to succeed - distutils fails if these
# are not set
export STAGING_INCDIR
export STAGING_LIBDIR
# This is used by introspection tools to find .gir includes
export XDG_DATA_DIRS = "${STAGING_DATADIR}"

View File

@@ -198,6 +198,17 @@ fakeroot python do_rootfs () {
from oe.rootfs import create_rootfs
from oe.manifest import create_manifest
# NOTE: if you add, remove or significantly refactor the stages of this
# process then you should recalculate the weightings here. This is quite
# easy to do - just change the MultiStageProgressReporter line temporarily
# to pass debug=True as the last parameter and you'll get a printout of
# the weightings as well as a map to the lines where next_stage() was
# called. Of course this isn't critical, but it helps to keep the progress
# reporting accurate.
stage_weights = [1, 203, 354, 186, 65, 4228, 1, 353, 49, 330, 382, 23, 1]
progress_reporter = bb.progress.MultiStageProgressReporter(d, stage_weights)
progress_reporter.next_stage()
# Handle package exclusions
excl_pkgs = d.getVar("PACKAGE_EXCLUDE", True).split()
inst_pkgs = d.getVar("PACKAGE_INSTALL", True).split()
@@ -230,8 +241,12 @@ fakeroot python do_rootfs () {
# Generate the initial manifest
create_manifest(d)
# Generate rootfs
create_rootfs(d)
progress_reporter.next_stage()
# generate rootfs
create_rootfs(d, progress_reporter=progress_reporter)
progress_reporter.finish()
}
do_rootfs[dirs] = "${TOPDIR}"
do_rootfs[cleandirs] += "${S}"
@@ -260,6 +275,36 @@ do_image_complete[dirs] = "${TOPDIR}"
do_image_complete[umask] = "022"
addtask do_image_complete after do_image before do_build
# Add image-level QA/sanity checks to IMAGE_QA_COMMANDS
#
# IMAGE_QA_COMMANDS += " \
# image_check_everything_ok \
# "
# This task runs all functions in IMAGE_QA_COMMANDS after the image
# construction has completed in order to validate the resulting image.
fakeroot python do_image_qa () {
from oe.utils import ImageQAFailed
qa_cmds = (d.getVar('IMAGE_QA_COMMANDS', True) or '').split()
qamsg = ""
for cmd in qa_cmds:
try:
bb.build.exec_func(cmd, d)
except oe.utils.ImageQAFailed as e:
qamsg = qamsg + '\tImage QA function %s failed: %s\n' % (e.name, e.description)
except bb.build.FuncFailed as e:
qamsg = qamsg + '\tImage QA function %s failed' % e.name
if e.logfile:
qamsg = qamsg + ' (log file is located at %s)' % e.logfile
qamsg = qamsg + '\n'
if qamsg:
imgname = d.getVar('IMAGE_NAME', True)
bb.fatal("QA errors found whilst validating image: %s\n%s" % (imgname, qamsg))
}
addtask do_image_qa after do_image_complete before do_build
#
# Write environment variables used by wic
# to tmp/sysroots/<machine>/imgdata/<image>.env

View File

@@ -215,7 +215,54 @@ IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES"
# Rebuild when the wks file or vars in WICVARS change
USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${COMPRESSIONTYPES}'.split()), '1', '', d)}"
do_image_wic[file-checksums] += "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"
WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"
do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}"
python do_write_wks_template () {
"""Write out expanded template contents to WKS_FULL_PATH."""
import re
template_body = d.getVar('_WKS_TEMPLATE', True)
# Remove any remnant variable references left behind by the expansion
# due to undefined variables
expand_var_regexp = re.compile(r"\${[^{}@\n\t :]+}")
while True:
new_body = re.sub(expand_var_regexp, '', template_body)
if new_body == template_body:
break
else:
template_body = new_body
wks_file = d.getVar('WKS_FULL_PATH', True)
with open(wks_file, 'w') as f:
f.write(template_body)
}
python () {
if d.getVar('USING_WIC', True):
wks_file_u = d.getVar('WKS_FULL_PATH', False)
wks_file = d.expand(wks_file_u)
base, ext = os.path.splitext(wks_file)
if ext == '.in' and os.path.exists(wks_file):
wks_out_file = os.path.join(d.getVar('WORKDIR', True), os.path.basename(base))
d.setVar('WKS_FULL_PATH', wks_out_file)
d.setVar('WKS_TEMPLATE_PATH', wks_file_u)
d.setVar('WKS_FILE_CHECKSUM', '${WKS_TEMPLATE_PATH}:True')
try:
with open(wks_file, 'r') as f:
body = f.read()
except (IOError, OSError) as exc:
pass
else:
# Previously, I used expandWithRefs to get the dependency list
# and add it to WICVARS, but there's no point re-parsing the
# file in process_wks_template as well, so just put it in
# a variable and let the metadata deal with the deps.
d.setVar('_WKS_TEMPLATE', body)
bb.build.addtask('do_write_wks_template', 'do_image_wic', None, d)
}
EXTRA_IMAGECMD = ""

View File

@@ -30,6 +30,8 @@ PACKAGESPLITFUNCS_prepend = "split_kernel_module_packages "
KERNEL_MODULES_META_PACKAGE ?= "kernel-modules"
KERNEL_MODULE_PACKAGE_PREFIX ?= ""
python split_kernel_module_packages () {
import re
@@ -181,7 +183,9 @@ python split_kernel_module_packages () {
module_deps = parse_depmod()
module_regex = '^(.*)\.k?o$'
module_pattern = 'kernel-module-%s'
module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX', True)
module_pattern = module_pattern_prefix + 'kernel-module-%s'
postinst = d.getVar('pkg_postinst_modules', True)
postrm = d.getVar('pkg_postrm_modules', True)

View File

@@ -232,8 +232,7 @@ do_bundle_initramfs () {
if [ -n "$realpath" ]; then
mv -f $realpath $realpath.initramfs
mv -f $realpath.bak $realpath
cd ${B}/${KERNEL_OUTPUT_DIR}
ln -sf $linkpath.initramfs
ln -sf $linkpath.initramfs ${B}/${KERNEL_OUTPUT_DIR}/$type.initramfs
else
mv -f ${KERNEL_OUTPUT_DIR}/$type ${KERNEL_OUTPUT_DIR}/$type.initramfs
mv -f ${KERNEL_OUTPUT_DIR}/$type.bak ${KERNEL_OUTPUT_DIR}/$type
@@ -586,8 +585,7 @@ kernel_do_deploy() {
initramfs_base_name=${type}-${INITRAMFS_BASE_NAME}
initramfs_symlink_name=${type}-initramfs-${MACHINE}
install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.initramfs ${DEPLOYDIR}/${initramfs_base_name}.bin
cd ${DEPLOYDIR}
ln -sf ${initramfs_base_name}.bin ${initramfs_symlink_name}.bin
ln -sf ${initramfs_base_name}.bin ${DEPLOYDIR}/${initramfs_symlink_name}.bin
fi
done
}

View File

@@ -47,15 +47,6 @@ python __anonymous () {
OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
do_configure_prepend() {
if [ -e ${S}/elf/ldd.bash.in ]; then
sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
fi
}
# indentation removed on purpose
locale_base_postinst() {
#!/bin/sh
@@ -63,33 +54,14 @@ if [ "x$D" != "x" ]; then
exit 1
fi
rm -rf ${TMP_LOCALE}
mkdir -p ${TMP_LOCALE}
if [ -f ${localedir}/locale-archive ]; then
cp ${localedir}/locale-archive ${TMP_LOCALE}/
fi
localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s --prefix=/tmp/locale %s
mkdir -p ${localedir}/
mv ${TMP_LOCALE}/locale-archive ${localedir}/
rm -rf ${TMP_LOCALE}
localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s %s
}
# indentation removed on purpose
locale_base_postrm() {
#!/bin/sh
rm -rf ${TMP_LOCALE}
mkdir -p ${TMP_LOCALE}
if [ -f ${localedir}/locale-archive ]; then
cp ${localedir}/locale-archive ${TMP_LOCALE}/
fi
localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s --prefix=/tmp/locale %s
mv ${TMP_LOCALE}/locale-archive ${localedir}/
rm -rf ${TMP_LOCALE}
localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s %s
}
TMP_LOCALE="/tmp/locale${localedir}"
LOCALETREESRC ?= "${PKGD}"
do_prep_locale_tree() {
@@ -290,7 +262,7 @@ python package_do_split_gconvs () {
bb.error("locale_arch_options not found for target_arch=" + target_arch)
raise bb.build.FuncFailed("unknown arch:" + target_arch + " for locale_arch_options")
localedef_opts += " --force --old-style --no-archive --prefix=%s \
localedef_opts += " --force --no-archive --prefix=%s \
--inputfile=%s/%s/i18n/locales/%s --charmap=%s %s/%s" \
% (treedir, treedir, datadir, locale, encoding, outputpath, name)
@@ -298,7 +270,7 @@ python package_do_split_gconvs () {
(path, i18npath, gconvpath, localedef_opts)
else: # earlier slower qemu way
qemu = qemu_target_binary(d)
localedef_opts = "--force --old-style --no-archive --prefix=%s \
localedef_opts = "--force --no-archive --prefix=%s \
--inputfile=%s/i18n/locales/%s --charmap=%s %s" \
% (treedir, datadir, locale, encoding, name)

View File

@@ -668,8 +668,6 @@ do_rootfs[recrdeptask] += "do_populate_lic"
IMAGE_POSTPROCESS_COMMAND_prepend = "write_deploy_manifest; "
do_image[recrdeptask] += "do_populate_lic"
do_populate_lic_setscene[dirs] = "${LICSSTATEDIR}/${PN}"
do_populate_lic_setscene[cleandirs] = "${LICSSTATEDIR}"
python do_populate_lic_setscene () {
sstate_setscene(d)
}

View File

@@ -39,7 +39,7 @@ SDK_UPDATE_URL ?= ""
SDK_TARGETS ?= "${PN}"
def get_sdk_install_targets(d):
def get_sdk_install_targets(d, images_only=False):
sdk_install_targets = ''
if d.getVar('SDK_EXT_TYPE', True) != 'minimal':
sdk_install_targets = d.getVar('SDK_TARGETS', True)
@@ -50,8 +50,9 @@ def get_sdk_install_targets(d):
if v[0] not in sdk_install_targets:
sdk_install_targets += ' {}'.format(v[0])
if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1':
sdk_install_targets += ' meta-world-pkgdata:do_allpackagedata'
if not images_only:
if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1':
sdk_install_targets += ' meta-world-pkgdata:do_allpackagedata'
return sdk_install_targets
@@ -223,10 +224,13 @@ python copy_buildsystem () {
# warning.
f.write('SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK = "none"\n\n')
# Error if the sigs in the locked-signature file don't match
# Warn if the sigs in the locked-signature file don't match
# the sig computed from the metadata.
f.write('SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "warn"\n\n')
# Set up whitelist for run on install
f.write('BB_SETSCENE_ENFORCE_WHITELIST = "%:* *:do_shared_workdir *:do_rm_work"\n\n')
# Hide the config information from bitbake output (since it's fixed within the SDK)
f.write('BUILDCFG_HEADER = ""\n')
@@ -280,7 +284,7 @@ python copy_buildsystem () {
f.write('\n')
# Filter the locked signatures file to just the sstate tasks we are interested in
excluded_targets = d.getVar('SDK_TARGETS', True)
excluded_targets = get_sdk_install_targets(d, images_only=True)
sigfile = d.getVar('WORKDIR', True) + '/locked-sigs.inc'
lockedsigs_pruned = baseoutpath + '/conf/locked-sigs.inc'
oe.copy_buildsystem.prune_lockedsigs([],
@@ -424,7 +428,7 @@ sdk_ext_postinst() {
# current working directory when first ran, nor will it set $1 when
# sourcing a script. That is why this has to look so ugly.
LOGFILE="$target_sdk_dir/preparing_build_system.log"
sh -c ". buildtools/environment-setup* > $LOGFILE && cd $target_sdk_dir/`dirname ${oe_init_build_env_path}` && set $target_sdk_dir && . $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> $LOGFILE && python $target_sdk_dir/ext-sdk-prepare.py '${SDK_INSTALL_TARGETS}' >> $LOGFILE 2>&1" || { echo "ERROR: SDK preparation failed: see $LOGFILE"; cat "$LOGFILE"; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
sh -c ". buildtools/environment-setup* > $LOGFILE && cd $target_sdk_dir/`dirname ${oe_init_build_env_path}` && set $target_sdk_dir && . $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> $LOGFILE && python $target_sdk_dir/ext-sdk-prepare.py '${SDK_INSTALL_TARGETS}' >> $LOGFILE 2>&1" || { echo "ERROR: SDK preparation failed: see $LOGFILE for a slightly more detailed log"; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
rm $target_sdk_dir/ext-sdk-prepare.py
fi
echo done
@@ -447,7 +451,13 @@ fakeroot python do_populate_sdk_ext() {
}
def get_ext_sdk_depends(d):
return d.getVarFlag('do_rootfs', 'depends', True) + ' ' + d.getVarFlag('do_build', 'depends', True)
# Note: the deps varflag is a list not a string, so we need to specify expand=False
deps = d.getVarFlag('do_image_complete', 'deps', False)
pn = d.getVar('PN', True)
deplist = ['%s:%s' % (pn, dep) for dep in deps]
for task in ['do_image_complete', 'do_rootfs', 'do_build']:
deplist.extend((d.getVarFlag(task, 'depends', True) or '').split())
return ' '.join(deplist)
python do_sdk_depends() {
# We have to do this separately in its own task so we avoid recursing into

View File

@@ -2,4 +2,12 @@ inherit python3-dir
PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}"
EXTRANATIVEPATH += "${PYTHON_PN}-native"
DEPENDS += " ${PYTHON_PN}-native "
DEPENDS_append = " ${PYTHON_PN}-native "
# python-config and other scripts are using distutils modules
# which we patch to access these variables
export STAGING_INCDIR
export STAGING_LIBDIR
# autoconf macros will use their internal default preference otherwise
export PYTHON

View File

@@ -5,4 +5,12 @@ PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}"
# PYTHON_EXECUTABLE is used by cmake
PYTHON_EXECUTABLE="${PYTHON}"
EXTRANATIVEPATH += "${PYTHON_PN}-native"
DEPENDS += " ${PYTHON_PN}-native "
DEPENDS_append = " ${PYTHON_PN}-native "
# python-config and other scripts are using distutils modules
# which we patch to access these variables
export STAGING_INCDIR
export STAGING_LIBDIR
# autoconf macros will use their internal default preference otherwise
export PYTHON

View File

@@ -59,9 +59,11 @@ python errorreport_handler () {
logFile = codecs.open(log, 'r', 'utf-8')
logdata = logFile.read()
topdir = e.data.getVar('TOPDIR', True)
if topdir:
logdata = logdata.replace(topdir, ' ')
# Replace host-specific paths so the logs are cleaner
for d in ("TOPDIR", "TMPDIR"):
s = e.data.getVar(d, True)
if s:
logdata = logdata.replace(s, d)
logFile.close()
except:

View File

@@ -45,6 +45,15 @@ systemd_create_users () {
[ "$id" != "-" ] && groupadd_params="$groupadd_params --gid $id"
groupadd_params="$groupadd_params --system $name"
eval groupadd --root ${IMAGE_ROOTFS} $groupadd_params || true
elif [ "$type" = "m" ]; then
group=$id
if [ ! `grep -q "^${group}:" ${IMAGE_ROOTFS}${sysconfdir}/group` ]; then
eval groupadd --root ${IMAGE_ROOTFS} --system $group
fi
if [ ! `grep -q "^${name}:" ${IMAGE_ROOTFS}${sysconfdir}/passwd` ]; then
eval useradd --root ${IMAGE_ROOTFS} --shell /sbin/nologin --system $name
fi
eval usermod --root ${IMAGE_ROOTFS} -a -G $group $name
fi
done
done

View File

@@ -17,6 +17,9 @@ SSTATE_EXTRAPATH = ""
SSTATE_EXTRAPATHWILDCARD = ""
SSTATE_PATHSPEC = "${SSTATE_DIR}/${SSTATE_EXTRAPATHWILDCARD}*/${SSTATE_PKGSPEC}"
# explicitly make PV to depend on evaluated value of PV variable
PV[vardepvalue] = "${PV}"
# We don't want the sstate to depend on things like the distro string
# of the system, we let the sstate paths take care of this.
SSTATE_EXTRAPATH[vardepvalue] = ""
@@ -719,6 +722,7 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
ret = []
missed = []
missing = []
extension = ".tgz"
if siginfo:
extension = extension + ".siginfo"
@@ -740,6 +744,18 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
return spec, extrapath, tname
def sstate_pkg_to_pn(pkg, d):
"""
Translate an sstate filename to a PN value by way of SSTATE_PKGSPEC. This is slightly hacky but
we don't have access to everything in this context.
"""
pkgspec = d.getVar('SSTATE_PKGSPEC', False)
try:
idx = pkgspec.split(':').index('${PN}')
except ValueError:
bb.fatal('Unable to find ${PN} in SSTATE_PKGSPEC')
return pkg.split(':')[idx]
for task in range(len(sq_fn)):
@@ -774,6 +790,8 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
if localdata.getVar('BB_NO_NETWORK', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "1":
localdata.delVar('BB_NO_NETWORK')
whitelist = bb.runqueue.get_setscene_enforce_whitelist(d)
from bb.fetch2 import FetchConnectionCache
def checkstatus_init(thread_worker):
thread_worker.connection_cache = FetchConnectionCache()
@@ -800,7 +818,14 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
except:
missed.append(task)
bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri)
pass
if whitelist:
pn = sstate_pkg_to_pn(sstatefile, d)
taskname = sq_task[task]
if not bb.runqueue.check_setscene_enforce_whitelist(pn, taskname, whitelist):
missing.append(task)
bb.error('Sstate artifact unavailable for %s.%s' % (pn, taskname))
pass
bb.event.fire(bb.event.ProcessProgress("Checking sstate mirror object availability", len(tasklist) - thread_worker.tasks.qsize()), d)
tasklist = []
for task in range(len(sq_fn)):
@@ -811,7 +836,7 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
tasklist.append((task, sstatefile))
if tasklist:
bb.note("Checking sstate mirror object availability (for %s objects)" % len(tasklist))
bb.event.fire(bb.event.ProcessStarted("Checking sstate mirror object availability", len(tasklist)), d)
import multiprocessing
nproc = min(multiprocessing.cpu_count(), len(tasklist))
@@ -821,6 +846,9 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
pool.add_task(checkstatus, t)
pool.start()
pool.wait_completion()
bb.event.fire(bb.event.ProcessFinished("Checking sstate mirror object availability"), d)
if whitelist and missing:
bb.fatal('Required artifacts were unavailable - exiting')
inheritlist = d.getVar("INHERIT", True)
if "toaster" in inheritlist:

View File

@@ -8,7 +8,7 @@
# To use it add testimage to global inherit and call your target image with -c testimage
# You can try it out like this:
# - first build a qemu core-image-sato
# - add INHERIT += "testimage" in local.conf
# - add IMAGE_CLASSES += "testimage" in local.conf
# - then bitbake core-image-sato -c testimage. That will run a standard suite of tests.
# You can set (or append to) TEST_SUITES in local.conf to select the tests
@@ -51,16 +51,13 @@ DEFAULT_TEST_SUITES_pn-core-image-sato = "${NETTESTSUITE} connman xorg parselogs
DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "${NETTESTSUITE} connman xorg perl python \
${DEVTESTSUITE} parselogs ${RPMTESTSUITE}"
DEFAULT_TEST_SUITES_pn-core-image-lsb-dev = "${NETTESTSUITE} pam perl python parselogs ${RPMTESTSUITE}"
DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcvs buildiptables buildsudoku \
DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcvs buildiptables buildgalculator \
connman ${DEVTESTSUITE} pam perl python parselogs ${RPMTESTSUITE}"
DEFAULT_TEST_SUITES_pn-meta-toolchain = "auto"
# aarch64 has no graphics
DEFAULT_TEST_SUITES_remove_aarch64 = "xorg"
#qemumips is too slow for buildsudoku
DEFAULT_TEST_SUITES_remove_qemumips = "buildsudoku"
TEST_SUITES ?= "${DEFAULT_TEST_SUITES}"
TEST_QEMUBOOT_TIMEOUT ?= "1000"

View File

@@ -65,7 +65,7 @@ def testsdk_main(d):
try:
subprocess.check_output("cd %s; %s <<EOF\n./tc\nY\nEOF" % (sdktestdir, tcname), shell=True)
except subprocess.CalledProcessError as e:
bb.fatal("Couldn't install the SDK:\n%s" % e.output)
bb.fatal("Couldn't install the SDK:\n%s" % e.output.decode("utf-8"))
try:
run_test_context(SDKTestContext, d, sdktestdir, tcname, pn)
@@ -113,10 +113,18 @@ def testsdkext_main(d):
testdir = d.expand("${WORKDIR}/testsdkext/")
bb.utils.remove(testdir, True)
bb.utils.mkdirhier(testdir)
sdkdir = os.path.join(testdir, 'tc')
try:
subprocess.check_output("%s -y -d %s/tc" % (tcname, testdir), shell=True)
subprocess.check_output("%s -y -d %s" % (tcname, sdkdir), shell=True)
except subprocess.CalledProcessError as e:
bb.fatal("Couldn't install the SDK EXT:\n%s" % e.output)
msg = "Couldn't install the extensible SDK:\n%s" % e.output.decode("utf-8")
logfn = os.path.join(sdkdir, 'preparing_build_system.log')
if os.path.exists(logfn):
msg += '\n\nContents of preparing_build_system.log:\n'
with open(logfn, 'r') as f:
for line in f:
msg += line
bb.fatal(msg)
try:
bb.plain("Running SDK Compatibility tests ...")

View File

@@ -136,60 +136,16 @@ python toaster_package_dumpdata() {
# 2. Dump output image files information
python toaster_image_dumpdata() {
"""
Image filename for output images is not standardized.
image_types.bbclass will spell out IMAGE_CMD_xxx variables that actually
have hardcoded ways to create image file names in them.
So we look for files starting with the set name.
We also look for other files in the images/ directory which don't
match IMAGE_NAME, such as the kernel bzImage, modules tarball etc.
"""
dir_to_walk = d.getVar('DEPLOY_DIR_IMAGE', True);
image_name = d.getVar('IMAGE_NAME', True);
image_info_data = {}
artifact_info_data = {}
# collect all images and artifacts in the images directory
for dirpath, dirnames, filenames in os.walk(dir_to_walk):
for filename in filenames:
full_path = os.path.join(dirpath, filename)
try:
if filename.startswith(image_name):
# image
image_info_data[full_path] = os.stat(full_path).st_size
else:
# other non-image artifact
if not os.path.islink(full_path):
artifact_info_data[full_path] = os.stat(full_path).st_size
except OSError as e:
bb.event.fire(bb.event.MetadataEvent("OSErrorException", e), d)
bb.event.fire(bb.event.MetadataEvent("ImageFileSize", image_info_data), d)
bb.event.fire(bb.event.MetadataEvent("ArtifactFileSize", artifact_info_data), d)
}
python toaster_artifact_dumpdata() {
"""
Dump data about artifacts in the SDK_DEPLOY directory
Dump data about SDK variables
"""
dir_to_walk = d.getVar("SDK_DEPLOY", True)
artifact_info_data = {}
event_data = {
"TOOLCHAIN_OUTPUTNAME": d.getVar("TOOLCHAIN_OUTPUTNAME", True)
}
# collect all artifacts in the sdk directory
for dirpath, dirnames, filenames in os.walk(dir_to_walk):
for filename in filenames:
full_path = os.path.join(dirpath, filename)
try:
if not os.path.islink(full_path):
artifact_info_data[full_path] = os.stat(full_path).st_size
except OSError as e:
bb.event.fire(bb.event.MetadataEvent("OSErrorException", e), d)
bb.event.fire(bb.event.MetadataEvent("ArtifactFileSize", artifact_info_data), d)
bb.event.fire(bb.event.MetadataEvent("SDKArtifactInfo", event_data), d)
}
# collect list of buildstats files based on fired events; when the build completes, collect all stats and fire an event with collected data
@@ -332,15 +288,22 @@ python toaster_buildhistory_dump() {
images[target][dependsname] = {'size': 0, 'depends' : []}
images[target][pname]['depends'].append((dependsname, deptype))
with open("%s/files-in-image.txt" % installed_img_path, "r") as fin:
for line in fin:
lc = [ x for x in line.strip().split(" ") if len(x) > 0 ]
if lc[0].startswith("l"):
files[target]['syms'].append(lc)
elif lc[0].startswith("d"):
files[target]['dirs'].append(lc)
else:
files[target]['files'].append(lc)
# files-in-image.txt is only generated if an image file is created,
# so the file entries ('syms', 'dirs', 'files') for a target will be
# empty for rootfs builds and other "image" tasks which don't
# produce image files
# (e.g. "bitbake core-image-minimal -c populate_sdk")
files_in_image_path = "%s/files-in-image.txt" % installed_img_path
if os.path.exists(files_in_image_path):
with open(files_in_image_path, "r") as fin:
for line in fin:
lc = [ x for x in line.strip().split(" ") if len(x) > 0 ]
if lc[0].startswith("l"):
files[target]['syms'].append(lc)
elif lc[0].startswith("d"):
files[target]['dirs'].append(lc)
else:
files[target]['files'].append(lc)
for pname in images[target]:
if not pname in allpkgs:
@@ -361,17 +324,6 @@ python toaster_buildhistory_dump() {
}
# dump information related to license manifest path
python toaster_licensemanifest_dump() {
deploy_dir = d.getVar('DEPLOY_DIR', True);
image_name = d.getVar('IMAGE_NAME', True);
data = { 'deploy_dir' : deploy_dir, 'image_name' : image_name }
bb.event.fire(bb.event.MetadataEvent("LicenseManifestPath", data), d)
}
# set event handlers
addhandler toaster_layerinfo_dumpdata
toaster_layerinfo_dumpdata[eventmask] = "bb.event.TreeDataPreparationCompleted"
@@ -388,11 +340,8 @@ do_packagedata_setscene[vardepsexclude] += "toaster_package_dumpdata "
do_package[postfuncs] += "toaster_package_dumpdata "
do_package[vardepsexclude] += "toaster_package_dumpdata "
do_image_complete[postfuncs] += "toaster_image_dumpdata "
do_image_complete[vardepsexclude] += "toaster_image_dumpdata "
do_rootfs[postfuncs] += "toaster_licensemanifest_dump "
do_rootfs[vardepsexclude] += "toaster_licensemanifest_dump "
do_populate_sdk[postfuncs] += "toaster_artifact_dumpdata "
do_populate_sdk[vardepsexclude] += "toaster_artifact_dumpdata "
do_populate_sdk_ext[postfuncs] += "toaster_artifact_dumpdata "
do_populate_sdk_ext[vardepsexclude] += "toaster_artifact_dumpdata "

View File

@@ -8,7 +8,8 @@ TARGET_CC_ARCH_append_libc-musl = " -mmusl"
# This function creates an environment-setup-script for use in a deployable SDK
toolchain_create_sdk_env_script () {
# Create environment setup script
# Create environment setup script. Remember that $SDKTARGETSYSROOT should
# only be expanded on the target at runtime.
base_sbindir=${10:-${base_sbindir_nativesdk}}
base_bindir=${9:-${base_bindir_nativesdk}}
sbindir=${8:-${sbindir_nativesdk}}
@@ -29,7 +30,7 @@ toolchain_create_sdk_env_script () {
echo "export PATH=$sdkpathnative$bindir:$sdkpathnative$sbindir:$sdkpathnative$base_bindir:$sdkpathnative$base_sbindir:$sdkpathnative$bindir/../${HOST_SYS}/bin:$sdkpathnative$bindir/${TARGET_SYS}"$EXTRAPATH':$PATH' >> $script
echo "export CCACHE_PATH=$sdkpathnative$bindir:$sdkpathnative$bindir/../${HOST_SYS}/bin:$sdkpathnative$bindir/${TARGET_SYS}"$EXTRAPATH':$CCACHE_PATH' >> $script
echo 'export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT' >> $script
echo 'export PKG_CONFIG_PATH=$SDKTARGETSYSROOT'"$libdir"'/pkgconfig' >> $script
echo 'export PKG_CONFIG_PATH=$SDKTARGETSYSROOT'"$libdir"'/pkgconfig:$SDKTARGETSYSROOT'"$prefix"'/share/pkgconfig' >> $script
echo 'export CONFIG_SITE=${SDKPATH}/site-config-'"${multimach_target_sys}" >> $script
echo "export OECORE_NATIVE_SYSROOT=\"$sdkpathnative\"" >> $script
echo 'export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script

View File

@@ -3,7 +3,7 @@
# The format to specify it, in the machine, is:
#
# UBOOT_CONFIG ??= <default>
# UBOOT_CONFIG[foo] = "config,images"
# UBOOT_CONFIG[foo] = "config,images,binary"
#
# or
#
@@ -11,9 +11,13 @@
#
# Copyright 2013, 2014 (C) O.S. Systems Software LTDA.
UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}"
python () {
ubootmachine = d.getVar("UBOOT_MACHINE", True)
ubootconfigflags = d.getVarFlags('UBOOT_CONFIG')
ubootbinary = d.getVar('UBOOT_BINARY', True)
ubootbinaries = d.getVar('UBOOT_BINARIES', True)
# The "doc" varflag is special, we don't want to see it here
ubootconfigflags.pop('doc', None)
@@ -27,6 +31,9 @@ python () {
if ubootmachine and ubootconfigflags:
raise bb.parse.SkipPackage("You cannot use UBOOT_MACHINE and UBOOT_CONFIG at the same time.")
if ubootconfigflags and ubootbinaries:
raise bb.parse.SkipPackage("You cannot use UBOOT_BINARIES as it is internal to uboot_config.bbclass.")
if not ubootconfigflags:
return
@@ -36,13 +43,19 @@ python () {
for f, v in ubootconfigflags.items():
if config == f:
items = v.split(',')
if items[0] and len(items) > 2:
raise bb.parse.SkipPackage('Only config,images can be specified!')
if items[0] and len(items) > 3:
raise bb.parse.SkipPackage('Only config,images,binary can be specified!')
d.appendVar('UBOOT_MACHINE', ' ' + items[0])
# IMAGE_FSTYPES appending
if len(items) > 1 and items[1]:
bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
if len(items) > 2 and items[2]:
bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % items[2])
d.appendVar('UBOOT_BINARIES', ' ' + items[2])
else:
bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % ubootbinary)
d.appendVar('UBOOT_BINARIES', ' ' + ubootbinary)
break
elif len(ubootconfig) == 0:
raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')

View File

@@ -43,7 +43,7 @@ def update_useradd_static_config(d):
if fields[0] not in id_table:
id_table[fields[0]] = fields
else:
id_table[fields[0]] = list(itertools.imap(lambda x, y: x or y, fields, id_table[fields[0]]))
id_table[fields[0]] = list(map(lambda x, y: x or y, fields, id_table[fields[0]]))
except IOError as e:
if e.errno == errno.ENOENT:
pass

View File

@@ -15,7 +15,7 @@ BASELIB_powerpc64 = "lib64"
# Path prefixes
export base_prefix = ""
export prefix = "/usr"
export exec_prefix = "/usr"
export exec_prefix = "${prefix}"
# Base paths
export base_bindir = "${base_prefix}/bin"
@@ -450,10 +450,10 @@ CCACHE ??= ""
# Disable ccache explicitly if CCACHE is null since gcc may be a symlink
# of ccache some distributions (e.g., Fedora 17).
export CCACHE_DISABLE ??= "${@[0,1][d.getVar('CCACHE', True) == '']}"
# Assign CCACHE_DIR a default value to fix a bug of ccache 3.1.7,
# since it would always create CCACHE_DIR/.ccache even if
# CCACHE_DISABLE = 1.
export CCACHE_DIR ??= "${@os.getenv('HOME')}"
# ccache < 3.1.10 will create CCACHE_DIR on startup even if disabled, and
# autogen sets HOME=/dev/null so in certain situations builds can fail.
# Explicitly export CCACHE_DIR until we can assume ccache >3.1.10 on the host.
export CCACHE_DIR ??= "${@os.getenv('HOME')}/.ccache"
TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
@@ -522,12 +522,7 @@ export BUILD_LDFLAGS = "-L${STAGING_LIBDIR_NATIVE} \
-Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE} \
-Wl,-O1"
BUILDSDK_LDFLAGS = "-L${STAGING_LIBDIR} \
-Wl,-rpath-link,${STAGING_LIBDIR} \
-Wl,-rpath,${libdir} -Wl,-O1 \
-L${STAGING_DIR_HOST}${base_libdir} \
-Wl,-rpath-link,${STAGING_DIR_HOST}${base_libdir} \
-Wl,-rpath,${base_libdir} -Wl,-O1"
BUILDSDK_LDFLAGS = "-Wl,-O1"
LINKER_HASH_STYLE ??= "gnu"
# mips does not support GNU hash style therefore we override
@@ -817,12 +812,14 @@ BB_HASHCONFIG_WHITELIST ?= "${BB_HASHBASE_WHITELIST} DATE TIME SSH_AGENT_PID \
SSH_AUTH_SOCK PSEUDO_BUILD BB_ENV_EXTRAWHITE DISABLE_SANITY_CHECKS \
PARALLEL_MAKE BB_NUMBER_THREADS BB_ORIGENV BB_INVALIDCONF BBINCLUDED \
GIT_PROXY_COMMAND ALL_PROXY all_proxy NO_PROXY no_proxy FTP_PROXY ftp_proxy \
HTTP_PROXY http_proxy HTTPS_PROXY https_proxy SOCKS5_USER SOCKS5_PASSWD"
HTTP_PROXY http_proxy HTTPS_PROXY https_proxy SOCKS5_USER SOCKS5_PASSWD \
BB_SETSCENE_ENFORCE"
BB_SIGNATURE_EXCLUDE_FLAGS ?= "doc deps depends \
lockfiles type vardepsexclude vardeps vardepvalue vardepvalueexclude \
file-checksums python func task export unexport noexec nostamp dirs cleandirs \
sstate-lockfile-shared prefuncs postfuncs export_func deptask rdeptask \
recrdeptask nodeprrecs stamp-extra-info sstate-outputdirs filename lineno"
recrdeptask nodeprrecs stamp-extra-info sstate-outputdirs filename lineno \
progress"
MLPREFIX ??= ""
MULTILIB_VARIANTS ??= ""

View File

@@ -46,7 +46,6 @@ DISTRO_PN_ALIAS_pn-connman-gnome = "Intel"
DISTRO_PN_ALIAS_pn-console-tools = "Debian=console-tools Ubuntu=console-tools"
DISTRO_PN_ALIAS_pn-core-image-base = "OE-Core"
DISTRO_PN_ALIAS_pn-core-image-clutter = "OE-Core"
DISTRO_PN_ALIAS_pn-core-image-directfb = "OE-Core"
DISTRO_PN_ALIAS_pn-core-image-full-cmdline = "OE-Core"
DISTRO_PN_ALIAS_pn-core-image-kernel-dev = "OE-Core"
DISTRO_PN_ALIAS_pn-core-image-lsb = "OE-Core"
@@ -75,7 +74,6 @@ DISTRO_PN_ALIAS_pn-db = "Debian=db5.1 Ubuntu=db5.1"
DISTRO_PN_ALIAS_pn-dbus-test = "Fedora=dbus Ubuntu=dbus"
DISTRO_PN_ALIAS_pn-dbus-wait = "OpenedHand"
DISTRO_PN_ALIAS_pn-depmodwrapper-cross = "OE-Core"
DISTRO_PN_ALIAS_pn-directfb-examples = "Debian=directfb Fedora=directfb"
DISTRO_PN_ALIAS_pn-distcc = "Debian=distcc Fedora=distcc"
DISTRO_PN_ALIAS_pn-distcc-config = "OpenedHand"
DISTRO_PN_ALIAS_pn-dmxproto = "Meego=xorg-x11-proto-dmxproto Ubuntu=x11proto-dmx Debian=x11proto-dmx"
@@ -216,7 +214,6 @@ DISTRO_PN_ALIAS_pn-libxft = "Mandriva=libxft Debian=libxft2 Ubuntu=libxft2"
DISTRO_PN_ALIAS_pn-libxi = "Ubuntu=libxi Fedora=libXi"
DISTRO_PN_ALIAS_pn-libxkbcommon = "Fedora=libxkbcommon Debian=libxkbcommon"
DISTRO_PN_ALIAS_pn-libxscrnsaver = "Fedora=libXScrnSaver Ubuntu=libxss1 Mandriva=libxscrnsaver"
DISTRO_PN_ALIAS_pn-libxsettings-client = "Debian=libxsettings-client0 Ubuntu=libxsettings-client0 Mandriva=libXsettings-client0"
DISTRO_PN_ALIAS_pn-libxxf86misc = "Mandriva=libxxf86misc Fedora=libXxf86misc"
DISTRO_PN_ALIAS_pn-linux-dummy = "Intel"
DISTRO_PN_ALIAS_pn-linux-firmware = "Fedora=linux-firmware Ubuntu=linux-firmware"
@@ -288,7 +285,6 @@ DISTRO_PN_ALIAS_pn-packagegroup-core-boot = "OE-Core"
DISTRO_PN_ALIAS_pn-packagegroup-core-buildessential = "OE-Core"
DISTRO_PN_ALIAS_pn-packagegroup-core-clutter = "OE-Core"
DISTRO_PN_ALIAS_pn-packagegroup-core-device-devel = "OE-Core"
DISTRO_PN_ALIAS_pn-packagegroup-core-directfb = "OE-Core"
DISTRO_PN_ALIAS_pn-packagegroup-core-eclipse-debug = "OE-Core"
DISTRO_PN_ALIAS_pn-packagegroup-core-full-cmdline = "OE-Core"
DISTRO_PN_ALIAS_pn-packagegroup-core-lsb = "OE-Core"

View File

@@ -43,7 +43,7 @@ SECURITY_CFLAGS_pn-flac = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-flex = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-gcc = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-gcc-runtime = ""
SECURITY_CFLAGS_pn-gcc-sanitizers = ""
SECURITY_CFLAGS_pn-gcc-sanitizers = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-gdb = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-gmp = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-gnutls = "${SECURITY_NO_PIE_CFLAGS}"
@@ -62,9 +62,10 @@ SECURITY_CFLAGS_pn-kexec-tools = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-iptables = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-libaio = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-libcap = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-libgcc = ""
SECURITY_CFLAGS_pn-libgcc = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-libid3tag = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-libnewt = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-libnewt-python = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-libglu = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-libpcap = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-libpcre = "${SECURITY_NO_PIE_CFLAGS}"
@@ -80,6 +81,7 @@ SECURITY_CFLAGS_pn-python-pycurl = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python-smartpm = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python-numpy = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python3-numpy = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python3-pycairo = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python3 = "${SECURITY_NO_PIE_CFLAGS}"
# Revert RPM to using internally supported values
SECURITY_CFLAGS_pn-rpm = "${lcl_maybe_fortify} -fstack-protector"
@@ -109,10 +111,8 @@ TARGET_CFLAGS_append_class-target = " ${SECURITY_CFLAGS}"
TARGET_LDFLAGS_append_class-target = " ${SECURITY_LDFLAGS}"
SECURITY_LDFLAGS_remove_pn-gcc-runtime = "-fstack-protector-strong"
SECURITY_LDFLAGS_remove_pn-gcc-sanitizers = "-fstack-protector-strong"
SECURITY_LDFLAGS_remove_pn-glibc = "-fstack-protector-strong"
SECURITY_LDFLAGS_remove_pn-glibc-initial = "-fstack-protector-strong"
SECURITY_LDFLAGS_remove_pn-libgcc = "-fstack-protector-strong"
SECURITY_LDFLAGS_remove_pn-uclibc = "-fstack-protector-strong"
SECURITY_LDFLAGS_remove_pn-uclibc-initial = "-fstack-protector-strong"
SECURITY_LDFLAGS_pn-xf86-video-fbdev = "${SECURITY_X_LDFLAGS}"

View File

@@ -12,3 +12,6 @@ PACKAGE_EXTRA_ARCHS_tune-ppce500mc = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppce50
# glibc configure options to get e500mc specific library (for sqrt)
GLIBC_EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'ppce500mc', '-with-cpu=e500mc', '', d)}"
# pass -mcpu=e500mc for ppce500mc kernel cross compile
TARGET_CC_KERNEL_ARCH = "-mcpu=e500mc"

View File

@@ -27,22 +27,6 @@ def exec_watch(cmd, **options):
return process.returncode, buf
def check_unexpected(lines, recipes):
"""Check for unexpected output lines from dry run"""
unexpected = []
for line in lines.splitlines():
if 'Running task' in line:
for recipe in recipes:
if recipe in line:
break
else:
line = line.split('Running', 1)[-1]
if 'do_rm_work' not in line:
unexpected.append(line.rstrip())
elif 'Running setscene' in line:
unexpected.append(line.rstrip())
return unexpected
def main():
if len(sys.argv) < 2:
sdk_targets = []
@@ -55,44 +39,10 @@ def main():
print('Preparing SDK for %s...' % ', '.join(sdk_targets))
ret, out = exec_watch('bitbake %s --setscene-only' % ' '.join(sdk_targets))
ret, out = exec_watch('BB_SETSCENE_ENFORCE=1 bitbake %s' % ' '.join(sdk_targets))
if ret:
return ret
targetlist = []
for target in sdk_targets:
if ':' in target:
target = target.split(':')[0]
if not target in targetlist:
targetlist.append(target)
recipes = []
for target in targetlist:
try:
out = subprocess.check_output(('bitbake -e %s' % target).split(), stderr=subprocess.STDOUT)
for line in out.splitlines():
if line.startswith('FILE='):
splitval = line.rstrip().split('=')
if len(splitval) > 1:
recipes.append(splitval[1].strip('"'))
break
except subprocess.CalledProcessError as e:
print('ERROR: Failed to get recipe for target %s:\n%s' % (target, e.output))
return 1
try:
out = subprocess.check_output('bitbake %s -n' % ' '.join(sdk_targets), stderr=subprocess.STDOUT, shell=True)
unexpected = check_unexpected(out, recipes)
except subprocess.CalledProcessError as e:
print('ERROR: Failed to execute dry-run:\n%s' % e.output)
return 1
if unexpected:
print('ERROR: Unexpected tasks or setscene left over to be executed:')
for line in unexpected:
print(' ' + line)
return 1
if __name__ == "__main__":
try:
ret = main()

View File

@@ -2,6 +2,7 @@
[ -z "$ENVCLEANED" ] && exec /usr/bin/env -i ENVCLEANED=1 HOME="$HOME" \
LC_ALL=en_US.UTF-8 \
TERM=$TERM \
http_proxy="$http_proxy" https_proxy="$https_proxy" ftp_proxy="$ftp_proxy" \
no_proxy="$no_proxy" all_proxy="$all_proxy" GIT_PROXY_COMMAND="$GIT_PROXY_COMMAND" "$0" "$@"
[ -f /etc/environment ] && . /etc/environment

View File

@@ -359,6 +359,24 @@ def compare_dict_blobs(path, ablob, bblob, report_all, report_ver):
if ' '.join(alist) == ' '.join(blist):
continue
if key == 'PKGR' and not report_all:
vers = []
# strip leading 'r' and dots
for ver in (astr.split()[0], bstr.split()[0]):
if ver.startswith('r'):
ver = ver[1:]
vers.append(ver.replace('.', ''))
maxlen = max(len(vers[0]), len(vers[1]))
try:
# pad with '0' and convert to int
vers = [int(ver.ljust(maxlen, '0')) for ver in vers]
except ValueError:
pass
else:
# skip decrements and increments
if abs(vers[0] - vers[1]) == 1:
continue
chg = ChangeRecord(path, key, astr, bstr, monitored)
changes.append(chg)
return changes

View File

@@ -114,7 +114,12 @@ def read_shlib_providers(d):
m = list_re.match(file)
if m:
dep_pkg = m.group(1)
fd = open(os.path.join(dir, file))
try:
fd = open(os.path.join(dir, file))
except IOError:
# During a build unrelated shlib files may be deleted, so
# handle files disappearing between the listdirs and open.
continue
lines = fd.readlines()
fd.close()
for l in lines:

View File

@@ -700,18 +700,19 @@ class RpmPM(PackageManager):
arch_list = self.feed_archs.split()
else:
# List must be prefered to least preferred order
default_platform_extra = set()
platform_extra = set()
default_platform_extra = list()
platform_extra = list()
bbextendvariant = self.d.getVar('BBEXTENDVARIANT', True) or ""
for mlib in self.ml_os_list:
for arch in self.ml_prefix_list[mlib]:
plt = arch.replace('-', '_') + '-.*-' + self.ml_os_list[mlib]
if mlib == bbextendvariant:
default_platform_extra.add(plt)
if plt not in default_platform_extra:
default_platform_extra.append(plt)
else:
platform_extra.add(plt)
platform_extra = platform_extra.union(default_platform_extra)
if plt not in platform_extra:
platform_extra.append(plt)
platform_extra = default_platform_extra + platform_extra
for canonical_arch in platform_extra:
arch = canonical_arch.split('-')[0]
@@ -1185,6 +1186,9 @@ class RpmPM(PackageManager):
new_depends[new_depend] = deps[depend]
pkgs = bb.utils.join_deps(new_depends, commasep=True).split(', ')
pkgs = self._pkg_translate_oe_to_smart(pkgs, attempt_only)
if not pkgs:
bb.note("There are no packages to install")
return
if not attempt_only:
bb.note('to be installed: %s' % ' '.join(pkgs))
cmd = "%s %s install -y %s" % \
@@ -1563,7 +1567,7 @@ class OpkgPM(OpkgDpkgPM):
self.deploy_dir = self.d.getVar("DEPLOY_DIR_IPK", True)
self.deploy_lock_file = os.path.join(self.deploy_dir, "deploy.lock")
self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
self.opkg_args = "--volatile-cache -f %s -o %s " % (self.config_file, target_rootfs)
self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % (self.config_file, self.d.expand('${T}/ipktemp/') ,target_rootfs)
self.opkg_args += self.d.getVar("OPKG_ARGS", True)
opkg_lib_dir = self.d.getVar('OPKGLIBDIR', True)

View File

@@ -117,43 +117,50 @@ class PatchSet(object):
return None
return os.sep.join(filesplit[striplevel:])
copiedmode = False
filelist = []
with open(patchfile) as f:
for line in f:
if line.startswith('--- '):
patchpth = patchedpath(line)
if not patchpth:
break
if copiedmode:
addedfile = patchpth
else:
removedfile = patchpth
elif line.startswith('+++ '):
addedfile = patchedpath(line)
if not addedfile:
break
elif line.startswith('*** '):
copiedmode = True
removedfile = patchedpath(line)
if not removedfile:
break
else:
removedfile = None
addedfile = None
for encoding in ['utf-8', 'latin-1']:
try:
copiedmode = False
filelist = []
with open(patchfile) as f:
for line in f:
if line.startswith('--- '):
patchpth = patchedpath(line)
if not patchpth:
break
if copiedmode:
addedfile = patchpth
else:
removedfile = patchpth
elif line.startswith('+++ '):
addedfile = patchedpath(line)
if not addedfile:
break
elif line.startswith('*** '):
copiedmode = True
removedfile = patchedpath(line)
if not removedfile:
break
else:
removedfile = None
addedfile = None
if addedfile and removedfile:
if removedfile == '/dev/null':
mode = 'A'
elif addedfile == '/dev/null':
mode = 'D'
else:
mode = 'M'
if srcdir:
fullpath = os.path.abspath(os.path.join(srcdir, addedfile))
else:
fullpath = addedfile
filelist.append((fullpath, mode))
if addedfile and removedfile:
if removedfile == '/dev/null':
mode = 'A'
elif addedfile == '/dev/null':
mode = 'D'
else:
mode = 'M'
if srcdir:
fullpath = os.path.abspath(os.path.join(srcdir, addedfile))
else:
fullpath = addedfile
filelist.append((fullpath, mode))
except UnicodeDecodeError:
continue
break
else:
raise PatchError('Unable to decode %s' % patchfile)
return filelist
@@ -280,12 +287,19 @@ class GitApplyTree(PatchTree):
"""
Extract just the header lines from the top of a patch file
"""
lines = []
with open(patchfile, 'r') as f:
for line in f.readlines():
if line.startswith('Index: ') or line.startswith('diff -') or line.startswith('---'):
break
lines.append(line)
for encoding in ['utf-8', 'latin-1']:
lines = []
try:
with open(patchfile, 'r', encoding=encoding) as f:
for line in f:
if line.startswith('Index: ') or line.startswith('diff -') or line.startswith('---'):
break
lines.append(line)
except UnicodeDecodeError:
continue
break
else:
raise PatchError('Unable to find a character encoding to decode %s' % patchfile)
return lines
@staticmethod

View File

@@ -66,21 +66,21 @@ def copytree(src, dst):
bb.utils.mkdirhier(dst)
cmd = 'tar -cf - -C %s -p . | tar -xf - -C %s' % (src, dst)
check_output(cmd, shell=True, stderr=subprocess.STDOUT)
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
def copyhardlinktree(src, dst):
""" Make the hard link when possible, otherwise copy. """
bb.utils.mkdirhier(dst)
if os.path.isdir(src) and not len(os.listdir(src)):
return
return
if (os.stat(src).st_dev == os.stat(dst).st_dev):
# Need to copy directories only with tar first since cp will error if two
# writers try and create a directory at the same time
cmd = 'cd %s; find . -type d -print | tar -cf - -C %s -p --files-from - --no-recursion | tar -xf - -C %s' % (src, src, dst)
check_output(cmd, shell=True, stderr=subprocess.STDOUT)
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
cmd = 'cd %s; find . -print0 | cpio --null -pdlu %s' % (src, dst)
check_output(cmd, shell=True, stderr=subprocess.STDOUT)
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
else:
copytree(src, dst)
@@ -105,47 +105,6 @@ def symlink(source, destination, force=False):
if e.errno != errno.EEXIST or os.readlink(destination) != source:
raise
class CalledProcessError(Exception):
def __init__(self, retcode, cmd, output = None):
self.retcode = retcode
self.cmd = cmd
self.output = output
def __str__(self):
return "Command '%s' returned non-zero exit status %d with output %s" % (self.cmd, self.retcode, self.output)
# Not needed when we move to python 2.7
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
If the exit code was non-zero it raises a CalledProcessError. The
CalledProcessError object will have the return code in the returncode
attribute and output in the output attribute.
The arguments are the same as for the Popen constructor. Example:
>>> check_output(["ls", "-l", "/dev/null"])
'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n'
The stdout argument is not allowed as it is used internally.
To capture standard error in the result, use stderr=STDOUT.
>>> check_output(["/bin/sh", "-c",
... "ls -l non_existent_file ; exit 0"],
... stderr=STDOUT)
'ls: non_existent_file: No such file or directory\n'
"""
if 'stdout' in kwargs:
raise ValueError('stdout argument not allowed, it will be overridden.')
process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
output, unused_err = process.communicate()
retcode = process.poll()
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
raise CalledProcessError(retcode, cmd, output=output)
return output
def find(dir, **walkoptions):
""" Given a directory, recurses into that directory,
returning all files as absolute paths. """

View File

@@ -2,7 +2,7 @@
#
# Some code borrowed from the OE layer index
#
# Copyright (C) 2013-2015 Intel Corporation
# Copyright (C) 2013-2016 Intel Corporation
#
import sys
@@ -15,6 +15,7 @@ from . import utils
import shutil
import re
import fnmatch
import glob
from collections import OrderedDict, defaultdict
@@ -365,6 +366,7 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True):
# Copy local files to target directory and gather any remote files
bb_dir = os.path.dirname(d.getVar('FILE', True)) + os.sep
remotes = []
copied = []
includes = [path for path in d.getVar('BBINCLUDED', True).split() if
path.startswith(bb_dir) and os.path.exists(path)]
for path in fetch.localpaths() + includes:
@@ -376,13 +378,14 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True):
if not os.path.exists(subdir):
os.makedirs(subdir)
shutil.copy2(path, os.path.join(tgt_dir, relpath))
copied.append(relpath)
else:
remotes.append(path)
# Simply copy whole meta dir, if requested
if whole_dir:
shutil.copytree(bb_dir, tgt_dir)
return remotes
return copied, remotes
def get_recipe_local_files(d, patches=False):
@@ -448,6 +451,60 @@ def validate_pn(pn):
return ''
def get_bbfile_path(d, destdir, extrapathhint=None):
"""
Determine the correct path for a recipe within a layer
Parameters:
d: Recipe-specific datastore
destdir: destination directory. Can be the path to the base of the layer or a
partial path somewhere within the layer.
extrapathhint: a path relative to the base of the layer to try
"""
import bb.cookerdata
destdir = os.path.abspath(destdir)
destlayerdir = find_layerdir(destdir)
# Parse the specified layer's layer.conf file directly, in case the layer isn't in bblayers.conf
confdata = d.createCopy()
confdata.setVar('BBFILES', '')
confdata.setVar('LAYERDIR', destlayerdir)
destlayerconf = os.path.join(destlayerdir, "conf", "layer.conf")
confdata = bb.cookerdata.parse_config_file(destlayerconf, confdata)
pn = d.getVar('PN', True)
bbfilespecs = (confdata.getVar('BBFILES', True) or '').split()
if destdir == destlayerdir:
for bbfilespec in bbfilespecs:
if not bbfilespec.endswith('.bbappend'):
for match in glob.glob(bbfilespec):
splitext = os.path.splitext(os.path.basename(match))
if splitext[1] == '.bb':
mpn = splitext[0].split('_')[0]
if mpn == pn:
return os.path.dirname(match)
# Try to make up a path that matches BBFILES
# this is a little crude, but better than nothing
bpn = d.getVar('BPN', True)
recipefn = os.path.basename(d.getVar('FILE', True))
pathoptions = [destdir]
if extrapathhint:
pathoptions.append(os.path.join(destdir, extrapathhint))
if destdir == destlayerdir:
pathoptions.append(os.path.join(destdir, 'recipes-%s' % bpn, bpn))
pathoptions.append(os.path.join(destdir, 'recipes', bpn))
pathoptions.append(os.path.join(destdir, bpn))
elif not destdir.endswith(('/' + pn, '/' + bpn)):
pathoptions.append(os.path.join(destdir, bpn))
closepath = ''
for pathoption in pathoptions:
bbfilepath = os.path.join(pathoption, 'test.bb')
for bbfilespec in bbfilespecs:
if fnmatch.fnmatchcase(bbfilepath, bbfilespec):
return pathoption
return None
def get_bbappend_path(d, destlayerdir, wildcardver=False):
"""Determine how a bbappend for a recipe should be named and located within another layer"""
@@ -728,14 +785,16 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
def find_layerdir(fn):
""" Figure out relative path to base of layer for a file (e.g. a recipe)"""
pth = os.path.dirname(fn)
""" Figure out the path to the base of the layer containing a file (e.g. a recipe)"""
pth = fn
layerdir = ''
while pth:
if os.path.exists(os.path.join(pth, 'conf', 'layer.conf')):
layerdir = pth
break
pth = os.path.dirname(pth)
if pth == '/':
return None
return layerdir

Some files were not shown because too many files have changed in this diff Show More