summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--smoke-pc.vmdb1
-rw-r--r--vmdb/plugins/mkfs_plugin.py10
2 files changed, 10 insertions, 1 deletions
diff --git a/smoke-pc.vmdb b/smoke-pc.vmdb
index 6773b6a..7d47463 100644
--- a/smoke-pc.vmdb
+++ b/smoke-pc.vmdb
@@ -13,6 +13,7 @@ steps:
- mkfs: ext4
partition: root-part
+ label: smoke
- mount: root-part
fs-tag: root-fs
diff --git a/vmdb/plugins/mkfs_plugin.py b/vmdb/plugins/mkfs_plugin.py
index 5aca499..e34c027 100644
--- a/vmdb/plugins/mkfs_plugin.py
+++ b/vmdb/plugins/mkfs_plugin.py
@@ -39,4 +39,12 @@ class MkfsStepRunner(vmdb.StepRunnerInterface):
device = state.parts[part_tag]
vmdb.progress(
'Creating {} filesystem on {}'.format(fstype, device))
- vmdb.runcmd(['/sbin/mkfs', '-t', fstype, device])
+ cmd = ['/sbin/mkfs', '-t', fstype]
+ if 'label' in step:
+ if fstype == 'vfat':
+ cmd.append('-n')
+ else:
+ cmd.append('-L')
+ cmd.append(step['label'])
+ cmd.append(device)
+ vmdb.runcmd(cmd)