summaryrefslogtreecommitdiffstats
path: root/scripts/wic
Commit message (Collapse)AuthorAgeFilesLines
...
* wic: implement --vars optionEd Bartosh2015-08-301-0/+6
| | | | | | | | | | | | | | | | | This option is used to point wic to the directory with .env files containing list of bitbake variables and their values. If this option is used wic will get bitbake variables from files instead of parsing 'bitbake -e' output. The main reason for this is to support new mode, when bitbake runs wic to produce wic images. In this case wic can't run bitbake again as it's locked, so it will get variables from .env files. (From OE-Core rev: abdfad1cd68fcd7387c2a508ab81512e8f6b93ce) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: set default imageEd Bartosh2015-08-301-2/+4
| | | | | | | | | | | Set BitbakeVars.default_image when wic is called with -e option. This makes get_bitbake_var API to use provided image as a default source of variables. (From OE-Core rev: d465233579d5efa2e0578baac67f42a35ad8b993) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: deferred call of hlp.get_wic_plugins_help()Ed Bartosh2015-08-301-1/+1
| | | | | | | | | | | | | | | | | | If get_wic_plugins_help is called from wic main module it calls git_bitbake_var at some point. This fails when wic is called from bitbake as 'bitbake -e' can't be run. Moved call of this method to help.py in order to call it later, when BitbakeVariables singleton is properly initialized to get variables from .env files. (From OE-Core rev: d401a8518fb4b0e8adeb34be8948fa780299870c) 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: release 0.2.0Ed Bartosh2015-08-091-1/+1
| | | | | | | | | | | | | | | | | Major changes in 0.2.0: - implemented UUID support - fixed support of GPT partition tables - implemented running bitbake from wic - implemented image compressing - started testing with oe-selftest. implemented 17 test cases - used native tools (parted, mkfs, mtools, etc) - usability and documentation fixes - code clenup (From OE-Core rev: a0f8cb7e0ffa15e101d39463c77707c821250203) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Code cleanup: long lines, identation and whitespacesEd Bartosh2015-07-021-9/+17
| | | | | | | | | | Fixed pylint warnings bad-continuation, bad-continuation and line-too-long. (From OE-Core rev: db43e59f41b6bc19152cd4743585a3217015e272) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix confusing error messageEd Bartosh2015-07-021-7/+12
| | | | | | | | | | | | | | | | | | | | Wic throws this message when any of the build artifacts are not provided: Build artifacts not completely specified, exiting. (Use 'wic -e' or 'wic -r -b -k -n' to specify artifacts) It was not clear which artifact was not specified. Reworked the code to specify list of missed artifacts. Now the message looks like this: The following build artifacts are not specified: bootimg-dir, kernel-dir, native-sysroot [YOCTO #7912] (From OE-Core rev: 98912687f15f6d7537746fb38499f739e1a47be9) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Refactor getting bitbake variablesEd Bartosh2015-07-021-16/+5
| | | | | | | | | | | | | | | | | | Wic gets bitbake variables by parsing output of 'bitbake -e' command. This implementation improves this procedure as it runs 'bitbake -e' only when API is called and does it only once, i.e. in a "lazy" way. As parsing results are cached 'bitbake -e' is run only once and results are parsed only once per requested set of variables. get_bitbake_var became the only API call. It replaces find_artifacts, find_artifact, find_bitbake_env_lines, get_bitbake_env_lines, set_bitbake_env_lines and get_line_val calls making API much more clear. (From OE-Core rev: 3abe23bd217315246ec2d98dc9c390b85cfe6a92) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix misleading messageEd Bartosh2015-07-021-1/+1
| | | | | | | | | | | | | Due to usage of incorrect variable wic produces strange message "No image named None found, exiting." when specified canned .wks doesn't exist. Fixed by replacing wks_file -> argv[0] (From OE-Core rev: 2be905feff3c2166adaa8f50ad09d4b6896461ab) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add new argument to wic_create functionEd Bartosh2015-06-271-1/+1
| | | | | | | | | | Added 'compressor' argument to wic_create to pass a name of compressor utility to the wic engine. (From OE-Core rev: 33d38aefb06f8849b46c5f9f6c1db73b4dccd985) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add --compress-with command line optionEd Bartosh2015-06-271-0/+3
| | | | | | | | | | | | Added -c/--compress-with command line option to 'wic create' subcommand. This option is used to specify compressor utility to compress the image produced by wic. gzip, bzip2 and xz compressors are supported in this implementation. (From OE-Core rev: 8425ef0a67aa5ca7b2dbf4c461004af555aa0c96) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: removed unused command line optionEd Bartosh2015-06-231-5/+3
| | | | | | | | | | | Removed -i/--infile wic command line option. Removed properties_file and properties arguments of wic_create function. (From OE-Core rev: 6b81c89878236b2ef8d8b8217f2e33286b49dab6) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Return error code when wic fails to invoke commandEd Bartosh2015-06-231-1/+1
| | | | | | | | | | | | | | | | | Return 1 if command doesn't exist or wic is called without any commmand. Return result of invoke_command as wic return code. Added tests for unsupported command and no command. Fixed typo in test case test02_createhelp spotted by this fix. [YOCTO #7856] (From OE-Core rev: ebd9f7b1da8ed556e98aab4d5f4e81707ac44b27) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Integrated plugin docstrings into 'wic help plugins' outputEd Bartosh2015-06-231-1/+1
| | | | | | | | | | | | | | | Added mechanism to show docstrings of plugin classes as a part of plugins help page. For missing plugins the following warning message is shown: <class '<plugin class spec>'> is missing docstring. [YOCTO #7118] (From OE-Core rev: 0997208266686473d23aed0fab58a1fd7c5d8cae) 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: refactored processing of wic exceptionsEd Bartosh2015-05-291-6/+5
| | | | | | | | | | | | | | | All wic exceptions are now inherited from new base exception class WicError. It makes them easy to maintain and catch. Processing of exceptions is done this way: Known wic exceptions cause wic to print error message to stdout. Unknown exceptions are not catched anymore and produce standard python traceback. (From OE-Core rev: e5e2c18ce4344c14d9e52ece916333bd0a619281) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: do not strip tracebackEd Bartosh2015-05-291-1/+1
| | | | | | | | | | Printing only first 5 levels of wic traceback makes it almost useless as the most valuable part of it is stripped. (From OE-Core rev: f9b121d8295eb9e297627f4d623164b43349a638) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: code cleanup: wildcard importsEd Bartosh2015-04-241-20/+21
| | | | | | | | | | | | | Here is what PEP8(Style Guide for Python Code) says about this: Wildcard imports (from <module> import *) should be avoided, as they make it unclear which names are present in the namespace, confusing both readers and many automated tools. (From OE-Core rev: 13416c1941f5dc8abcdb0073f2104a89eae2d6f1) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: try to find bitbake using find_executable APIEd Bartosh2015-04-191-5/+15
| | | | | | | | | | | | | | | | Current wic code was assuming that bitbake directory is on the same level as scripts, which is not the case for oe classic. Using find_executable bitbake location should be determined better as this API uss $PATH to search for executables. Fixes [YOCTO #7621] (From OE-Core rev: 9d86eb2e448263f7e395b48d95c380b2dc66ad8e) Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add argv argument to mainEd Bartosh2015-04-131-3/+3
| | | | | | | | | | | | Make it possible to call wic as an API from tests passing command line parameters as arguments to main. This is yet another enabler for wic unit testing. (From OE-Core rev: 8cb9ac3751424d429a38f6f80d733b289b6684ea) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Use __file__ instead of sys.argv[0]Ed Bartosh2015-04-131-1/+1
| | | | | | | | | | | | | | Using __file__ makes the code work independently of the way it's loaded. In some cases wic can be imported by another program without executing it. sys.argv[0] would not contain path to the wic in such a cases. This is an enabler for unit testing with nose framework. (From OE-Core rev: 7166262032648dbbc8b4b476c8770e35b1d4e234) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic:code cleanup: No space allowedEd Bartosh2015-04-131-29/+29
| | | | | | | | | | Fixed pylint warning 'No space allowed around keyword argument assignment' (From OE-Core rev: e07dd9b9c71960fbeded162ed52fbce06de620e9) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Implement --build-rootfs command line optionEd Bartosh2015-04-091-3/+22
| | | | | | | | | | | -f/--build-rootfs option makes wic to run bitbake <image> to produce rootfs. This option requires image name to be specified with -e/--image-name. (From OE-Core rev: 75ae0b7cf3863eb2857a2b6a7073beea626f751d) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: code cleanup: bad indentationEd Bartosh2015-04-091-4/+4
| | | | | | | | | Fixed pylint warning 'Bad indentation' (From OE-Core rev: ee71acc6f114f992a2edc9a3f557a731795aa076) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Remove special-case bootimg_dirTom Zanussi2014-10-301-7/+5
| | | | | | | | | | | | | | | | | | | | The first iterations of wic very shortsightedly catered to two specific use-cases and added special-purpose params for those cases so that they could be directly given their corresponding boot artifacts. (hdddir and staging_data_dir). As more use-cases are added, it becomes rather obvious that such a scheme doens't scale, and additionally causes confusion for plugin writers. This removes those special cases and states explicitly in the help text that plugins are responsible for locating their own boot artifacts. (From OE-Core rev: 6ba3eb5ff7c47aee6b3419fb3a348a634fe74ac9) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "wic: set bootimg_dir when using image-name artifacts"Tom Zanussi2014-10-301-4/+3
| | | | | | | | | | | | | | | | This reverts commit 7ce1dc13f91df70e8a2f420e7c3eba51cbc4bd48. This patch broke the assumption that a non-null boot_dir means a user-assigned (-b command-line param) value. Reverting doesn't break anything, since the case it was added for doesn't use the boot_dir for anything except debugging anyhow. Fixes [YOCTO #6290] (From OE-Core rev: db90f10bf31dec8d7d7bb2d3680d50e133662850) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: set bootimg_dir when using image-name artifactsMaciej Borzecki2014-09-231-3/+4
| | | | | | | | | | | | | Running wic with -e to use artifacts from a named image, bootimg_dir was always passed as empty string to partition source plugins. The patch sets bootimg_dir to current value of DEPLOY_DIR_IMAGE, as bootloader artifacts end up in that location as well. (From OE-Core rev: d7f69e6f0932a927b6ce289fb47ba575d7aaa1c8) Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add kickstart reference to help systemTom Zanussi2014-07-161-12/+15
| | | | | | | | | | | Add a 'wic kickstart' help section to make it easy for users to access the kickstart reference without having to go to an external website. (From OE-Core rev: 136137ec1c124aee89d2120abded60a5cf0562b0) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add wic overview to help systemTom Zanussi2014-07-161-9/+12
| | | | | | | | | | | Add a general overview of wic to the help system as 'wic overview', along with some introductory examples. (From OE-Core rev: fa108caaa53878152e4856d32ce1ab7fe3802287) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add general 'plugins' help topicTom Zanussi2014-07-101-6/+9
| | | | | | | | | | | Add a category for help topics with an initial help topic discussing source plugins. (From OE-Core rev: a3dbe46dd28a6fd9e6c21f6bbb6a12578df9dff3) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add dummy subcommand and usage stringsTom Zanussi2014-07-101-0/+13
| | | | | | | | | | | | | | In order to reuse the existing subcommand infrastructure to display various general-purpose help topics, add a dummy 'help_topic' subcommand and usage string. This allows users to invoke general help topics by the natural form 'wic help <topic>' even though topic doesn't correspond to a real subcommand. (From OE-Core rev: d03f39a99058c2393d7b50ac4909bdaa84b09920) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add support to look in all layers and get .wks fileJoão Henrique Ferreira de Freitas2014-05-211-0/+6
| | | | | | | | | | | | | | | .wks file are looked in 'scripts/lib/image/canned-wks' directory on all BBLAYERS variable returned by bitbake environment. If found, it will be used. The user could create your own .wks and keep it inside its layers. For now the path must be <layer-dir>/scripts/lib/image/canned-wks. (From OE-Core rev: 1f3e312211f277a1befd707a59a0c0a9bf6cbcbc) Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Extend --rootfs-dir to connect rootfs-dirsJoão Henrique Ferreira de Freitas2014-03-301-3/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The wic command-line param --rootfs-dir gets generalized to support multiple directories. Each '--rootfs-dir' could be connected using a special string, that should be present in .wks. I.e: wic create ... --rootfs-dir rootfs1=/some/rootfs/dir \ --rootfs-dir rootfs2=/some/other/rootfs/dir part / --source rootfs --rootfs-dir="rootfs1" --ondisk sda --fstype=ext3 \ --label primary --align 1024 part /standby --source rootfs --rootfs-dir="rootfs2" \ --ondisk sda --fstype=ext3 --label secondary --align 1024 The user could use harded-code directory instead of connectors. Like this: wic create ... hard-coded-path.wks -r /some/rootfs/dir part / --source rootfs --ondisk sda --fstype=ext3 --label primary --align 1024 part /standby --source rootfs --rootfs-dir=/some/rootfs/dir \ --ondisk sda --fstype=ext3 --label secondary --align 1024 (From OE-Core rev: 719d093c40e4c259a4c97d6c8a5efb5aeef5fd38) Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Hook up --debug optionTom Zanussi2014-02-041-8/+3
| | | | | | | | | | | Hook up the existing --debug option to toggle the wic debug loglevel, which is indispensible when things go wrong, and make it easy to use from the command-line. (From OE-Core rev: a5ece6f37656fa56b97fd8faf52917345238d015) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Create and use new functions for getting bitbake variablesTom Zanussi2014-02-041-0/+6
| | | | | | | | | | Add get_bitbake_var() and bitbake_env_lines() functions for use by plugins, which will need access to them for customization. (From OE-Core rev: f0bb47b0d7ab6520c105ce131844269172de3efd) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: eliminate module checksTom Zanussi2013-10-231-10/+0
| | | | | | | | | | We're removing all external dependencies including rpm and urlgrabber, so we don't need this check. (From OE-Core rev: 429c0d72b9b8bfed34832e283be92996e074b9ac) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Check for the existence/correctness of build artifactsTom Zanussi2013-10-181-0/+20
| | | | | | | | | | | If a user uses the -e option and specifies a machine that hasn't been built or uses the wrong .wks script for the build artifacts pointed to by the current machine, we should point that out for obvious cases. (From OE-Core rev: a5b9ccadc0603c70c65f74fa386995c585a951db) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Check for external modulesDarren Hart2013-10-161-0/+12
| | | | | | | | | | | | | | | | | | Since eight unique files import rpm, perform a check at the top level for the existence of the rpm module print a sensible error message if it is not. This may be able to be removed if some of the core rpm dependencies are removed from the mic libs. Also check for urlgrabber. This avoids a bracktrace in the event the modules are not installed which can be very off-putting to would-be users. (From OE-Core rev: b11bfadba20c1f39a63e396e605a8316c2ed2a94) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Cc: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: check passed-in build artifact directoriesTom Zanussi2013-10-161-0/+12
| | | | | | | | | Make sure they exist - complain if they don't. (From OE-Core rev: 24a585e3fd0ea0166991a6aa834bba15bcd8295d) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: check for build artifactsTom Zanussi2013-10-161-0/+8
| | | | | | | | | | wic needs to be given one form of build artifacts or another - complain if the user doesn't do that. (From OE-Core rev: 9116a17efd42447f276000927d0c2ea63776865b) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Initial code for wic (OpenEmbedded Image Creator)Tom Zanussi2013-10-011-0/+185
Initial implementation of the 'wic' command. The 'wic' command generates partitioned images from existing OpenEmbedded build artifacts. Image generation is driven by partitioning commands contained in an 'Openembedded kickstart' (.wks) file specified either directly on the command-line or as one of a selection of canned .wks files (see 'wic list images'). When applied to a given set of build artifacts, the result is an image or set of images that can be directly written onto media and used on a particular system. 'wic' is based loosely on the 'mic' (Meego Image Creator) framework, but heavily modified to make direct use of OpenEmbedded build artifacts instead of package installation and configuration, things already incorporated int the OE artifacts. The name 'wic' comes from 'oeic' with the 'oe' diphthong promoted to the letter 'w', because 'oeic' is impossible to remember or pronounce. This covers the mechanics of invoking and providing help for the command and sub-commands; it contains hooks for future commits to connect with the actual functionality, once implemented. Help is integrated into the 'wic' command - see that for details on usage. (From OE-Core rev: 95455ae4251e06d66e60945092b784d2d9ef165c) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>