aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)Author
2015-09-16recipetool: add 'newappend' sub-commandChristopher Larson
This sub-command creates a bbappend for the specified target and prints the path to the bbappend. The -w argument, as with some of the other recipetool commands, will make a version-independent bbappend. Example usage: recipetool newappend meta-mylayer virtual/kernel [YOCTO #7964] Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-16mkefidisk: Create interactive menu for the scriptBruno Bottazzini
If it is passed only the image parameter, it will show some interactive options to help to conclude the script. With this patch it will detect devices available in the machine, asking to choose what it is wanted to be flashed. it will suggest the target device. If it is a SD card the suggestion is /dev/mmcblk0. If it is a pendrive it will suggest to use /dev/sda. Signed-off-by: Bruno Bottazzini <bruno.bottazzini@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-12devtool: update-recipe: get srcuri parameters with decodeurl()Markus Lehtonen
Use already existing bb.fetch.decodeurl() for getting the parameters for a URI. This is more fault tolerant and maintainable. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12runqemu: avoid image file name mismatchesPatrick Ohly
Giving anything with -image in it as bootparams or in qemuparams (for example, an additional -drive parameter with an image file or an "-initrd .../core-image-minimal-initramfs-qemux86.cpio.gz") caused runqemu to treat these parameters as names of the rootfs image file. Matching *-image) after checking the current argument for more specific cases like bootparams and qemuparams avoids this misinterpretation of the command line parameters. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-12runqemu: Define OECORE_MACHINE_SYSROOT on setup_sysrootLeonardo Sandoval
At least the OVFM (UEFI Firmware for Qemu and KVM) recipe stores the BIOS under $OE_TMPDIR/sysroots/$MACHINE, now defined as OECORE_MACHINE_SYSROOT. The latter is used when searching BIOS, VGA BIOS and keymaps. As a example, to boot a OVFM BIOS, one can run the following command: $ runqemu qemux86-64 core-image-minimal \ biosdir=usr/share/ovmf \ biosfilename=bios.bin \ nographic Note the bios* parameters: these two are needed to specify the subfolder (parent folder is OECORE_MACHINE_SYSROOT) and BIOS filename (without it, it picks a BIOS named bios-256k.bin). [YOCTO #5654] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-12buildstats: Outputs 'task recipe elapsed-time' from each buildstats' recipeLeonardo Sandoval
Given a 'buildstats' path (created by bitbake when setting USER_CLASSES ?= "buildstats" on local.conf) and task names, outputs '<task> <recipe> <elapsed time>' for all recipes. Elapsed times are in seconds, and task should be given without the 'do_' prefix. Some useful pipelines 1. Tasks with largest elapsed times $ buildstats.sh -b <buildstats> | sort -k3 -n -r | head do_compile perl-5.20.0-r1 221.82 do_configure gettext-native-0.19.4-r0 140.34 do_compile openssl-native-1.0.2a-r0 107.48 do_compile openssl-1.0.2a-r0 102.10 do_configure perl-native-5.20.0-r0 90.70 do_configure gettext-0.19.4-r0 88.17 do_compile gcc-cross-i586-4.9.2-r0 83.98 do_configure m4-native-1.4.17-r0 83.44 do_compile qemu-native-2.2.0-r1 71.69 do_compile glibc-2.21-r0 60.88 2. Min, max, sum per task $ buildstats.sh | datamash -t' ' -g1 min 3 max 3 sum 3 | sort -k4 -n -r do_configure 0.03 140.34 1968.66 do_compile 0.01 221.82 1664.44 do_install 0.03 40.31 330.45 do_populate_sysroot 0.11 34.45 229.23 do_unpack 0.01 36.1 193.54 do_patch 0.01 9.2 62.07 do_fetch 0.01 6.66 32.13 do_populate_lic 0.09 1.65 30.7 Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-12devtool: make plugin_init optionalEd Bartosh
So far all devtool and recipetool plugins were expected to have plugin_init function. This function is empty in most of plugins as they don't require initialisation. Making plugin_init optional would allow not having empty plugin_init in every plugin. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-12scripts: Move BUILDDIR chmod fix after checks in oe-setup-builddirAlex Franco
Makes more sense to have this fix after checking BUILDDIR exists, is a directory and is writable. [YOCTO #7669] Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-09devtool: fix running from a different directoryPaul Eggleton
Fixes the following error when running devtool from a directory other than the build directory (or the SDK base path when using within the extensible SDK): The BBPATH variable is not set and bitbake did not find a conf/bblayers.conf file in the expected location. Maybe you accidentally invoked bitbake from the wrong directory? Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: add package plugin that lets you create package via devtoolBrendan Le Foll
Enables creating packages using devtool within the extensible SDK. (This is only enabled within the extensible SDK because it provides no advantage over just running bitbake directly there). Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: update-recipe: add a warning when recipe is inside the workspacePaul Eggleton
If a recipe has been added to the workspace via "devtool add" or "devtool upgrade" then the recipe file itself will be in the workspace layer; if you run "devtool update-recipe" particularly in the upgrade case you might think it would apply the upgrade to the original recipe, but it will not - in order to remain consistent it has to update the recipe that's in use which is the one in the workspace. Warn the user in this situation so that they know what they need to do when they are finished. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: update-recipe: better 'auto' modeMarkus Lehtonen
Enhance the logic behind the 'auto' mode a bit by only updating the SRCREV if the changes are already found upstream. The logic is simple: update SRCREV only if the current local HEAD commit is found in the remote branch (i.e. 'origin/<branch_name>'). Otherwise resort to patching. This affects a couple of the oe-selftest tests so update those as well. [YOCTO #7907] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: Allow disabling make parallelism on build commandLeonardo Sandoval
Through -s/--disable-parallel-make, the user can turn off parallelism on the make tool. This can be useful when debuging race condition issues. In order to set PARALLEL_MAKE = "" a post-config file created and then passed into the build. [YOCTO #7589] 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>
2015-09-09devtool: Create a single file for the build devtool featureLeonardo Sandoval
The intention is to have a single file for each devtool feature so devtool can grow in a modular way. In this direction, this patch creates build.py, moving all related build features from standard.py to build.py. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: add upgrade featureLeonardo Sandoval
Upgrades a recipe to a particular version and downloads the source code into a folder. User can avoid patching the source code. These are the general steps of the upgrade function: - Extract current recipe source code into srctree and create a branch - Extract upgrade recipe source code into srctree and rebase with previous branch. In case the rebase is not correctly applied, source code will not be deleted, so user correct the patches - Creates the new recipe under the workspace [YOCTO #7642] 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>
2015-09-09devtool: improve modified file preservation to handle directory structuresPaul Eggleton
Allow the _add_md5() function to be called with a directory in order to recursively add the files under it. Additionally, we need to skip preserving empty directories (since directories aren't listed in the md5 file). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09scriptutils: split out simple fetching function from recipetoolPaul Eggleton
This will now also be used by "devtool upgrade". Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: modify: enable do_shared_workdir for kernelMarkus Lehtonen
Do not put 'do_shared_workdir' into SRCTREECOVEREDTASKS when creating bbappend for kernel packages. This will allow building packages that depend on the shared build artifacts of kernel. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09wic: round variable before converting to intEd Bartosh
Wic uses bitbake variable ROOTFS_SIZE to set correspondent partition size. This variable is a literal representing float value. Wic crashes trying to convert it to int with the error: invalid literal for int() with base 10: '10166.0' Fixed this by converting variable to float and rounding result. This should work for int and float literals. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-07devtool: add mechanism for updating extensible SDKQi.Chen@windriver.com
Enable updating the installed extensible SDK from a local or remote server, avoiding the need to install it again from scratch when updating. (This assumes that the updated SDK has been built and then published somewhere using the oe-publish-sdk script beforehand.) This plugin is only enabled when devtool is used within the extensible SDK since it doesn't make sense to use it next to a normal install of the build system. E.g. devtool sdk-update /mnt/sdk-repo/ devtool sdk-update http://mysdkhost/sdk Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-07oe-publish-sdk: add scriptQi.Chen@windriver.com
Add a script to publish an extensible SDK that has previously been built to a specified destination. This published SDK is intended to be accessed by the devtool sdk-update command from an installed copy of the extensible SDK. e.g. oe-publish-sdk <ext-sdk> <destination> Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-07postinst_intercept: allow to pass variables with spacesMartin Jansa
* trying to pass foo="a b" through postinst_intercept ends with the actual script header to containing: b foo=a which fails because "b" command doesn't exist. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-06runqemu: support full-disk imagesPatrick Ohly
This makes it possible to boot images with multiple partitions (the ones ending in .hddimg or .hdddirect) in several ways: runqemu qemux86 core-image-minimal hddimg runqemu tmp/deploy/images/qemux86/core-image-minimal-qemux86.hddimg VM=tmp-glibc/deploy/images/qemux86/iot-os-image-qemux86.hddimg FSTYPE=hddimg runqemu Same for hdddirect. This is useful for testing initramfs scripts, secure boot (when switching to UEFI), or boot loaders like syslinux. For testing the content of the rootfs, the ext4 image is better because that approach is faster (no need to create another large image during build, rootfs can be read directly instead of reading boot.img through loop device). When booting a live image, the kernel, initramfs (if any) and kernel parameters are taken from the image by the virtual machine's BIOS, so any additional kernel parameters given to runqemu are ignored. This can be avoided (already without this change) in a slightly hacky runqemu setup: ROOTFS=tmp/deploy/images/qemux86/core-image-minimal-qemux86.hddimg \ FSTYPE=ext4 \ KERNEL=tmp/deploy/images/qemux86/bzImage-initramfs-qemux86.bin \ MACHINE=qemux86 \ runqemu serial kvm nographic 'bootparams=root=/dev/ram0' The additional bzImage-initramfs-qemux86.bin kernel here was created by adding this to local.conf: INITRAMFS_IMAGE = "core-image-minimal-initramfs" INITRAMFS_IMAGE_BUNDLE = "1" In the code, the new FSTYPE=hddimg resp. hdddirect behaves almost exactly like the older vmdk FSTYPE. New types were chosen because it seemed cleaner than using FSTYPE=vmdk when the actual image pointed to by VM is not in that format. The downside is that several checks for FSTYPE=vmdk had to be duplicated for FSTYPE=hddimg. The VM variable now gets interpreted as "virtual machine disk image" instead of "vmdk image". Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03devtool: run kernel dependenciesMarkus Lehtonen
The kernel package needs "kern-tools-native" in order for it's do_kernel_metadata. Thus, devtool extract for kernel in a pristine environment fails. With the current bb.tinfoil implementation it is not possible to run arbitrary bitbake commands - e.g. run "bitbake kern-tools-native -c populate_sysroot" in our case. This patch implements an ugly workaround for that problem, basically by hardcoding this dependency and running the required bitbake task(s) before tinfoil is initialized. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2015-09-03devtool: extract: correct initial rev for kernel packagesMarkus Lehtonen
Change handling of kernel packages so that the "initial rev" is parsed correctly. Also, the devtool-specific git tags (devtool-base and devtoo-patched) are now generated for kernel packages as well. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2015-09-03devtool: make required tasks be run in kernel buildMarkus Lehtonen
Set SRCTREECOVEREDTASKS appropriately in the workspace .bbappend file for kernel recipes. This tries to ensure that all needed tasks (esp. configure and patch) are run when building the kernel - tasks which would normally be disabled by externalsrc.bbclass. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2015-09-02Fix recursive mode -st on BUILDDIR setupAlex Franco
Removing recursive option from chmod -st on BUILDDIR as it would take very long on existing build directories [YOCTO 7669] Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix short variable namesEd Bartosh
Made short variable names longer and more readable. Fixed pylint warnings "Invalid variable name" and "Invalid argument name". Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: get rid of listing propertiesEd Bartosh
Functionality of listing and using properties of wic images does not exist in the wic code. However, there are plenty of help and usage content about it, which is very confusing. Removed everything regarding image properties from wic codebase. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix pylint warning redefined-builtinEd Bartosh
Renamed variables named as Python builtin functions. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix pylint warning unused-variableEd Bartosh
Removed or reworked code with unused variables. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix pylint warning no-memberEd Bartosh
Fixed pylint warning: Instance of 'ConfigMgr' has no 'create' member (no-member) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: use optparse instead of cmdlnEd Bartosh
cmdln.py https://pypi.python.org/pypi/cmdln was used in creator.py to parse image plugin options and arguments. There is no need in such a sofisticated API to do this simple task. Standard option parser optparse.OptionParser can do it just fine. Modified Creator class to work with option parser. Removed cmdln.py from the wic codebase. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix pylint warning multiple-statementsEd Bartosh
Fixed pylint warning: More than one statement on a single line (multiple-statements) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: get rid of wildcard importsEd Bartosh
Used explicit imports in partitions.py and wicboot.py Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix errors in partition.py moduleEd Bartosh
Fixed the followring errors found by pylint in partition.py: E: 42, 0: class already defined line 33 (function-redefined) E:429,63: Undefined variable 'fs' (undefined-variable) E:432,37: Undefined variable 'fs' (undefined-variable) E:481, 0: class already defined line 33 (function-redefined) E:488,22: Undefined variable 'OptionValueError' (undefined-variable) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: remove micboot.pyEd Bartosh
Moved functionaly of micboot.py Mic_Bootloader class to Wic_Bootloader class of wicboot.py module. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: remove micpartition.pyEd Bartosh
Moved functionality of Mic_Partition and Mic_PartData classes from micpartition.py to Wic_Partition and Wic_PartData classes of partition.py module. Reduced level of inheritance. Removed confusing mic legacy names. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix typoEd Bartosh
Fixed typo in tool name: mkswqp -> mkswap. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: get rid of scripts/lib/imageEd Bartosh
Moved content of scripts/lib/image/ to scripts/lib/wic as one directory with the same name as a tool is self-explanatory and less confusing than two. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: use ext4 in canned .wks filesEd Bartosh
Latest kernel doesn't have ext3 compiled in. Wic images produced from canned .wks can't boot because of that. Switching to ext4 fixes this issue. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31Fix mode +st on TMPDIR when creating itAlex Franco
A sanity check fails when TMPDIR has setuid, setgid set. It was proposed to fix this on TMPDIR creation instead of failing with a sanity test only. This patch handles removal of those special bits (and additonally, the sticky bit) from BUILDDIR and TMPDIR when these directories are created. [YOCTO #7669] Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31devtool: build-image: add commentsEd Bartosh
Added couple of hopefully useful comments to the code. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: build-image: remove <image>.bbappendEd Bartosh
Removed <image>.bbappend before generating it again as it may cause tinfoil to fail due to its wrong content. It's safe to do as <image>.bbappend is regenerated anyway. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: build-image: add extra loggingEd Bartosh
Added logger calls to show if image is modified by the plugin or not. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: build-image: generate notification callbackEd Bartosh
Added notification callback to <image>.bbapend to notify user that image is modified by build-image plugin. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: build-image: filter out recipesEd Bartosh
Filtered out non-target recipes and recipes with recipe name != package name in build-image plugin. Isolated all logic of getting recipes in _get_recipes function. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: build-image: improve help and descriptionEd Bartosh
Made parser help message and description more clear in build-image plugin. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: build-image: rename LOG -> loggerEd Bartosh
Used logger variable name instead of LOG as it is used the rest of the devtool code. Pylint complains about 'logger' being invalid constant name, but it's better to be consistent in naming. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31Revert "devtool: make add_md5 a public API"Ed Bartosh
This reverts commit 69c63728dae38d5b1cc9874268f235a07e04d3db. Moved add_md5 back to standard.py as it's not used in any plugin anymore. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>