[node-patches] Change in ovirt-node[master]: EFI changes for EL7

rbarry at redhat.com rbarry at redhat.com
Wed Sep 17 17:55:27 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: EFI changes for EL7
......................................................................

EFI changes for EL7

Grub is grubx64 now instead of just grub, and partitions in
/dev/mapper don't always use p(\d+), so efibootmgr will try to
install on a partition if the regex isn't changed. This probably
also affects Fedora

Change-Id: I50f16b95c65c874f95dbd02033136dff83bac856
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1130965
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirtnode/install.py
1 file changed, 33 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/19/33019/1

diff --git a/src/ovirtnode/install.py b/src/ovirtnode/install.py
index bab63cf..a6cf6e7 100755
--- a/src/ovirtnode/install.py
+++ b/src/ovirtnode/install.py
@@ -194,8 +194,12 @@
             if _functions.is_iscsi_install() or _functions.findfs("BootNew"):
                 _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")
+            if os.path.isfile("/boot/efi/EFI/redhat/grubx86.efi"):
+                _functions.system("cp /boot/efi/EFI/redhat/grubx64.efi \
+                                  /liveos/efi/EFI/BOOT/BOOTX64.efi")
+            else:
+                _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" \
                               % self.grub_config_file)
             _functions.system("umount /liveos/efi")
@@ -310,8 +314,13 @@
         if _functions.is_efi_boot():
             if "OVIRT_ISCSI_INSTALL" in OVIRT_VARS:
                 _functions.system("umount /boot")
-            shutil.copy("/boot/efi/EFI/%s/grub.efi" % self.efi_dir_name,
-                        "/tmp")
+            if os.path.isfile("/boot/efi/EFI/%s/grubx64.efi" %
+                              self.efi_dir_name):
+                shutil.copy("/boot/efi/EFI/%s/grubx64.efi" % self.efi_dir_name,
+                            "/tmp")
+            else:
+                shutil.copy("/boot/efi/EFI/%s/grub.efi" % self.efi_dir_name,
+                            "/tmp")
             _functions.mount_boot()
         if "OVIRT_ROOT_INSTALL" in OVIRT_VARS:
             if OVIRT_VARS["OVIRT_ROOT_INSTALL"] == "n":
@@ -476,8 +485,15 @@
                 _functions.mount_efi()
                 _functions.system("mkdir -p /liveos/efi/EFI/redhat")
                 if _functions.is_iscsi_install() or _functions.is_efi_boot():
-                    shutil.copy("/tmp/grub.efi",
-                                "/liveos/efi/EFI/redhat/grub.efi")
+                    if os.path.isfile("/tmp/grubx64.efi"):
+                        shutil.copy("/tmp/grubx64.efi",
+                                    "/liveos/efi/EFI/redhat/grubx64.efi")
+                    else:
+                        shutil.copy("/tmp/grub.efi",
+                                    "/liveos/efi/EFI/redhat/grub.efi")
+                elif os.path.isfile("/boot/efi/EFI/redhat/grubx64.efi"):
+                    shutil.copy("/boot/efi/EFI/redhat/grubx64.efi",
+                          "/liveos/efi/EFI/redhat/grubx64.efi")
                 else:
                     shutil.copy("/boot/efi/EFI/redhat/grub.efi",
                           "/liveos/efi/EFI/redhat/grub.efi")
@@ -486,7 +502,7 @@
                 if not "/dev/mapper/" in self.disk:
                     efi_disk = self.disk[:-1]
                 else:
-                    efi_disk = re.sub("p[1,2,3]$", "", self.disk)
+                    efi_disk = re.sub(r'p?[1,2,3]$', "", self.disk)
                 # generate grub legacy config for efi partition
                 #remove existing efi entries
                 _functions.remove_efi_entry(_functions.PRODUCT_SHORT)
@@ -496,10 +512,16 @@
                                               self.efi_dir_name),
                                              efi_disk)
                 else:
-                    _functions.add_efi_entry(_functions.PRODUCT_SHORT,
-                                             ("\\EFI\\%s\\grub.efi" %
-                                              self.efi_dir_name),
-                                             efi_disk)
+                    if os.path.isfile("/liveos/efi/EFI/redhat/grubx64.efi"):
+                        _functions.add_efi_entry(_functions.PRODUCT_SHORT,
+                                                 ("\\EFI\\%s\\grubx64.efi" %
+                                                  self.efi_dir_name),
+                                                 efi_disk)
+                    else:
+                        _functions.add_efi_entry(_functions.PRODUCT_SHORT,
+                                                 ("\\EFI\\%s\\grub.efi" %
+                                                  self.efi_dir_name),
+                                                 efi_disk)
         self.kernel_image_copy()
 
         # reorder tty0 to allow both serial and phys console after installation


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I50f16b95c65c874f95dbd02033136dff83bac856
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list