diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2011-07-10 04:49:40 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2011-07-10 04:49:40 +0000 |
commit | f1a7c45aca309282c007bcc7bdd77667654d7bd6 (patch) | |
tree | d75099cfcc45bcf356bbdab7d0eab7d908706a59 /sys/arch | |
parent | 0385d57b1538aa4f7e3a1ccd2394449b39cb6aab (diff) |
If there is recognized MD disk partitioning info, use it to determine
where to write the OpenBSD disklabel even if there isn't yet a valid
OpenBSD disklabel at that location.
Alpha/Mac68k/Sparc/Sparc64 to come.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hppa/hppa/disksubr.c | 13 | ||||
-rw-r--r-- | sys/arch/hppa64/hppa64/disksubr.c | 13 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/disksubr.c | 14 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/disksubr.c | 13 |
4 files changed, 42 insertions, 11 deletions
diff --git a/sys/arch/hppa/hppa/disksubr.c b/sys/arch/hppa/hppa/disksubr.c index 6d384208ca8..abc6c124b98 100644 --- a/sys/arch/hppa/hppa/disksubr.c +++ b/sys/arch/hppa/hppa/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.82 2011/07/08 00:08:00 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.83 2011/07/10 04:49:38 krw Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -234,8 +234,15 @@ finished: goto done; } - error = checkdisklabel(bp->b_data + LABELOFFSET, lp, openbsdstart, - DL_GETDSIZE(lp)); /* XXX */ + /* + * Do OpenBSD disklabel validation/adjustment. + * + * N.B: No matter what the bits are on the disk, we now have the + * OpenBSD disklabel for this lif disk. DO NOT proceed to + * readdoslabel(), iso_spooflabel(), etc. + */ + checkdisklabel(bp->b_data, lp, openbsdstart, DL_GETDSIZE(lp)); + error = 0; done: if (dbp) { diff --git a/sys/arch/hppa64/hppa64/disksubr.c b/sys/arch/hppa64/hppa64/disksubr.c index 84674497c91..6b564480fea 100644 --- a/sys/arch/hppa64/hppa64/disksubr.c +++ b/sys/arch/hppa64/hppa64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.66 2011/07/08 00:08:00 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.67 2011/07/10 04:49:39 krw Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -234,8 +234,15 @@ finished: goto done; } - error = checkdisklabel(bp->b_data + LABELOFFSET, lp, openbsdstart, - DL_GETDSIZE(lp)); /* XXX */ + /* + * Do OpenBSD disklabel validation/adjustment. + * + * N.B: No matter what the bits are on the disk, we now have the + * OpenBSD disklabel for this lif disk. DO NOT proceed to + * readdoslabel(), iso_spooflabel(), etc. + */ + checkdisklabel(bp->b_data, lp, openbsdstart, DL_GETDSIZE(lp)); + error = 0; done: if (dbp) { diff --git a/sys/arch/macppc/macppc/disksubr.c b/sys/arch/macppc/macppc/disksubr.c index 8f1301654f1..7e4df923049 100644 --- a/sys/arch/macppc/macppc/disksubr.c +++ b/sys/arch/macppc/macppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.75 2011/07/08 23:26:40 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.76 2011/07/10 04:49:39 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -183,8 +183,16 @@ readdpmelabel(struct buf *bp, void (*strat)(struct buf *), if (biowait(bp)) return(bp->b_error); - return checkdisklabel(bp->b_data + LABELOFFSET, lp, hfspartoff, - hfspartend); + /* + * Do OpenBSD disklabel validation/adjustment. + * + * N.B: No matter what the bits are on the disk, we now have the + * disklabel for this dpme disk. DO NOT proceed to readdoslabel(), + * iso_spooflabel(), * etc. + */ + checkdisklabel(bp->b_data + LABELOFFSET, lp, openbsdstart, + DL_GETDSIZE(lp)); + return (0); } /* diff --git a/sys/arch/sgi/sgi/disksubr.c b/sys/arch/sgi/sgi/disksubr.c index 6a2269f79d7..3c99259f314 100644 --- a/sys/arch/sgi/sgi/disksubr.c +++ b/sys/arch/sgi/sgi/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.24 2011/07/08 00:08:00 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.25 2011/07/10 04:49:39 krw Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -206,7 +206,16 @@ finished: if (biowait(bp)) return (bp->b_error); - return checkdisklabel(bp->b_data + offset, lp, fsoffs, fsend); + /* + * Do OpenBSD disklabel validation/adjustment. + * + * N.B: No matter what the bits are on the disk, we now have the + * OpenBSD disklabel for this sgi disk. DO NOT proceed to + * readdoslabel(), iso_spooflabel(), etc. + */ + checkdisklabel(bp->b_data + LABELOFFSET, lp, openbsdstart, + DL_GETDSIZE(lp)); + return (0); } /* |