summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxiaojuan.mao <xiaojuan.mao@samsung.com>2017-05-22 10:10:44 +0800
committerxiaojuan.mao <xiaojuan.mao@samsung.com>2017-07-13 11:22:40 +0800
commit85ac4324ef3f5555752d36ce4a9dbbcdc654b689 (patch)
tree144eadd4e8440435d9757c1301dcbfcfebb093fd
parent074909a7f3379d608efa48072a8c87f500168984 (diff)
downloadmic-85ac4324ef3f5555752d36ce4a9dbbcdc654b689.tar.gz
mic-85ac4324ef3f5555752d36ce4a9dbbcdc654b689.tar.bz2
mic-85ac4324ef3f5555752d36ce4a9dbbcdc654b689.zip
Modify the arguments that use cpio to generate image.
Change-Id: Ieb9dc524fedd056d0ff61bd2ec139a44395d1daf
-rwxr-xr-x[-rw-r--r--]mic/3rdparty/pykickstart/options.py10
-rwxr-xr-xmic/imager/baseimager.py2
-rwxr-xr-xmic/imager/loop.py5
3 files changed, 9 insertions, 8 deletions
diff --git a/mic/3rdparty/pykickstart/options.py b/mic/3rdparty/pykickstart/options.py
index 341c5d7..d971d92 100644..100755
--- a/mic/3rdparty/pykickstart/options.py
+++ b/mic/3rdparty/pykickstart/options.py
@@ -137,11 +137,11 @@ def _check_ksboolean(option, opt, value):
raise OptionValueError(_("Option %(opt)s: invalid boolean value: %(value)r") % mapping)
def _check_string(option, opt, value):
- if len(value) > 2 and value.startswith("--"):
- mapping = {"opt": opt, "value": value}
- raise OptionValueError(_("Option %(opt)s: invalid string value: %(value)r") % mapping)
- else:
- return value
+ #if len(value) > 2 and value.startswith("--"):
+ #mapping = {"opt": opt, "value": value}
+ #raise OptionValueError(_("Option %(opt)s: invalid string value: %(value)r") % mapping)
+ # else:
+ return value
# Creates a new Option class that supports several new attributes:
# - required: any option with this attribute must be supplied or an exception
diff --git a/mic/imager/baseimager.py b/mic/imager/baseimager.py
index 3cd11de..0230424 100755
--- a/mic/imager/baseimager.py
+++ b/mic/imager/baseimager.py
@@ -1265,7 +1265,7 @@ class BaseImageCreator(object):
cpiomountdir = os.path.join(self._instroot, item['mountpoint'].lstrip('/'))
os.chdir(cpiomountdir)
# find . | cpio --create --'format=newc' | gzip > ../ramdisk.img
- runner.show('find . | cpio --create --format=%s | gzip > %s' % (item['cpioopts'], imgfile))
+ runner.show('find . | cpio --create %s | gzip > %s' % (item['cpioopts'], imgfile))
shutil.rmtree(cpiomountdir, ignore_errors=True)
fs.makedirs(cpiomountdir)
os.chdir(oldoutdir)
diff --git a/mic/imager/loop.py b/mic/imager/loop.py
index d976b88..cca8080 100755
--- a/mic/imager/loop.py
+++ b/mic/imager/loop.py
@@ -446,9 +446,10 @@ class LoopImageCreator(BaseImageCreator):
runner.show('ls -al %s' % self._imgdir)
if item['fstype'] == "ext4":
- runner.show('/sbin/tune2fs -O ^huge_file,extents,uninit_bg %s '
+ if not item['cpioopts']:
+ runner.show('/sbin/tune2fs -O ^huge_file,extents,uninit_bg %s '
% imgfile)
- runner.quiet(["/sbin/e2fsck", "-f", "-y", imgfile])
+ runner.quiet(["/sbin/e2fsck", "-f", "-y", imgfile])
self.image_files.setdefault('partitions', {}).update(
{item['mountpoint']: item['label']})
if self.compress_image: