summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2012-02-11 23:48:56 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2012-02-11 23:48:56 +0000
commit6782ae3dcfa74e0f7818fd08cc7732b6631f952e (patch)
tree7c0c03e5acd30e8d71558a103a155e473b8d195f /sys/arch/sparc64
parent948b3d4bf75c536d53c579a9b837f9e12438963d (diff)
Don't compare command line input to softraid device names. Parse
out the intended device name from the realdev constructed by opendev(). Should fix the issue found by stsp@ in trying to install a boot-from-softraid sparc64. ok deraadt@
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/stand/installboot/installboot.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/arch/sparc64/stand/installboot/installboot.c b/sys/arch/sparc64/stand/installboot/installboot.c
index 033661cd7ff..1af04ac8abb 100644
--- a/sys/arch/sparc64/stand/installboot/installboot.c
+++ b/sys/arch/sparc64/stand/installboot/installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: installboot.c,v 1.14 2012/01/11 16:15:02 jsing Exp $ */
+/* $OpenBSD: installboot.c,v 1.15 2012/02/11 23:48:55 krw Exp $ */
/* $NetBSD: installboot.c,v 1.8 2001/02/19 22:48:59 cgd Exp $ */
/*-
@@ -127,6 +127,11 @@ main(int argc, char *argv[])
if (verbose)
printf("device: %s\n", realdev);
+ dev = strdup(realdev + 6); /* Skip the "/dev/r" */
+ if (dev == NULL)
+ err(1, "strdup of realdev failed");
+ dev[strlen(dev)-1] = '\0'; /* And chop off the 'c'. */
+
if (sr_volume(devfd, &vol, &ndisks)) {
/* Install boot loader in softraid volume. */
@@ -143,6 +148,7 @@ main(int argc, char *argv[])
}
+ free(dev);
close(devfd);
}