Commit Graph

55 Commits

Author SHA1 Message Date
Ed Bartosh 15ea180414 wic: refactor get_boot_config
This function is going to be used by ks parser to find include .wks
files. get_boot_config name is a bit confusing as function is quite
generic. It looks if file is present in the canned wks directories.

Renamed get_boot_config -> get_canned.
Renamed parameter file_boot -> file_name.
Updated description.

(From OE-Core rev: 8ea9a4c0422c9600cd33ec6e815ebcf2d0aad364)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-20 17:07:13 +00:00
Mariano Lopez f95f729518 wic/utils/misc.py: Added function to search for files in canned-wks
This change add two new function to search for files in the
canned-wks folder for all the layers included in bblayers.conf.
This will be used to search for custom configuration files for
the bootloaders.

There are similar functions in the wic engine, but these are
focused in wks files only, so it was needed to create new ones.

[YOCTO #8728]

(From OE-Core rev: 356a942e75ac1743290d2c360d1bb89e2225b6cc)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09 08:48:24 +00:00
Ed Bartosh 67af6d6402 wic: exec_native_cmd: implement support for pseudo
Wic runs some tools through pseudo, which makes exec_native_cmd
to fail and throw cryptic error message when tool is not baked:
For example:
  Error: exec_cmd: 'export
  PSEUDO_PREFIX=/media/ssd/poky-build/tmp/sysroots/x86_64-linux/usr;export
  PSEUDO_LOCALSTATEDIR=/media/ssd/poky-build/tmp/work/qemux86-poky-linux/
...
  PSEUDO_PASSWD=/media/ssd/poky-build/tmp/work/qemux86-poky-linux/ ...
  PSEUDO_NOSYMLINKEXP=1;/media/ssd/poky-build/tmp/sysroots/ ...
  mkfs.ext4 -F -i 8192 /var/tmp/wic/build/rootfs_platform.7.ext4 -L
  platform -d
  /media/ssd/poky-build/tmp/work/qemux86-poky-linux/core-image-minimal/...
  returned '1' instead of 0

Made exec_native_cmd aware of pseudo and properly report
errors when command is not found.

(From OE-Core rev: 04bab58809c63c9114feb0aadc9b6115be10fcc4)

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>
2015-12-01 21:32:02 +00:00
Randy Witt 0f75740830 wic/utils/oe/misc.py: Preserve PATH when running native tools
Previously exec_native_cmd() would remove all items from PATH except for
the native sysroot. This can cause issues for the tools that are created
using create_wrapper().

Now instead of wiping out the PATH, run a sanity check to check if the
command is in the native sysroot.

(From OE-Core rev: ba127370e621b5b683d6f454596c3d0c60c13df7)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:29 +00:00
Ed Bartosh 791a3912d9 wic: fix short variable names
Made short variable names longer and more readable.

Fixed pylint warnings "Invalid variable name" and
"Invalid argument name".

(From OE-Core rev: 872cb0d5d79b26f34e6b35d7be8870d245021be4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:31 +01:00
Ed Bartosh e85f807b87 wic: use optparse instead of cmdln
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.

(From OE-Core rev: 1e5220f74830b99cf8340a4f6977399b5cf49871)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:28 +01:00
Ed Bartosh f1bcf47ff4 wic: fix pylint warning multiple-statements
Fixed pylint warning:
More than one statement on a single line (multiple-statements)

(From OE-Core rev: fa43b8b482a9423208f5d2c12994fa15bcbddbb2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:28 +01:00
Ed Bartosh 2e2ac0cb7a wic: fix typo
Fixed typo in tool name: mkswqp -> mkswap.

(From OE-Core rev: e21d4b442437fac450070922ec74029ee1d10208)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:26 +01:00
Ed Bartosh 5856f8ff96 wic: implement getting variables from .env files
Added functionality of getting variables from <image>.env files to
BitbakeVars class. env files will be parsed if the directory with
env files is known, i.e. when vars_dir attribute is set.
Otherwise 'bitbake -e' output will be parsed.

(From OE-Core rev: d21e4c1e56cab750ed4f6031d7f3dc5775a2c2cc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:22 +01:00
Ed Bartosh 95c6749af8 wic: add default_image attribute to BitbakeVars
New attribute is used when bitbake variable is requested without
specifying image name. The attribute should be set from outside,
for example when wic is called with '-e <image>' option.

(From OE-Core rev: 38d0b3744b5829333148ac4fc97dc45a8d0ba3a5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:21 +01:00
Ed Bartosh e1fe3479a6 wic: create new method _parse_line
Moved code that parses one line of 'bitbake -e' output
to separate method _parse_line.

This method will be also used later to parse lines of .env files.

(From OE-Core rev: 49ef04d3c9eeb76cbbc89b27b4dd1570b7a2552b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:21 +01:00
Ed Bartosh 58c393022f wic: add BitbakeVars class
Moved code of getting bitbake variables into separate class.

Created singleton object of this class in the module namespace.

Preserved existing API get_bitbake_var.

(From OE-Core rev: 3229d37993e315c9ca1902849746b9f50f35845c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:21 +01:00
Ed Bartosh b41de121c6 wic: remove undescore from function name
Renamed __exec_cmd -> _exec_cmd as double underscores cause
strange behaviour when function is called in class method.
Python complains that __exec_cmd method(!!!) of the same class
doesn't exist.

(From OE-Core rev: 3b400a06d755e3d437967f60842b1d9bd94f0814)

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>
2015-08-30 12:36:08 +01:00
Ed Bartosh 8ce8328901 wic: code cleanup: pylint misc.py
Fixed pylint warnings.
Increased pylint score from 8.02 to 9.40.

(From OE-Core rev: 26d8c70fb8a7cc8f6473ad1779b20b00616740c0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:02 -07:00
Ed Bartosh 8421e0e29f wic: code cleanup: remove unused code
Removed unused global variable wks_vars and 2 unused functions
get_wks_var and add_wks_var.

(From OE-Core rev: 7d87c821da6a5020e8dde3f1907fb8d6a023b110)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:01 -07:00
Ed Bartosh 87a846d588 wic: Report recipe name for native commands
exec_native_cmd was modified to report recipe to build
native programs.

Pairs executable->recipe are hardcoded as it's not possible
to obtain this information automatically.

[YOCTO #7631]

(From OE-Core rev: 1274379c91ee8e2fb9fbb34a6445cd5767eb4a35)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:01 -07:00
Ed Bartosh 8f8d3362b8 wic: Set default set of bitbake variables
Set default set of bitbake variables to the set of variables
for the first parsed image.

This allows wic to find proper bitbake varibale values
if it's called with '-e <image>' even without specifying
image in the call of get_bitbake_var.

(From OE-Core rev: 18cc6d2ec4dc289bb0333dddc96df5a645ea53d0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-10 13:35:40 +01:00
Ed Bartosh 00020fada3 wic: Code cleanup: unused imports
Fixed pylint warning unused-import

(From OE-Core rev: e77fda5fb6cb0a35308e4620ca4602715a471fbe)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:38 +01:00
Ed Bartosh 34172ef805 wic: Code cleanup: long lines, identation and whitespaces
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>
2015-07-02 23:08:38 +01:00
Ed Bartosh d88af4f518 wic: Remove __write_partition method
Moved code of __write_partition to 'assemble' method.
This way it should be more readable.

(From OE-Core rev: f7059362053c87f96ce68d1ab850962defb76540)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:38 +01:00
Ed Bartosh 1e307c3b40 wic: Rename partition images
Renamed partition images into <final image>.p<partition number>
This should make output directory look more organized and easier
to understand.

(From OE-Core rev: c826939e4eeed034f39207089ec1a7ed87c1c493)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh 992f78939e wic: Turn off debug output for 'bitbake -e'
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.

(From OE-Core rev: 71510c32d78ba24bf1172548f8eb4adfe621d2de)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:36 +01:00
Ed Bartosh aa470a1fcd wic: Refactor getting bitbake variables
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>
2015-07-02 23:08:36 +01:00
Ed Bartosh a4da21d92f wic: code cleanup: superfluous-parens
Removed unncecessary parents after 'if' 'del' and 'print' keywords.
Fixed pyling warning: Unnecessary parens after 'xxx' keyword

(From OE-Core rev: a64604d11f75973b4c2347fa2669da9889e44013)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:47:36 +01:00
Ed Bartosh d59d876f44 wic: Move validation of --ptable option to wks parser
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.

(From OE-Core rev: b812d0f40423bc56394cc8b6fc92eb1f477dba1b)

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>
2015-06-11 23:59:13 +01:00
Ed Bartosh 708ce3f3b7 wic: Set type GUID and UUID for partition
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]

(From OE-Core rev: c3cb9eb31570b2a92c8081a6b3716cb7443b1506)

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>
2015-06-11 23:59:12 +01:00
Ed Bartosh 9f40e6a5e8 wic: Add parameter 'uuid' to Image.add_partition method
With this parameter it's possible to pass generated UUID
into Image class to set it for partition when it's created.

(From OE-Core rev: e4bc71fa78b0d7a60aa85b8eb09a053545b61b84)

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>
2015-06-11 23:59:12 +01:00
Ed Bartosh 0e364973a4 wic: pylinted partitionedfs.py
Fixed some pylint findings in partitionedfs.py

(From OE-Core rev: fcb891a391a34fad15d99edfea6b0f022fc0d1c9)

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>
2015-06-11 23:59:11 +01:00
Ed Bartosh 4f9fe5b616 wic: replaced __run_parted with exec_native_cmd
There is no need for yet another wrapper around exec_native_cmd.

(From OE-Core rev: f0f163e55865dc10d2a4188b5f2d759836c13f68)

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>
2015-06-11 23:59:11 +01:00
Ed Bartosh dec9156ce8 wic: move checks to exec_native_cmd
Checked for return code and output of native commands
inside exec_native_cmd.

Removed similar code from a lot of places where
exec_native_cmd is called.

(From OE-Core rev: 9e3e933321d58c04619a585326fb291dbf2748f5)

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>
2015-06-11 23:59:11 +01:00
Ed Bartosh 77e9243210 wic: removed exec_cmd_quiet and exec_native_cmd_quiet
These functions are not used anywhere.

(From OE-Core rev: 7467fd446d08704881325577b7035b6128db6151)

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>
2015-06-11 23:59:11 +01:00
Ed Bartosh b7b3e4642c wic: check if part_type is set only for msdos partition table
Specifying partition type(GUID) makes sense for gpt partition table.

Current code checks if part-type is specified and throws exception
if it is. This makes sense to do only for msdos partition table.

(From OE-Core rev: 52dcccbead0c57d1a3f4afd2f9c7a38a985301ec)

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>
2015-06-11 23:59:10 +01:00
Ed Bartosh 0a13707513 wic: set legacy_boot flag for gpt partitions
This flag is used to tell special purpose software that
the GPT partition may be bootable.

(From OE-Core rev: 3ec5e2892c5ee312c44f4425096450a1914ce44a)

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>
2015-06-11 23:59:10 +01:00
Ed Bartosh 346ef9245d wic: refactored processing of wic exceptions
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>
2015-05-29 10:17:14 +01:00
Adrian Freihofer 4255b32738 wic: Add plugin for single partition disk
The wic plugin creates a disk image containig one ext2/3/4 partition.
No additional boot partition is required. Syslinux is installed into
the image. The target device is a legacy BIOS PC.

Purpose of this plugin:
Other avaliable plugins create a fat partition for /boot and an ext
partition for rootfs. Current linux-yocto kernel packages are not
compatible with this disk layout. The boot partition is not mounted
by default, hence the kernel is installed into rootfs and not into
boot partition. A kernel update ends up in a bricked device. The old
kernel which is still in boot likely does not even boot with updated
kernel modules from /. Even if the boot partition is mounted during
the kernel update the update will fail. The kernel package installs
a symbolic link which is not supported by the fat partition.
Creating just one ext partition for boot and rootfs solves all issues
related to package based kernel updates on the device.

The plugin depends on syslinux-nomtools a user space installer for
syslinux on ext filesystems.
Thanks to Robert Yang who implemented syslinux-nomtools and supported
the implementation of this plugin.

(From OE-Core rev: 4a7bd79b5100a496c9b1597b57d6dc18ba2b9c83)

Signed-off-by: Adrian Freihofer <adrian.freihofer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-03 11:43:49 +01:00
Ed Bartosh f2a0a98523 wic: code cleanup: wildcard imports
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>
2015-04-24 11:06:55 +01:00
Ed Bartosh e9fcc57071 wic: Print bitbake error output
Added bitbake error output to wic error message to make it
more descriptive.

[YOCTO #6911]

(From OE-Core rev: f68576d4c9cecbe7122325d7fc78c9b27ff07a8e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-14 12:38:50 +01:00
Ed Bartosh ea07f0325c wic: use native parted
Used exec_native_cmd instead of find_binary_path to run parted.
Got rid of find_binary_path as it's not used anywhere else.

There are several tools wic is trying to find not only in sysroot,
but also in host root. Parted is a special as on some distros it's
installed in /usr/sbin, which is not in the user's PATH. This makes
wic to fail with error "External command 'parted' not found, exiting."

[YOCTO #7122]

(From OE-Core rev: 76adf38c0d8e0faf04a5ecb3fcfbe831c85bb81f)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-14 12:38:49 +01:00
Ed Bartosh d0d0ab85c4 wic:code cleanup: No space allowed
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>
2015-04-13 22:33:20 +01:00
Ed Bartosh 16d8c895a4 wic: make error message more informative
Included name of the missing program into the error message produced
by exec_native_cmd when program is not found.

Removed mentioning of the host programs as this API is not running
them anymore.

(From OE-Core rev: 7d1599cf6a55d3624d2b90c1f55e14c4df73e570)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:26 +01:00
Ed Bartosh 024514037d wic: don't use host paths when looking for native tools
exec_native_cmd should not use host paths in $PATH to
avoid finding and using host tools.

[YOCTO: #6204]

(From OE-Core rev: fa263f238bbddb00c9953994fb69cc358170e2ec)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:26 +01:00
Alexandre Belloni 939fca9de2 wic: support ontrackdm6aux3 partitions
ontrack dm6 aux3 is a type of partition required to be able to boot a Freescale
mxs based platform.

(From OE-Core rev: aa2d05c58992810a5f816eef8078facf03a07e3c)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-09 07:43:52 +01:00
Ed Bartosh dd6a1525ec wic: code cleanup: unused imports
Fixed pylint warning 'Unused import'

(From OE-Core rev: dfde8bdae3ae151ffed5777b920d24c774e5da2c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-09 07:43:52 +01:00
Alexandre Belloni 8102bd0172 wic: add GPT support
Add GPT partition table support.

(From OE-Core rev: a3479ab45d89273b4474ca54517554fc5346da32)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:59 +00:00
Alexandre Belloni cf3e21e71e wic: allow to configure overhead factor per partition
Introduce a new option --overhead-factor to replace
IMAGE_OVERHEAD_FACTOR.

(From OE-Core rev: 20fe0c7202724187dbe80eb2101d8ef69e86b94e)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:58 +00:00
Alexandre Belloni d84742c39f wic: allow to configure extra space per partition
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.

(From OE-Core rev: 9f7fe71a10bcdd1864d2f838f3510e96810ef42e)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:58 +00:00
Alexandre Belloni 0b156dac83 wic: allow creation of partitions not in table
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.

(From OE-Core rev: 233b631ece5ee14d057932c146327065064b5196)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:58 +00:00
Alexandre Belloni 602d90d57a wic: use kB for the partitions size
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.

(From OE-Core rev: 3d4da9186016d54b76ad2fa710646de253f0f063)

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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-08 08:00:27 +00:00
Maciej Borzecki 6b19a93f38 wic: fix extended/logical partition layout
The patch fixes an issue in laying out extended and logical partitions
by wic. The original code produced disk images in which the size 3rd
partition as described in MBR was incorrect. Depending on the type of
file system used for that partition and size of the partition, it would
be impossible to mount the partition correctly. For instance, kickstart
file in which the 3rd partition had size of 1GB and used ext4 fs, would
result in an image with an umountable partition. The root cause is
reservation of sectors for EBR through stealing of last sector from the
last primary partition.

(From OE-Core rev: a8b85f7878726503dbfa2e9ea86bd6fd961bf03b)

Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-08 08:00:24 +00:00
Martin Hundebøll c0dafd3101 scripts: use '/usr/bin/env' in shebangs with python
To support yocto on systems with python3 as default version, scripts
should use /usr/bin/env python in the shebang, as this allows the use of
a fake env to mimic python2 as default version.

This patch simply replaces occurrences of #!/usr/bin/python with
 #!/usr/bin/env python and was done with this oneliner:

     git grep -lE '^#!/usr/bin/python' | xargs \
         sed -i 's|/usr/bin/python|/usr/bin/env python|'

(From OE-Core rev: 6d3de22a19657a413e01d7bb5fd74d16c00dc696)

Signed-off-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-12 15:38:29 +00:00