summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Jin <jin.xiao@samsung.com>2018-09-25 16:37:36 +0800
committerXiao Jin <jin.xiao@samsung.com>2018-09-26 10:09:44 +0800
commit06b816be261edd5046211f6ce2f796734b9de693 (patch)
tree7107c42c4573e43750b1f12a598699082757f782
parentea0cf44c6b2b10754ecf77575cc970821821216d (diff)
downloadmic-06b816be261edd5046211f6ce2f796734b9de693.tar.gz
mic-06b816be261edd5046211f6ce2f796734b9de693.tar.bz2
mic-06b816be261edd5046211f6ce2f796734b9de693.zip
add new option --fslabel in part section
Change-Id: I0ef3de0c99f23a971b4a862cce2ed38c5fc65a4b
-rwxr-xr-x[-rw-r--r--]mic/3rdparty/pykickstart/commands/partition.py4
-rwxr-xr-x[-rw-r--r--]mic/imager/loop.py6
2 files changed, 9 insertions, 1 deletions
diff --git a/mic/3rdparty/pykickstart/commands/partition.py b/mic/3rdparty/pykickstart/commands/partition.py
index e65e012..5dbd4d4 100644..100755
--- a/mic/3rdparty/pykickstart/commands/partition.py
+++ b/mic/3rdparty/pykickstart/commands/partition.py
@@ -102,6 +102,7 @@ class FC4_PartData(FC3_PartData):
self.bytesPerInode = kwargs.get("bytesPerInode", 4096)
self.fsopts = kwargs.get("fsopts", "")
self.label = kwargs.get("label", "")
+ self.fslabel = kwargs.get("fslabel", "")
def _getArgsAsStr(self):
retval = FC3_PartData._getArgsAsStr(self)
@@ -112,6 +113,8 @@ class FC4_PartData(FC3_PartData):
retval += " --fsoptions=\"%s\"" % self.fsopts
if self.label != "":
retval += " --label=%s" % self.label
+ if self.fslabel != "":
+ retval += " --fslabel=%s" % self.fslabel
return retval
@@ -279,6 +282,7 @@ class FC4_Partition(FC3_Partition):
type="int", nargs=1)
op.add_option("--fsoptions", dest="fsopts")
op.add_option("--label", dest="label")
+ op.add_option("--fslabel", dest="fslabel")
return op
class RHEL5_Partition(FC4_Partition):
diff --git a/mic/imager/loop.py b/mic/imager/loop.py
index dc2123d..eb9f381 100644..100755
--- a/mic/imager/loop.py
+++ b/mic/imager/loop.py
@@ -141,6 +141,9 @@ class LoopImageCreator(BaseImageCreator):
part.fstype = "ext4"
label = part.label
+ fslabel = part.fslabel
+ if fslabel == '':
+ fslabel = label
mp = part.mountpoint
if mp == '/':
# the base image
@@ -157,6 +160,7 @@ class LoopImageCreator(BaseImageCreator):
allloops.append({
'mountpoint': mp,
'label': label,
+ 'fslabel':fslabel,
'name': imgname,
'size': part.size or 4096L * 1024 * 1024,
'fstype': part.fstype or 'ext3',
@@ -381,7 +385,7 @@ class LoopImageCreator(BaseImageCreator):
mp,
fstype,
self._blocksize,
- loop['label'],
+ loop['fslabel'],
fsopt,
fsuuid = loop['uuid'])