summaryrefslogtreecommitdiffstats
path: root/scripts/lib
Commit message (Collapse)AuthorAgeFilesLines
* resulttool/resultutils: Fix unicode error handlingRichard Purdie2020-05-151-4/+1
| | | | | | | | | | | | | | | | | | | | | | This error handling didn't work as expected since upon failure it would inject bytestreams back into the code leading to tracebacks. Instead, ignore the decode errors. Fixes: Traceback (most recent call last): File "/home/pokybuild/yocto-worker/a-full/build/scripts/resulttool", line 78, in <module> sys.exit(main()) File "/home/pokybuild/yocto-worker/a-full/build/scripts/resulttool", line 72, in main ret = args.func(args, logger) File "/home/pokybuild/yocto-worker/a-full/build/scripts/lib/resulttool/store.py", line 70, in store resultutils.save_resultsdata(results, tempdir, ptestlogs=True) File "/home/pokybuild/yocto-worker/a-full/build/scripts/lib/resulttool/resultutils.py", line 178, in save_resultsdata f.write(sectionlog) TypeError: write() argument must be str, not bytes (From OE-Core rev: b63955977ebbf9fba291faa1b30c8dba9bd52869) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: align layer plugin pathLee Chee Yang2020-04-292-6/+8
| | | | | | | | | | | | | | | | | | | wic look for external layer source plugin under scripts/lib/ while other tools look for lib/. allow wic to check for source plugin at both scripts/lib/ and lib/ to align with other tools while avoid breaking any existing source plugin in external layer. [YOCTO #13056] (From OE-Core rev: 8351cb19e8a83157143b1df61cd9bbb71282e9fc) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 986baff26bd96a6265f5fe2d631818fff9f66374) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/direct: reserve 2 sector for extended partitionChee Yang Lee2020-03-301-3/+3
| | | | | | | | | | | | | | | | | | extended partition should reserve at least 2 unallocated sectors between the start of the extended partition and the start of a logical partition. [YOCTO #13658] (From OE-Core rev: 884c8a0e50a49bdca5e048197a9dc0ff37cc8d1a) (From OE-Core rev: 0743dcd0cd70dee87a49d3bcd017168352e60982) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 590555e3b8ccbd94b628aa6778adea7f4538d966) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/engine: lets display an error not a tracebackArmin Kuster2020-03-161-1/+4
| | | | | | | | | | | | | | | If the requested partition does not exist in this request "wic ls {path}:pnum" display a nice message not a trackback Also fix displaying the pnum and not "%s" (From OE-Core rev: 29a1d9bed5bf7ed024870a0323f9afdf88346e4d) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 15d1722950a22649905cf8a5789d3cfe48a2a892) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool/standard.py: Allow recipe to disable menuconfig logicTom Hochstein2020-02-111-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | u-boot.inc supports u-boot recipes with or without menuconfig [1]. However, running devtool on a u-boot recipe that does not support menuconfig results in an error: cp: cannot stat '/home/r60874/upstream/fsl-xwayland/tmp/work/imx8mmevk-fsl-linux/u-boot-imx/2018.03-r0/u-boot-imx-2018.03//.config': No such file or directory The problem is the devtool logic assumes that any recipe with a do_menuconfig task will generate a .config in do_configure(). Fix the problem by removing the assumption with a flag that the recipe can control, like this: do_configure() { if [ menuconfig-supported ]; then ... else DEVTOOL_DISABLE_MENUCONFIG=true fi } [1] https://github.com/openembedded/openembedded-core/commit/11278e3b2c75be80645b9841763a97dbb35daadc (From OE-Core rev: 803391ef7ba662a5ee58609d9c81aeffa494287c) Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/filemap: If FIGETBSZ iotctl fail, failback to os.statKalle Lampila2020-01-281-2/+4
| | | | | | | | | | | | | | Some file systems don't support fetching the block size (notably the file system Docker uses for containers), so if iotctl() fail, try to use failback via os.stat() to get block size. (From OE-Core rev: 996013b4e5d3cd1c054e87539ac1a8d95581a87f) Signed-off-by: Kalle lampila <kalle.lampila@lempea.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e219f5175177a640dd62833082ea19adc1c13d42) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "devtool/standard.py: Not filtering devtool workspace for devtool finish"Alexander Kanavin2019-11-251-1/+1
| | | | | | | | | | | | | | | | | This reverts commit 41d225f4a37d02e9f79bdbfb79caac8cd3d291ce. Unfortunately this change broke 'devtool upgrade' functionality, causing 'devtool finish' to write out an upgraded recipe that no longer includes the original upstream source in SRC_URI. (From OE-Core rev: 2d6e55192dba0bf7f6e23e5ab5b3dbc68835bb28) (From OE-Core rev: 2bb221ee5689f13d44b7452738f5a97baa1815a1) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/engine: use 'linux-swap' for swap file systemChee Yang Lee2019-10-291-1/+1
| | | | | | | | | | | | | | | | | [YOCTO #13312] see https://bugzilla.yoctoproject.org/show_bug.cgi?id=13312 wic/engine.Disk._get_part_image was looking at variable fstypes for supported fstype which is 'swap' but image build with 'linux-swap'. supported fstype should be 'linux-swap'. (From OE-Core rev: 759a37e315d72e462a617f1cda326b8f198e3d4e) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7e6da22fe4faf841bcec02e55f376b4dae04d6a8) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/rawcopy: Support files in sub-directoriesEugene Smirnov2019-10-291-0/+3
| | | | | | | | | | | | | | | | | | If the source file is located in a subdirectory of DEPLOY_DIR rawcopy will currently fail in sparse_copy function on open(dst_fname, 'wb'), as the parent directory for destination file does not exist. This patch helps to avoid that by recursively creating parent directories. (From OE-Core rev: 03796926046e5b5b57349d66de6bb009a34d2cb2) Signed-off-by: Eugene Smirnov <evgenii.smirnov@here.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 073c435644091c2801e45c6d02afa917de575082) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/direct: Partition numbering is broken for MBR primary partition #4Michael Cooper2019-10-081-1/+2
| | | | | | | | | | | | | When wks describes extra partitions that aren't in the partition table (e.g. boot loader) and exactly four primary MBR partitions, the last partition gets added to fstab as partition #5 instead of #4. [YOCTO #13560] (From OE-Core rev: 7537580b3dd21bd512fb26e56e92b6553c549fa8) Signed-off-by: Michael Cooper <michaelcooper81@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool/standard.py: Not filtering devtool workspace for devtool finishJaewon Lee2019-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | All devtool commands right now are filtering out the devtool workspace bbappends in build/workspace/appends when calling parse_recipe. While this may make sense for devtool add and modify, we need devtool finish to include those appends. A specific breakage that is caused because devtool finish filters devtool appends is the cmake/cml1 flow where a file is created in the WORKDIR that finish needs access to, to commit those files. Particularly for git packages with SRCPV in PV, SRCPV is only changed to 999 when using external source, hence when creating the cfg or cmake config files using for instance bitbake -c diffconfig, these files are created in the git999 workdir correctly (as in the devtool bbapends, we are inheriting externalsrc class). But when devtool finish is run, the devtool appends are not parsed, hence SRCPV is not changed to 999 and devtool is looking for the fragment files in the wrong WORKDIR. Changing the parse_recipe call just in devtool finish to not filter out the devtool workspace. Fixes [YOCTO #13533] (From OE-Core rev: aa94f00eec64ef936acc80dfa826fd309daa294f) Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/case.py: Encode binary data of logNathan Rossi2019-09-301-1/+5
| | | | | | | | | | | | | | | Do not decode the log content into a string only to re-encode it as binary data again. Some logs might un-intentionally contain bytes that do not decode as utf-8, as such preserve the log file content as it was on disk. Handle the decoding on the resulttool side, but also handle the failure to decode the data. (From OE-Core rev: 20531dc0b8f76a6e37cc856f36cd94077b6aba50) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: finish: Add suppport for the --no-clean optionPeter Kjellerstedt2019-09-271-1/+2
| | | | | | | | | | This works just like the already existing --no-clean option to the `devtool reset` command. (From OE-Core rev: 4433d3133ce53cdf7db17f5e7914fe8c4d78dba3) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: finish: Keep patches ordered when updating bbappendNiclas Svensson2019-09-271-4/+4
| | | | | | | | | | | | The _get_patchset_revs() function returns the patches in an OrderedDict to keep them ordered. However, this information was lost when the patches were added to the bbappend file. (From OE-Core rev: 69b7a2ba3af1280cc220ab236032f8466246ee93) Signed-off-by: Niclas Svensson <niclas.svensson@axis.com> Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Using the right rootfs size during prepare_rootfsAlessio Igor Bogani2019-09-271-6/+17
| | | | | | | | | | | | | | | | The commit 8e48b4d6c4 makes wic ignores IMAGE_ROOTFS_SIZE for rootfs size and makes it uses the computed one only. Re-add support for IMAGE_ROOTFS_SIZE variable and compute roots size only if the former is not defined. Moreover the size of a provided directory with --rootfs-dir="" in the .wks file should always be computed on the fly, else every partition will be constrained to be the same size as what ever value was in ROOTFS_SIZE. (From OE-Core rev: 0217a0392b8cc534fcc0d760b7663a1845b306f5) Signed-off-by: Alessio Igor Bogani <alessio.bogani@elettra.eu> Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/case.py: Add OEPTestResultTestCase for ptestresult helpersNathan Rossi2019-09-162-28/+60
| | | | | | | | | | | | | | | | Add the OEPTestResultTestCase class as a mix-in class to provide helper functions for interacting with ptestresults within the extraresults object generated by the test case. This class also provides default compression of log text and log files. Also add support to resulttool for decoding/decompressing log files embedded in the test results. (From OE-Core rev: 06cba9883a5964320969301fd05eeb6bec3e786d) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool: Handle multiple series containing ptestresultsNathan Rossi2019-09-161-12/+32
| | | | | | | | | | | | Handle multiple results series having ptestresults content. The contents are merged on a per-result basis where duplicates are ignored (with a warning message printed). The 'ptestresults.sections' collection is also merged on a per-suite basis. (From OE-Core rev: 47edd51970ed0c33edbe04fd72abd1cfc6ecd3d1) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool: Add reproducible log extractionJoshua Watt2019-09-061-3/+30
| | | | | | | | | | | | | | | | | Adds an argument to the log subcommand to extract the raw logs from the reproducible selftest. To prevent ambiguity, the "--raw" argument has been renamed "--raw-ptest", although the old "--raw" argument is kept around for compatibility. [YOCTO #13324] (From OE-Core rev: 7a4ebb361ff1efc22e7dafadfa60c98bc8a79ed4) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: Implement console 'keepalive' outputNathan Rossi2019-09-061-2/+41
| | | | | | | | | | | Similar to bitbake, implement a 'keepalive' output to the console to ensure CI systems do not kill the process. The default timeout for bitbake is 5000s. (From OE-Core rev: 77939cca96fa5467c88eafa3ac0db2db4aef09d6) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemuriscv: Generate a wic rootFS with a larger filesystemAlistair Francis2019-09-031-0/+3
| | | | | | | | | | This allows us to generate a rootFS with a large filesystem for use with QEMU. (From OE-Core rev: e06439200e44999c1e2f88d7d6c651da13698ca7) Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: Avoid failure for recipes with S == WORKDIR and no local filesPeter Kjellerstedt2019-09-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When extracting the sources for a recipe that has S == WORKDIR and no local files in the SRC_URI (which, e.g., can happen for a recipe with a URI that has the unpack=false attribute), the extraction fails with the following backtrace: Traceback (most recent call last): File ".../scripts/devtool", line 344, in <module> ret = main() File ".../scripts/devtool", line 331, in main ret = args.func(args, config, basepath, workspace) File ".../poky/scripts/lib/devtool/standard.py", line 762, in modify initial_rev, _ = _extract_source(srctree, args.keep_temp, args.branch, False, config, basepath, workspace, args.fixed_setup, rd, tinfoil, no_overrides=args.no_overrides) File ".../poky/scripts/lib/devtool/standard.py", line 647, in _extract_source bb.process.run('git %s commit -a -m "Committing local file symlinks\n\n%s"' % (' '.join(useroptions), oe.patch.GitApplyTree.ignore_commit_prefix), cwd=srctree) File ".../poky/bitbake/lib/bb/process.py", line 178, in run raise ExecutionError(cmd, pipe.returncode, stdout, stderr) bb.process.ExecutionError: Execution of 'git commit -a -m "Committing local file symlinks %% ignore"' failed with exit code 1: On branch devtool nothing to commit, working tree clean This is because no files were found in the oe-local-files directory and consequently no symbolic links were added using `git add`, but the `git commit` command was still executed. (From OE-Core rev: 3fdf304e72a1fb5de8bf9bc21e5b598fefb08648) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-check-layer: Allow any case for README file detectionMark Hatle2019-08-301-1/+1
| | | | | | | | | | It's become more commone for files to be named "readme" or "Readme" on github servers in recent time. So adjust the scanning to allow any mix of case. (From OE-Core rev: afe46eca15b6ddfa15c75cb7b707d6dd9aae3eae) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/resulttool/report.py: Add more result typesNathan Rossi2019-08-281-3/+3
| | | | | | | | | | | Add additional result types into the dictionary to handle dejagnu style test results. These include PASS, FAIL, XPASS, XFAIL, UNSUPPORTED, UNTESTED, UNRESOLVED and ERROR. (From OE-Core rev: 684fc36402a23760b203f4761f284043031c799c) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build: Also run deploy for devtool build if applicableJaewon Lee2019-08-211-1/+12
| | | | | | | | | | | | | | | | Right now `devtool build` runs populate_sysroot and packagedata tasks. Adding deploy to this list, if the recipe has the deploy task, so that the newly built artifacts are available in the deploy directory. Applicable only for packages with deploy task, such as kernel. [YOCTO#13382] (From OE-Core rev: b38a1328f0c7bc4b4102a05daee4058fd3214489) Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com> Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool: Prevent multiple results for the same testJon Mason2019-08-211-0/+14
| | | | | | | | | | | | | Currently, if a test occurs multiple times over different series, the code will sum these. This can lead to confusion over the desired results. Change the code to report the redundant tests and skip adding an additional values. (From OE-Core rev: caeaa0648dff64c56a33f52e45e82bfab6719e3e) Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-check-layer: Ensure we use OEBasicHash as the signature handlerRichard Purdie2019-08-211-1/+1
| | | | | | | | | The layer checks are designed to work with OEBasicHash so ensure that handler is in use rather than the new hash equivalency one as an example. (From OE-Core rev: a10bf92516a4771e2dc49ba9f74323d7a87a1619) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Make disk partition size consistently computedJason Wessel2019-08-121-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using different root directories with a wks file wic is using the value from the original ROOTFS_SIZE which is not correct. Example: Number Start End Size File system Name Flags 1 20.5kB 318MB 318MB fat16 otaefi legacy_boot, msftdata 2 318MB 636MB 318MB ext4 otaboot 3 636MB 1709MB 1074MB ext4 otaroot 4 1709MB 2027MB 318MB ext4 otaboot_b 5 2027MB 3101MB 1074MB ext4 otaroot_b 6 3101MB 5249MB 2147MB ext4 fluxdata The partitions 1, 2, and 3 incorrectly inherit the size, instead of using a computed size. With the patch applied it is working properly: Number Start End Size File system Name Flags 1 20.5kB 14.5MB 14.5MB fat16 otaefi legacy_boot, msftdata 2 14.5MB 65.3MB 50.8MB ext4 otaboot 3 65.3MB 1139MB 1074MB ext4 otaroot 4 1139MB 1190MB 50.8MB ext4 otaboot_b 5 1190MB 2264MB 1074MB ext4 otaroot_b 6 2264MB 4411MB 2147MB ext4 fluxdata As for the removal of the bb.warn, if the size is not specified, it is not something to warn the end user about. Some of my default images make use of the head room + a computed directory size or while generating images. (From OE-Core rev: 8e48b4d6c4d0ed213089a7449fea63aa0656e786) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add partition type for msdos partition tablesJason Wessel2019-08-123-11/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to create a msdos partition table disk image that can auto expand after the image is copied to an SD card, wic needs the ability to have a primary partition as the last entry. The desired use case is to be able to create an A/B update partition image scheme with a /var volume that can be auto expanded to the remainder of the SD card at run time. The typical .wks file will look similar to the following: bootloader --ptable msdos part / --source rawcopy --sourceparams="file=u-boot.imx" \ --ondisk mmcblk --no-table --align 1 --size 1 part /boot --source bootimg-partition \ --ondisk mmcblk --fstype=vfat --label boot --active --align 4 --size 16 part / --source rawcopy --sourceparams="file=imx6_boot.otaimg" \ --ondisk mmcblk --fstype=ext4 --label otaboot --align 4 --type logical part / --source rawcopy --sourceparams="file=imx6.otaimg" \ --ondisk mmcblk --fstype=ext4 --label otaroot --align 4 --type logical part / --source rawcopy --sourceparams="file=imx6_boot.otaimg" \ --ondisk mmcblk --fstype=ext4 --label otaboot_b --align 4 --type logical part / --source rawcopy --sourceparams="file=imx6.otaimg" \ --ondisk mmcblk --fstype=ext4 --label otaroot_b --align 4 --type logical part /var --source rawcopy --sourceparams="file=imx6_var.otaimg" \ --ondisk mmcblk --fstype=ext4 --label fluxdata --align 4 Without the patch applied, wic will generate an SD card image that looks like: Disk boot.img: 890940s Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 2056s 48001s 45946s primary fat16 lba 2 48008s 132467s 84460s primary ext4 3 132472s 454467s 321996s primary ext4 4 454471s 890939s 436469s extended lba 5 454472s 538931s 84460s logical ext4 6 538936s 860931s 321996s logical ext4 7 860936s 890939s 30004s logical ext4 boot With the patch applied a primary partition can be created at the end of the image which can be expanded to fill the free space on the media where the image has been copied, which looks like: Disk boot.img: 890940s Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 2056s 48001s 45946s primary fat16 lba 2 48007s 860931s 812925s extended lba 5 48008s 132467s 84460s logical ext4 6 132472s 454467s 321996s logical ext4 7 454472s 538931s 84460s logical ext4 8 538936s 860931s 321996s logical ext4 3 860936s 890939s 30004s primary ext4 boot (From OE-Core rev: 56add7cc547e0113cdf980579d1421b14cc233e5) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/plugins: Source that support both EFI and BIOSWilliam Bourque2019-07-231-0/+213
| | | | | | | | | | | | | | Add a source plugin that support both EFI and legacy PC-Bios. While using this plugin, both bootloaders configurations reside in the same /boot partitions. This plugin has very little code : to avoid code duplication, we simply re-import bootimg-pcbios and bootmg-efi source and call both their SourcePlugin methods. (From OE-Core rev: c8545d54139c6c48bffd1dd1d39d79891626c6f7) Signed-off-by: William Bourque <wbourque@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: remove temp dir in upgradeChen Qi2019-07-221-0/+1
| | | | | | | | | | For now, the temp dir is left in system, although the temporary source directory has been cleaned up. So we clean it up too. (From OE-Core rev: 8a0602327d5afcf4f36850d3f05c9721305852af) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix (again) partition files UIDs on multi rootfs imagesRicardo Ribalda Delgado2019-07-191-25/+12
| | | | | | | | | | | | | | | | | | | | | Commit 450335ba5e73a375eb9932b4c4cf37979640dbfc copies the pseudo database to the working directory in order to have ownership information when the filesystem is generated. Unfortunately this does not work anymore. The filenames on the database are absolute and there is no information about the new directory. Instead of fixing the database, we could redo a bit the way we patch the fstab file. Now I am saving the old contents of fstab, modifying the file and then reverting the changes on exit. This is faster than the previous approach, although it can cause indeterminism if the application is killed before finishing. (From OE-Core rev: dcbf7b864dd1713b54a172d8714ce1508482f086) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add support for kernel with initramfs bundledChee Yang Lee2019-07-173-14/+29
| | | | | | | | | | | | | | | | | | | | when INITRAMFS_IMAGE_BUNDLE and INITRAMFS_IMAGE are set, wic should look for kernel with initramfs image bundled. Include required variable MACHINE, INITRAMFS_IMAGE_BUNDLE, INITRAMFS_IMAGE, INITRAMFS_LINK_NAME and KERNEL_IMAGETYPE in WICVARS. No longer require default value for variable kernel as KERNEL_IMAGETYPE is not optional variable and included in WICVARS. image_types_wic to inherit kernel-artifact-names to obtain default INITRAMFS_LINK_NAME when INITRAMFS_IMAGE_BUNDLE are set. update wic.Wic2.test_image_env test case to filter optional variable INITRAMFS_LINK_NAME, INITRAMFS_IMAGE and INITRAMFS_IMAGE_BUNDLE. (From OE-Core rev: bac984fbb2d5ad5d13ba3275c8a3e878d8753c58) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/buildstats-diff: Add option to filter tasksJoshua Watt2019-07-171-1/+5
| | | | | | | | | | | | | | | | Adds a command line option to filter out the buildstats-diff report by one more more tasks. e.g.: buildstats-diff --only-task do_compile A B will only show the differences for do_compile tasks. The --only-task option can be specified multiple times to filter out multiple tasks at once. (From OE-Core rev: a8c7960d24c48107fd3703e49c38f890e84e2226) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: provide support for devtool menuconfig commandSai Hari Chandana Kalluri2019-07-172-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All packages that support the menuconfig task will be able to run devtool menuconfig command. This would allow the user to modify the current configure options and create a config fragment which can be added to a recipe using devtool finish. 1. The patch checks if devtool menuconfig command is called for a valid package. 2. It checks for oe-local-files dir within source and creates one if needed, this directory is needed to store the final generated config fragment so that devtool finish can update the recipe. 3. Menuconfig command is called for users to make necessary changes. After saving the changes, diffconfig command is run to generate the fragment. Syntax: devtool menuconfig <package name> Ex: devtool menuconfig linux-yocto The config fragment is saved as devtool-fragment.cfg within oe-local-files dir. Ex: <workspace_path>/sources/linux-yocto/oe-local-files/devtool-fragment.cfg Run devtool finish to update the recipe by appending the config fragment to SRC_URI and place a copy of the fragment within the layer where the recipe resides. Ex: devtool finish linux-yocto meta [YOCTO #10416] (From OE-Core rev: 417feb559a74b367315e8658d6ba868a4f8d1340) Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool/standard.py: Create a copy of kernel source within work-shared if ↵Sai Hari Chandana Kalluri2019-07-171-1/+19
| | | | | | | | | | | | | | | | | | not present If kernel source is not already downloaded i.e staging kernel dir is empty, place a copy of the source when the user runs devtool modify linux-yocto. This way the kernel source is available for other packages that use it. [YOCTO #10416] (From OE-Core rev: bb42ab90835e8ec2f1dfbb35056c353784693266) Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool/standard.py: Update devtool modify to copy source from work-shared ↵Sai Hari Chandana Kalluri2019-07-171-23/+99
| | | | | | | | | | | | | | | | | | | | | if its already downloaded In the regular devtool modify flow, the kernel source is fetched by running do_fetch task. This is an overhead in time and space. This patch updates modify command to check if the kernel source is already downloaded. If so, then instead of calling do_fetch, copy the source from work-shared to devtool workspace by creating hard links else run the usual devtool modify flow and call do_fetch task. [YOCTO #10416] (From OE-Core rev: 3c3a9bae296f849dbfe03942282f44036e6fa1fb) Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: add MD5 hash for the line-wrapped MPL-1.1 licenseRoss Burton2019-07-111-0/+1
| | | | | | | (From OE-Core rev: d2755523d339a4eba7a034bdef5563657609f563) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: upgrade: fix handling of errors parsing upgraded recipePaul Eggleton2019-07-031-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of upgrading a recipe we create the upgraded recipe file in the workspace and then try to parse it so we can then make further modifications. If for some reason that parsing fails then the failure was not being handled very well - the broken recipe was being left in place, breaking parsing until it was removed by hand. Fix that by adding a call to the cleanup function, and fix the following issues: * Fix the cleanup function which doesn't look like it has ever worked due to a typo in the function call * Fix double-printing the error message * Remove usage of DevtoolError in this case (DevtoolError is for simple usage errors, not this kind of issue which may be the result of a bug). We're still printing a traceback in this scenario but at least it doesn't break the build system requiring manual cleanup. I also introduced a command-line option to preserve the broken upgraded recipe file(s) for debugging purposes. (The reproducer for this is "devtool upgrade libnewt-python", however you need to check out revision b82ea144e144671d3f64c0785ba4beafe905cd4f or earlier since that recipe has now been absorbed into the libnewt recipe. The libnewt-python recipe was causing an issue with the upgrade because it actually included the libnewt recipe using ${PV} in the include statement, and of course PV was changing in the upgrade.) Fixes [YOCTO #13404]. (From OE-Core rev: c519ac360796675d7fc09a5250d21f0f5b6236fc) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: ignore zero-length setup.py filesPaul Eggleton2019-07-031-2/+7
| | | | | | | | | | | | | | | If a setup.py file exists it ought to have something in it before we consider the source tree to be a Python module and treating it as such. (A counter-example is https://www.bro.org/downloads/binpac-0.50.tar.gz - it's not clear why this has a zero-length setup.py in it but we should pay no attention to it.) Fixes [YOCTO #12923]. (From OE-Core rev: 548a5c8f42c6ac1b0f7962926d05276e71505678) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package: Build pkgdata specific to the current recipeRichard Purdie2019-06-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This switches the code to build pkgdata specific to the current recipe which means that its filtered to the recipes dependencies and can perform better as we can drop the lockfile. It uses a similar method to the staging code to do this, using BB_TASKDEPDATA to construct a list of packagedata task output which this recipe should "see". The original pkgdata store is left unaltered so existing code works. The lock file was there to prevent files disappearing as they were read or as directories were listed. Since we have a copy of the data and only access output from completed tasks (as per their manifests), we can remove the lock. The lock was causing starvation issues on systems with parallelism. There was also a potential determinism problem as the current code could "see" data from recipes which it doesn't depend upon. [YOCTO #13412] (From OE-Core rev: 1951132576bfb95675b4879287f8b3b7c47524fa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: python2 -> python3Robert Yang2019-06-303-3/+3
| | | | | | | (From OE-Core rev: 9303f92599343adf645fee5d2434fadd97e7febb) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: warn user about multiple layer having the same base nameChen Qi2019-06-281-4/+18
| | | | | | | | | | | | | | | | | | | Currently `devtool finish RECIPE meta' will silently succeed even if there are multiple layers having the same base name of 'meta'. e.g. meta layer from oe-core and meta layer from meta-secure-core. We should at least give user a warning in such case. With the patch, we will get warning like below. WARNING: Multiple layers have the same base name 'meta', use the first one '<PROJ_DIR>/oe-core/meta'. WARNING: Consider using path instead of base name to specify layer: <PROJ_DIR>/oe-core/meta <PROJ_DIR>/meta-secure-core/meta (From OE-Core rev: 2c8740f543c38dbaef3345e40827ef48b3f75405) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/bootimg-efi: allow multiple initrdChee Yang Lee2019-06-191-6/+16
| | | | | | | | | | | | | | | Allow plugin bootimg-efi to configure with multiple initrd through source parameter. Uses ; to separate each initrd. e.g: --sourceparams="loader=${EFI_PROVIDER},initrd=initrd1;initrd2" (From OE-Core rev: c7b0823f9ab6a9959aaa809b8c3f70d199feb64d) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/merge: Enable control TESTSERIES and extra configurationsYeoh Ee Peng2019-06-121-5/+15
| | | | | | | | | | | | | Current QA team need to merge test result files from multiple sources. Adding TESTSERIES configuration too early will have negative implication to report and regression. Enable control to add TESTSERIES when needed. Also enable adding EXECUTED_BY configuration when needed. (From OE-Core rev: 651d8d371e78e77599d56681228d5782664f7743) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/store: Enable add EXECUTED_BY config to resultsYeoh Ee Peng2019-06-121-2/+7
| | | | | | | | | | | Current results stored does not have information needed to trace who executed the tests. Enable store to add EXECUTED_BY configuration to results file in order to track who executed the tests. (From OE-Core rev: dca2a57d54163a2e63b06e2f140fea3bd49cef0d) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/resultutils: Enable add extra configurations to resultsYeoh Ee Peng2019-06-121-7/+12
| | | | | | | | | | | | Current resultutils library always add "TESTSERIES" configuration to results. Enhance this to allow control of adding "TESTSERIES" configuration as well as allow adding extra configurations when needed. (From OE-Core rev: 443c0acc14ef2451b10878fc83dd11b46805daf0) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/plugins: kernel image refer to KERNEL_IMAGETYPEChee Yang Lee2019-06-113-15/+35
| | | | | | | | | | replaced hardcoded kernel image with KERNEL_IMAGETYPE. set kernel image to "bzImage" incase KERNEL_IMAGETYPE not set. (From OE-Core rev: 88a9fef761c5e67b2964fedc85a7e8ad37067564) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: add python3 supportMaciej Pijanowski2019-06-101-11/+11
| | | | | | | | | | | | | | | | Add support for generating python3 recipes using the recipetool / devtool. Drop python2 support at the same time. Tested with: oe-selftest -r recipetool.RecipetoolTest [YOCTO #13264] (From OE-Core rev: d8b2f58974482b3b1ccc65c5f93104d0d7ba87bc) Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/filemap: handle FIGETBSZ failingRoss Burton2019-06-081-1/+4
| | | | | | | | | | | Some file systems don't support fetching the block size (notably the file system Docker uses for containers), so handle the iotctl() failing and raise the expected error. (From OE-Core rev: 3757073726a00c5250556aae3d0daac76b88085e) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/engine: include .wks.in in wic search and listChee Yang Lee2019-06-071-3/+4
| | | | | | | | | | allow wic to list and search for kickstart file in .wks.in extension. basename show by wic list images to fully exclude extension. (From OE-Core rev: 2c0a292a790ad069648e37b1b29fcea656fcf3e4) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>