diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-02-19 20:43:38 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-02-19 20:43:38 +0000 |
commit | f033765843f49cc4279e2e922c5c5af5894ec941 (patch) | |
tree | 5e3b35bfdbaec7fee16f3279c5afce999045b440 /sbin/disklabel | |
parent | dd3c9b788922fdc66406ea7fe115d15b9615e3ed (diff) |
deal with partition type renamed
Diffstat (limited to 'sbin/disklabel')
-rw-r--r-- | sbin/disklabel/disklabel.c | 30 | ||||
-rw-r--r-- | sbin/disklabel/editor.c | 12 |
2 files changed, 29 insertions, 13 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index 4436881b604..6e1cb67fe96 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.c,v 1.47 1997/11/25 00:36:22 millert Exp $ */ +/* $OpenBSD: disklabel.c,v 1.48 1998/02/19 20:43:36 deraadt Exp $ */ /* $NetBSD: disklabel.c,v 1.30 1996/03/14 19:49:24 ghudson Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #endif /* not lint */ #ifndef lint -static char rcsid[] = "$OpenBSD: disklabel.c,v 1.47 1997/11/25 00:36:22 millert Exp $"; +static char rcsid[] = "$OpenBSD: disklabel.c,v 1.48 1998/02/19 20:43:36 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -411,7 +411,8 @@ writelabel(f, boot, lp) */ if (dosdp && pp->p_size && (dosdp->dp_typ == DOSPTYP_OPENBSD || - dosdp->dp_typ == DOSPTYP_386BSD)) { + dosdp->dp_typ == DOSPTYP_FREEBSD || + dosdp->dp_typ == DOSPTYP_NETBSD)) { sectoffset = get_le(&dosdp->dp_start) * lp->d_secsize; } else { if (dosdp) { @@ -615,7 +616,17 @@ readmbr(f) } } for (part = 0; part < NDOSPART; part++) { - if (get_le(&dp[part].dp_size) && dp[part].dp_typ == DOSPTYP_386BSD) { + if (get_le(&dp[part].dp_size) && dp[part].dp_typ == DOSPTYP_FREEBSD) { + fprintf(stderr, "# using MBR partition %d: " + "type %02X off %d (0x%x) size %d (0x%x)\n", part, + dp[part].dp_typ, + get_le(&dp[part].dp_start), get_le(&dp[part].dp_start), + get_le(&dp[part].dp_size), get_le(&dp[part].dp_size)); + return (&dp[part]); + } + } + for (part = 0; part < NDOSPART; part++) { + if (get_le(&dp[part].dp_size) && dp[part].dp_typ == DOSPTYP_NETBSD) { fprintf(stderr, "# using MBR partition %d: " "type %02X off %d (0x%x) size %d (0x%x)\n", part, dp[part].dp_typ, @@ -653,8 +664,9 @@ readlabel(f) #ifdef DOSLABEL if (dosdp && get_le(&dosdp->dp_size) && - (dosdp->dp_typ == DOSPTYP_386BSD || - dosdp->dp_typ == DOSPTYP_OPENBSD)) + (dosdp->dp_typ == DOSPTYP_OPENBSD || + (dosdp->dp_typ == DOSPTYP_FREEBSD || + dosdp->dp_typ == DOSPTYP_NETBSD)) sectoffset = get_le(&dosdp->dp_start) * DEV_BSIZE; #endif if (verbose) @@ -1554,8 +1566,10 @@ checklabel(lp) if (lp->d_secperunit == 0) lp->d_secperunit = lp->d_secpercyl * lp->d_ncylinders; #ifdef i386__notyet - if (dosdp && dosdp->dp_size && (dosdp->dp_typ == DOSPTYP_386BSD || - dosdp->dp_typ == DOSPTYP_OPENBSD)) { + if (dosdp && dosdp->dp_size && + (dosdp->dp_typ == DOSPTYP_OPENBSD || + dosdp->dp_typ == DOSPTYP_FREEBSD || + dosdp->dp_typ == DOSPTYP_NETBSD)) { && lp->d_secperunit > dosdp->dp_start + dosdp->dp_size) { warnx("exceeds DOS partition size"); errors++; diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 88b6afb4d9a..fe8f84a2550 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.29 1998/01/11 18:21:17 millert Exp $ */ +/* $OpenBSD: editor.c,v 1.30 1998/02/19 20:43:37 deraadt Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -31,7 +31,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.29 1998/01/11 18:21:17 millert Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.30 1998/02/19 20:43:37 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -1734,9 +1734,11 @@ find_bounds(lp) ending_sector = lp->d_secperunit; #ifdef DOSLABEL - /* If we have an MBR, use values from the OpenBSD/386BSD parition. */ - if (dosdp && pp->p_size && (dosdp->dp_typ == DOSPTYP_OPENBSD || - dosdp->dp_typ == DOSPTYP_386BSD)) { + /* If we have an MBR, use values from the OpenBSD/FreeBSD parition. */ + if (dosdp && pp->p_size && + (dosdp->dp_typ == DOSPTYP_OPENBSD || + dosdp->dp_typ == DOSPTYP_FREEBSD || + dosdp->dp_typ == DOSPTYP_NETBSD)) { starting_sector = get_le(&dosdp->dp_start); ending_sector = starting_sector + get_le(&dosdp->dp_size); printf("Treating sectors %u-%u as the OpenBSD portion of the " |