summaryrefslogtreecommitdiffstats
path: root/scripts/lib/image
AgeCommit message (Collapse)Author
2015-02-21wic: Fix kernel dir locationTom Zanussi
With the recent kernel staging changes, STAGING_KERNEL_DIR no longer points to the kernel image, which can be found however in DEPLOY_DIR_IMAGE. This updates find_artifacts() to look there instead. Fixes [YOCTO #7307]. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: allow to configure overhead factor per partitionAlexandre Belloni
Introduce a new option --overhead-factor to replace IMAGE_OVERHEAD_FACTOR. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: allow to configure extra space per partitionAlexandre Belloni
Introduce a new option --extra-space instead of using IMAGE_EXTRA_SPACE. This is useful for boot partitions where the extra space is often useless or for huge partition where 10MiB may not be enough. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: allow creation of partitions not in tableAlexandre Belloni
For some architectures it is necessary to reserve space on disk without it being present in the partition table. For example, u-boot on i.mx is placed at an offset of 1kB on the sdcard. While it would be possible to create a partition at that offset and place u-boot there, it would then be necessary to update the default u-boot environment to use partition 2 on the mmc instead of partition 1. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-07wic: use kB for the partitions sizeAlexandre Belloni
Use kB instead of MB for the partition size to get a better granularity. This is needed on some SoC (i.mx, omap) where it is necessary to create partitions as small as 64kB. Keep the backward compatibility by assuming MB when no unit is provided. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com> Tested-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-10-30wic: Remove special-case bootimg_dirTom Zanussi
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. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30Revert "wic: set bootimg_dir when using image-name artifacts"Tom Zanussi
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] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30wic: Update the help text to include -D (--debug)Tom Zanussi
The --debug option is missing from the wic help text; this adds it and at the same time rearranges the usage into a more logical arrangement. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-23wic: add sdimage-bootpart kickstart fileMaciej Borzecki
Add kickstart for generating a SD card image that should cover most use case scenarios. The layout is as follows: - 16MB vfat partition that IMAGE_BOOT_FILES will be copied to, 4k alignment - ext4 rootfs, 4k alignment 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>
2014-09-23wic: set bootimg_dir when using image-name artifactsMaciej Borzecki
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. 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>
2014-08-15wic: Add mkgummidisk kickstart fileTom Zanussi
This is the same as mkefidisk but uses gummiboot instead of grub-efi. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15wic: Add sourceparams to mkefidisk.wksTom Zanussi
The bootimg-efi plugin now requires a loader param, so supply it to retain existing behavior. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11wic: Rename /mic to /wicTom Zanussi
As well as any other stray instances of mic in the codebase that can be removed. We don't really need to carry around legacy naming, and the history is in git. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Remove unused conf supportTom Zanussi
Also fix up users such as imager functions. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Update 'Background and Motivation' help sectionTom Zanussi
Remove help text regarding the source and future intentions of the wic codebase, since the code prompting those comments has now been mostly removed. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-02wic: Various typo/grammar fixes to wic help textTom Zanussi
This is a set of miscellaneous help text updates noticed while transcribing wic help for the dev manual. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-08-02wic: Add squashfs to --fstypes documentationTom Zanussi
squashfs support was recently added to wic, so document it. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-08-02wic: Add documentation for --fsoptionsTom Zanussi
--fsoptions support was recently added to wic, so document it. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-08-02wic: Fix plugin help textTom Zanussi
Fix various typoes and grammar problems noticed while transcribing for the dev manual. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-07-23wic: Remove fstype from mkefidisk canned wksTom Zanussi
The bootimg-efi plugin specifies the fstype internally, so remove it from the partition definition. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-23wic: Add help entry for wic kickstartTom Zanussi
Previous patches added help for 'wic kickstart' but forgot to add an entry in the main help page showing its availability. Add an entry for it. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-16wic: Add kickstart reference to help systemTom Zanussi
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. 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>
2014-07-16wic: Add wic overview to help systemTom Zanussi
Add a general overview of wic to the help system as 'wic overview', along with some introductory examples. 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>
2014-07-10wic: Add general 'plugins' help topicTom Zanussi
Add a category for help topics with an initial help topic discussing source plugins. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-07-10wic: Add help text for 'wic list source-plugins'Tom Zanussi
Add both short and long text for the new 'wic list source-plugins' command. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-07-10wic: Add command to list available source pluginsTom Zanussi
Add a 'wic list source-plugins' command enabling users to get a list of valid partition --sources. This is useful not only for determining sources to use in .wks partition statements, but also for making sense of errors in .wks partition processing. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-06-06wic: check if BBLAYERS is valid before useJoão Henrique Ferreira de Freitas
If wic is running as raw mode, it's better to check if BBLAYERS is valid before inspect it. No functional changes. Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-21wic: add support to look in all layers and get .wks fileJoão Henrique Ferreira de Freitas
.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. Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-05-13wic: Move find_bitbake_env_line() to oe.miscJoão Henrique Ferreira de Freitas
Move find_bitbake_env_line() since they're going to need to be accessible from source plugins. Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-30wic: Fix bitbake_env_command for 'None' caseTom Zanussi
bitbake_env_command will choke if it isn't given an image, make sure it does the right thing in that case. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-04wic: Hook up --debug optionTom Zanussi
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. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-04wic: Hook up BootimgEFIPlugin and BootimgPcbiosPlugin pluginsTom Zanussi
Remove all the Wic_PartData and DirectImageCreator code now implemented by the BootimgEFIPlugin and BootimgPcbiosPlugin plugins, as well as all the special-cased boot_type code, significantly cleaning up the code. Replace the calling code with general-purpose plugin invocations, in essence calling the appropriate implementations at run-time based on the --source value in effect. Change the directdisk.wks and mkefidisk.wks scripts to make use of the new plugins. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-04wic: Create and use new functions for getting bitbake variablesTom Zanussi
Add get_bitbake_var() and bitbake_env_lines() functions for use by plugins, which will need access to them for customization. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-04wic: Move some common items to oe.miscTom Zanussi
Move a couple items into a more common location since they're going to need to be accessible from source plugins. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-18wic: Initialize return values in find_artifacts()Tom Zanussi
If one of these isn't found, it won't be initialized and will throw an UnboundLocalError. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-01wic: Add OpenEmbedded-specific implementationTom Zanussi
Reuses the mic/livecd infrastructure but heavily subclasses and modifies it to adapt to the special needs of building images from existing OpenEmbedded build artifacts. In addition to the OE-specific mic objects and modifications to the underlying infrastructure, this adds a mechanism to allow OE kickstart files to be 'canned' and made available to users via the 'wic list images' command. Two initial OE kickstart files have been added as canned .wks files: directdisk, which implements the same thing as the images created by directdisk.bbclass, and mkefidisk, which can essentially be used as a replacement for mkefidisk.sh. Of course, since creation of these images are now driven by .wks files rather than being hard-coded into class files or scripts, they can be easily modified to generate different variations on those images. They also don't require root priveleges, since they don't use mount to create the images. They don't however write to media like mkefidisk.sh does, but rather create images that can be written onto media. 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>
2013-10-01wic: Initial code for wic (OpenEmbedded Image Creator)Tom Zanussi
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. 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>