diff options
author | setje <none@none> | 2008-01-07 17:40:55 -0800 |
---|---|---|
committer | setje <none@none> | 2008-01-07 17:40:55 -0800 |
commit | d46ed901a1027484eb470062f803f4aad62b8650 (patch) | |
tree | dd1086466d83cca2b58ad71979ee26f269b70958 | |
parent | 14a66e5a5df38a62990b14d0672ff8f6f55caa09 (diff) | |
download | illumos-gate-d46ed901a1027484eb470062f803f4aad62b8650.tar.gz |
6647001 installgrub writes to incorrect partition, leaving system unable to boot
-rw-r--r-- | usr/src/cmd/boot/installgrub/installgrub.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/usr/src/cmd/boot/installgrub/installgrub.c b/usr/src/cmd/boot/installgrub/installgrub.c index 8dbda6e060..25677223ab 100644 --- a/usr/src/cmd/boot/installgrub/installgrub.c +++ b/usr/src/cmd/boot/installgrub/installgrub.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -214,18 +214,10 @@ get_start_sector(int fd) (void) fprintf(stderr, BAD_PART, i); exit(-1); } - if (part->relsect == dkpi.p_start) { + if (dkpi.p_start >= part->relsect && + dkpi.p_start < (part->relsect + part->numsect)) { /* Found the partition */ break; - } else if (part->relsect > dkpi.p_start) { - /* - * The next fdisk partition starts beyond - * offset of Solaris partition. - * So the previous partition is the right one. - */ - i--; - part = (struct ipart *)mboot->parts + i; - break; } } } |