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 > Ubuntu > Kubuntu User

 
 
LinkBack Thread Tools
 
Old 05-30-2012, 11:46 PM
"Brian C. Lane"
 
Default Pick the last / device (#826537)

From: "Brian C. Lane" <bcl@redhat.com>

When there are multiple devices mounted on /, as there can
be during a preupgrade, the last device is the one that should
match the grub.cfg entry. This was preventing preupgrade from
installing the new f17 kernel.

Related: rhbz#820340
Related: rhbz#820351
---
grubby.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/grubby.c b/grubby.c
index b7d989d..fe8317d 100644
--- a/grubby.c
+++ b/grubby.c
@@ -1460,6 +1460,8 @@ static char *findDiskForRoot()
buf[rc] = '';
chptr = buf;

+ char *foundanswer = NULL;
+
while (chptr && chptr != buf+rc) {
devname = chptr;

@@ -1487,13 +1489,8 @@ static char *findDiskForRoot()
* for '/' obviously.
*/
if (*(++chptr) == '/' && *(++chptr) == ' ') {
- /*
- * Move back 2, which is the first space after the device name, set
- * it to so strdup will just get the devicename.
- */
- chptr -= 2;
- *chptr = '';
- return strdup(devname);
+ /* remember the last / entry in mtab */
+ foundanswer = devname;
}

/* Next line */
@@ -1502,6 +1499,13 @@ static char *findDiskForRoot()
chptr++;
}

+ /* Return the last / entry found */
+ if (foundanswer) {
+ chptr = strchr(foundanswer, ' ');
+ *chptr = '';
+ return strdup(foundanswer);
+ }
+
return NULL;
}

--
1.7.7.6

_______________________________________________
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 11:45 AM.

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