Module Name:    src
Committed By:   martin
Date:           Sun Oct  2 10:21:36 UTC 2022

Modified Files:
        src/usr.sbin/sysinst/arch/landisk: md.c

Log Message:
PR install/57025: revert bogus rev 1.9 which was only papering over
a bug in the adoption of the MBR handling code and fix the original
conversion bug instead:
 - run fdisk to install the MBR bootcode on the raw disk partition
 - run installboot against the NetBSD root partition (not the raw partition).


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/sysinst/arch/landisk/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/landisk/md.c
diff -u src/usr.sbin/sysinst/arch/landisk/md.c:1.15 src/usr.sbin/sysinst/arch/landisk/md.c:1.16
--- src/usr.sbin/sysinst/arch/landisk/md.c:1.15	Sat Jan 29 16:01:19 2022
+++ src/usr.sbin/sysinst/arch/landisk/md.c	Sun Oct  2 10:21:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.15 2022/01/29 16:01:19 martin Exp $	*/
+/*	$NetBSD: md.c,v 1.16 2022/10/02 10:21:36 martin Exp $	*/
 
 /*
  * Copyright 1997,2002 Piermont Information Systems Inc.
@@ -130,7 +130,9 @@ md_pre_disklabel(struct install_partitio
 	    msg_string(parts->pscheme->short_name));
 
 	/* write edited "MBR" onto disk. */
-	if (!parts->pscheme->write_to_disk(parts)) {
+	if (!parts->pscheme->write_to_disk(parts) ||
+	    run_program(RUN_SILENT | RUN_ERROR_OK,
+	    "/sbin/fdisk -f -i -c /usr/mdec/mbr %s", parts->disk)) {
 		msg_display(MSG_wmbrfail);
 		process_menu(MENU_ok, NULL);
 		return false;
@@ -166,7 +168,7 @@ md_post_newfs(struct install_partition_d
 	bootxx = bootxx_name(install);
 	if (bootxx != NULL) {
 		error = run_program(RUN_DISPLAY,
-		    "/usr/sbin/installboot -v /dev/r%sd %s", pm->diskdev, bootxx);
+		    "/usr/sbin/installboot -v /dev/r%sa %s", pm->diskdev, bootxx);
 		free(bootxx);
 	} else
 		error = -1;

Reply via email to