summaryrefslogtreecommitdiffstats
path: root/scripts/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* resulttool: Remove prints if no tests occurJon Mason2019-06-041-11/+3
| | | | | | | | | | Printing the lack of a test is not necessary (per feedback). Remove this from the template to quieten it. (From OE-Core rev: b1fe6ae66360e160eeaeafe456536f335a0eab60) Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/manualexecution: Enable creation of test case configurationsangeeta jain2019-06-041-1/+30
| | | | | | | | | | | | Allow the creation of test case configuration file based on user inputs. Where this testcase configuration file will be used by the the manual execution to run selected test cases for a module rather than compulsory run all test cases in manual json file. (From OE-Core rev: 73d2a747c17779da0ca972da776b3cf02c2e1cbc) Signed-off-by: sangeeta jain <sangeeta.jain@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool: modify to be multi-machineJon Mason2019-06-042-67/+81
| | | | | | | | | | | | Currently, the code will sum all of the different machine results into a single report of the tests results. This can lead to confusion as to which machine may be experiencing issues. Modify the code to store the results in a per machine basis and report them accordingly. (From OE-Core rev: 16d4031ea5df8a4ddfdb937d35464c09e1abd10e) Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: bootimg-efi: add label source parameterChee Yang Lee2019-05-301-4/+15
| | | | | | | | | | | | | Add new source parameter label to allow custom boot.conf/grub.cfg label, so far it's hardcoded to "Boot". Default label to "Boot" for systemd-boot and blank for grub-efi when source parameter label are not set. (From OE-Core rev: 7a0aab1aa31e66e6bc94c04c2f6c1043b64a8967) Signed-off-by: Chee Yang Lee <chee.yang.lee at intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/bootimg-efi: replace hardcoded volume name with labelChee Yang Lee2019-05-151-2/+4
| | | | | | | | | | | volume name should refer to --label in .wks. Replace the hardcoded volume name with label. set "ESP" as default name when no lable specified. (From OE-Core rev: 5621aceaf39ef0dc097b16c83e73b9882c987a7c) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib+scripts: Convert to SPDX license headersRichard Purdie2019-05-0959-587/+81
| | | | | | | | | | | | | | | | | | | | | | | This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. (From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool: Add option to dump all ptest logsJoshua Watt2019-05-082-16/+54
| | | | | | | | | | | | | | | Adds an option to dump all the ptest logs to individual files in a specified directory. If multiple test runs are present, the '--prepend-run' argument will create separate directories for each test run under the target directory and put the logs there to prevent each test run from clobbering the others. [YOCTO #13331] (From OE-Core rev: f262b9e7482e38f04dfa162f0aaf65b17e86f8b2) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: fix unbound variable when fixed SRCREV can't be foundAlex Kiernan2019-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | If attempting to find a fixed SRCREV fails because the directory doesn't exit, avoid failing with: Traceback (most recent call last): File "/home/vagrant/poky/scripts/recipetool", line 121, in <module> ret = main() File "/home/vagrant/poky/scripts/recipetool", line 110, in main ret = args.func(args) File "/home/vagrant/poky/scripts/lib/recipetool/create.py", line 707, in create_recipe srcrev = stdout.rstrip() UnboundLocalError: local variable 'stdout' referenced before assignment Fixes: 000480c42797 ("recipetool / devtool: set a fixed SRCREV by default when fetching from git") (From OE-Core rev: 8e4b301573071ea04911b0df6533c25bc4596b93) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool: add LTP compliance sectionArmin Kuster2019-04-292-1/+58
| | | | | | | (From OE-Core rev: a680d7d15fafbecf4edce9a29cc4eda16c11fd94) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool: add ltp test supportArmin Kuster2019-04-292-1/+59
| | | | | | | (From OE-Core rev: 966795aa2c6960aca11a04e87f415256faf26957) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/manualexecution: Enable test case configuration optionsangeeta jain2019-04-261-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | Current manualexecution required user to exceute all test cases defined inside a "modulename.json" file in oeqa/manual There are cases when all test cases all not required to run for a module on specific DUT. Enable manualexecution to have the optional feature where it will use pre-defined json format test case configuration file where user will be able to select test cases from the "modulename.json" instead of running all of them. This will help in reducing testing time and reporting unneccesary skip or failures. Example pre-defined json format test case configuration file (for build-applince): { "testcases" : [ "build-appliance.build-appliance.Create_core-image-sato-sdk_using_build_appliance", "build-appliance.build-appliance.Build_a_image_without_error_(added_recipe)" ] } (From OE-Core rev: 3950c28a34f94b5907d37b579bdaee5a59794652) Signed-off-by: sangeeta jain <sangeeta.jain@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "wic: Set a miniumum FAT16 volume size."Angus Lees2019-04-261-1/+1
| | | | | | | | | | | | | | | | This reverts commit f7dfb4d43247d3c13a4e0a3853007d63b9512b83. FAT16 volumes do not have a minimum size of 8250 blocks (== slightly over 4MB). Exhibit A: floppy disks. The original commit message suggests this was a workaround for a bug in parted - in which case we should fix it there, or use the wic `--fixed-size` option to pass down an enforced minimum from a more context-aware point in the callstack. (From OE-Core rev: e0a1ae3863bc229512d43e4a5248551bf25950e5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resultool/resultutils: Fix module import errorRichard Purdie2019-04-261-1/+1
| | | | | | | | | Fix AttributeError: module 'urllib' has no attribute 'request' when using remote http urls. (From OE-Core rev: 9acc47236e2a9ac7f97f80040f5e508f23f01611) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool: Add log subcommandJoshua Watt2019-04-252-1/+57
| | | | | | | | | Adds a subcommand for dumping various logs from test results (From OE-Core rev: 454b8d2cdc6f79a51e610dae92c22352850c3f7c) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool: Load results from URLJoshua Watt2019-04-255-13/+28
| | | | | | | | | | Adds support for resulttool to load JSON files directly from a http:// or https:// URL (From OE-Core rev: 235bcf0c504e7ea253ccfb28d600898117c64c1f) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/manualexecution: Refactor and remove duplicate codeYeoh Ee Peng2019-04-121-47/+40
| | | | | | | | | | | Remove duplicate codes. Replace unnecessary class variables with local variables. Rename variables and arguments with simple and standard name. (From OE-Core rev: 6bef61d36f3328fad003c0dc9c010d3f76ba96d8) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: add missed moduleLei Yang2019-04-121-0/+1
| | | | | | | | | | | | | | When I use recipetool to add a new recipe, it says: [snip] sys.exit(14) NameError: name 'sys' is not defined [snip] (From OE-Core rev: 051e1c27bbf6a5898f2cf13b78dd3d8d1ec31586) Signed-off-by: Lei Yang <Lei.Yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/manualexecution: Enable creation of configuration option fileYeoh Ee Peng2019-04-101-1/+53
| | | | | | | | | | | | Allow the creation of configuration option file based on user inputs. Where this configuration option file will be used by the the manual execution to display options for configuration rather than user need to inputs configuration manually. (From OE-Core rev: 23c7a037a85a825aa088bfac3a144c14087a9f49) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/manualexecution: Enable configuration options selectionYeoh Ee Peng2019-04-101-9/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current manualexecution required user to input configuration manually where there were inconsistent inputs and human typo issues. Enable manualexecution to have the optional feature where it will use pre-compiled configuration options file where user will be able to select configuration from the pre-compiled list instead of manual key-in the configuration. This will eliminate human error. Expect the pre-compiled configuration options file in json format below { "bsps-hw": { "IMAGE_BASENAME": { "1": "core-image-sato-sdk" }, "MACHINE": { "1": "beaglebone-yocto", "2": "edgerouter", "3": "mpc8315e-rdb", "4": "genericx86", "5": "genericx86-64" } }, "bsps-qemu": { "IMAGE_BASENAME": { "1": "core-image-sato-sdk" }, "MACHINE": { "1": "qemuarm", "2": "qemuarm64", "3": "qemumips", "4": "qemumips64", "5": "qemuppc", "6": "qemux86", "7": "qemux86-64" } } } (From OE-Core rev: 1af7e04223b415a64e100a9f91d60f5e9b0f789a) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: standard: Handle exporting generated config fragmentsNathan Rossi2019-04-091-0/+14
| | | | | | | | | | | | | | | The cml1 and ccmake bbclasses generate configuration fragment source files that must be exported from the WORKDIR as a source file to be preserved across builds. This change adds detection of the current recipes inherited classes and for cml1 and ccmake classes checks for the specific generated configuration fragment files. These files are then exported by devtool and included as SRC_URI files from within the target layer. (From OE-Core rev: 7a1fabe4a24552ce8a50c8d6009969ca52a5fd27) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/manualexecution: Refactor and simplify codebaseYeoh Ee Peng2019-04-041-36/+20
| | | | | | | | | | Simplify and removed unnecessary codes. Refactor to allow pythonic loop. (From OE-Core rev: 84c6a992e1114685194f6e8a554bce7753c090cc) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/manualexecution: Fixed step sorted by integerYeoh Ee Peng2019-04-041-1/+1
| | | | | | | | | | | | | Currently the manual execution display step by sorting the step as string, where steps were not being sorted correctly when there are more than 9 steps. Fixed the step sorting by sorting step as integer. (From OE-Core rev: 192c255d9f597b3526a5b94fcf3eedc4527189ed) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/manualexecution: Enable display full steps without press enterYeoh Ee Peng2019-04-041-2/+3
| | | | | | | | | | | | Current manualexecution required pressing enter button to show each step information, where this was wasting execution time. Enable display full steps without needing to any press enter button. (From OE-Core rev: e44c9a018c13208fef0dcef4479ce71977628cd4) Signed-off-by: Mazliana <mazliana.mohamad@intel.com> Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/manualexecution: Standardize input checkYeoh Ee Peng2019-04-041-2/+2
| | | | | | | | | | | Current input checking does not match the standard input practiced by QA team. Change the input checking to match the standard input practiced by the QA team. (From OE-Core rev: 630a93c740359a65249a198f314f15040042f8d3) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool: Allow extraction of ptest dataRichard Purdie2019-04-042-9/+32
| | | | | | | | | | | | | Rather than simply discarding the ptest data, change the code to discard it when writing out the new testresult files, or optionally either preserve it, or write it as seperate discrete logs. This means the autobuilder should start writing out individual ptest log files as well as allowing ueers to extract these manually. (From OE-Core rev: a1e0944bf260ef50dd7dfcb10db248fdd7f45bc9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool: Allow store to work on single filesRichard Purdie2019-04-041-9/+12
| | | | | | | | | | Store operations using a single file as a source weren't working as the os.walk command didn't like being given a single file. Fix the store operation to work for single files. (From OE-Core rev: eb5bbe613d8c7cbcd8b74d8ac0073c2217970410) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/engine: Add missing newlineRichard Purdie2019-04-031-1/+1
| | | | | | | | | | | | | | | | On some hosts the wic.Wic2.test_wic_cp_ext selftest was failing as files weren't being copied into the rootfs with "wic cp". This was due to a bug added by: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=89d4a8df074598cfb3a76e41db7c45d845afd961 where there should be a second newline added at the end of the expression due to the difference in the way echo -e and printf behave. [YOCTO #13237] (From OE-Core rev: 2f3adb21cc5067458a12964d0bde235966a20a60) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: prevent starting git gc in backgroundTaras Kondratiuk2019-03-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Devtool creates a git repository for extracted sources in a temporary directory and then moves it to a final destination after patching is done. Unfortunately devtool is not aware that some of its git operations may have caused git garbage collector to start in background. If timing is just right a repository move fails because GC is removing git objects while they are being moved. The issue was hit on Krogoth release, but the code that moves created git repository is still the same. Disable gc.autodetach to make GC run synchronously and block git until it is done. Traceback (most recent call last): File "<snip>/openembedded-core/scripts/devtool", line 342, in <module> ret = main() File "<snip>/openembedded-core/scripts/devtool", line 329, in main ret = args.func(args, config, basepath, workspace) File "<snip>/openembedded-core/scripts/lib/devtool/standard.py", line 352, in extract initial_rev = _extract_source(srctree, args.keep_temp, args.branch, False, rd) File "<snip>/openembedded-core/scripts/lib/devtool/standard.py", line 644, in _extract_source shutil.move(srcsubdir, srctree) File "/usr/lib/python2.7/shutil.py", line 299, in move copytree(src, real_dst, symlinks=True) File "/usr/lib/python2.7/shutil.py", line 208, in copytree raise Error, errors Error: [('/tmp/devtool5RXkuX/workdir/grpc-1.2.5/.git/objects/5e', '<snip>/build/grpc/grpc_src/.git/objects/5e', "[Errno 2] No such file or directory: '/tmp/devtool5RXkuX/workdir/grpc-1.2.5/.git/objects/5e'"), ('/tmp/devtool5RXkuX/workdir/grpc-1.2.5/.git/objects/57', '<snip>/build/grpc/grpc_src/.git/objects/57', "[Errno 2] No such file or directory: '/tmp/devtool5RXkuX/workdir/grpc-1.2.5/.git/objects/57'"), many git objects ... ] (From OE-Core rev: 3da578a79195a63fb6d4bbd68d8f1548defd205f) Signed-off-by: Taras Kondratiuk <takondra@cisco.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>