From 06b816be261edd5046211f6ce2f796734b9de693 Mon Sep 17 00:00:00 2001 From: Xiao Jin Date: Tue, 25 Sep 2018 16:37:36 +0800 Subject: add new option --fslabel in part section Change-Id: I0ef3de0c99f23a971b4a862cce2ed38c5fc65a4b --- mic/3rdparty/pykickstart/commands/partition.py | 4 ++++ mic/imager/loop.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) mode change 100644 => 100755 mic/3rdparty/pykickstart/commands/partition.py mode change 100644 => 100755 mic/imager/loop.py diff --git a/mic/3rdparty/pykickstart/commands/partition.py b/mic/3rdparty/pykickstart/commands/partition.py old mode 100644 new mode 100755 index e65e012..5dbd4d4 --- 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 old mode 100644 new mode 100755 index dc2123d..eb9f381 --- 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']) -- cgit v1.2.3