summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2006-10-14 18:26:55 +0000
committerkrw <krw@openbsd.org>2006-10-14 18:26:55 +0000
commit30eb6e87d43126707693c085395d82fdeb2eba74 (patch)
treecfcf6f38e40b64c878daeeb32e607329e2a38ad6
parentfix the slightly different reset procedure of single chip variants. (diff)
downloadwireguard-openbsd-30eb6e87d43126707693c085395d82fdeb2eba74.tar.xz
wireguard-openbsd-30eb6e87d43126707693c085395d82fdeb2eba74.zip
Friends don't let friends look for disklabels in Free/NetBSD MBR
partitions since the kernel doesn't put them or look for them there anymore.
-rw-r--r--sbin/disklabel/disklabel.c27
-rw-r--r--sbin/disklabel/editor.c10
2 files changed, 7 insertions, 30 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index 22e68636fcb..86e1099a972 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.c,v 1.101 2006/09/27 00:40:43 krw Exp $ */
+/* $OpenBSD: disklabel.c,v 1.102 2006/10/14 18:26:55 krw Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -39,7 +39,7 @@ static const char copyright[] =
#endif /* not lint */
#ifndef lint
-static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.101 2006/09/27 00:40:43 krw Exp $";
+static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.102 2006/10/14 18:26:55 krw Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -418,10 +418,7 @@ writelabel(int f, char *boot, struct disklabel *lp)
* In this case, partition 'a' had better start at 0,
* otherwise we reject the request as meaningless. -wfj
*/
- if (dosdp && pp->p_size &&
- (dosdp->dp_typ == DOSPTYP_OPENBSD ||
- dosdp->dp_typ == DOSPTYP_FREEBSD ||
- dosdp->dp_typ == DOSPTYP_NETBSD)) {
+ if (dosdp && pp->p_size && (dosdp->dp_typ == DOSPTYP_OPENBSD)) {
sectoffset = (off_t)letoh32(dosdp->dp_start) *
lp->d_secsize;
} else {
@@ -624,24 +621,6 @@ readmbr(int f)
return (&dp[part]);
}
}
- for (part = 0; part < NDOSPART; part++) {
- if (letoh32(dp[part].dp_size) && dp[part].dp_typ == DOSPTYP_FREEBSD) {
- fprintf(stderr, "# Inside MBR partition %d: "
- "type %02X start %u size %u\n",
- part, dp[part].dp_typ,
- letoh32(dp[part].dp_start), letoh32(dp[part].dp_size));
- return (&dp[part]);
- }
- }
- for (part = 0; part < NDOSPART; part++) {
- if (letoh32(dp[part].dp_size) && dp[part].dp_typ == DOSPTYP_NETBSD) {
- fprintf(stderr, "# Inside MBR partition %d: "
- "type %02X start %u size %u\n",
- part, dp[part].dp_typ,
- letoh32(dp[part].dp_start), letoh32(dp[part].dp_size));
- return (&dp[part]);
- }
- }
/*
* If there is no signature and no OpenBSD partition this is probably
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 29ee6d263d4..e63d8f038b9 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.104 2006/07/01 16:50:33 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.105 2006/10/14 18:26:55 krw Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: editor.c,v 1.104 2006/07/01 16:50:33 krw Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.105 2006/10/14 18:26:55 krw Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -1619,12 +1619,10 @@ find_bounds(struct disklabel *lp, struct disklabel *bios_lp)
#ifdef DOSLABEL
/*
- * If we have an MBR, use values from the {Open,Free,Net}BSD partition
+ * If we have an MBR, use values from the OpenBSD partition.
*/
if (dosdp) {
- if (dosdp->dp_typ == DOSPTYP_OPENBSD ||
- dosdp->dp_typ == DOSPTYP_FREEBSD ||
- dosdp->dp_typ == DOSPTYP_NETBSD) {
+ if (dosdp->dp_typ == DOSPTYP_OPENBSD) {
u_int32_t i, new_end;
/* Set start and end based on fdisk partition bounds */