raw: support the 'fstab' installerfw attribute
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Thu, 27 Jun 2013 04:35:55 +0000 (07:35 +0300)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Thu, 27 Jun 2013 04:42:45 +0000 (07:42 +0300)
Similarly to the 'extlinux' attribute of the 'installerfw' KS command, start
supporitng the 'fstab' attribute. This means, for example, if the KS file has
this command:

installerfw "extlinux,fstab"

then MIC will not install/configure extlinux, and it will not generate
/etc/fstab. Instead, installer framework scripts will do that.

I've added the support only to raw images, since installerfw "extlinux" is
allso supported only by raw images. The liveusb support can be added later. I
do not do this because I cannot test liveusb images at this point, so I am
afraid of breaking it.

Change-Id: Ic6bb7241783aeff571956762a42665fcd8881e3f
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
mic/imager/baseimager.py
mic/imager/raw.py

index c5672f5..40d011d 100644 (file)
@@ -684,9 +684,11 @@ class BaseImageCreator(object):
             raise CreatorError("No repositories specified")
 
     def __write_fstab(self):
-        fstab = open(self._instroot + "/etc/fstab", "w")
-        fstab.write(self._get_fstab())
-        fstab.close()
+        fstab_contents = self._get_fstab()
+        if fstab_contents:
+            fstab = open(self._instroot + "/etc/fstab", "w")
+            fstab.write(fstab_contents)
+            fstab.close()
 
     def __create_minimal_dev(self):
         """Create a minimal /dev so that we don't corrupt the host /dev"""
index 407d984..838191a 100644 (file)
@@ -77,6 +77,11 @@ class RawImageCreator(BaseImageCreator):
         BaseImageCreator.configure(self, repodata)
 
     def _get_fstab(self):
+        if kickstart.use_installerfw(self.ks, "fstab"):
+            # The fstab file will be generated by installer framework scripts
+            # instead.
+            return None
+
         s = ""
         for mp in self.__instloop.mountOrder:
             p = None