From cf68de56e3f26f658aa31ec170138217e0acce77 Mon Sep 17 00:00:00 2001 From: downsj Date: Sun, 16 Feb 1997 17:54:38 +0000 Subject: [PATCH] Fix autoconfiguration code, so that it can actually boot from pdevs. --- sys/arch/hp300/conf/MINIROOT | 4 ++-- sys/arch/hp300/dev/rd_root.c | 4 ++-- sys/arch/hp300/hp300/autoconf.c | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sys/arch/hp300/conf/MINIROOT b/sys/arch/hp300/conf/MINIROOT index 514aaac21c2..fd5208a6742 100644 --- a/sys/arch/hp300/conf/MINIROOT +++ b/sys/arch/hp300/conf/MINIROOT @@ -1,4 +1,4 @@ -# $OpenBSD: MINIROOT,v 1.2 1997/02/16 14:37:08 downsj Exp $ +# $OpenBSD: MINIROOT,v 1.3 1997/02/16 17:54:38 downsj Exp $ # # Ram disk kernel for the miniroot. # @@ -45,7 +45,7 @@ option SE_KEYBOARD # include Swedish HIL keymap # (Warning: this compiles in a large string table) option DIOVERBOSE # recognize "unknown" DIO devices -config bsd root rd0 swap sd0 and sd1 and hd0 and hd1 +config bsd root rd0 swap rd0 mainbus0 at root # root "bus" diff --git a/sys/arch/hp300/dev/rd_root.c b/sys/arch/hp300/dev/rd_root.c index 036f1f262bc..2e12b5886a6 100644 --- a/sys/arch/hp300/dev/rd_root.c +++ b/sys/arch/hp300/dev/rd_root.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rd_root.c,v 1.1 1997/02/16 10:42:20 downsj Exp $ */ +/* $OpenBSD: rd_root.c,v 1.2 1997/02/16 17:54:39 downsj Exp $ */ /* $NetBSD: rd_root.c,v 1.1 1996/05/20 01:17:31 chuck Exp $ */ /* @@ -61,7 +61,7 @@ rd_attach_hook(unit, rd) rd->rd_addr = (caddr_t) rd_root_image; rd->rd_size = (size_t) rd_root_size; rd->rd_type = RD_KMEM_FIXED; - printf(" fixed, %d blocks", MINIROOTSIZE); + printf("rd%d: fixed, %d blocks\n", unit, MINIROOTSIZE); } } diff --git a/sys/arch/hp300/hp300/autoconf.c b/sys/arch/hp300/hp300/autoconf.c index 718a4962d36..f582740c59c 100644 --- a/sys/arch/hp300/hp300/autoconf.c +++ b/sys/arch/hp300/hp300/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.12 1997/02/16 14:37:10 downsj Exp $ */ +/* $OpenBSD: autoconf.c,v 1.13 1997/02/16 17:54:40 downsj Exp $ */ /* $NetBSD: autoconf.c,v 1.31 1997/01/31 01:49:41 thorpej Exp $ */ /* @@ -705,8 +705,8 @@ setroot() #endif rootdevname = findblkname(major(rootdev)); if (rootdevname == NULL) { - printf("unknown root device major 0x%x\n", rootdev); - panic("setroot"); + root_device = NULL; /* no device */ + return; } bzero(buf, sizeof(buf)); sprintf(buf, "%s%d", rootdevname, DISKUNIT(rootdev)); @@ -718,17 +718,11 @@ setroot() break; } } - if (dv == NULL) { - printf("device %s (0x%x) not configured\n", - buf, rootdev); - panic("setroot"); - } - + root_device = dv; /* NULL is fine. */ return; } root_device = rootdv; - switch (rootdv->dv_class) { #ifdef NFSCLIENT case DV_IFNET: @@ -993,6 +987,12 @@ setbootdev() */ bootdev = 0; + /* + * If we don't have a saveable root_device, just punt. + */ + if (root_device == NULL) + goto out; + dd = dev_data_lookup(root_device); /* -- 2.20.1