diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2013-01-11 23:22:36 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2013-01-11 23:22:36 +0000 |
commit | bf811a6ef5680ddb5b6120f96e9366f9d82e86b0 (patch) | |
tree | fd08b1af16baaa2d3f3835d92a229b07e5b5c07f /sys | |
parent | 1393878f767eb6d8fe15589c66baed8d24313864 (diff) |
Change boot commandline parsing to only force lowercase of the device name
part, and keep the filename unchanged.
This allows a kernel which name contains uppercase letters to be bootable,
instead of getting a `file not found' error with the filename being all
lower case.
A workaround was to prepend the filename with `/', to give an absolute path.
Yet there is no reason to lowercase the filename unless there is a boot device
prefix.
Crank version.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hp300/stand/cdboot/devopen.c | 14 | ||||
-rw-r--r-- | sys/arch/hp300/stand/common/version.c | 7 | ||||
-rw-r--r-- | sys/arch/hp300/stand/libsa/devopen.c | 14 |
3 files changed, 23 insertions, 12 deletions
diff --git a/sys/arch/hp300/stand/cdboot/devopen.c b/sys/arch/hp300/stand/cdboot/devopen.c index cfbd44b21d5..2584c0cbf1b 100644 --- a/sys/arch/hp300/stand/cdboot/devopen.c +++ b/sys/arch/hp300/stand/cdboot/devopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: devopen.c,v 1.3 2006/08/17 06:31:10 miod Exp $ */ +/* $OpenBSD: devopen.c,v 1.4 2013/01/11 23:22:35 miod Exp $ */ /* $NetBSD: devopen.c,v 1.7 1996/10/14 07:31:47 thorpej Exp $ */ /*- @@ -115,12 +115,15 @@ devparse(const char *fname, int *dev, int *adapt, int *ctlr, int *unit, int i; char *s, *args[4]; - /* get device name and make lower case */ + /* check for device name */ for (s = (char *)fname; *s && *s != '/' && *s != ':' && *s != '('; s++) - if (isupper(*s)) *s = tolower(*s); + /* if (isupper(*s)) *s = tolower(*s) */; /* first form */ if (*s == '(') { + /* make device name lower case */ + for (s = (char *)fname; *s != '('; s++) + if (isupper(*s)) *s = tolower(*s); /* lookup device and get index */ if ((*dev = devlookup(fname, s - fname)) < 0) goto baddev; @@ -160,8 +163,9 @@ devparse(const char *fname, int *dev, int *adapt, int *ctlr, int *unit, else if (*s == ':') { int temp; - /* isolate device */ - for (s = (char *)fname; *s != ':' && !isdigit(*s); s++); + /* isolate device and make its name lower case*/ + for (s = (char *)fname; *s != ':' && !isdigit(*s); s++) + if (isupper(*s)) *s = tolower(*s); /* lookup device and get index */ if ((*dev = devlookup(fname, s - fname)) < 0) diff --git a/sys/arch/hp300/stand/common/version.c b/sys/arch/hp300/stand/common/version.c index 5a3fa7ca5af..0e435af37c1 100644 --- a/sys/arch/hp300/stand/common/version.c +++ b/sys/arch/hp300/stand/common/version.c @@ -1,4 +1,4 @@ -/* $OpenBSD: version.c,v 1.11 2013/01/01 17:18:49 miod Exp $ */ +/* $OpenBSD: version.c,v 1.12 2013/01/11 23:22:35 miod Exp $ */ /* * Record major changes in the boot code here, and increment the version @@ -21,6 +21,9 @@ * 2.11 sti@dio frame buffer support (for models 362 and 382), and various * cleanups. * 2.12 Switch to MI loadfile code. + * 2.13 Allow kernels with uppercase characters in their names to be loaded + * from the default boot device without an explicit device or a leading + * `/'. */ -const char version[] = "2.12"; +const char version[] = "2.13"; diff --git a/sys/arch/hp300/stand/libsa/devopen.c b/sys/arch/hp300/stand/libsa/devopen.c index b0cfbb2d8d9..5cd06293198 100644 --- a/sys/arch/hp300/stand/libsa/devopen.c +++ b/sys/arch/hp300/stand/libsa/devopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: devopen.c,v 1.4 2006/08/17 06:31:10 miod Exp $ */ +/* $OpenBSD: devopen.c,v 1.5 2013/01/11 23:22:35 miod Exp $ */ /* $NetBSD: devopen.c,v 1.7 1996/10/14 07:31:47 thorpej Exp $ */ /*- @@ -132,12 +132,15 @@ devparse(const char *fname, int *dev, int *adapt, int *ctlr, int *unit, int i; char *s, *args[4]; - /* get device name and make lower case */ + /* check for device name */ for (s = (char *)fname; *s && *s != '/' && *s != ':' && *s != '('; s++) - if (isupper(*s)) *s = tolower(*s); + /* if (isupper(*s)) *s = tolower(*s) */; /* first form */ if (*s == '(') { + /* make device name lower case */ + for (s = (char *)fname; *s != '('; s++) + if (isupper(*s)) *s = tolower(*s); /* lookup device and get index */ if ((*dev = devlookup(fname, s - fname)) < 0) goto baddev; @@ -177,8 +180,9 @@ devparse(const char *fname, int *dev, int *adapt, int *ctlr, int *unit, else if (*s == ':') { int temp; - /* isolate device */ - for (s = (char *)fname; *s != ':' && !isdigit(*s); s++); + /* isolate device and make its name lower case*/ + for (s = (char *)fname; *s != ':' && !isdigit(*s); s++) + if (isupper(*s)) *s = tolower(*s); /* lookup device and get index */ if ((*dev = devlookup(fname, s - fname)) < 0) |