Fix autoconfiguration code, so that it can actually boot from pdevs.
authordownsj <downsj@openbsd.org>
Sun, 16 Feb 1997 17:54:38 +0000 (17:54 +0000)
committerdownsj <downsj@openbsd.org>
Sun, 16 Feb 1997 17:54:38 +0000 (17:54 +0000)
sys/arch/hp300/conf/MINIROOT
sys/arch/hp300/dev/rd_root.c
sys/arch/hp300/hp300/autoconf.c

index 514aaac..fd5208a 100644 (file)
@@ -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"
 
index 036f1f2..2e12b58 100644 (file)
@@ -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);
        }
 }
 
index 718a496..f582740 100644 (file)
@@ -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);
 
        /*