summaryrefslogtreecommitdiff
path: root/usr/src/grub
diff options
context:
space:
mode:
authorEnrico Perla - Sun Microsystems <Enrico.Perla@Sun.COM>2010-07-28 15:51:57 -0700
committerEnrico Perla - Sun Microsystems <Enrico.Perla@Sun.COM>2010-07-28 15:51:57 -0700
commitaf28f636873b7156cfd73ceffa927658cca33fd0 (patch)
treec7148377edbc72d270398f01aa43a6a0c2b8b11f /usr/src/grub
parentdde44d91a86b600c41f0e58ba2b3985bb425e52f (diff)
downloadillumos-joyent-af28f636873b7156cfd73ceffa927658cca33fd0.tar.gz
PSARC/2010/113 Boot Block Downgrade Avoidance
PSARC/2010/271 EOF and removal of installgrub(1m) floppy support 6944352 prevent downgrading the boot block on update on multi-BE environments 6972371 EOF and removal of installgrub(1m) floppy support [PSARC/2010/271] --HG-- rename : usr/src/cmd/boot/installgrub/floppy.c => usr/src/cmd/boot/installgrub/pcfs_glue.c
Diffstat (limited to 'usr/src/grub')
-rw-r--r--usr/src/grub/grub-0.97/grub/asmstub.c3
-rw-r--r--usr/src/grub/grub-0.97/stage2/asm.S17
-rw-r--r--usr/src/grub/grub-0.97/stage2/builtins.c32
-rw-r--r--usr/src/grub/grub-0.97/stage2/shared.h7
4 files changed, 8 insertions, 51 deletions
diff --git a/usr/src/grub/grub-0.97/grub/asmstub.c b/usr/src/grub/grub-0.97/grub/asmstub.c
index fabe86df26..c32823b0f1 100644
--- a/usr/src/grub/grub-0.97/grub/asmstub.c
+++ b/usr/src/grub/grub-0.97/grub/asmstub.c
@@ -67,9 +67,6 @@ int grub_stage2 (void);
#define EXTENDED_MEMSIZE (64 * 1024 * 1024) /* 64MB */
#define CONVENTIONAL_MEMSIZE (640 * 1024) /* 640kB */
-unsigned char md5hash[] = "\xCC\xCC\xCC\xCC\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB"
- "\xBB\xBB\xBB\xBB";
-char pkg_version[] = "empty";
unsigned long install_partition = 0x20000;
unsigned long boot_drive = 0;
int saved_entryno = 0;
diff --git a/usr/src/grub/grub-0.97/stage2/asm.S b/usr/src/grub/grub-0.97/stage2/asm.S
index 931098136f..3e9986c0df 100644
--- a/usr/src/grub/grub-0.97/stage2/asm.S
+++ b/usr/src/grub/grub-0.97/stage2/asm.S
@@ -108,17 +108,16 @@ VARIABLE(config_file)
* Leave some breathing room for the config file name.
*/
- . = EXT_C(main) + 0x5f
-VARIABLE(ext_info)
- .byte 0xEE
-VARIABLE(md5hash)
- .quad 0xAAAAAAAACCCCCCCC, 0xBBBBBBBBBBBBBBBB
-VARIABLE(pkg_version)
- .byte 0
+ . = EXT_C(main) + 0x60
+VARIABLE(fake_mboot)
+ .long 0x1BADB002
+ .long 0x00010003
+ .long -0x1BAEB005
/*
- * installgrub will place the pkg_version here
+ * installgrub will place the rest of the fake
+ * multiboot header here.
*/
- .= EXT_C(main) + 0x110
+ .= EXT_C(main) + 0x140
/* the real mode code continues... */
codestart:
cli /* we're not safe here! */
diff --git a/usr/src/grub/grub-0.97/stage2/builtins.c b/usr/src/grub/grub-0.97/stage2/builtins.c
index 0aedcd7b19..af4a6f28bb 100644
--- a/usr/src/grub/grub-0.97/stage2/builtins.c
+++ b/usr/src/grub/grub-0.97/stage2/builtins.c
@@ -18,11 +18,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
/* Include stdio.h before shared.h, because we can't define
WITHOUT_LIBC_STUBS here. */
#ifdef GRUB_UTIL
@@ -2175,32 +2170,6 @@ static struct builtin builtin_impsprobe =
" a tight loop."
};
-/* extended info */
-static int
-info_func (char *arg, int flags)
-{
- int i;
-
- grub_printf("Extended version information : %s\n", pkg_version);
- grub_printf("stage2 (MD5) signature : ");
-
- for (i = 0; i < 0x10; i++)
- grub_printf("%x", md5hash[i]);
-
- grub_printf("\n");
-}
-
-static struct builtin builtin_info =
-{
- "info",
- info_func,
- BUILTIN_CMDLINE | BUILTIN_HELP_LIST | BUILTIN_SCRIPT,
- "info",
- "Read Grub extended version and stage2 MD5 hash"
-};
-
-
-
/* initrd */
static int
initrd_func (char *arg, int flags)
@@ -5896,7 +5865,6 @@ struct builtin *builtin_table[] =
&builtin_ifconfig,
#endif /* SUPPORT_NETBOOT */
&builtin_impsprobe,
- &builtin_info,
&builtin_initrd,
&builtin_install,
&builtin_ioprobe,
diff --git a/usr/src/grub/grub-0.97/stage2/shared.h b/usr/src/grub/grub-0.97/stage2/shared.h
index 45f878a707..205715b021 100644
--- a/usr/src/grub/grub-0.97/stage2/shared.h
+++ b/usr/src/grub/grub-0.97/stage2/shared.h
@@ -17,10 +17,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
/*
* Generic defines to use anywhere
@@ -534,7 +530,6 @@ struct vbe_mode
unsigned char reserved3[189];
} __attribute__ ((packed));
-
#undef NULL
#define NULL ((void *) 0)
@@ -607,8 +602,6 @@ extern char version_string[];
extern char config_file[];
extern char *bootfile;
extern configfile_origin_t configfile_origin;
-extern unsigned char md5hash[];
-extern char pkg_version[];
extern unsigned long linux_text_len;
extern char *linux_data_tmp_addr;
extern char *linux_data_real_addr;