more info message for copy_kernel
authorJF Ding <jian-feng.ding@intel.com>
Mon, 23 Jan 2012 10:36:49 +0000 (18:36 +0800)
committerJF Ding <jian-feng.ding@intel.com>
Mon, 23 Jan 2012 10:36:49 +0000 (18:36 +0800)
mic/imager/baseimager.py

index 4a39922..672f6f8 100644 (file)
@@ -74,8 +74,9 @@ class BaseImageCreator(object):
         self.destdir = "."
         self.target_arch = "noarch"
         self._local_pkgs_path = None
+
         # If the kernel is save to the destdir when copy_kernel cmd is called.
-        self._copy_kernel = False
+        self._need_copy_kernel = False
 
         # Eeach image type can change these values as they might be image type
         # specific
@@ -92,7 +93,7 @@ class BaseImageCreator(object):
                       "arch" : "target_arch",
                       "local_pkgs_path" : "_local_pkgs_path",
                       "compress_disk_image" : "_img_compression_method",
-                      "copy_kernel" : "_copy_kernel",
+                      "copy_kernel" : "_need_copy_kernel",
                      }
     
             # update setting from createopts
@@ -1181,14 +1182,17 @@ class BaseImageCreator(object):
         """ Copy kernel files to the outimage directory.
         
         NOTE: This needs to be called before unmounting the instroot.
-        
         """
-        if not self._copy_kernel:
+
+        if not self._need_copy_kernel:
             return
+
         if not os.path.exists(self.destdir):
             os.makedirs(self.destdir)
+
         for kernel in glob.glob("%s/boot/vmlinuz-*" % self._instroot):
             kernelfilename = "%s/%s-%s" % (self.destdir, self.name, os.path.basename(kernel))
+            msger.info('copy kernel file %s as %s' % (os.path.basename(kernel), kernelfilename))
             shutil.copy(kernel, kernelfilename)
             self.outimage.append(kernelfilename)