Module Name: src Committed By: gson Date: Sat Oct 11 13:34:01 UTC 2014
Modified Files: src/usr.sbin/sysinst/arch/i386: md.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/arch/i386/md.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/sysinst/arch/i386/md.c diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.3 src/usr.sbin/sysinst/arch/i386/md.c:1.4 --- src/usr.sbin/sysinst/arch/i386/md.c:1.3 Mon Aug 11 00:31:22 2014 +++ src/usr.sbin/sysinst/arch/i386/md.c Sat Oct 11 13:34:01 2014 @@ -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 @@ md_post_newfs(void) { int ret; size_t len; - char bootxx[8192 + 4]; char boot_options[1024]; char *bootxx_filename; /* @@ -324,7 +323,6 @@ md_post_newfs(void) 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 @@ md_post_newfs(void) 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");