summaryrefslogtreecommitdiff
path: root/usr/src/cmd/boot/installgrub
diff options
context:
space:
mode:
authorJohn Sonnenschein <johns@joyent.com>2012-11-07 22:04:45 +0000
committerJohn Sonnenschein <johns@joyent.com>2012-11-07 22:04:45 +0000
commitad2a40e16d2bee59cfe84f89db3ce92b9f15adff (patch)
treebc8e23c4588b29e4602a54b72dbe2f1d8786468d /usr/src/cmd/boot/installgrub
parentb5f683274309a9c6f46eea8ce5d0cca514d977a8 (diff)
parent7c45eec5760d4195b6b85770e7ac51c380adfb8a (diff)
downloadillumos-joyent-ad2a40e16d2bee59cfe84f89db3ce92b9f15adff.tar.gz
Illumos sync
Diffstat (limited to 'usr/src/cmd/boot/installgrub')
-rw-r--r--usr/src/cmd/boot/installgrub/Makefile3
-rw-r--r--usr/src/cmd/boot/installgrub/installgrub.c8
-rw-r--r--usr/src/cmd/boot/installgrub/installgrub.h2
3 files changed, 10 insertions, 3 deletions
diff --git a/usr/src/cmd/boot/installgrub/Makefile b/usr/src/cmd/boot/installgrub/Makefile
index bf3d73ab70..4cc69eccd5 100644
--- a/usr/src/cmd/boot/installgrub/Makefile
+++ b/usr/src/cmd/boot/installgrub/Makefile
@@ -36,6 +36,9 @@ SBINLINKS= $(PROG)
include ../Makefile.com
CPPFLAGS += -I$(SRC)/uts/i86pc -I$(SRC)/uts/intel -I$(SRC)/uts/common
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lmd5
diff --git a/usr/src/cmd/boot/installgrub/installgrub.c b/usr/src/cmd/boot/installgrub/installgrub.c
index 3df067420c..c27dca802b 100644
--- a/usr/src/cmd/boot/installgrub/installgrub.c
+++ b/usr/src/cmd/boot/installgrub/installgrub.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012 Milan Jurik. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
#include <stdio.h>
@@ -403,7 +404,7 @@ handle_getinfo(char *progname, char **argv)
goto out_dev;
}
- einfo = find_einfo(stage2->extra);
+ einfo = find_einfo(stage2->extra, stage2->extra_size);
if (einfo == NULL) {
retval = BC_NOEINFO;
(void) fprintf(stderr, gettext("No extended information "
@@ -501,7 +502,7 @@ handle_mirror(char *progname, char **argv)
goto out_devs;
}
- einfo_curr = find_einfo(stage2_curr->extra);
+ einfo_curr = find_einfo(stage2_curr->extra, stage2_curr->extra_size);
if (einfo_curr != NULL)
updt_str = einfo_get_string(einfo_curr);
@@ -1221,6 +1222,7 @@ read_stage2_from_disk(int dev_fd, ig_stage2_t *stage2)
stage2->mboot_off = mboot_off;
stage2->mboot = (multiboot_header_t *)(stage2->buf + stage2->mboot_off);
stage2->extra = stage2->buf + P2ROUNDUP(stage2->file_size, 8);
+ stage2->extra_size = stage2->buf_size - P2ROUNDUP(stage2->file_size, 8);
return (BC_SUCCESS);
}
@@ -1251,7 +1253,7 @@ is_update_necessary(ig_data_t *data, char *updt_str)
* Look for the extended information structure in the extra payload
* area.
*/
- einfo = find_einfo(stage2_disk.extra);
+ einfo = find_einfo(stage2_disk.extra, stage2_disk.extra_size);
if (einfo == NULL) {
BOOT_DEBUG("No extended information available\n");
return (B_TRUE);
diff --git a/usr/src/cmd/boot/installgrub/installgrub.h b/usr/src/cmd/boot/installgrub/installgrub.h
index e23d1c35d7..af6e60b973 100644
--- a/usr/src/cmd/boot/installgrub/installgrub.h
+++ b/usr/src/cmd/boot/installgrub/installgrub.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _INSTALLGRUB_H
@@ -53,6 +54,7 @@ typedef struct _stage2_data {
multiboot_header_t *mboot;
uint32_t mboot_off;
uint32_t file_size;
+ uint32_t extra_size;
uint32_t buf_size;
uint32_t first_sector;
uint32_t pcfs_first_sectors[2];