remove arch key from default mic.conf
authorJF Ding <jian-feng.ding@intel.com>
Mon, 12 Sep 2011 16:12:17 +0000 (09:12 -0700)
committerJF Ding <jian-feng.ding@intel.com>
Mon, 12 Sep 2011 16:12:17 +0000 (09:12 -0700)
distfiles/mic.conf
mic/creator.py
mic/imager/baseimager.py

index cedd270ce3c8d18edc82cb09b94f81faf3773627..a592d5eb672d3b7fcb0b87e3809cff9c7a35c3e4 100644 (file)
@@ -7,7 +7,6 @@ tmpdir= /var/tmp/mic
 cachedir= /var/tmp/mic/cache
 outdir= .
 pkgmgr = zypp
-arch = i586
 
 ; proxy = http://proxy.yourcompany.com:8080/
 ; no_proxy = localhost,127.0.0.0/8,.yourcompany.com
index b25547bc8d8b4ee0669e34597e6303ec407a2014..3251902591014b5daef0106634250d487b787365 100644 (file)
@@ -62,6 +62,7 @@ class Creator(cmdln.Cmdln):
         optparser.add_option('', '--local-pkgs-path', type='string', dest='local_pkgs_path', default=None, help='Path for local pkgs(rpms) to be installed')
         optparser.add_option('', '--logfile', type='string', dest='logfile', default=None, help='Path of logfile')
         optparser.add_option('', '--release', type='string', dest='release', default=None, help='Generate release package')
+        optparser.add_option('-A', '--arch', type='string', dest='arch', default=None, help='Specify repo architecture')
         return optparser
 
     def preoptparse(self, argv):
@@ -116,6 +117,9 @@ class Creator(cmdln.Cmdln):
         if self.options.release:
             self.configmgr.create['release'] = self.options.release
 
+        if self.options.arch is not None:
+            self.configmgr.create['arch'] = self.options.arch
+
         if self.options.logfile:
             msger.set_interactive(False)
             msger.set_logfile(self.options.logfile)
index 623de8e57db2c81668a0e6d4058af9b6a81c8207..57f53bef3d33c0b07233665a8dae14acd479b822 100644 (file)
@@ -74,7 +74,7 @@ class BaseImageCreator(object):
 
             self.destdir = createopts['outdir']
 
-            self.arch = createopts['arch']
+            target_arch = createopts['arch']
             self._local_pkgs_path = createopts['local_pkgs_path']
 
         else:
@@ -83,7 +83,7 @@ class BaseImageCreator(object):
             self.tmpdir = "/var/tmp/mic"
             self.cachedir = "/var/tmp/mic/cache"
             self.destdir = "."
-            self.arch = "noarch"
+            target_arch = "noarch"
             self._local_pkgs_path = None
 
         self.__builddir = None
@@ -128,15 +128,11 @@ class BaseImageCreator(object):
                     self._dep_checks.append("mkfs.btrfs")
                     break
 
-        # make sure arch available
-        if not self.arch:
-            raise CreatorError("Architecture for creator is not available")
-        if self.arch.startswith("arm"):
-            if not self.set_target_arch(self.arch):
-                raise CreatorError("Architecture %s is not support" % self.arch)
+        if target_arch.startswith("arm"):
+            if not self.set_target_arch(target_arch):
+                raise CreatorError('arch "%s" can not be supported' % target_arch)
         else:
             self.target_arch = None
-        print self.arch, self.target_arch
 
         # make sure the specified tmpdir and cachedir exist
         if not os.path.exists(self.tmpdir):
@@ -162,8 +158,8 @@ class BaseImageCreator(object):
             vdso_fh.close()
             if (int)(vdso_value) == 1:
                 msger.warning("vdso is enabled on your host, which might cause problems with arm emulations.\n"
-                                  "\tYou can disable vdso with following command before starting image build:\n"
-                                  "\techo 0 | sudo tee /proc/sys/vm/vdso_enabled")
+                              "\tYou can disable vdso with following command before starting image build:\n"
+                              "\techo 0 | sudo tee /proc/sys/vm/vdso_enabled")
 
         return True