summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/fdisk/cmd.c12
-rw-r--r--sbin/fdisk/user.c11
2 files changed, 21 insertions, 2 deletions
diff --git a/sbin/fdisk/cmd.c b/sbin/fdisk/cmd.c
index 4888f85186c..2068fd042ad 100644
--- a/sbin/fdisk/cmd.c
+++ b/sbin/fdisk/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.18 1998/08/08 05:27:59 downsj Exp $ */
+/* $OpenBSD: cmd.c,v 1.19 1998/09/08 11:03:15 pefo Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -80,6 +80,16 @@ Xreinit(cmd, disk, mbr, tt, offset)
/* Fix up start/length fields */
PRT_fix_BN(disk, &mbr->part[3]);
+#if defined(__powerpc__)
+ /* Now fix up for the MS-DOS boot partition on PowerPC. */
+ mbr->part[0].flag = DOSACTIVE; /* Boot from dos part */
+ mbr->part[3].flag = 0;
+ mbr->part[3].ns += mbr->part[3].bs;
+ mbr->part[3].bs = mbr->part[0].bs + mbr->part[0].ns;
+ mbr->part[3].ns -= mbr->part[3].bs;
+ PRT_fix_CHS(disk, &mbr->part[3]);
+#endif
+
/* Tell em we did something */
printf("In memory copy is initialized to:\n");
printf("Offset: %d\t", offset);
diff --git a/sbin/fdisk/user.c b/sbin/fdisk/user.c
index 5420a972aa1..7cd9497c63c 100644
--- a/sbin/fdisk/user.c
+++ b/sbin/fdisk/user.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: user.c,v 1.12 1997/12/23 23:53:02 deraadt Exp $ */
+/* $OpenBSD: user.c,v 1.13 1998/09/08 11:03:16 pefo Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -95,6 +95,15 @@ USER_init(disk, tt)
/* Fix up start/length fields */
PRT_fix_BN(disk, &tt->part[3]);
+#if defined(__powerpc__)
+ /* Now fix up for the MS-DOS boot partition on PowerPC. */
+ tt->part[0].flag = DOSACTIVE; /* Boot from dos part */
+ tt->part[3].flag = 0;
+ tt->part[3].ns += tt->part[3].bs;
+ tt->part[3].bs = tt->part[0].bs + tt->part[0].ns;
+ tt->part[3].ns -= tt->part[3].bs;
+ PRT_fix_CHS(disk, &tt->part[3]);
+#endif
/* Write sector 0 */
printf("\a\n"
"\t-----------------------------------------------------\n"