Age | Commit message (Collapse) | Author | Files |
|
Fixed pylint warnings bad-continuation, bad-continuation and
line-too-long.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Moved code of __write_partition to 'assemble' method.
This way it should be more readable.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Made the code to backup and restore fstab only if it's modified.
Cleaned up the code. Made it more pythonic.
Improved code readability by moving code from several tiny
methods into one place.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Added --uuid option to the configuration of wks parser.
This option specifies partition UUID. The code to process
it is already in place. It was implemented for --use-uuid
option.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Image file name is not unique for the partitions without label.
This causes image being rewritten and used as a source for all
partitions without label. Wic produces broken or incorrect result
images because of that.
Added wks line number to the image name to make it unique.
|
|
Moved duplicated code of geting rootfs size
out of prepare_rootfs* methods.
|
|
Moved code out of prepare_empty_partition* methods
to avoid code duplication.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Shortened code by using getattr to obtain a method to call for
prepare_empty_partition_* and prepare_rootfs_* methods.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Removed useless variable 'image_rootfs' from 4 prepare_rootfs_* methods.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Renamed partition images into <final image>.p<partition number>
This should make output directory look more organized and easier
to understand.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Moved code out of prepare_roots* methods to avoid code duplication.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Switched debug level to 'normal' to prevent huge 'bitbake -e'
output to go into wic debug output. This should help to make
wic debug info much more clean and easier to read.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Wic tries to find plugins in every layer and prints a message
'Plugin dir is not a directory or does not exist' if layer
doesn't have plugin dir. It causes a lot of duplicated
messages in the debug output, which makes it hard to find
useful info there.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Wic doesn't show any information for the partition if label is not set.
Fixed this by adding mount point to the report.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
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.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Added canned wks and testcase to create multi-rootfs images referring
bitbake image recipes.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
This adds the `appendsrcfile` and `appendsrcfiles` sub-commands, which let the
user add or replace one or more files in the recipe sources, either in a path
relative to `S` or `WORKDIR`. Each file gets added to `SRC_URI` as a file://
URI, using the subdir= parameter to specify the destination directory.
Examples:
# Adds our defconfig as file://defconfig. If it's already in SRC_URI, it
# won't be duplicated.
recipetool appendsrcfile --workdir meta-mylayer linux-mel defconfig
recipetool appendsrcfiles --workdir meta-mylayer linux-mel defconfig
# Does the same, handling the different local filename
recipetool appendsrcfile --workdir meta-mylayer linux-mel defconfig.mine defconfig
# Adds our device tree files to the source tree
recipetool appendsrcfiles --destdir arch/arm/boot/dts meta-mylayer linux-mel *.dts
Of course, for the latter example to be of use, the new dts files would need
to be added to `KERNEL_DEVICETREE` as well, and depending on the kernel,
`DEFCONFIG` or `KERNEL_DEFCONFIG` may need to be set.
Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
This validates the arguments early, when argparse is parsing the arguments, in
a consistent way.
Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
Used more pythonic way to make a list.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Implemented compressing result image with specified compressor.
Updated reporting code to show compressed image.
[YOCTO #7593]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Added 'compressor' argument to Direct plugin API to
pass a name of compressor utility.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Added 'compressor' argument to wic_create to pass a name of
compressor utility to the wic engine.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
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.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
If patches fail to apply with git, quilt it used as a fallback. If that
happens, the code in this class is meant to handle cleanup of these patch
files. In the case where ${S} is a subdir of the git tree, the code doesn't
correctly set the patches directory.
This change correctly sets the patches directory (which is different to the
location of the git repository).
[YOCTO #7911]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
Removed -i/--infile wic command line option.
Removed properties_file and properties arguments of
wic_create function.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
Removed unncecessary parents after 'if' 'del' and 'print' keywords.
Fixed pyling warning: Unnecessary parens after 'xxx' keyword
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
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]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
|
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]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Docstings from plugin classes are used as part of
output of 'wic help plugins'. Adding them makes help page
more informative.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Fixed wrong name for the first argument in class methods.
Pylint complains about the issue this way:
Class method should have 'cls' as first argument
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Added short explanation of how to create empty pattition
to the 'wic help kickstart' output.
[YOCTO #7131]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
It turns out that scp can't be used to copy symlinks because it follows
them instead of copying them, and this is by design (since it emulates
rcp which also behaved this way); the unfortunate result is that
symlinks that point to valid files on the host translate into the host
file being copied to the target (yuck). The simplest alternative that
does not have this undesirable behaviour is to use tar and pipe it over
ssh.
At the same time, it would be even better if we properly reflect file
permissions and ownership on the target that have been established
within the pseudo environment. We can do this by executing the copy
process under pseudo, which turns out to be quite easy with access to
the pseudo environment set up by the build system.
Fixes [YOCTO #7868].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
|
|
* It turns out that not all versions of the file command support the -E
option - the version in Ubuntu 14.04 doesn't support it for example.
This option is supposed to force file to return an error if the file
can't be opened - since we can't rely upon it then fall back to
looking at the output instead. (The results of this issue were simply
that we didn't notice if the file was executable and give a warning,
which tripped an oe-selftest failure - so it was minor.)
* If we receive an error there's not much point looking at the output to
see what type was returned because there wasn't one.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
|
|
Add a long description and tweak some of the argument descriptions so
that it's clearer what the appendfile subcommand does and how it works.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
|
|
Use DevtoolError exception more widely for handling error cases. This
exception is now caught in the main script and raising it can be used to
exit with an error. This hopefully simplifies error handling. The
change also makes exit codes more consistent, always returning '1' when
an error occurs.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
|
|
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
|
|
Continue refactoring of update_recipe() by splitting out the 'patch'
mode into a separate function.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
|
|
Refactor update_recipe() (i.e. the implementation of the update-recipe
command) by splitting out the 'srcrev' into a distinct function.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
|
|
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
|
|
Just refactor the code.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
|
|
A slight simplification of the code.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
|
|
Split out the logic of determining "initial rev" and "update rev" into a
separate function.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
|
|
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
|
|
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
|
|
bootloader --ptable option has two valid choices: gpt and msdos
Moved this check to wks parser by changing option type to 'choice'.
Removed similar checks from 5 other places.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Added help for two wks partition options specific to
GUID partition table and globally unique identificators (GUID).
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Used --use-uuid option for root partition in directdisk-gpt.wks
This is useful to have example of image with UUID support.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Set type GUID and UUID for partition using sgdisk utility.
Type GUID can be specified for partition in .wks with
--part-type option.
UUID is generated when --use-uuid option is specified for
partition.
[YOCTO #7716]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
With this parameter it's possible to pass generated UUID
into Image class to set it for partition when it's created.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Replaced DirectImageCreator._get_boot_config private method
with a 'rootdev' property.
Simplified the code and API.
Used 'uuid' property instead of incorrectly used 'part_type'.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|