summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpefo <pefo@openbsd.org>1998-09-08 11:03:15 +0000
committerpefo <pefo@openbsd.org>1998-09-08 11:03:15 +0000
commite627f0060018311ce927cf0a6ab10c5fd069c9d7 (patch)
tree88837e4a6b2183ecf17f7b8906612fa52178da47
parentdon't generate @exec ranlib for .a files (plist target) (diff)
downloadwireguard-openbsd-e627f0060018311ce927cf0a6ab10c5fd069c9d7.tar.xz
wireguard-openbsd-e627f0060018311ce927cf0a6ab10c5fd069c9d7.zip
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.
-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"