Module Name: src Committed By: tsutsui Date: Sat May 11 09:55:11 UTC 2024
Modified Files: src/sys/arch/hp300/hp300: autoconf.c Log Message: Fix a 20 years old botch by me in setbootdev() on switching to MI SCSI. setbootdev() updates bootdev data shared between BOOTROM and it notifies BOOTROM to choose a current root device as a boot device on the next boot, but I didn't understand the intention and then it has been broken on SCSI disks. Sigh. (I wonder if no one has noticed this old feature for 20 years..) Should be pulled up to netbsd-10 and netbsd-9. To generate a diff of this commit: cvs rdiff -u -r1.112 -r1.113 src/sys/arch/hp300/hp300/autoconf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/hp300/hp300/autoconf.c diff -u src/sys/arch/hp300/hp300/autoconf.c:1.112 src/sys/arch/hp300/hp300/autoconf.c:1.113 --- src/sys/arch/hp300/hp300/autoconf.c:1.112 Tue Jan 16 07:07:00 2024 +++ src/sys/arch/hp300/hp300/autoconf.c Sat May 11 09:55:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.112 2024/01/16 07:07:00 thorpej Exp $ */ +/* $NetBSD: autoconf.c,v 1.113 2024/05/11 09:55:11 tsutsui Exp $ */ /*- * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc. @@ -88,7 +88,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.112 2024/01/16 07:07:00 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.113 2024/05/11 09:55:11 tsutsui Exp $"); #include "dvbox.h" #include "gbox.h" @@ -678,10 +678,9 @@ setbootdev(void) */ switch (type) { case 2: /* rd */ - case 4: /* sd */ /* * "rd" -> "hpibbus" -> "fhpib" - * "sd" -> "scsibus" -> "spc" + * "rd" -> "hpibbus" -> "nhpib" */ for (cdd = LIST_FIRST(&dev_data_list_hpib), ctlr = 0; cdd != NULL; cdd = LIST_NEXT(cdd, dd_clist), ctlr++) { @@ -697,6 +696,24 @@ setbootdev(void) } } break; + case 4: /* sd */ + /* + * "sd" -> "scsibus" -> "spc" + */ + for (cdd = LIST_FIRST(&dev_data_list_scsi), ctlr = 0; + cdd != NULL; cdd = LIST_NEXT(cdd, dd_clist), ctlr++) { + if (cdd->dd_dev == + device_parent(device_parent(root_device))) { + /* + * Found it! + */ + bootdev = MAKEBOOTDEV(type, + ctlr, dd->dd_slave, dd->dd_punit, + DISKPART(rootdev)); + break; + } + } + break; } out: