[node-patches] Change in ovirt-node[master]: fix efi upgrades grub config file path

jboggs at redhat.com jboggs at redhat.com
Tue Aug 14 16:16:30 UTC 2012


Joey Boggs has uploaded a new change for review.

Change subject: fix efi upgrades grub config file path
......................................................................

fix efi upgrades grub config file path

Change-Id: Ie1c915090680642c11e46110522e6f50bc366ff0
Signed-off-by: Joey Boggs <jboggs at redhat.com>
---
M scripts/ovirtnode/install.py
M scripts/ovirtnode/ovirtfunctions.py
2 files changed, 15 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/78/7178/1

diff --git a/scripts/ovirtnode/install.py b/scripts/ovirtnode/install.py
index 3428def..09dffc9 100755
--- a/scripts/ovirtnode/install.py
+++ b/scripts/ovirtnode/install.py
@@ -86,7 +86,11 @@
             self.grub_dir = self.grub_dir + "2"
             self.grub_config_file = "%s/grub.cfg" % self.grub_dir
         else:
-            self.grub_config_file = "%s/grub.conf" % self.grub_dir
+            if not _functions.is_efi_boot():
+                self.grub_config_file = "%s/grub.conf" % self.grub_dir
+            else:
+                self.grub_config_file = "/liveos/efi/EFI/redhat/grub.conf"
+                _functions.mount_efi()
 
     def grub_install(self):
         device_map = "(hd0) %s" % self.disk
@@ -119,7 +123,6 @@
 """
 
         if _functions.is_efi_boot():
-            self.grub_config_file = "/liveos/efi/EFI/redhat/grub.conf"
             """ The EFI product path.
                 eg: HD(1,800,64000,faacb4ef-e361-455e-bd97-ca33632550c3)
             """
@@ -348,22 +351,7 @@
             if _functions.is_efi_boot():
                 logger.info("efi detected, installing efi configuration")
                 _functions.system("mkdir /liveos/efi")
-                # determine proper efi partition
-                self.efi_part = _functions.findfs("Root")
-                self.efi_part = self.efi_part[:-1] + "1"
-                _functions.system("mount -t vfat " + self.efi_part + \
-                                  " /liveos/efi")
-                i = 0
-                while not os.path.ismount("/liveos/efi"):
-                    self.s.reread_partitions(self.efi_part)
-                    time.sleep(3)
-                    _functions.system("mount -t vfat " + self.efi_part + \
-                                      " /liveos/efi")
-                    _functions.system("mount")
-                    i = i + 1
-                    if i == 5:
-                        logger.error("Timed out waiting for /liveos/efi mount")
-                        return False
+                _functions.mount_efi()
                 _functions.system("mkdir -p /liveos/efi/EFI/redhat")
                 _functions.system("cp /boot/efi/EFI/redhat/grub.efi " +
                        "/liveos/efi/EFI/redhat/grub.efi")
diff --git a/scripts/ovirtnode/ovirtfunctions.py b/scripts/ovirtnode/ovirtfunctions.py
index b6cc827..8b0b9f3 100644
--- a/scripts/ovirtnode/ovirtfunctions.py
+++ b/scripts/ovirtnode/ovirtfunctions.py
@@ -454,6 +454,15 @@
         else:
             return True
 
+def mount_efi():
+    efi_part = findfs("Root")
+    efi_part = efi_part[:-1] + "1"
+    if system_closefds("mount -t vfat " + efi_part + " /liveos/efi"):
+        return True
+    else:
+        logger.error("Unable to mount EFI partition")
+        return False
+
 # mount config partition
 # /config for persistance
 def mount_config():


--
To view, visit http://gerrit.ovirt.org/7178
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1c915090680642c11e46110522e6f50bc366ff0
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Joey Boggs <jboggs at redhat.com>



More information about the node-patches mailing list