summaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)Author
2017-07-06yocto-compat-layer.py: avoid adding layers more than oncePatrick Ohly
add_layer_dependencies() might get called more than once, or one of the layer dependencies might already be present. The function should not add layers again because doing so can cause warnings like: WARNING: Duplicate inclusion for .../meta-openembedded/meta-oe/conf/distro/include/meta_oe_security_flags.inc in .../meta-openembedded/meta-oe/conf/layer.conf Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-30mkefidsk: fix bash/dash shell quoting problemSaul Wold
mkefidsk currently writes a startup.nsh with embedded control characters. This happens because \b etc are control sequences to the shell echo command when using dash. The resulting startup.nsh causes the bootup to fail, and the user is dropped into the EFI shell to manually run startup.nsh. Patch originally provided by Troy D. Hanson <troy.hanson@jhuapl.edu> [YOCTO #9665] Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-29scripts/contrib/patchreview: add new scriptRoss Burton
This script analyses the patches we apply and can sanity check or output statistics. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-28scripts/test-reexec: fix several incomplete regexpMing Liu
Some "=" are missing in the regexp, which leads it match multiple results if the variables have overrides, for instance: ... SSTATE_DIR="xxxx" SSTATE_DIR_qemux86="yyyy" ... it will match both of them without "=". Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-28scripts/oe-find-native-sysroot: fix a incomplete regexpMing Liu
A "=" is missing in the regexp, which leads it match multiple results if STAGING_DIR_NATIVE has overrides, for instance: ... STAGING_DIR_NATIVE="xxxx" STAGING_DIR_NATIVE_qemux86="yyyy" ... it will match both of them without "=". Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-27runqemu: drop RPC portsRobert Yang
The following commit has removed rpc ports from runqemu-export-rootfs, so runqemu should also remove them, otherwise "runqemu nfs" doesn't work. And use abspath for nfsroot, otherwise it doesn't work when it is a relative path. commit 6bb9860ef7ba9c84fe9bd3a81aa6555f67ebd38e Author: Cody P Schafer <dev@codyps.com> Date: Tue Jun 6 18:30:49 2017 -0400 runqemu-export-rootfs: don't change RPC ports [YOCTO #11687] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-23sstate-sysroot-cruft.sh: Extend the whitelistMartin Jansa
* add more php5 entries Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-23wic: remove extra double-quote on documentation stringJean-Francois Dagenais
Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-23wic/runner.py: move runtool API to misc.pyEd Bartosh
Moved remaining API to misc.py. Removed runner.py. Now misc.py is ready to be moved to the scripts/lib/wic and utils directory can be removed. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-23wic: fix restoring of original fstabEd Bartosh
Wic updates fstab if mount points are specified in .wks. After partition images are created the original fstab is restored. However, if exception is raised when partition image being prepared wic doesn't restore original fstab. This can cause duplication of added lines in fstab when 'wic create' runs next time. Wrapping call of 'prepare' method and restoring original fstab even if exception occurs should fix this. [YOCTO #11633] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-23wic: code cleanupEd Bartosh
Split long lines. Removed unused imports. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-23wic: flatten directory structureEd Bartosh
Moved misc.py from wic/utils/ to wic/ Removed wic/utils directory Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-23scripts/contrib/patchtest: run patchtest on local branchLeonardo Sandoval
The script run patchtest on local branch commits, printing results into stdout. This script is useful to test patches before sending to the mailing list. Examples: $ git checkout master-next-1.9 Branch master-next-1.9 set up to track remote branch master-next-1.9 from origin. Switched to a new branch 'master-next-1.9' $ ~/scripts/contrib/patchtest.sh 166e70e: Robert Yang: Thu Apr 2 12:01:37 2015 +0100: patch: fix CVE-2015-1196: FAIL Issue Missing or incorrectly formatted CVE tag in commit message [test_cve_presence_in_commit_message] Suggested fix Include a "CVE-xxxx-xxxx" tag in the commit message Issue Missing or incorrectly formatted CVE tag in included patch file [test_cve_tag_format] Suggested fix Correct or include the CVE tag on cve patch with format: "CVE: CVE-YYYY-XXXX" eaa4536: Robert Yang: Thu Apr 2 12:01:37 2015 +0100: wget: 1.16.1 -> 1.16.2: OK 3c29ce3: Robert Yang: Thu Apr 2 12:01:38 2015 +0100: git: 2.3.0 -> 2.3.1: OK 85491f6: Khem Raj: Thu Apr 2 12:01:38 2015 +0100: gdb: Upgrade 7.8.1 -> 7.9: OK f701142: Robert Yang: Thu Apr 2 12:01:38 2015 +0100: binutils: upgrade to 2.25: OK 385d0b1: Khem Raj: Thu Apr 2 12:01:39 2015 +0100: binutils: Fix ICE in gold: OK [YOCTO #10720] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-23buildhistory-diff: exclude paths from the outputEd Bartosh
Implemented -e/--exclude-path command line option to exclude paths from buildhistory-diff output. [YOCTO #11459] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-14python-3.5: Move bz2.py, lzma.py and _compression.py from python3-misc to ↵Martin Jansa
python3-compression * the /usr/lib/python3.5/_compression.py file is possibly incorrectly included in python3-misc. This runtime dependency is needed in order to use e.g. gzip.py in runtime: >>> import tarfile, zlib, gzip Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.5/gzip.py", line 12, in <module> import _compression ImportError: No module named '_compression' * at least python3-tests and lzma and bz2 still in python3-misc are using this as well: $ grep -R import.*_compression tmp-glibc/work/aarch64-oe-linux/python3/3.5.2-r1.0/packages-split/ tmp-glibc/work/aarch64-oe-linux/python3/3.5.2-r1.0/packages-split/python3-compression/usr/lib/python3.5/gzip.py:import _compression tmp-glibc/work/aarch64-oe-linux/python3/3.5.2-r1.0/packages-split/python3-misc/usr/lib/python3.5/lzma.py:import _compression tmp-glibc/work/aarch64-oe-linux/python3/3.5.2-r1.0/packages-split/python3-misc/usr/lib/python3.5/bz2.py:import _compression tmp-glibc/work/aarch64-oe-linux/python3/3.5.2-r1.0/packages-split/python3-tests/usr/lib/python3.5/test/test_bz2.py:import _compression tmp-glibc/work/aarch64-oe-linux/python3/3.5.2-r1.0/packages-split/python3-tests/usr/lib/python3.5/test/test_lzma.py:import _compression and python3-tests are using it as well, so add new runtime dependency on python3-compression Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14runqemu: change terminal settings for valid tty'sMikko Ylinen
runqemu uses stty to change terminal settings to give users better control to qemu. However, stty does not work when runqemu is run directly or indirectly via oe-selftest in a Docker container (presumably some problems with Docker's pseudo-tty implementation). The error reported is: stty: 'standard input': Inappropriate ioctl for device As runqemu recently moved to subprocess.check_call() for stty calls we now get thrown an error and all runqemu runs fail. sys.stdin.isatty() does proper job in detecting if the stty calls can work so we use that check before running the stty subprocess operations. Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: implement removing directoriesEd Bartosh
Added support for removing directories using mdeltree utility to Disk.del method [YOCTO #11283] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: implement removing filesEd Bartosh
Added implementation of Disk.del method and wic_r function that removes files from the vfat partition using mdel utility. [YOCTO #11283] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: add 'wic rm' commandEd Bartosh
Added empty 'wic rm' command that does nothing. The functionality will be added by the next commits. [YOCTO #11283] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: add help and usage content for 'wic rm'Ed Bartosh
Added wic_rm_help and wic_rm_usage variables to help.py. These variables contain help content that will be used in 'wic rm help' and 'wic rm --help' output. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: add wic_init_parser_rmEd Bartosh
Add parser for 'wic rm' subcommand. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: fully implement 'wic cp'Ed Bartosh
Added implementation of Disk.copy method and wic_cp function that copies files/directories to the vfat partition of the partitioned image. [YOCTO #11283] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: add Disk._put_part_image methodEd Bartosh
This method copies partition image into the wic image. It will be used in 'wic cp' and 'wic rm' subcommands to copy changed partition back into wic image. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14filemap: calculate dst size correctlyEd Bartosh
Fixed calculation of the dst file size using skip, seek and length parameters. Current code does it incorrectly which causes sparse_copy API to create unnecessary big output files. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14filemap: check if dest is written for every blockEd Bartosh
If lenght parameter is provided to sparse_copy call it's mandatory to check if the output file is fully written after reading unmapped block from input file. If it's not done then sparse_copy can write more data than specified length. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14filemap: change signature of sparse_copy functionEd Bartosh
Renamed parameter offset->skip to match names of dd parameters. Changed affected sparse_copy calls. Added explanation of the parameters to docstring. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: add mcopy propertyEd Bartosh
Added property that points to the mcopy executable. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: add Disk._prop helperEd Bartosh
Added generic helper to use in property methods to access commands in a lazy manner. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: add 'wic cp' commandEd Bartosh
Added empty 'wic cp' command that does nothing. The functionality will be added by the next commits. [YOCTO #11283] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: add help and usage content for 'wic cp'Ed Bartosh
Added wic_cp_help and wic_cp_usage variables to help.py. These variables contain help content that will be used in 'wic cp help' and 'wic cp --help' output. [YOCTO #11283] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: add wic_init_parser_cpEd Bartosh
Add parser for 'wic cp' subcommand and a custom argument type. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14engine: implement listing wic imagesEd Bartosh
Implemented 'wic ls' functionality: - list image partitions - list directory content of vfat partitions [YOCTO #11283] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: add 'wic ls' commandEd Bartosh
Added empty 'wic ls' command that does nothing. The functionality will be added by the next commits. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: add help and usage content for 'wic ls'Ed Bartosh
Added wic_ls_help and wic_ls_usage variables to help.py. These variables contain help content that will be used in 'wic ls help' and 'wic ls --help' output. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14wic: add wic_init_parser_lsEd Bartosh
Added parser for 'wic ls' command. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14bootimg-pcbios: make boot image file uniqueEd Bartosh
Plugin code uses boot.img file name for an image file. If there are two partitions that use bootimg-pcbios wic breaks with an error "file already exists: boot.img" Made image file name unique by adding wks like number to it to fix the issue. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14filemap: add parameter 'length' to sparse_copyEd Bartosh
Added parameter 'length' to specify amount of data to write into destination file. This is useful when only part of source file should be written into destination file. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14filemap: fix skip logicEd Bartosh
Fixed bug in processing 'skip' parameter: don't read input file if end of bmap block is less than skip Simplified logic of positioning to the start of data inside a partially skipped bmap block. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-12runqemu-export-rootfs: don't change RPC portsCody P Schafer
RPC ports (also known as rpc program numbers) are values: - given to rpcbind (aka portmapper) to allow nfsv3 clients that don't know the tcp/udp port number of nfsd and mountd to look it up the tcp/udp port number, and to - allow a single transport (ie: tcp/udp port) to provide multiple sunrpc services. OE has carried patches to nfsutils & linux for some time to support the mountprog & nfsprog options. In the case of runqemu-export-rootfs, we don't need to use custom rpc program numbers because runqemu-export-rootfs tells unfsd not to register with the portmapper, and unfsd runs the nfs and mount rpc services on tcp/udp ports unfsd binds itself (iow: the tcp/udp ports are not shared in the sunrpc sense). Linux's nfs client does not query rpcbind when tcp/udp port numbers are specified (in net/sunrpc/clnt.c, call_bind checks for the tcp/udp port with xprt_bound() and skips the call to rpcbind if xprtsock.c's xs_setup_udp() or xs_setup_tcp() has found a non-zero tcp/udp port). The program numbers _are_ sent over the mount & nfs protocol (really, over sunrpc), and checked to match at both ends. As a result, even when rpcbind is unused, using different program numbers in unfsd vs linux nfs client causes mounts to fail (and nfsroot mounts to timeout). The result is that specifying custom program numbers in runqemu-export-rootfs doesn't solve any conflicts, it simply requires that users of runqemu-export-rootfs carry a kernel patch & adds 2 extra parameters to the kernel command line unnecessarily. Change runqemu-export-rootfs to use the default program numbers. For now, I have not dropped the custom program number patches to linux, nfs-utils, and unfsd just in case someone is using them in a non-runqemu-export-rootfs context. CC: Bruce Ashfield <bruce.ashfield@gmail.com> CC: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-12devtool/standard: Fix lock in _prep_extract_operationAníbal Limón
If for any reason the parse_recipe fail in extract command the process gets locked because Cooker is expecting the finish event by tinfoil. For example: $ devtool extract remake /tmp/remake ERROR: remake is unavailable: remake was skipped: PREFERRED_PROVIDER_virtual/make set to make, not remake Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-09buildstats-diff: show more graceful error messagesMing Liu
I got a following error when I run buildstats-diff against a invalid buildstats file: | Traceback (most recent call last): | File "/poky/scripts/buildstats-diff", line 548, in <module> | sys.exit(main()) | File "/poky/scripts/buildstats-diff", line 534, in main | bs1 = read_buildstats(args.buildstats1, args.multi) | File "/poky/scripts/buildstats-diff", line 222, in read_buildstats | return read_buildstats_dir(path) | File "/poky/scripts/buildstats-diff", line 165, in read_buildstats_dir | os.path.join(recipe_dir, task))] | File "/poky/scripts/buildstats-diff", line 124, in read_buildstats_file | bs_task['elapsed_time'] = end_time - start_time | UnboundLocalError: local variable 'end_time' referenced before assignment the root cause is that a task was terminated by me on the terminal, so the generated buildstats file was invalid, supposing that it would make the buildstats.sh fail, but the script should give more graceful error messages. Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-09scripts/yocto-compat-layer-wrapper: Use realpath of output_logAníbal Limón
We are using a temp directory, use the realpath for output log to store the results in the original BUILDDIR. [YOCTO #11571] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-09scripts/yocto-compat-layer.py: Return non-zero when layer test failAníbal Limón
If whatever layer tested fails returns 2 to indicate the failure. [YOCTO #11482] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-06python3: add python3-modules-native to RPROVIDES for python3-nativeRoss Burton
Also clean up the logic in the script to be more Pythonic. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-06python: add python-modules-native to RPROVIDES for python-nativeRoss Burton
Also clean up the logic in the script to be more Pythonic. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-06wic: Remove obsolete reference to msger logger.Kristian Amlie
This was overlooked when msger was removed in 28014087b8091. Signed-off-by: Kristian Amlie <kristian.amlie@mender.io> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-05scripts/oe-{self,}test: Logger change default stream to stdoutAníbal Limón
By default python logging module uses stderr as default stream for output but is unix-like to use stdout instead, so change it. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-06-05sstate-diff-machines.sh: Replace MACHINE_ARCH only at the beginning and ↵Martin Jansa
separated with dash * I had some components where the MACHINE name was also included in PV of allarch recipe which was tripping the script into saying that they have different signatures (because for one MACHINE was the string in PV replaced with 'MACHINE' and not for other MACHINEs Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-05scripts/oe-selftest: Migrate to new framework into oeqa.selftest.contextLeonardo Sandoval
The new OEQA framework aims to re-use code into the different Test components. The previous oe-selftest implements it-self loading, run, and list test cases in a non-standard way (unittest base) and other functionalities like logging that is now on oeqa core. This ends on a compact oe-selftest script. All needed command line options was migrated but there are some of them pending of implementation and others deprecated. Deprecated options: list-tags: The tag functionality into the old oeqa framework isn't work, the selftest doesn't has tag decorators. {run, list}-tests-by: Ambiguos options it accepts all the posibilites module, class, name, id or tag. Remaining to implement: coverage: It enables covrage reports over a test run, currently isn't on on use and some bugs [1], i filed a bug to add support to OEQA core module in this way other Test components could enable it. repository: It push XML results into a git repository and isn't in use, i filed a bug to implement this into OEQA core module. [2] [1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=11582#c0 [2] https://bugzilla.yoctoproject.org/show_bug.cgi?id=11583#c0 Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-06-05scripts/oe-selftest: Move {add,remove}_include files to caseLeonardo Sandoval
The oe-selftest creates include files to store custom configuration to make specific tests, every class executes a different test and may be uses custom configuration. So move to case class in order to simplify oe-selftest script and later implement later a build folder per class. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>