Do the Ultrix label check in readdisklabel() instead of in rz.c. Ultrix
disks are now usable with the MI SCSI sd devices. The install mini-root adjustment and the default partitioning still needs to be moved into readdisklabel().
This commit is contained in:
parent
9eaf0ad1d4
commit
40b13c16c0
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rz.c,v 1.56 2000/02/07 20:16:52 thorpej Exp $ */
|
||||
/* $NetBSD: rz.c,v 1.57 2000/03/03 17:51:28 mhitch Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -39,7 +39,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
__KERNEL_RCSID(0, "$NetBSD: rz.c,v 1.56 2000/02/07 20:16:52 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rz.c,v 1.57 2000/03/03 17:51:28 mhitch Exp $");
|
||||
|
||||
/*
|
||||
* SCSI CCS (Command Command Set) disk driver.
|
||||
|
@ -47,8 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: rz.c,v 1.56 2000/02/07 20:16:52 thorpej Exp $");
|
|||
* I guess I can't avoid confusion someplace.
|
||||
*/
|
||||
|
||||
#include "opt_compat_ultrix.h"
|
||||
|
||||
#include "rz.h"
|
||||
#include "rnd.h" /* is random device-driver configured? */
|
||||
|
||||
|
@ -154,15 +152,6 @@ static struct size rzdefaultpart[MAXPARTITIONS] = {
|
|||
{ 196608, RZ_END } /* H -- B to end of disk */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Ultrix disklabel declarations
|
||||
*/
|
||||
#ifdef COMPAT_ULTRIX
|
||||
char *compat_label __P((dev_t dev, void (*strat) __P((struct buf *bp)),
|
||||
struct disklabel *lp, struct cpu_disklabel *osdep)); /* XXX */
|
||||
#endif /* COMPAT_ULTRIX */
|
||||
|
||||
struct rzstats {
|
||||
long rzresets;
|
||||
long rztransfers;
|
||||
|
@ -938,6 +927,7 @@ rzgetinfo(dev)
|
|||
lp->d_npartitions = MAXPARTITIONS;
|
||||
lp->d_partitions[part].p_offset = 0;
|
||||
lp->d_partitions[part].p_size = sc->sc_blks;
|
||||
rz_setlabelgeom(lp, &sc->params);
|
||||
|
||||
/*
|
||||
* Now try to read the disklabel
|
||||
|
@ -973,22 +963,6 @@ rzgetinfo(dev)
|
|||
return;
|
||||
printf("rz%d: WARNING: %s\n", unit, msg);
|
||||
|
||||
|
||||
#ifdef COMPAT_ULTRIX
|
||||
/*
|
||||
* No native label, try and substitute Ultrix label
|
||||
*/
|
||||
msg = compat_label(dev, rzstrategy, lp, &cd);
|
||||
if (msg == NULL) {
|
||||
printf("rz%d: WARNING: using ULTRIX partition information",
|
||||
unit);
|
||||
/* Ultrix labels have no geom info. Use softc params. */
|
||||
rz_setlabelgeom(lp, &sc->params);
|
||||
return;
|
||||
}
|
||||
printf("rz%d: WARNING: trying Ultrix label, %s\n", unit, msg);
|
||||
#endif /* COMPAT_ULTRIX */
|
||||
|
||||
/*
|
||||
* No label found. Concoct one from compile-time default.
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: disksubr.c,v 1.27 2000/02/19 09:43:40 nisimura Exp $ */
|
||||
/* $NetBSD: disksubr.c,v 1.28 2000/03/03 17:51:26 mhitch Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
|
||||
|
@ -45,6 +45,8 @@
|
|||
|
||||
#ifdef COMPAT_ULTRIX
|
||||
#include <machine/dec_boot.h>
|
||||
#include <ufs/ufs/dinode.h> /* XXX for fs.h */
|
||||
#include <ufs/ffs/fs.h> /* XXX for BBSIZE & SBSIZE */
|
||||
|
||||
char *compat_label __P((dev_t dev, void (*strat) __P((struct buf *bp)),
|
||||
struct disklabel *lp, struct cpu_disklabel *osdep)); /* XXX */
|
||||
|
@ -103,6 +105,20 @@ readdisklabel(dev, strat, lp, osdep)
|
|||
}
|
||||
bp->b_flags = B_INVAL | B_AGE;
|
||||
brelse(bp);
|
||||
#ifdef COMPAT_ULTRIX
|
||||
/*
|
||||
* If no NetBSD label was found, check for an Ultrix label and
|
||||
* construct tne incore label from the Ultrix partition information.
|
||||
*/
|
||||
if (msg != NULL) {
|
||||
msg = compat_label(dev, strat, lp, osdep);
|
||||
if (msg == NULL) {
|
||||
printf("WARNING: using Ultrix partition information\n");
|
||||
/* set geometry? */
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* XXX If no NetBSD label or Ultrix label found, generate default label here */
|
||||
return (msg);
|
||||
}
|
||||
|
||||
|
@ -153,6 +169,12 @@ compat_label(dev, strat, lp, osdep)
|
|||
|
||||
lp->d_magic = DEC_LABEL_MAGIC;
|
||||
lp->d_npartitions = 0;
|
||||
strncpy(lp->d_packname, "Ultrix label", 16);
|
||||
lp->d_rpm = 3600;
|
||||
lp->d_interleave = 1;
|
||||
lp->d_flags = 0;
|
||||
lp->d_bbsize = BBSIZE;
|
||||
lp->d_sbsize = SBSIZE;
|
||||
for (part = 0;
|
||||
part <((MAXPARTITIONS<DEC_NUM_DISK_PARTS) ?
|
||||
MAXPARTITIONS : DEC_NUM_DISK_PARTS);
|
||||
|
|
Loading…
Reference in New Issue