[5/5] wic: Error on zero-sized partitions

Submitted by tom.zanussi@linux.intel.com on July 15, 2014, 3:43 p.m. | Patch ID: 75671


Message ID e25d490ce37196736b03574b7db299e2fc447958.1405438752.git.tom.zanussi@linux.intel.com
State Accepted
Commit 3231562c3c9f8173ddcc0812001aadf0988c8892
Headers show

Commit Message

tom.zanussi@linux.intel.com July 15, 2014, 3:43 p.m.
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.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
 scripts/lib/mic/kickstart/custom_commands/partition.py | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
index 4662bdd..06f29a9 100644
--- a/scripts/lib/mic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
@@ -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,