summaryrefslogtreecommitdiffstats
path: root/scripts/lib
Commit message (Collapse)AuthorAgeFilesLines
* recipetool: create: make recently added branch/tag handling git specificPaul Eggleton2017-08-311-2/+2
| | | | | | | | | | | | The branch and tag handling code that was recently added in OE-Core revs ecca596b75cfda2f798a0bdde75f4f774e23a95b and 3afdcbdc9a3e65bc925ec61717784ffec67d529d is specific to git, so only apply it when we're fetching from a git URL. (From OE-Core rev: 5d4bfe6cf788ce971a2e9419bc13492153023681) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: add: add explicit srcrev/branch optionsPaul Eggleton2017-08-312-5/+37
| | | | | | | | | | | | | | | | At the moment when fetching source from a git repository you have to know that you can specify the revision and branch in the URL with ';rev=' and ';branch=' respectively, and you can also get thrown off by the shell splitting on the ; character if you forget to surround the URL in quotes. Add explicit -S/--srcrev and -B/--srcbranch options (consistent with devtool upgrade) to make this easier for the user to discover and use. (The rev and branch URL parameters will continue to work, however.) (From OE-Core rev: 2d86cac853d6daa496c0315a5cb0662ebf1165b0) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: edit-recipe: fix regressionPaul Eggleton2017-08-311-4/+11
| | | | | | | | | | | | | | OE-Core commit 5a16b3c804c5eca331a1c08a7ce31a54909af105 attempted to use the same function to get the path to a recipe as the new "find-recipe" command it implemented, except that cannot work because (a) it didn't return anything and (b) event if it had tried, a command function can only return an exit code and we don't want that for find-recipe if it succeeded. Split out a separate reusable function for both commands. (From OE-Core rev: d5191840212adbf480961ba6fc68e1ab17e5a77a) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: upgrade: workaround for recipes which apply patches conditional ↵Paul Eggleton2017-08-311-1/+1
| | | | | | | | | | | | | | | | | | | | upon class If we're upgrading a recipe that appends additional patches for, say, class-native, and we're just upgrading the target variant, then when we copied the recipe into the workspace we skipped copying the additional patches for the native variant. This caused warnings because the workspace recipe is preferred. Look at SRC_URI for all variants when copying files to work around this. More work is needed to make it easier to work with recipes that use BBCLASSEXTEND where you need to build more than one variant at once, but this at least fixes the immediate ugliness. (From OE-Core rev: 56bf5e93358187e31160d7893f57906bb3dc7ad7) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: upgrade: fix handling of non-absolute pathsPaul Eggleton2017-08-311-0/+3
| | | | | | | | | | | | | | | | If your BBLAYERS has non-absolute paths in it (e.g. "${COREBASE}/../something") then none of the paths matched in copy_recipe_files() with the result that no files got copied and you ended up with an error later on because the recipe file couldn't be found at the destination. Fix this as well as adding an explicit check to see if no files got copied - error out earlier if so. Fixes [YOCTO #10981]. (From OE-Core rev: 3861486ad06f90c8644ebab119bbc5ddb9e693ca) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: update-recipe: ensure patches get deleted in srcrev modePaul Eggleton2017-08-311-1/+2
| | | | | | | | | | | | | | | | Patches that we identify as having been "deleted" (i.e. patches in SRC_URI that no longer appear in the git tree) need to be dropped even if we're updating in srcrev mode. This fixes the case where HEAD of the git tree is valid upstream (i.e. no extra commits), but there are patches left over in the recipe, e.g. when we do devtool upgrade and then all of the commits rebased on top of the new branch get skipped. Fixes [YOCTO #11972]. (From OE-Core rev: 350f83dc1e317aeb93539f13966caca6d894f569) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: deploy-target: Support stripped libs and execsTobias Hagelborn2017-08-271-4/+29
| | | | | | | | | | | | | | | | | | | | New devtool deploy-target option --strip which enables deploying stripped binaries, saving some space on target. * Copies the files of ${D} into a new directory and strips them in place * Used oe.package.strip_execs for stripping directory * Added devtool.conf option "strip" for changing default behavior Config example: [Deploy] strip = true [YOCTO #11227] (From OE-Core rev: 7f10c5118793da6ded59ae6e60e796152dbd7ca3) Signed-off-by: Tobias Hagelborn <tobiasha@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: always read image partitionsEd Bartosh2017-08-271-2/+3
| | | | | | | | | | | Got rid of lazy evaluation of self.partitions property. It's not needed because partitions of the source image should be always read. (From OE-Core rev: 1186fd8fd4a4789dc7c60feb86cc9fdd03fee7b3) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: implement 'wic write' commandEd Bartosh2017-08-272-0/+186
| | | | | | | | | | | | This command writes image to the media or another file with the possibility to expand partitions to fill free target space. [YOCTO #11278] (From OE-Core rev: ac5fc0d691aad66ac01a5cde34c331c928e9e25a) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: extend list of used toolsEd Bartosh2017-08-271-1/+2
| | | | | | | | | | | | | | Added sfdisk, e2fsck, mkswap, resize2fs, mkdosfs to the list of used tools in Disk class. They're going to be used in 'wic write' implementation. Added dependency to util-linux to wic-tools to ensure that sfdisk and mkswap are available from wic-tools native sysroot. (From OE-Core rev: 1add68e4d6150e3038609d8ce7e3cff28fe8fbb8) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: added 'fstypes' parameter to Disk.__init__Ed Bartosh2017-08-271-2/+7
| | | | | | | | | | | This parameter specifies list of supported filesystems. So far only 'fat' is supported, but 'wic write' is going to support at least 'fat', 'ext' and 'swap'. (From OE-Core rev: 7cffcdcfdf4f8934d212740a6d7cf136911ebdac) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: convert partition number to intEd Bartosh2017-08-271-2/+2
| | | | | | | | | | Converted partition number to int in order to use it as an index in the list of partitions. (From OE-Core rev: f901f23eb05cd6b86a49ef1b6ec7efaf72f6d685) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: get more info from the 'parted print' outputEd Bartosh2017-08-271-1/+8
| | | | | | | | | | | Got partition type and sector sizes from the output of 'parted print'. This info may be used in the implementation of 'wic write' command. (From OE-Core rev: 5c0926d8efa468177b7cb43a5f06b35058255644) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: reimplement getting paths of used toolsEd Bartosh2017-08-271-27/+9
| | | | | | | | | | | | | | So far every used tool have to have separate property and private attribute in the Disk class. This is too verbose, considering that there will be much more tools used. Reimplemented getting tools paths using custom __getattr__ method. This is much more compact and readable. (From OE-Core rev: d1a831a9870bc31e936eb480485b28f1ffc13080) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: fix npm license code regressionPaul Eggleton2017-08-231-0/+3
| | | | | | | | | | | | | | OE-Core commit 1df60b09f7a60427795ec828c9c7180e4e52f98c caused a regression in npm handling since it still expected to be able to get the results of the license handling, but this no longer happens until after the npm plugin is called. Thus, call the license handling function ourselves here (which will record this as having been handled so it doesn't get done again later). (From OE-Core rev: 3e408aadaea85b6f192b34d37d508cbaf3cd7164) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: fix broken import in npm modulePaul Eggleton2017-08-231-1/+1
| | | | | | | | | | | With "import oe" in create_npm.py you get "AttributeError: module 'oe' has no attribute 'package'" when it tries to call oe.package.npm_split_package_dirs(). (From OE-Core rev: 1261900aeac725e5712e0180600753a9d4c67e60) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* linux-yocto: Drop 4.1 kernel appendsRichard Purdie2017-08-2314-578/+0
| | | | | | (From meta-yocto rev: ecde92624c27ebe511696b5bcfc83b21efec17d0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: allow plugins to set LICENSE and LIC_FILES_CHKSUMPaul Eggleton2017-08-232-80/+79
| | | | | | | | | | | | | | | | | | | | | We were being a bit prescriptive in setting LICENSE and LIC_FILES_CHKSUM. We can't always trust what's in the metadata accompanying some source which plugins will almost always be pulling from, however we do want to allow plugins to set the LICENSE and LIC_FILES_CHKSUM values. Merge what we find in our license file scan with what the plugin sends back. Additionally, plugins can now add a "license" item to the handled list in order to inhibit the normal LICENSE / LIC_FILES_CHKSUM handling if they have already taken care of it completely. Thanks to Mark Horn <mark.d.horn@intel.com> for prompting, testing and fixing this patch. (From OE-Core rev: 1df60b09f7a60427795ec828c9c7180e4e52f98c) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: allow plugins to set PN / PV more easilyPaul Eggleton2017-08-231-7/+9
| | | | | | | | | | | | | Previously if we were able to auto-determine the name from the URL, that took precedence over any name that might be set in extravalues by a plugin. Some plugins might be able to get a better idea of the name and thus we should move defaulting of the name further down after the plugins have had a chance to set it. (From OE-Core rev: 3bb979c13463705c4db6c59034661c4cd8100756) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: import: new plugin to import the devtool workspaceLeonardo Sandoval2017-08-232-0/+180
| | | | | | | | | | | | | | | | Takes a tar archive created by 'devtool export' and imports (untars) it into the workspace. Currently the whole tar archive is imported, there is no way to limit what is imported. https://bugzilla.yoctoproject.org/show_bug.cgi?id=10510 [YOCTO #10510] (From OE-Core rev: 2de8ba89ef10fefcc97246dfeb4b8d1e48ee8232) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: append md5sum only if not already presentLeonardo Sandoval2017-08-231-2/+5
| | | | | | | | | | | In case the proposed md5sum to be appended to the .devtool_md5 file is already present, do not append it. (From OE-Core rev: f958c5cba3b0d24ca696b2b707857009c9a7b5b8) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: export: new plugin to export the devtool workspaceLeonardo Sandoval2017-08-231-0/+119
| | | | | | | | | | | | | | | | | | By default, exports the whole workspace (all recipes) including the source code. User can also limit what is exported with --included/--excluded flags. As a result of this operation, a tar archive containing only workspace metadata and its corresponding source code is created, which can be properly imported with 'devtool import'. https://bugzilla.yoctoproject.org/show_bug.cgi?id=10510 [YOCTO #10510] (From OE-Core rev: f9bc3b5101b554a72298266519dbdd1497f262a6) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: upgrade: enable branch checking when revision is providedChang Rebecca Swee Fun2017-08-231-5/+22
| | | | | | | | | | | | | | | | | When devtool upgrade is run on a recipe with revision specified that is not on master branch, and branch isn't set by --srcbranch or -B, then we should get the correct branch and append the branch to the URL. If the revision was found on multiple branches, we will display error to inform user to provide a correct branch and exit. [YOCTO #11484] (From OE-Core rev: 29ced7387a92aed17b7fe93b1654790a981734c1) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: replacing PV in SRCURIStanley Phoong2017-08-231-1/+3
| | | | | | | | | | | | | During recipe creation, it seems that the automation for replacing ${PV} at the SRCURI for tag, (e.g mbed-tls-${PV}) is causing some issue due to PV assuming it's a git source. A fix is implemented in this patch to resolve this issue. (From OE-Core rev: 9d3ec76c1b7dd75d904f5ff47297de0fb65b21c2) Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: handle git URLs specifying only a tagStanley Phoong2017-08-231-1/+22
| | | | | | | | | | | | | If a git URL is passed to recipetool create with a tag=, recipetool should handle it assuming that the tag is valid. [YOCTO #11393] (From OE-Core rev: 3afdcbdc9a3e65bc925ec61717784ffec67d529d) Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: being able to set branch when revision is providedChang Rebecca Swee Fun2017-08-231-0/+48
| | | | | | | | | | | | | | | | | | | | | This change is to improve the buildability of the recipe created by recipetool and devtool. When recipetool create is run on a git URL and a revision specified that is not on master, and "branch=" isn't already in the URL, then we should get the correct branch and append the branch to the URL. If the revision was found on multiple branches and 'master' is not in the list, we will display error to inform user to provide a correct branch and exit. [YOCTO #11389] (From OE-Core rev: ecca596b75cfda2f798a0bdde75f4f774e23a95b) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: disable PREMIRRORS and MIRRORS by defaultChang Rebecca Swee Fun2017-08-232-1/+9
| | | | | | | | | | | | | | | When creating new recipes, we are almost certainly fetching a new source rather that something that has already been fetched. I have disable PREMIRRORS and MIRRORS settings in the recipe that created by devtool while leaving an option for users to enable them manually if needed. Since devtool already has this options, we need to ensure that recipetool is able to handle the options passed from devtool. (From OE-Core rev: 091cee2bdc2378a3425a4ef8558d03e6f9c021ff) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: fix incorrect URL variable usagePaul Eggleton2017-08-171-1/+1
| | | | | | | | | | | | | | | | | We have two variables here, srcuri and fetchuri. srcuri is what eventually ends up in the recipe, whereas fetchuri is what we actually pass to the fetcher when we fetch the source within recipetool - sometimes these need to be different particularly for an upcoming patch to handle automatically setting the branch parameter. In OE-Core revision 9a47a6690052ef943c0d4760630ee630fb012153 I erroneously changed the call to scriptutils.fetch_url() to pass srcuri instead of fetchuri - this likely didn't have any ill effect, but change it back to passing fetchuri to match the original intent. (From OE-Core rev: b66b73bcf5ee7e4488970576fdc31dfa25b35f5e) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: sdk-update: fix pulling updates from gitAndrea Galbusera2017-08-091-1/+1
| | | | | | | | | | | | | Commit 4657bc9d165e51981e034e73e7b92552e873eef7 replaced the git pull logic with the git fetch + git reset --hard combo, but resetting to HEAD does not really pull in new commits from remote... Replace with resetting to the upstream branch instead. (From OE-Core rev: 0dcdb146f59a184419bffd4f24cdf8343a43c0ea) Signed-off-by: Andrea Galbusera <gizero@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: fix handling of errors during task executionPaul Eggleton2017-08-091-0/+10
| | | | | | | | | | | | | | | | | | | * If an error is logged while executing a task, we need to ensure we exit instead of assuming everything went OK. * If we receive CookerExit, the server is shutting down and we need to stop waiting for events and probably exit (knotty does this). This will occur if an exception or bb.fatal() happens during an event handler. This fixes a couple of issues highlighted when using devtool upgrade or modify on a non-supported recipe with intel-iot-refkit together with bitbake master, but I'd be very surprised if it were hard to reproduce in other scenarios. (From OE-Core rev: 65e644368fc9c294af96906528ee0cf30305e0a6) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: improve generating disk system identifierJonathan Liu2017-08-031-1/+2
| | | | | | | | | | This should reduce the chance of generating 0xffffffff as the disk system identifier. (From OE-Core rev: 5619e72facbc9228d3cf8f844f198e03b536ac8c) Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Switch to using --use-uuid by defaultTom Rini2017-07-303-6/+6
| | | | | | | | | | | | | | | | | The most portable way to specifiy a root device in a disk image that we create is to use PARTUUID rather than /dev/sda2. As background, both GPT and MBR tables provide valid UUID values for each partition and the Linux Kernel contains the logic to parse this value. With this change we can now boot the default disk images when used as any valid block device that the included kernel uses. This for example means that VirtualBox can be used to run vmdk without changes as it uses IDE for the virtual disk controller. Cc: Matt Porter <mporter@konsulko.com> (From OE-Core rev: 8a58e9bb3e76a9962f1d14a8bdd3f7de675c3492) Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: ensure generated disk system identifier is non-zeroJonathan Liu2017-07-301-1/+1
| | | | | | | | | | Zero may be interpreted as no MBR signature present and another partitioning program might install a new MBR signature. (From OE-Core rev: f53b5555d6eaa171bc5882cfee807cf62576862d) Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add /boot mount point to fstab by defaultEd Bartosh2017-07-301-1/+1
| | | | | | | | | | | | | | | | wic avoided adding /boot to fstab for no reason. This exception was hardcoded in the wic code. There is no need for this as mountpoint in .wks file is an optional field. It can be used only if user wants to have partitions automatically mounted on system boot. [YOCTO #11662] (From OE-Core rev: 2376b05512ddb8c4ec3aaf1df11071f536a76bd9) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: rootfs: make copied rootfs uniqueEd Bartosh2017-07-301-1/+1
| | | | | | | | | | Used unique suffix (line number from .wks file) for the copied rootfs directory to avoid possible conflicts. (From OE-Core rev: 01efc234a8caab67ed3138ab2de9bbd82ce97b44) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: rootfs: fix rootfs path reportingEd Bartosh2017-07-301-6/+4
| | | | | | | | | | | | | | | | wic gets rootfs paths from partition object property 'rootfs_dir' and shows them in final report. rootfs plugin sets this property to the temporary path, which causes temporary paths appearing in the report. Changed the code to prevent storing temporary rootfs path in part.rootfs_dir. This should fix the report. (From OE-Core rev: 28d2d7d6f79df08431187c7debaab2a3fa516671) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: use absolute paths in rootfs pluginEd Bartosh2017-07-301-2/+2
| | | | | | | | | | | Using relative paths can cause copyhardlinktree API to fail as it changes current directory when working. Converted all paths to absolute paths using os.path.realpath. (From OE-Core rev: a1c83cebe986e211dfc31be5cbd748f53fc298df) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: copy rootfs directory before changing fstabEd Bartosh2017-07-301-9/+15
| | | | | | | | | | | | | | | | | | wic updates /etc/fstab on root partition if there are valid mount points in .wks When wic runs from bitbake this can cause incorrect results or even breakage of other tasks working with the same rootfs directory in parallel with do_image_wic. Implemented copying rootfs directory to a temporary location using copyhardlinktree before updating fstab to avoid conflicts with other tasks working with the same rootfs directory. (From OE-Core rev: 92e1c7d47e695eb4ce1a863cd0f6c49dca1c2339) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bsp/help: include a warning showing deprecation of create-layer pluginLeonardo Sandoval2017-07-301-0/+8
| | | | | | | | | | | This plugin will be removed starting 2.5 development in favour of using 'bitbake-layers create-layer' script/plugin, offering a single script to manage layers. (From meta-yocto rev: 76dd79e345d8edb22fc7aefd31f2a1f150916718) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add description of --mkfs-extraoptsEd Bartosh2017-07-211-0/+6
| | | | | | | | | | | Updated help contents with the description of new wks option --mkfs-extraopts (From OE-Core rev: 69c95f74013d0d8b199abc38ba0d6f3ff952eed3) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: implement wks option --mkfs-extraoptsEd Bartosh2017-07-212-15/+25
| | | | | | | | | | | | This option specifies extra options to pass to mkfs.<fstype> utilities. [YOCTO #11709] (From OE-Core rev: 67b7c67edba305fbd31967baa10d27c2e603ec77) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: standard: enable options for PREMIRRORS and MIRRORSChang Rebecca Swee Fun2017-07-211-0/+3
| | | | | | | | | | | | Since we have provide an option to manually enable PREMIRRORS and MIRRORS in recipetool, we need to make sure devtool is having the same options as devtool uses recipetool in creating new recipes. (From OE-Core rev: 198bddeb928a318c3ad168bcb4f83b5cd9a604fb) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: find-recipe: enable new subcommand for devtoolChang Rebecca Swee Fun2017-07-211-4/+14
| | | | | | | | | | | | | | | | | | | devtool find-recipe will prints out the path to the recipe in a workspace. This subcommand can also help to find recipe outside of current workspace using "-a" or "--any-recipe" option. This enhancement helps developer to get the recipe path when working with devtool. [YOCTO #11434] (From OE-Core rev: 5a16b3c804c5eca331a1c08a7ce31a54909af105) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scriptutils: pass in logger as parameterChang Rebecca Swee Fun2017-07-213-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | logger was not defined in scriptutils.py based on the observation in python traceback. Traceback (most recent call last): File "/workdir/poky/scripts/devtool", line 351, in <module> ret = main() File "/workdir/poky/scripts/devtool", line 338, in main ret = args.func(args, config, basepath, workspace) File "/workdir/poky/scripts/lib/devtool/utilcmds.py", line 55, in edit_recipe return scriptutils.run_editor(find_recipe(args, config, basepath, workspace)) File "/workdir/poky/scripts/lib/scriptutils.py", line 141, in run_editor logger.error("Execution of '%s' failed: %s" % (editor, exc)) NameError: name 'logger' is not defined We pass in logger as parameter to run_editor() from where it has been called (devtool/utilcmds.py and recipetool/newappend.py), which both modules already has logger setup. (From OE-Core rev: 21f04b61973dd9029f0e6bff5445e31cd762bf32) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scriptutils: exit politely when no text editor availableChang Rebecca Swee Fun2017-07-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | devtool edit-recipe now has ugly tracebacks if executed without an editor available. This happens in the build containers whenever no text editor is available. subprocess.check_call will run text editing command with recipe path provided. It will wait for command to complete. If the return code was zero then return, otherwise raise CalledProcessError exception. This enhancement will suppress the traceback by catching the exception and prompt the error messages in a proper manner shown below: pokyuser@59c99c507238:/workdir/docker-dbg$ devtool edit-recipe ifupdown /bin/sh: 1: vi: not found ERROR: Execution of 'vi' failed: Command 'vi "/workdir/docker-dbg/workspace/recipes/ifupdown/ifupdown_0.8.16.bb"' returned non-zero exit status 127 [YOCTO #11434] (From OE-Core rev: c536ccfd162fc8871838fa229012c562e3f8e0d9) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fix calculation of partition numberEd Bartosh2017-07-211-1/+1
| | | | | | | | | | | | | | | | Total number of partitions should be taken into account when calculating real partition number for msdos partition table. The number can be different for the 4th partition: it can be 4 if there are 4 partitions in the table and 5 if there are more than 4 partitions in the table. In the latter case number 4 is occupied by extended partition. [YOCTO #11790] (From OE-Core rev: 5689139b3cd862e2df49f6b21171f513e8a46c60) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* argparse_oe: Add int_positive typeAníbal Limón2017-07-211-0/+7
| | | | | | | | | | Sometimes only expect positive values from cmdline so it's better to filter at parsing cmdline step instead of validate later. (From OE-Core rev: 3ef5b518febd047bf90a0955fa2b9fb78ba6dde5) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: Setup logging before calling prepareRichard Purdie2017-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This avoids test failures like: INFO - ====================================================================== INFO - FAIL [1.755s]: test_devtool_layer_plugins (devtool.DevtoolTests) INFO - ---------------------------------------------------------------------- INFO - Traceback (most recent call last): File "/media/build1/poky/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f return func(*args, **kwargs) File "/media/build1/poky/meta/lib/oeqa/selftest/cases/devtool.py", line 1354, in test_devtool_layer_plugins self.assertEqual(result.output, s[::-1]) AssertionError: "NOTE: Starting bitbake server...\noY senu[36 chars]rciM" != "oY senuZ s'enoynA morF tiforP oN edaM tfosorciM" - NOTE: Starting bitbake server... oY senuZ s'enoynA morF tiforP oN edaM tfosorciM INFO - ---------------------------------------------------------------------- since there is corruption in the output. Setting the logging up before calling tinfoil.prepare() resolves this. (From OE-Core rev: 3c479fb17ae4d3e7e5f0889af0f68257ef66475c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: refactor code for ensuring npm is availablePaul Eggleton2017-07-214-79/+34
| | | | | | | | | | | | | | | | | | | Across devtool and recipetool we had an ugly set of code for ensuring that we can call an npm binary, and much of that ugliness was a result of not being able to run build tasks when tinfoil was active - if recipetool found that npm was required and we didn't know beforehand (e.g. we're fetching from a plain git repository as opposed to an npm:// URL where it's obvious) then it had to exit and return a special result code, so that devtool knew it needed to build nodejs-native and then call recipetool again. Now that we are using real build tasks to fetch and unpack, we can drop most of this and move the code to the one place where it's still needed (i.e. create_npm where we potentially have to deal with node.js code in a plain source repository). (From OE-Core rev: 8450de16ddb02d863204b411a94c6d84e0f88817) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: reimplement fetching with normal fetch/unpack tasksPaul Eggleton2017-07-214-65/+153
| | | | | | | | | | | | | | | | | | | | Now that we have the ability to run the tasks in a more standard context through tinfoil, change recipetool's fetching code to use that to fetch files using it. This has the major advantage that any dependencies of do_fetch and do_unpack (e.g. for subversion or npm) will be handled automatically. This also has the beneficial side-effect of fixing a recent regression that prevented this fetch operation from working with memory resident bitbake. Also fix devtool's usage of fetch_uri() at the same time so that we can completely replace it. Fixes [YOCTO #11710]. (From OE-Core rev: 9a47a6690052ef943c0d4760630ee630fb012153) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>