Index: sys/arch/cobalt/cobalt/autoconf.c =================================================================== RCS file: /cvsroot/src/sys/arch/cobalt/cobalt/autoconf.c,v retrieving revision 1.24 diff -u -r1.24 autoconf.c --- sys/arch/cobalt/cobalt/autoconf.c 17 Nov 2006 21:01:03 -0000 1.24 +++ sys/arch/cobalt/cobalt/autoconf.c 28 Oct 2007 09:26:22 -0000 @@ -37,6 +37,9 @@ #include #include +#include +#include + extern char bootstring[]; extern int netboot; extern int bootunit; @@ -73,23 +76,34 @@ setroot(booted_device, booted_partition); } -static int hd_iterate = -1; - void device_register(struct device *dev, void *aux) { - if (booted_device) + if (booted_device != NULL) return; - if ((booted_device == NULL) && (netboot == 1)) - if (device_class(dev) == DV_IFNET) - booted_device = dev; - - if ((booted_device == NULL) && (netboot == 0)) { - if (device_class(dev) == DV_DISK && device_is_a(dev, "wd")) { - hd_iterate++; - if (hd_iterate == bootunit) { + if (netboot == 1) { + /* check tlp0 on netboot */ + if (device_class(dev) == DV_IFNET && + device_is_a(dev, "tlp")) { + struct pci_attach_args *pa = aux; + + if (pa->pa_bus == 0 && + pa->pa_device == 7 && + pa->pa_function == 0) + booted_device = dev; + } + } else { + /* check wd channel and drive */ + if (device_class(dev) == DV_DISK && + device_is_a(dev, "wd")) { + struct ata_device *adev = aux; + int unit; + + unit = adev->adev_channel * 2 + + adev->adev_drv_data->drive; + if (unit == bootunit) { booted_device = dev; } } Index: sys/arch/cobalt/cobalt/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/cobalt/cobalt/machdep.c,v retrieving revision 1.75.4.1 diff -u -r1.75.4.1 machdep.c --- sys/arch/cobalt/cobalt/machdep.c 28 Aug 2007 19:27:05 -0000 1.75.4.1 +++ sys/arch/cobalt/cobalt/machdep.c 28 Oct 2007 09:26:23 -0000 @@ -826,6 +826,9 @@ bootpart = root_bstr[8] - '1'; } } + + if (nfsroot_bstr != NULL) + netboot = 1; }