diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2008-08-04 15:58:14 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2008-08-04 15:58:14 +0000 |
commit | a9ab805b1ac0b429c1e21ef9951792f773c4cde6 (patch) | |
tree | 6565e324559e8dc27dc336b1bfbf2c21f5c3f7bf /sbin/disklabel | |
parent | 222b13f8193cd311de104a63752b6aee24d6d8b3 (diff) |
fix extended partition support by handling chained EBRs correctly
(using a recursion limit). now OpenBSD can be installed in a
subsequent DOS/Linux-compatible extended partition.
ok krw@ deraadt@
Diffstat (limited to 'sbin/disklabel')
-rw-r--r-- | sbin/disklabel/disklabel.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index 7c287a3cbcb..abc88b92731 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.c,v 1.133 2008/07/10 00:21:39 krw Exp $ */ +/* $OpenBSD: disklabel.c,v 1.134 2008/08/04 15:58:13 reyk 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.133 2008/07/10 00:21:39 krw Exp $"; +static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.134 2008/08/04 15:58:13 reyk Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -579,19 +579,19 @@ findopenbsd(int f, off_t mbroff, struct dos_partition **first, int *n) "type %02X start %u size %u\n", part, dp[part].dp_typ, letoh32(dp[part].dp_start), letoh32(dp[part].dp_size)); + dp[part].dp_start = + htole32((off_t)letoh32(dp[part].dp_start) + mbroff); return (&dp[part]); + case DOSPTYP_EXTEND: case DOSPTYP_EXTENDL: fprintf(stderr, "# Extended partition %d: " "type %02X start %u size %u\n", part, dp[part].dp_typ, letoh32(dp[part].dp_start), letoh32(dp[part].dp_size)); - start = letoh32(dp[part].dp_start); + start = letoh32(dp[part].dp_start) + mbroff; p = findopenbsd(f, start, NULL, n); - if (p != NULL) { - p->dp_start = - htole32(letoh32(p->dp_start) + start); + if (p != NULL) return (p); - } break; } } |