[node-patches] Change in ovirt-node[master]: Fix efi on iscsi support

jboggs at redhat.com jboggs at redhat.com
Wed Oct 30 17:31:19 UTC 2013


Joey Boggs has uploaded a new change for review.

Change subject: Fix efi on iscsi support
......................................................................

Fix efi on iscsi support

rhbz#924531
Signed-off-by: Joey Boggs <jboggs at redhat.com>
Change-Id: Ia6ef579093a4cfc49f81615f99713bed3383059c
---
M src/ovirtnode/install.py
M src/ovirtnode/storage.py
2 files changed, 17 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/23/20723/1

diff --git a/src/ovirtnode/install.py b/src/ovirtnode/install.py
index 137f49f..542bce6 100755
--- a/src/ovirtnode/install.py
+++ b/src/ovirtnode/install.py
@@ -184,6 +184,9 @@
         # usb devices requires default BOOTX64 entries
         if _functions.is_efi_boot():
             _functions.system("mkdir -p /liveos/efi/EFI/BOOT")
+            if _functions.is_iscsi_install():
+                _functions.system("cp /tmp/grub.efi \
+                                   /liveos/efi/EFI/BOOT/BOOTX64.efi")
             _functions.system("cp /boot/efi/EFI/redhat/grub.efi \
                               /liveos/efi/EFI/BOOT/BOOTX64.efi")
             _functions.system("cp %s /liveos/efi/EFI/BOOT/BOOTX64.conf" \
@@ -296,7 +299,8 @@
     def ovirt_boot_setup(self, reboot="N"):
         self.generate_paths()
         logger.info("Installing the image.")
-
+        # copy grub.efi to safe location
+        shutil.copy("/boot/efi/EFI/redhat/grub.efi", "/tmp")
         if "OVIRT_ROOT_INSTALL" in OVIRT_VARS:
             if OVIRT_VARS["OVIRT_ROOT_INSTALL"] == "n":
                 logger.info("Root Installation Not Required, Finished.")
@@ -474,8 +478,14 @@
                 _functions.system("mkdir /liveos/efi")
                 _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")
+                if _functions.is_iscsi_install():
+                    shutil.copy("/tmp/grub.efi",
+                                "/liveos/efi/EFI/redhat/grub.efi")
+                else:
+                    shutil.copy("/boot/efi/EFI/redhat/grub.efi",
+                          "/liveos/efi/EFI/redhat/grub.efi")
+                if _functions.is_iscsi_install():
+                    self.disk = _functions.findfs("BootNew")
                 if not "/dev/mapper/" in self.disk:
                     efi_disk = self.disk[:-1]
                 else:
diff --git a/src/ovirtnode/storage.py b/src/ovirtnode/storage.py
index 7ecad7e..b03a407 100644
--- a/src/ovirtnode/storage.py
+++ b/src/ovirtnode/storage.py
@@ -579,12 +579,13 @@
                      "\" -s \"mkpart EFI 1M " +
                      str(self.EFI_SIZE) + "M\"")
         _functions.system(parted_cmd)
+        time.sleep(1)
         partefi = disk + "1"
         if not os.path.exists(partefi):
             partefi = disk + "p1"
-            _functions.system("ln -snf \"" + partefi + \
-                              "\" /dev/disk/by-label/EFI")
-            _functions.system("mkfs.vfat \"" + partefi + "\"")
+        _functions.system("ln -snf \"" + partefi + \
+                          "\" /dev/disk/by-label/EFI")
+        _functions.system("mkfs.vfat \"" + partefi + "\"")
 
     def create_iscsiroot(self):
         logger.info("Partitioning iscsi root drive: " + self.ISCSIDRIVE)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6ef579093a4cfc49f81615f99713bed3383059c
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