wic: Error on zero-sized partitions

It doesn't make sense to create zero-sized partitions so assume user
error and notify the user they should be using a non-zero --size for
partitions that don't specify a --source.

(From OE-Core rev: 3231562c3c9f8173ddcc0812001aadf0988c8892)

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>
This commit is contained in:
Tom Zanussi
2014-07-15 10:33:15 -05:00
committed by Richard Purdie
parent d08c2ce0d6
commit eca8a56a4e

View File

@@ -122,6 +122,8 @@ class Wic_PartData(Mic_PartData):
partition command parameters.
"""
if not self.source:
if not self.size:
msger.error("The %s partition has a size of zero. Please specify a non-zero --size for that partition." % self.mountpoint)
if self.fstype and self.fstype == "swap":
self.prepare_swap_partition(cr_workdir, oe_builddir,
native_sysroot)