From 22cfd1948d13c4755aa2a0a601a1015f1317d4ec Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 29 Jul 2007 20:22:08 +0000 Subject: Add support for bootpaths like /pci@1f,4000/ide@3,0/ata@0,0/cmdk@0,0 in addition to paths like /pci@1f,0/ide@d,0/disk@0,0 for machines rooting off wd(4). This makes the Ultrabook 170/200 find its root disk. tested by krw@ --- sys/arch/sparc64/sparc64/autoconf.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'sys/arch/sparc64') diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c index 428e45c3eaf..6d6a352ee1b 100644 --- a/sys/arch/sparc64/sparc64/autoconf.c +++ b/sys/arch/sparc64/sparc64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.67 2007/06/01 19:25:10 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.68 2007/07/29 20:22:07 kettenis Exp $ */ /* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */ /* @@ -1118,9 +1118,19 @@ device_register(struct device *dev, void *aux) if (strcmp("wd", devname) == 0) { /* IDE disks. */ struct ata_atapi_attach *aa = aux; + u_int channel, drive; - if ((bp->val[0] / 2) == aa->aa_channel && - (bp->val[0] % 2) == aa->aa_drv_data->drive) { + if (strcmp(bp->name, "ata") == 0 && + bp->val[0] == aa->aa_channel) { + channel = bp->val[0]; bp++; + drive = bp->val[0]; + } else { + channel = bp->val[0] / 2; + drive = bp->val[0] % 2; + } + + if (channel == aa->aa_channel && + drive == aa->aa_drv_data->drive) { nail_bootdev(dev, bp); return; } -- cgit v1.2.3