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

login
register
mail settings
Submitter tom.zanussi@linux.intel.com
Date July 15, 2014, 3:43 p.m.
Message ID <e25d490ce37196736b03574b7db299e2fc447958.1405438752.git.tom.zanussi@linux.intel.com>
Download mbox | patch
Permalink /patch/75671/
State Accepted
Commit eca8a56a4e41780a4b383cbca26478c2e90f8e81
Headers show

Comments

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

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,
                                             native_sysroot)