aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)Author
2015-08-09wic: release 0.2.0Ed Bartosh
Major changes in 0.2.0: - implemented UUID support - fixed support of GPT partition tables - implemented running bitbake from wic - implemented image compressing - started testing with oe-selftest. implemented 17 test cases - used native tools (parted, mkfs, mtools, etc) - usability and documentation fixes - code clenup Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09wic: code cleanup: pylint misc.pyEd Bartosh
Fixed pylint warnings. Increased pylint score from 8.02 to 9.40. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09wic: code cleanup: remove unused codeEd Bartosh
Removed unused global variable wks_vars and 2 unused functions get_wks_var and add_wks_var. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09wic: Report recipe name for native commandsEd Bartosh
exec_native_cmd was modified to report recipe to build native programs. Pairs executable->recipe are hardcoded as it's not possible to obtain this information automatically. [YOCTO #7631] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09wic: Improve 'wic help overview' contentEd Bartosh
Included full console output and example of the .wks file into the 'wic help overview' content. Used qemux86-64 machine instead of crownbay to make example working without cloning additional layers. [YOCTO #7940] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09wic: improved usage textEd Bartosh
Made command line specification less confusing. Reformatted usage output. [YOCTO #7938] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09create-pull-request: cd to relative directoryEd Bartosh
create-pull-request -d path creates empty patches if directory is specified as a path, i.e. ./bitbake or ./bitbake/ or full path. It behaves expected way only if script is run with -d bitbake, i.e. relative dir name doesn't contain '\'. Fixed this unwanted behaviour by changing directory and running git format-patch in it with --relative, without specifying relative path as a parameter. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09runqemu: Handle device names like tapX@NONERichard Purdie
ip list can return devices in the form tapX@NONE. If it does so, ensure we handle that case correctly. Newer distros appear to do this in some cases. [YOCTO #8129] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09runqemu: Add error handling for unexpected tap devicesRichard Purdie
In theory the code reduces the tap device number to an integer. This patch adds error checking to ensure that does happen and that the script exits if something unexpected happens. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09combo-layer: fix action_pull for unknown branchPatrick Ohly
When reconfiguring the branch to something not already fetched, action_pull fails with error: pathspec '<new branch name>' did not match any file(s) known to git. It is the "git checkout" which fails like that. To solve this, try the faster "git checkout + git pull" first and only if that fails, fall back to the slow "git fetch + git checkout". In the conf.hard_reset case, do the checkout always after the git fetch. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09combo-layer: enhance output in action_pullPatrick Ohly
The git operations can fail, for example when the branch is unknown or misconfigured. Better move the info message and extend it such that it is printed first and provides the necessary context, because otherwise the CalledProcessError exception gets dumped without mentioning for which component it occurred. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01python3: remove 2to3 symlink from package python3-2to3Dominic Sacré
The 2to3 symlink conflicts with its Python 2 equivalent in package python-2to3. The Python 3 version of the tool is still available as 2to3-3.4. Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01python3: remove package python3-robotparserDominic Sacré
robotparser has been moved to urllib.robotparser in Python 3, and gets packaged as part of python3-netclient alongside the rest of urllib. This causes python3-modules to depend on an empty/missing python3-robotparser package. robotparser.py is relatively small and has no dependencies outside urllib, so it makes more sense to eliminate the python3-robotparser package than to alter the manifest for python3-netclient. Part of the fix for [YOCTO #8048]. Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01devtool: add --bbpath argumentChristopher Larson
Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31create-pull-request: Implement -d optionEd Bartosh
This options allows to generate patches against relative directory by using git format-patch --relative option. See more details about --relative option in git diff manual page. For example generating bitbake patchsets from poky can be done this way: create-pull-request -u contrib -d ./bitbake Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-31devtool: use tinfoil shutdown methodPaul Eggleton
Tinfoil now has its own shutdown method, use it instead of calling into cooker - not only is it the right thing to do from an API perspective, it also ensures proper lock handling. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31combo-layer: fix AttributeError traceback.Alexander Kanevskiy
Commit c908a423f85a84ddd8249abd00254f29d47df74b introduced a new issue in combo-layer that leads to a traceback as args.hard_reset is an unknown variable. This change defines an appropriate destination for the command args parser and fixes the reference. Signed-off-by: Alexander Kanevskiy <kad@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31gcc: Add support for nativesdk-gccRichard Purdie
Being able to build a nativesdk gcc is useful, particularly in cases where the host compiler may be of an incompatible version (or a 32 bit compiler is needed). Sadly, building nativesdk-gcc is not straight forward. We install nativesdk-gcc into a relocatable location and this means that its library locations can change. "Normal" sysroot support doesn't help in this case since the values of paths like "libdir" change, not just base root directory of the system. In order to handle this we do two things: a) Add %r into spec file markup which can be used for injected paths such as SYSTEMLIBS_DIR (see gcc_multilib_setup()). b) Add other paths which need relocation into a .gccrelocprefix section which the relocation code will notice and adjust automatically. This patch adds tweaks to the relocation script to handle the new section too. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27oe-selftest: add scripts/lib and bitbake/lib to pathPaul Eggleton
In particular, this allows us to use code from bitbake's bb module (such as tinfoil). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27oe-selftest: add libdirs from BBPATH to sys.pathChristopher Larson
This ensures that oeqa.selftest.* from layers are found. [YOCTO #7625] Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-27oe-selftest: obey oeqa.selftest.__path__Christopher Larson
This ensures that all paths that hold selftest tests will be checked (oeqa.selftest is a namespace package). [YOCTO #7625] Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-27devtool: also load plugins from BBPATHChristopher Larson
This makes it easier to extend, as a layer can add its own sub-commands. Argument parsing is also separated into two steps, the same way it's done in recipetool, as we need access to the global command-line arguments early, before plugins are loaded, both for debugging arguments and for the bitbake path (we need to load the bitbake module to get tinfoil, which is now needed to load the plugins). Rather than constructing tinfoil once and passing it through into sub-commands for their use, we have to construct it for configuration metadata, use it, and then shut it down, as some sub-commands call out to recipetool, which needs its own tinfoil instance, and therefore needs to acquire the bitbake lock. If we're still holding the lock at that point, that's clearly a problem. [YOCTO #7625] Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-27recipetool: parse global args earlyChristopher Larson
This separates the argument parsing into two steps, which lets us apply global settings like enabling debugging before the plugins load, so we can see the paths where plugins are being loaded. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-27recipetool: also load plugins from BBPATHChristopher Larson
This makes it easier to extend, as a layer can add its own sub-commands. The bitbake path setup is moved earlier, as it has to be done before tinfoil_init. [YOCTO #7625] Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-27recipetool.append: add extralines arg to appendsrcChristopher Larson
This makes the function more reusable for other sub-commands. Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-27recipetool: catch BBHandledException from parsingChristopher Larson
This ensures that we don't see a traceback on parsing failures. Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-22recipetool: appendsrcfile: handle S == STAGING_KERNEL_DIRChristopher Larson
When determining the path from WORKDIR to the extracted sources, we're using S, but if S is in work-shared, that's problematic and won't give us good results, so assume 'git' for that case, warning when appropriate. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22recipetool: appendsrcfile: use -D, not -d for destdirChristopher Larson
-d is already taken for --debug. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22recipetool: appendsrcfile: fix duplicate SRC_URI checkChristopher Larson
Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-21Revert "create-pull-request: Fix error on 2.0 versions of git"Ross Burton
This breaks create-pull-request for git <2, which is many people. This reverts commit 7ee64ea60ede5477b2f9a355d93bdc556e6b7895. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16runqemu-internal: add temporary disk interface to qemuarm64Cristian Iorga
Starting with qemu 2.4, a disk needs be attached via a specified interface, even if that interface is none. In case of qemuarm64 machine, the board is virtual, so a none interface it works correctly. Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
2015-07-16create-pull-request: Fix error on 2.0 versions of gitBen Shelton
On 2.0 versions of git, the create-pull-request script exits with the warning "No match for commit... Are you sure you pushed 'HEAD' there?". This is due to a change in behavior where git used to guess the branch you meant, but no longer does. See the thread at http://www.spinics.net/lists/git/msg233050.html for more information. To accommodate the new behavior, if the COMMIT_ID is set to the default of "HEAD", make it point explicitly to $BRANCH instead. Signed-off-by: Ben Shelton <ben.shelton@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-16combo-layer: implement --hard-reset optionMarkus Lehtonen
This option causes combo-layer to do git fetch and hard reset instead of git pull in the component repositories. This makes sure that the local component repositories are always in sync with the remote - tolerating force pushes and overriding any locally made changes. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-16combo-layer: only allow fast-forward when pullingMarkus Lehtonen
Only allow fast-forward merges in the component repositories when doing git-pull. This makes it possible to spot problems (i.e. rewriting of history) in the component upstream . Also, this change prevents the creation of local-only merge commits in the component repositories. These merges cause "last_revision" field of the combo-layer config to point to a git commit that is only present in the users local component repository but nowhere in upstream. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-16python-io: Add runtime dependency on contextlibAsh Charles
The python-io package includes ssl.py module which imports the contextlib library. This applied to Python 2.7.9 but not 3.3. Signed-off-by: Ash Charles <ashcharles@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-12recipetool/append: Fix selftest failure with multilibRichard Purdie
If you have multilib enabled, it finds lib32-base-files instead of base-files for test_recipetool_appendfile_basic causing a test failure. Add a fix for this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-10wic: Set default set of bitbake variablesEd Bartosh
Set default set of bitbake variables to the set of variables for the first parsed image. This allows wic to find proper bitbake varibale values if it's called with '-e <image>' even without specifying image in the call of get_bitbake_var. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-07combo-layer: modified to generate better commit messages.Puustinen, Ismo
This patch includes support for a global section in combo-layer.conf called [combo-layer-settings]. Supported in this section is key "commit_msg"; its value is the template for the git commit message that updates the last_revision. The template can include substitution for the updated component list: ${components}. The substituted value will either be a comma-separated list of components or "all components", if combo-layer was invoked without component list argument. If the key is not present, the old default value is used for the commit message. Configuration file example: [combo-layer-settings] commit_msg = pulled in the latest changes for ${components}. Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-07scripts/oe-selftest: Added mechanism for including/removing bblayers.incDaniel Istrate
When oe-selftest starts it includes bblayers.inc into bblayers.conf When oe-selftest ends it deletes bblayers.inc and the included line from bblayers.conf Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-02runqemu-internal: correctly set format for root FS as rawCristian Iorga
qemu guesses via probing the format of root FS, but gives a warning and restricts write operations on block 0. Fix it by setting correctly the format as raw for more machines and non-KVM machines. In some cases, replaced the way machine disk is set for qemu. Fix for [YOCTO #7918] Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-02wic: Code cleanup: unused importsEd Bartosh
Fixed pylint warning unused-import Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-07-02wic: Code cleanup: long lines, identation and whitespacesEd Bartosh
Fixed pylint warnings bad-continuation, bad-continuation and line-too-long. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-07-02wic: Fix confusing error messageEd Bartosh
Wic throws this message when any of the build artifacts are not provided: Build artifacts not completely specified, exiting. (Use 'wic -e' or 'wic -r -b -k -n' to specify artifacts) It was not clear which artifact was not specified. Reworked the code to specify list of missed artifacts. Now the message looks like this: The following build artifacts are not specified: bootimg-dir, kernel-dir, native-sysroot [YOCTO #7912] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-07-02wic: Remove __write_partition methodEd Bartosh
Moved code of __write_partition to 'assemble' method. This way it should be more readable. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-07-02wic: Refactor fstab update codeEd Bartosh
Made the code to backup and restore fstab only if it's modified. Cleaned up the code. Made it more pythonic. Improved code readability by moving code from several tiny methods into one place. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-07-02wic: Add --uuid partition optionEd Bartosh
Added --uuid option to the configuration of wks parser. This option specifies partition UUID. The code to process it is already in place. It was implemented for --use-uuid option. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-07-02wic: Fix naming conflictEd Bartosh
Image file name is not unique for the partitions without label. This causes image being rewritten and used as a source for all partitions without label. Wic produces broken or incorrect result images because of that. Added wks line number to the image name to make it unique.
2015-07-02wic: Remove duplicated codeEd Bartosh
Moved duplicated code of geting rootfs size out of prepare_rootfs* methods.
2015-07-02wic: Refactor prepare_empty_partition APIEd Bartosh
Moved code out of prepare_empty_partition* methods to avoid code duplication. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-07-02wic: Call methods better wayEd Bartosh
Shortened code by using getattr to obtain a method to call for prepare_empty_partition_* and prepare_rootfs_* methods. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>