Skip to contentSkip to conversation

pygrub: look harder for elilo.conf

PATCH In review Aron Griffis 4 participants 4 messages May 3, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pygrub: look harder for elilo.conf

Keir,

This would also be appropriate for 3.1.0, since the /usr/lib fix makes pygrub work on ia64

Presently pygrub only looks in /efi/redhat/elilo.conf. It should check for other distributions, plus a couple fallback locations.

tools/pygrub/src/pygrub +6 -1
diff -r 6d64f9eefad5 -r 67df28389f46 tools/pygrub/src/pygrub
@@ -361,7 +361,12 @@ class Grub:
 
         if platform.machine() == 'ia64':
             self.cf = grub.LiloConf.LiloConfigFile()
-            file_list = ("/efi/redhat/elilo.conf",)
+            # common distributions
+            file_list = ("/efi/debian/elilo.conf", "/efi/gentoo/elilo.conf", 
+                         "/efi/redflag/elilo.conf", "/efi/redhat/elilo.conf", 
+                         "/efi/SuSE/elilo.conf",)
+            # fallbacks
+            file_list += ("/efi/boot/elilo.conf", "/elilo.conf",)
         else:
             self.cf = grub.GrubConf.GrubConfigFile()
             file_list = ("/boot/grub/menu.lst", "/boot/grub/grub.conf",
#1 lore raw
Quoted 14 lines · Aron Griffis

Keir,

This would also be appropriate for 3.1.0, since the /usr/lib fix makes pygrub work on ia64

Presently pygrub only looks in /efi/redhat/elilo.conf. It should check for other distributions, plus a couple fallback locations.

diff -r 6d64f9eefad5 -r 67df28389f46 tools/pygrub/src/pygrub

tools/pygrub/src/pygrub class Grub: · line 367

Quoted 8 lines
tools/pygrub/src/pygrub +4 -1
@@ -361,7 +361,12 @@ class Grub:
 
         if platform.machine() == 'ia64':
             self.cf = grub.LiloConf.LiloConfigFile()
-            file_list = ("/efi/redhat/elilo.conf",)
+            # common distributions
+            file_list = ("/efi/debian/elilo.conf", "/efi/gentoo/elilo.conf", 
+                         "/efi/redflag/elilo.conf", "/efi/redhat/elilo.conf", 
+                         "/efi/SuSE/elilo.conf",)

How about simply having it iterate over every first level subdirectory of /efi, ie basically looking for /efi/*/elilo.conf rather than hardcoding a small list of distros ?

Regards,
Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#2 lore raw
Quoted 10 lines · Daniel P. Berrange

tools/pygrub/src/pygrub class Grub: · line 367

Quoted 8 lines · Aron Griffis

if platform.machine() == 'ia64':
self.cf = grub.LiloConf.LiloConfigFile()

tools/pygrub/src/pygrub +4 -1
-            file_list = ("/efi/redhat/elilo.conf",)
+            # common distributions
+            file_list = ("/efi/debian/elilo.conf", "/efi/gentoo/elilo.conf", 
+                         "/efi/redflag/elilo.conf", "/efi/redhat/elilo.conf", 
+                         "/efi/SuSE/elilo.conf",)
Quoted 3 lines

How about simply having it iterate over every first level subdirectory of /efi, ie basically looking for /efi/*/elilo.conf rather than hardcoding a small list of distros ?

I think Aron looked into it briefly, but it wasn't clear how to do
that in libfsimage. If it can be done, that certainly sounds like less maintenance. Thanks,

Alex

Signature · 1 line
Alex Williamson                             HP Open Source & Linux Org.
#3 lore raw
Quoted 11 lines · Alex Williamson
Quoted 10 lines · Daniel P. Berrange
Quoted 8 lines · Aron Griffis

if platform.machine() == 'ia64':
self.cf = grub.LiloConf.LiloConfigFile()

tools/pygrub/src/pygrub +4 -1
-            file_list = ("/efi/redhat/elilo.conf",)
+            # common distributions
+            file_list = ("/efi/debian/elilo.conf", "/efi/gentoo/elilo.conf", 
+                         "/efi/redflag/elilo.conf", "/efi/redhat/elilo.conf", 
+                         "/efi/SuSE/elilo.conf",)
Quoted 7 lines
Quoted 3 lines

How about simply having it iterate over every first level subdirectory of /efi, ie basically looking for /efi/*/elilo.conf rather than hardcoding a small list of distros ?

I think Aron looked into it briefly, but it wasn't clear how to do
that in libfsimage. If it can be done, that certainly sounds like less maintenance. Thanks,

There is no way yet to iterate directory entries, since it's not been needed yet. You could do it, but you'd have to add new code to every FS backend, so it wouldn't be fun.

regards
john