summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-05-14 22:34:15 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-05-14 22:34:15 +0000
commit56c97249fb5862caa79a735dcf51106433e96255 (patch)
tree1761500b81950d42a1563be6b5e036c79b8d744f /sys/arch
parent33aa44c1b65f11dae0bb3419402872c07148ae9f (diff)
Determine boot device from arguments passed by the bootloader.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/socppc/socppc/autoconf.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/arch/socppc/socppc/autoconf.c b/sys/arch/socppc/socppc/autoconf.c
index 90da6d18b0c..4bc29f7a00a 100644
--- a/sys/arch/socppc/socppc/autoconf.c
+++ b/sys/arch/socppc/socppc/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.1 2008/05/10 12:02:21 kettenis Exp $ */
+/* $OpenBSD: autoconf.c,v 1.2 2008/05/14 22:34:14 kettenis Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
@@ -54,8 +54,15 @@ diskconf(void)
{
struct device *dv;
dev_t tmpdev;
+ int len;
+ char *p;
- dv = parsedisk("wd0a", strlen("wd0a"), 0, &tmpdev);
+ if ((p = strchr(bootpath, ':')) != NULL)
+ len = p - bootpath;
+ else
+ len = strlen(bootpath);
+
+ dv = parsedisk(bootpath, len, 0, &tmpdev);
setroot(dv, 0, RB_USERREQ);
dumpconf();
}