Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sysinst/arch/i386 When checking if the user chose t...



details:   https://anonhg.NetBSD.org/src/rev/04f84b85ae46
branches:  trunk
changeset: 332902:04f84b85ae46
user:      gson <gson%NetBSD.org@localhost>
date:      Sat Oct 11 13:34:01 2014 +0000

description:
When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev.  Also remove bp and bootxx since their only use was in
the incorrect check.  This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.

diffstat:

 usr.sbin/sysinst/arch/i386/md.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r e2f40a2b6a2b -r 04f84b85ae46 usr.sbin/sysinst/arch/i386/md.c
--- a/usr.sbin/sysinst/arch/i386/md.c   Sat Oct 11 12:36:25 2014 +0000
+++ b/usr.sbin/sysinst/arch/i386/md.c   Sat Oct 11 13:34:01 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.3 2014/08/11 00:31:22 riz Exp $ */
+/*     $NetBSD: md.c,v 1.4 2014/10/11 13:34:01 gson Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -301,7 +301,6 @@
 {
        int ret;
        size_t len;
-       char bootxx[8192 + 4];
        char boot_options[1024];
        char *bootxx_filename;
        /*
@@ -324,7 +323,6 @@
        static int conmib[] = {CTL_MACHDEP, CPU_CONSDEV};
        struct termios t;
        dev_t condev;
-#define bp (*(struct x86_boot_params *)(bootxx + 512 * 2 + 8))
 
        /*
         * Get console device, should either be ttyE0 or tty0n.
@@ -342,7 +340,8 @@
 
        process_menu(MENU_getboottype, &boottype);
        msg_display(MSG_dobootblks, pm->diskdev);
-       if (bp.bp_consdev == ~0u)
+       if (boottype.bp_consdev == ~0u)
+               /* Use existing bootblocks */
                return 0;
 
        ret = cp_to_target("/usr/mdec/boot", "/boot");



Home | Main Index | Thread Index | Old Index