baseimager: export INSTALLERFW_MOUNT_PREFIX
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 26 Jun 2013 09:15:28 +0000 (12:15 +0300)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 26 Jun 2013 09:15:28 +0000 (12:15 +0300)
The installer framework scripts sometimes need to know the real current path
where the partitions are mounted. In MIC environment, the real path is the same
as the mountpoint, except when we are not in chroot, in which case the real
path has a prefix. Export this information in the 'INSTALLERFW_MOUNT_PREFIX'
variable.

In other environments, like pc-installer, the current path may be different,
and pc-installer will export it in 'INSTALLERFW_MOUNT_PREFIX'.

This will allow us writing configuration scripts which will work in both MIC
and pc-installer environments.

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

index fed1ad7..6c91af2 100644 (file)
@@ -463,6 +463,13 @@ class BaseImageCreator(object):
         # Name of the image creation tool
         env[self.installerfw_prefix + "INSTALLER_NAME"] = "mic"
 
+        # The real current location of the mounted file-systems
+        if in_chroot:
+            mount_prefix = "/"
+        else:
+            mount_prefix = self._instroot
+        env[self.installerfw_prefix + "MOUNT_PREFIX"] = mount_prefix
+
         # These are historical variables which lack the common name prefix
         if not in_chroot:
             env["INSTALL_ROOT"] = self._instroot