Module Name: src
Committed By: tsutsui
Date: Sat May 26 05:09:59 UTC 2012
Modified Files:
src/distrib/utils/sysinst: mbr.c
Log Message:
Fix regression by my dumb patch in PR/45990.
sysinst fails with "floating exception" after
changing MBR partition size in MBR editor menu
if the target disk doesn't have valid MBR partition
or has a valid partition 0 whose offset is not 1MB aligned
(like 63 sectors).
read_mbr() (which calls get_ptn_alignment()) is called
before set_bios_geom(), so bhead is not initialized there
and ptn_alignment could be zero.
To workaround, explicitly call get_ptn_alignment() again
in edit_mbr() to update ptn_alignemnt per BIOS geom values.
To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/distrib/utils/sysinst/mbr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/utils/sysinst/mbr.c
diff -u src/distrib/utils/sysinst/mbr.c:1.90 src/distrib/utils/sysinst/mbr.c:1.91
--- src/distrib/utils/sysinst/mbr.c:1.90 Sat Apr 7 03:08:33 2012
+++ src/distrib/utils/sysinst/mbr.c Sat May 26 05:09:59 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: mbr.c,v 1.90 2012/04/07 03:08:33 tsutsui Exp $ */
+/* $NetBSD: mbr.c,v 1.91 2012/05/26 05:09:59 tsutsui Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1271,6 +1271,7 @@ edit_mbr(mbr_info_t *mbri)
/* Ask full/part */
part = &mbrs->mbr_parts[0];
+ get_ptn_alignment(part); /* update ptn_alignment */
msg_display(MSG_fullpart, diskdev);
process_menu(MENU_fullpart, &usefull);
@@ -1477,7 +1478,7 @@ read_mbr(const char *disk, mbr_info_t *m
mbrp = &mbrs->mbr_parts[0];
if (ext_base == 0) {
- get_ptn_alignment(mbrp);
+ get_ptn_alignment(mbrp); /* get ptn_0_offset */
} else {
/* sanity check extended chain */
if (MBR_IS_EXTENDED(mbrp[0].mbrp_type))