[PATCH 06/10] ia64/elilo: add support for probing the currently installed bootloader

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Cleber Rosa <crosa@xxxxxxxxxx>
---
 grubby.c |   33 ++++++++++++++++++++++++++-------
 1 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/grubby.c b/grubby.c
index f366c42..ccb11b0 100644
--- a/grubby.c
+++ b/grubby.c
@@ -3176,6 +3176,13 @@ int checkForYaboot(struct grubConfig * config) {
     return 1;
 }
 
+int checkForElilo(struct grubConfig * config) {
+    if (!access("/etc/elilo.conf", R_OK))
+	return 2;
+
+    return 1;
+}
+
 static char * getRootSpecifier(char * str) {
     char * idx, * rootspec = NULL;
 
@@ -3663,7 +3670,7 @@ int main(int argc, const char ** argv) {
 	{ "boot-filesystem", 0, POPT_ARG_STRING, &bootPrefix, 0,
 	    _("filestystem which contains /boot directory (for testing only)"),
 	    _("bootfs") },
-#if defined(__i386__) || defined(__x86_64__) || defined (__powerpc64__)
+#if defined(__i386__) || defined(__x86_64__) || defined (__powerpc64__) || defined (__ia64__)
 	{ "bootloader-probe", 0, POPT_ARG_NONE, &bootloaderProbe, 0,
 	    _("check which bootloader is installed on boot sector") },
 #endif
@@ -3905,8 +3912,8 @@ int main(int argc, const char ** argv) {
     }
 
     if (bootloaderProbe) {
-	int lrc = 0, grc = 0, gr2c = 0, erc = 0, yrc = 0;
-	struct grubConfig * lconfig, * gconfig, * yconfig;
+	int lrc = 0, grc = 0, gr2c = 0, extrc = 0, yrc = 0, erc = 0;
+	struct grubConfig * lconfig, * gconfig, * yconfig, * econfig;
 
 	const char *grub2config = grub2FindConfig(&grub2ConfigType);
 	if (grub2config) {
@@ -3934,12 +3941,21 @@ int main(int argc, const char ** argv) {
 		lrc = checkForLilo(lconfig);
 	} 
 
+	if (!access(eliloConfigType.defaultConfig, F_OK)) {
+	    econfig = readConfig(eliloConfigType.defaultConfig,
+				 &eliloConfigType);
+	    if (!econfig)
+		erc = 1;
+	    else
+		erc = checkForElilo(econfig);
+	}
+
 	if (!access(extlinuxConfigType.defaultConfig, F_OK)) {
 	    lconfig = readConfig(extlinuxConfigType.defaultConfig, &extlinuxConfigType);
 	    if (!lconfig)
-		erc = 1;
+		extrc = 1;
 	    else
-		erc = checkForExtLinux(lconfig);
+		extrc = checkForExtLinux(lconfig);
 	} 
 
 
@@ -3952,13 +3968,16 @@ int main(int argc, const char ** argv) {
 	      yrc = checkForYaboot(lconfig);
 	}
 
-	if (lrc == 1 || grc == 1 || gr2c == 1 || yrc == 1) return 1;
+	if (lrc == 1 || grc == 1 || gr2c == 1 || extrc == 1 || yrc == 1 ||
+	    erc == 1)
+	    return 1;
 
 	if (lrc == 2) printf("lilo\n");
 	if (gr2c == 2) printf("grub2\n");
 	if (grc == 2) printf("grub\n");
-	if (erc == 2) printf("extlinux\n");
+	if (extrc == 2) printf("extlinux\n");
 	if (yrc == 2) printf("yaboot\n");
+	if (erc == 2) printf("elilo\n");
 
 	return 0;
     }
-- 
1.7.6.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux