From d49fbca3fca592ec18648e7fbc12b3d9ab80831f Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" <millert@cvs.openbsd.org> Date: Mon, 27 Oct 1997 04:55:05 +0000 Subject: Pull out the device crap for now as it prevents paths like 2.2/alpha/bsd. --- sys/arch/alpha/stand/boot/devopen.c | 86 ++----------------------------------- 1 file changed, 3 insertions(+), 83 deletions(-) (limited to 'sys/arch/alpha') diff --git a/sys/arch/alpha/stand/boot/devopen.c b/sys/arch/alpha/stand/boot/devopen.c index fc6de09d56c..bac90dab979 100644 --- a/sys/arch/alpha/stand/boot/devopen.c +++ b/sys/arch/alpha/stand/boot/devopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: devopen.c,v 1.4 1997/05/05 06:01:51 millert Exp $ */ +/* $OpenBSD: devopen.c,v 1.5 1997/10/27 04:55:04 millert Exp $ */ /* $NetBSD: devopen.c,v 1.1 1995/11/23 02:39:37 cgd Exp $ */ /*- @@ -60,89 +60,9 @@ devopen(f, fname, file) cp = (char *)fname; ncp = namebuf; + dp = devsw; + ctlr = unit = part = 0; - /* look for a string like '5/rz0/vmunix' or '5/rz3f/vmunix */ - if ((c = *cp) >= '0' && c <= '9') { - ctlr = c - '0'; - /* skip the '/' */ - if (*++cp != '/') - return (ENXIO); - cp++; - while ((c = *cp) != '\0') { - if (c == '/') - break; - if (c >= '0' && c <= '9') { - /* read unit number */ - unit = c - '0'; - - /* look for a partition */ - if ((c = *++cp) >= 'a' && c <= 'h') { - part = c - 'a'; - c = *++cp; - } - if (c != '/') - return (ENXIO); - break; - } - if (ncp < namebuf + sizeof(namebuf) - 1) - *ncp++ = c; - cp++; - } - *ncp = '\0'; - } else if (strchr(cp, '(')) { - /* expect a string like 'rz(0,0,0)vmunix' */ - while ((c = *cp) != '\0') { - if (c == '(') { - cp++; - break; - } - if (ncp < namebuf + sizeof(namebuf) - 1) - *ncp++ = c; - cp++; - } - - /* get controller number */ - if ((c = *cp) >= '0' && c <= '9') { - ctlr = c - '0'; - c = *++cp; - } - - if (c == ',') { - /* get SCSI device number */ - if ((c = *++cp) >= '0' && c <= '9') { - unit = c - '0'; - c = *++cp; - } - - if (c == ',') { - /* get partition number */ - if ((c = *++cp) >= '0' && c <= '9') { - part = c - '0'; - c = *++cp; - } - } - } - if (c != ')') - return (ENXIO); - cp++; - *ncp = '\0'; - } else { - dp = devsw; - ctlr = unit = part = 0; - goto fnd; - } - - for (dp = devsw, i = 0; i < ndevs; dp++, i++) - if (dp->dv_name && strcmp(namebuf, dp->dv_name) == 0) - goto fnd; - printf("Unknown device '%s'\nKnown devices are:", namebuf); - for (dp = devsw, i = 0; i < ndevs; dp++, i++) - if (dp->dv_name) - printf(" %s", dp->dv_name); - printf("\n"); - return (ENXIO); - -fnd: rc = (dp->dv_open)(f, ctlr, unit, part); if (rc) return (rc); -- cgit v1.2.3