FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 03-20-2012, 05:55 PM
Cleber Rosa
 
Default ia64/elilo: add support for probing the currently installed bootloader

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
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
");
if (gr2c == 2) printf("grub2
");
if (grc == 2) printf("grub
");
- if (erc == 2) printf("extlinux
");
+ if (extrc == 2) printf("extlinux
");
if (yrc == 2) printf("yaboot
");
+ if (erc == 2) printf("elilo
");

return 0;
}
--
1.7.6.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-27-2012, 12:13 PM
Cleber Rosa
 
Default ia64/elilo: add support for probing the currently installed bootloader

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

diff --git a/grubby.c b/grubby.c
index 04b29bf..5992e67 100644
--- a/grubby.c
+++ b/grubby.c
@@ -3272,6 +3272,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;

@@ -3759,7 +3766,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
@@ -4001,8 +4008,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) {
@@ -4030,12 +4037,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);
}


@@ -4048,13 +4064,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
");
if (gr2c == 2) printf("grub2
");
if (grc == 2) printf("grub
");
- if (erc == 2) printf("extlinux
");
+ if (extrc == 2) printf("extlinux
");
if (yrc == 2) printf("yaboot
");
+ if (erc == 2) printf("elilo
");

return 0;
}
--
1.7.6.5

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

Thread Tools




All times are GMT. The time now is 07:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org