summaryrefslogtreecommitdiff
path: root/sbin/fdisk/cmd.c
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1998-09-08 11:03:17 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1998-09-08 11:03:17 +0000
commit9ed26abfb19a3865ab208e075d261b087ae0b6ae (patch)
tree670a644c7dd0af67c1e74d86cedbb4823258d3bd /sbin/fdisk/cmd.c
parent84fce0cee3f71633b269d1877d7c2d46880657c1 (diff)
For powerpc's we want to keep the preinstalled msdos partition in the init
MBR when doing a 'fdisk -i'. That is because the msdos partition is used for booting. The OpenBSD part (part 3) is set up to be the rest of the disk. Also the msdos partition is set as the 'active' partition.
Diffstat (limited to 'sbin/fdisk/cmd.c')
-rw-r--r--sbin/fdisk/cmd.c12
1 files changed, 11 insertions, 1 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);