summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-03-19 14:33:29 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-03-19 14:33:29 +0000
commit064833876ff1e42207036f9071ff4396cd97fd4f (patch)
tree4ee7daf46f72f4f1a090678e7ac5286fc7c85289 /sys
parented6150a6c21fc42da1a47b01cc465742c0a793fe (diff)
attach softraid to the root of the device tree in a machine independant
way, rather than requiring some glue in each machines mainbus probe. it is still commented out. based on a discussion with miod@ ok marco@ deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/conf/GENERIC5
-rw-r--r--sys/arch/i386/conf/files.i3867
-rw-r--r--sys/arch/i386/i386/mainbus.c13
-rw-r--r--sys/conf/GENERIC5
-rw-r--r--sys/conf/files6
-rw-r--r--sys/dev/softraid.c6
-rw-r--r--sys/dev/softraidvar.h6
-rw-r--r--sys/kern/init_main.c8
8 files changed, 19 insertions, 37 deletions
diff --git a/sys/arch/i386/conf/GENERIC b/sys/arch/i386/conf/GENERIC
index ff895dc9c44..afe9bb4125e 100644
--- a/sys/arch/i386/conf/GENERIC
+++ b/sys/arch/i386/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.550 2007/03/19 03:02:09 marco Exp $
+# $OpenBSD: GENERIC,v 1.551 2007/03/19 14:33:28 dlg Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -50,9 +50,6 @@ pcibios0 at bios0 flags 0x0000 # use 0x30 for a total verbose
ipmi0 at mainbus? # IPMI
esm0 at mainbus? # Dell Embedded Server Management
-#softraid0 at mainbus? # Software RAID
-#scsibus* at softraid?
-
isa0 at mainbus0
isa0 at pcib?
isa0 at ichpcib?
diff --git a/sys/arch/i386/conf/files.i386 b/sys/arch/i386/conf/files.i386
index 54a34506343..b659ed772dd 100644
--- a/sys/arch/i386/conf/files.i386
+++ b/sys/arch/i386/conf/files.i386
@@ -1,4 +1,4 @@
-# $OpenBSD: files.i386,v 1.156 2007/03/19 09:29:33 art Exp $
+# $OpenBSD: files.i386,v 1.157 2007/03/19 14:33:28 dlg Exp $
#
# new style config file for i386 architecture
#
@@ -414,11 +414,6 @@ include "../../../dev/acpi/files.acpi"
file arch/i386/i386/acpi_machdep.c acpi
#
-# SOFTRAID
-#
-attach softraid at mainbus
-
-#
# IPMI
#
attach ipmi at mainbus
diff --git a/sys/arch/i386/i386/mainbus.c b/sys/arch/i386/i386/mainbus.c
index 03b5af4464f..4ae0d4f0da8 100644
--- a/sys/arch/i386/i386/mainbus.c
+++ b/sys/arch/i386/i386/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.34 2007/03/19 03:02:09 marco Exp $ */
+/* $OpenBSD: mainbus.c,v 1.35 2007/03/19 14:33:28 dlg Exp $ */
/* $NetBSD: mainbus.c,v 1.21 1997/06/06 23:14:20 thorpej Exp $ */
/*
@@ -53,7 +53,6 @@
#include "acpi.h"
#include "ipmi.h"
#include "esm.h"
-#include "softraid.h"
#include "vesabios.h"
#include <machine/cpuvar.h>
@@ -77,10 +76,6 @@
#include <arch/i386/i386/esmvar.h>
#endif
-#if NSOFTRAID > 0
-#include <dev/softraidvar.h>
-#endif
-
#if NVESABIOS > 0
#include <dev/vesa/vesabiosvar.h>
#endif
@@ -286,12 +281,6 @@ mainbus_attach(struct device *parent, struct device *self, void *aux)
#endif
config_found(self, &mba.mba_iba, mainbus_print);
}
-
-#if NSOFTRAID > 0
- memset(&mba.mba_maa, 0, sizeof(mba.mba_maa));
- mba.mba_maa.maa_name = "softraid";
- config_found(self, &mba.mba_maa, mainbus_print);
-#endif
}
int
diff --git a/sys/conf/GENERIC b/sys/conf/GENERIC
index 3b7860fd72c..f1f33ea0648 100644
--- a/sys/conf/GENERIC
+++ b/sys/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.125 2006/08/03 16:13:24 mbalmer Exp $
+# $OpenBSD: GENERIC,v 1.126 2007/03/19 14:33:28 dlg Exp $
#
# Machine-independent option; used by all architectures for their
# GENERIC kernel
@@ -68,6 +68,9 @@ option PPP_DEFLATE
option MROUTING # Multicast router
#option PIM # Protocol Independent Multicast
+#softraid0 at root # Software RAID
+#scsibus* at softraid?
+
pseudo-device pf # packet filter
pseudo-device pflog # pf log if
pseudo-device pfsync # pf sync if
diff --git a/sys/conf/files b/sys/conf/files
index 20eba93e6a1..9921a3a89d8 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1,4 +1,4 @@
-# $OpenBSD: files,v 1.394 2007/03/19 03:02:09 marco Exp $
+# $OpenBSD: files,v 1.395 2007/03/19 14:33:28 dlg Exp $
# $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@@ -431,7 +431,9 @@ file dev/radio.c radio needs-flag
device ipmi
file dev/ipmi.c ipmi needs-flag
-device softraid: scsi
+# Software RAID
+device softraid: scsi
+attach softraid at root
file dev/softraid.c softraid needs-flag
# legitimate pseudo-devices
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index d3f8bed46b4..fdc9f4cd64d 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -122,12 +122,6 @@ struct scsi_device sr_dev = {
int
sr_probe(struct device *parent, void *match, void *aux)
{
- struct sr_attach_args *maa = aux;
- struct cfdata *cf = match;
-
- if (strcmp(maa->maa_name, cf->cf_driver->cd_name))
- return (0);
-
return (1);
}
diff --git a/sys/dev/softraidvar.h b/sys/dev/softraidvar.h
index 664d37dea53..b87e6eaea82 100644
--- a/sys/dev/softraidvar.h
+++ b/sys/dev/softraidvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraidvar.h,v 1.1 2007/03/19 03:02:08 marco Exp $ */
+/* $OpenBSD: softraidvar.h,v 1.2 2007/03/19 14:33:28 dlg Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <sro@peereboom.us>
*
@@ -253,10 +253,6 @@ struct sr_softc {
struct sr_discipline *sc_dis[SR_MAXSCSIBUS]; /* scsibus is u_int8_t */
};
-struct sr_attach_args {
- char *maa_name;
-};
-
int sr_probe(struct device *, void *, void *);
void sr_attach(struct device *, struct device *, void *);
int sr_detach(struct device *, int);
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index f54f517f4f8..e41810455d8 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.135 2007/03/15 10:22:30 art Exp $ */
+/* $OpenBSD: init_main.c,v 1.136 2007/03/19 14:33:28 dlg Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -97,6 +97,8 @@
extern void nfs_init(void);
#endif
+#include "softraid.h"
+
const char copyright[] =
"Copyright (c) 1982, 1986, 1989, 1991, 1993\n"
"\tThe Regents of the University of California. All rights reserved.\n"
@@ -436,6 +438,10 @@ main(void *framep)
dostartuphooks();
+#if NSOFTRAID > 0
+ config_rootfound("softraid", NULL);
+#endif
+
/* Configure root/swap devices */
if (md_diskconf)
(*md_diskconf)();