summaryrefslogtreecommitdiff
path: root/sys/arch/octeon/stand
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2020-05-25 13:04:26 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2020-05-25 13:04:26 +0000
commitb0efc43bc8c24452bdee702d82dd116c9d055654 (patch)
treed422d37fbeba4e648873b42af5640802949ebbde /sys/arch/octeon/stand
parent6dee5ee83cfdf168c1972aa9642eef561adfd454 (diff)
Pass boothowto from the bootloader to the kernel on octeon.
OK deraadt@
Diffstat (limited to 'sys/arch/octeon/stand')
-rw-r--r--sys/arch/octeon/stand/rdboot/rdboot.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/arch/octeon/stand/rdboot/rdboot.c b/sys/arch/octeon/stand/rdboot/rdboot.c
index cc4ed59ff4b..2a215eb13f9 100644
--- a/sys/arch/octeon/stand/rdboot/rdboot.c
+++ b/sys/arch/octeon/stand/rdboot/rdboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rdboot.c,v 1.3 2019/11/01 20:54:52 deraadt Exp $ */
+/* $OpenBSD: rdboot.c,v 1.4 2020/05/25 13:04:25 visa Exp $ */
/*
* Copyright (c) 2019 Visa Hankala
@@ -150,7 +150,7 @@ void
kexec(void)
{
struct octboot_kexec_args kargs;
- char kernelflags[8];
+ char boothowtostr[32];
char rootdev[32];
const char *path;
int argc, ret;
@@ -163,12 +163,9 @@ kexec(void)
kargs.path = path;
argc = 0;
if (cmd.boothowto != 0) {
- snprintf(kernelflags, sizeof(kernelflags), "-%s%s%s%s",
- (cmd.boothowto & RB_ASKNAME) ? "a" : "",
- (cmd.boothowto & RB_CONFIG) ? "c" : "",
- (cmd.boothowto & RB_KDB) ? "d" : "",
- (cmd.boothowto & RB_SINGLE) ? "s" : "");
- kargs.argv[argc++] = kernelflags;
+ snprintf(boothowtostr, sizeof(boothowtostr), "boothowto=%d",
+ cmd.boothowto);
+ kargs.argv[argc++] = boothowtostr;
}
if (cmd.hasduid) {
snprintf(rootdev, sizeof(rootdev),