summaryrefslogtreecommitdiffstats
path: root/bin
AgeCommit message (Collapse)Author
2015-10-16toaster: exit or return depending on the modeEd Bartosh
When toaster script is sourced 'return' should be used as using 'exit' will cause script to exit the shell and close terminal window. If script is called 'exit' should be used. Otherwise shell will throw and error: return: can only `return' from a function or sourced script Used 'return' or 'exit' depending on the toaster mode using TOASTER_MANAGED variable. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16toaster: set TOASTER_MANAGED variableEd Bartosh
Set TOASTER_MANAGED to 1 if toaster is run as a script. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16toaster: get rid of SRCFILEEd Bartosh
Used TOASTER variable instead of SRCFILE as they're essentially the same. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16toaster: use path to the script to guess config pathEd Bartosh
Used $TOASTER variable(path to the toaster script) instead of current directory name to get path to the toasterconf.json This way script should work in both modes and it doesn't depend on the current directory. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16toaster: Always run bldcontrol migrationsElliot Smith
The toaster startup script conditionally migrates the database tables depending on whether you are in managed mode or not. This means that if you are in analysis mode, some of the bldcontrol* database tables used by managed mode are not available. As a consequence, some of the code in toaster which refers to those tables can break in analysis mode, as there's no clean isolation of the two modes. To prevent this from happening, always run the migrations for managed mode and create the bldcontrol* tables, even if in analysis mode. Also clean up the function which starts up toaster so the logic is easier to follow. [YOCTO #8277] Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11toaster: remove bashisms so script works in dash as wellbrian avery
[YOCTO #8217] Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11toaster: get rid of interactivity in bldcontrolbrian avery
removed layer dir questions and base off TOASTER_DIR removed build dir questions and base off TOASTER_DIR base configuration file off of TOASTER_CONF fixed some pylint issues [YOCTO #8217] Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11toaster: check for configuration file and exit if not foundbrian avery
[YOCTO #8217] Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11toaster: remove layer and build dir interactive questionsbrian avery
added TOASTER_CONF env var for toaasterconf.json added TOASTER_DIR env var for working dir added bugfix so WEB_PORT env variable is honored Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11toaster: removed superuser question from startupbrian avery
added comment explaining how to create one later Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01bitbake/lib: Update version to 1.28.0Richard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29bitbake-worker: Guard against multiprocessing corruption of event dataRichard Purdie
In the forked child, we may use multiprocessing. There is only one event pipe to the worker controlling process and if we're unlucky, multiple processes can write to it at once corrupting the data by intermixing it. We don't see this often but when we do, its quite puzzling. I suspect it only happens in tasks which use multiprocessng (do_rootfs, do_package) and is much more likely to happen when we have long messages, usually many times PAGE_SIZE since PAGE_SIZE writes are atomic. This makes it much more likely within do_roofs, when for example a subprocess lists the contents of a rootfs. To fix this, we give each child a Lock() object and use this to serialise writes to the controlling worker. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23toaster: start script warning text formatting small improvementCristian Iorga
Add a carriage return to build environment warning message to avoid it being mixed up with shell prompt. Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09bitbake-worker: Ensure pipe closure doesn't crash before killpg()Richard Purdie
If the pipe is closed, we want to ensure that we kill any child processes by triggering the sigterm handler before we exit. This code does that, hopefully avoiding the remaining process left behind issues on the autobuilder. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09bitbake-worker: Handle SIGKILL of parent gracefullyRichard Purdie
If we SIGKILL cooker (the parent process), ensure the worker notices and shuts down gracefully. To do this: * trigger the sigterm handler if the parent exits * ensure broken pipe writes don't trigger backtraces which interfer with other exit work * notice if our command pipe is broken due to EOF and sigterm if so Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09bitbake-worker: Simple code cleanupRichard Purdie
start/end are unused here and we can improve the code conditional blocks. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19bitbake-layers: show-recipes: allow filtering by class inheritancePaul Eggleton
Add a -i/--inherits option to filter the output to include only recipes inheriting the specified class(es). Implements [YOCTO #7475]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19bitbake-layers: fix mapping files to layersPaul Eggleton
bitbake-layers needs to map recipe and class files to the layer they came from within the show-recipes and show-overlayed commands. However, it turns out that mapping a file to the layer it came from is not as trivial as it might seem. To do it properly we need to match the path to an entry in BBFILES then map that to the collection name using BBFILE_PATTERN, then map that to the actual layer using variable history. If it doesn't match any entry in BBFILES, then we can fall back to BBFILE_PATTERN (to handle classes and conf files). This fixes the layer name not showing up properly in the output of the show-recipes and show-overlayed commands for recipes in layers such as meta-intel that have subdirectories in BBFILE_PATTERN. It also fixes the priority not showing up in show-layers for such layers. As part of this I've added a function to VariableHistory which for a space-separated list variable gives you a dict mapping the items added to the files in which they were added. I've also fixed bb.utils.get_file_layer() and reduced some of the duplication by using this function in bitbake-layers. Also fixes the priority not showing up for layers such as meta-intel Fixes [YOCTO #8160]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19bitbake-layers: remove-layer: accept just layer directoryPaul Eggleton
If the specified layer isn't a path, then just match on the directory. Fixes [YOCTO #7839]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19bitbake-layers: ensure we exit if BBLAYERS_LAYERINDEX_URL is not setPaul Eggleton
We were printing an error here, but not exiting. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-18bitbake-layers: use "with open" consistentlyPaul Eggleton
It's best practice to use "with open..." rather than open & close where practical. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-18bitbake-layers: refactor show-appends to stop using cooker bbappends listPaul Eggleton
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-18bitbake-layers: Convert flatten to use collections.bbappendsRichard Purdie
flatten support currently looks broken since it doesn't appear to deal with handling "%" support in bbappend file names. This patch converts it to use collections.get_file_appends() which correctly handles "%" support. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22bitbake-selftest: Add -v option for verbosityRichard Purdie
Also document BB_SKIP_NETTESTS=yes parameter in --help output. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-10toaster: Make toaster script to work in dashEd Bartosh
Made it working in dash. Note, that due to dash limitations script will not work if sourced. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2015-06-10toaster: Code cleanup: bashismsEd Bartosh
Fixed the following bashisms: replaced echo -e -> printf removed 'function' from function definitions replaced $(< ${file}) -> `cat ${file}` Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-06-09bitbake: Bump version to 1.27.1Richard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29toaster: enable no browser startAlexandru DAMIAN
We enable a "nobrowser" parameter that inhibits the launch of a browser when toaster starts. This is useful for integration with automated startup scripts and enables headless testing. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2015-05-29toaster: enable server-side sessions for all usagesAlexandru DAMIAN
In an effort to fix client-side session storage using cookies, we enable server-side session support for all pages. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2015-05-24bitbake-worker: Fix regression with unbuffered logsJason Wessel
I noticed that I was seeing loss of the log files when hitting control-c while debugging a function in bitbake. In fact if you take a recipe and replace its compile function as shown below let it run for a few seconds and hit control-c, you will see first hand that log data is not there. do_compile () { while [ 1 ] ; do echo -n "Output date: " date sleep 1 done } It turns out there was a regression introduced by commit: d0f0e5d9e69 which created the bitbake worker. Since the bitbake worker is started in its own process space, it needs the exact same code added from commit: 88429f018b where the problem was fixed the first time around. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-19toaster: Remove dependency on daemon applicationRandy Witt
The bitbake observer is now started using python subprocess. This should allow for toaster to run without installing the "daemon" application. [Yocto #7271] Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-14tests/parse: Add very basic start of parse testsRichard Purdie
This tests very basic usage of the parser and then adds a test to ensure that incomplete functions raise an exception. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-12toaster: Code cleanup: indentEd Bartosh
Replaced tabs with 4 spaces. Removed useless semicolons at the end of lines. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-05-12toaster: Make toaster script working in zshEd Bartosh
Fixed shell syntax not understood by zsh. Made toaster script to work for both shells in both modes: sourced and directly called. [YOCTO #6964] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-05-12toaster: clear up toaster shutdown for mac osxAlexander Kanevskiy
This patch properly shuts down toaster in interactive mode under Mac OSx. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2015-05-01toasterui: proper exit code on toaster errorsAlexandru DAMIAN
This patch modifies the toasterui to properly return the exit code based on the errors found in the toaster itself. The upload event file API call will not delete event logs for which toasterui showed an error. This will facilitate debugging. Minor enhancement in the buildinfohelper to reduce the number of lookups on unknown layer objects (prevented testing of the patch). Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2015-04-28bitbake: use sys.exit to simplify the codeEd Bartosh
Used sys.exit instead of assigning exit code to variable. This way it's more clear when bitbake exists and which exit code is used. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-28bitbake: Check if bitbake versions matchEd Bartosh
Bitbake program and core versions must match. Moved __version__ from main.py back to bin/bitbake. Implemented check for version match in bin/bitbake. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> tbs Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-28bitbake: Handle BBMainExceptionEd Bartosh
Some error messages were lost because BBMainException was inherited from bb.BBHandledException. When bb.BBHandledException is processed error messages are not printed as they suppose to be printed before raising this exception. Stopped to inherit BBMainException from bb.BBHandledException. Handled BBMainException in bin/bitbake and printed error message to the stderr. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-17bitbake-diffsigs: consider the situation where sigdata and siginfo files ↵Chen Qi
having the same hash values For now, `bitbake-diffsigs -t <recipe> <task>' doesn't work. It always outputs nothing. The problem is that bitbake-diffsigs are comparing sigdata and siginfo files that have the same hash value. This is not what we want. These two files are actually duplicates considering the purpose of bitbake-diffsigs. So we need to remove one of them so that bitbake-diffsigs could actually compare the correct signature files. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-11bitbake-layers: ensure non-extended recipe name is preferredRichard Purdie
In show-recipes and show-overlayed, we only list one variant of each recipe where multiple exist, therefore we should show the main one (e.g. in OpenEmbedded, we now show openssl and not nativesdk-openssl which would otherwise sort first.) Fixes [YOCTO #7514]. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-31bin/image-writer: Add ext4 as a deployable image typeRichard Purdie
This is particularly problematic since qemu images switched to ext4 by default and now cannot work properly with UIs like hob. This patch adds in ext4 to the appropriate variable fixing this. [YOCTO #7426] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-24bin/bitbake: Create bitbake_main APIEd Bartosh
Moved most of functionality of bin/bitbake to lib/bb/main.py to be able to call bitbake from python code. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-16bitbake-layers: use stdout instead of stderr for loggingPaul Eggleton
We use logger.plain() to produce actual output which needs to go to stdout. We could use more advanced filtering (and probably should in future) but for the moment let's just fix the regression. Fixes [YOCTO #7458]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-25bitbake-layers: fix wildcard support in remove-layerPaul Eggleton
The recent refactoring caused use of wildcards to trigger a traceback because the old variable name was being used. Fixes [YOCTO #7367]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24toaster: update requirement for Django 1.6Alexandru Damian
In order to bring in transaction.set_commit support, we need Django 1.6, discarding support for Django 1.5 This patch removes 1.5 from the list of acceptable Django versions. Signed-off-by: Alexandru Damian <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-20bitbake-layers: add ability to fetch layers and their dependencies from ↵Chong Lu
layer index Add a command to query layer dependencies from a layer index such as the OpenEmbedded Layer Index at http://layers.openembedded.org. Fetches the layer and its dependencies and adds them into conf/bblayers.conf. [YOCTO #5348] Signed-off-by: Chong Lu <Chong.Lu@windriver.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-20bitbake-layers: fix loggingPaul Eggleton
Logging output was simply not getting printed. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-20bitbake-layers: refactor to use argparse instead of cmdPaul Eggleton
This makes help formatting and option handling a lot more standardised and allows us to drop a bunch of code. We also gain slightly more straightforward error handling. One side-effect however is that the old subcommand syntax using underscores is no longer supported. The dashed form has been supported (and displayed in the help text) for quite a while now so I wouldn't imagine that will be much of an issue. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-09toaster: improve logging facilities for toasterAlexandru DAMIAN
This patch improves the logging facilities for toaster in order to help diagnose bugs that happen on user machines. The logs are stored now under "/tmp/toaster_$$" where $$ is a PID-based unique identifier. On shutdown, toaster will automatically erase all logs unless errors are listed in the log file. On error, Toaster provides suggestions on what to do. This patch includes a minor fix found as a result of logging improvements. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>