[et-mgmt-tools] PATCH: Get koan working on ia64

Gavin Romig-Koch gavin at redhat.com
Fri Feb 8 16:22:08 UTC 2008


Please consider the following patch for koan.


* Fri Feb 8 2008 Gavin Romig-Koch <gavin at redhat.com>
Get koan working on ia64

The following changes are needed to get koan working on ia64.  Elilo
expects the kernel and initrd to be on the EFI storage device, and 
grubby expects them to be within /boot/efi/EFI/redhat.  

Grubby's --bootloader-probe option only exists on x86 and x86_64, on
other arches grubby errors out when given it, so grubby --bootloader-probe
never returns "elilo".  

This patch changes koan to just let grubby figure out the appropriate 
bootloader to use (which it does correctly), and only after that checks
to see if the boot loader is lilo, and if necessary runs lilo.

                                         -gavin...


diff --git a/koan/app.py b/koan/app.py
index 6d116de..3410b26 100755
--- a/koan/app.py
+++ b/koan/app.py
@@ -542,10 +542,15 @@ class Koan:
 
         # find the correct file download location 
         if not self.is_virt:
-            download = "/boot"
             if self.live_cd:
                 download = "/tmp/boot/boot"
 
+            elif os.path.exists("/boot/efi/EFI/redhat/elilo.conf"):
+                download = "/boot/efi/EFI/redhat"
+
+            else:
+                download = "/boot"
+
         else:
             # ensure we have a good virt type choice and know where
             # to download the kernel/initrd
@@ -711,19 +716,7 @@ class Koan:
 
             k_args = k_args.replace("lang ","lang= ")
 
-            cmd = [ "/sbin/grubby", 
-                    "--bootloader-probe" ]
-
-            which_loader = sub_process.Popen(cmd, stdout=sub_process.PIPE).communicate()[0]
- 
-            loader = "--grub"
-            if which_loader.find("elilo") != -1:
-                loader = "--elilo"
-            elif which_loader.find("lilo") != -1:
-                loader = "--lilo"
-
             cmd = [ "/sbin/grubby",
-                    loader,
                     "--add-kernel", self.safe_load(profile_data,'kernel_local'),
                     "--initrd", self.safe_load(profile_data,'initrd_local'),
                     "--make-default",
@@ -737,7 +730,14 @@ class Koan:
                cmd.append("--config-file=/tmp/boot/boot/grub/grub.conf")
             self.subprocess_call(cmd)
 
-            if loader == "--lilo":
+
+            # if grubby --bootloader-probe returns lilo,
+            #    apply lilo changes
+            cmd = [ "/sbin/grubby", "--bootloader-probe" ]
+            probe_process = sub_process.Popen(cmd, stdout=sub_process.PIPE)
+            which_loader = probe_process.communicate()[0]
+            if probe_process.returncode == 0 and \
+                   which_loader.find("lilo") != -1:
                 print "- applying lilo changes"
                 cmd = [ "/sbin/lilo" ]
                 sub_process.Popen(cmd, stdout=sub_process.PIPE).communicate()[0]







More information about the et-mgmt-tools mailing list