1
0
mirror of https://github.com/openbsd/src.git synced 2026-04-24 14:14:37 +00:00

stub 'time' command; OK miod

octeon (like loongson at least) lacks clock code and thus the 'time'
command besides MD boot* manuals.

Since unsupported commands are treated as file names and explicit
kernels overrule any /bsd.{boot,upgrade} fallback in general,
this causes sysupgrade to not kick in until boot.conf is fixed:

	>> OpenBSD/octeon BOOT 1.5
	upgrade detected: switching to /bsd.upgrade
	failed to load kernel sd0a:time: No such file or directory
	will try /bsd
	boot>
	NOTE: random seed is being reused.
	booting sd0a:/bsd

Make 'time' do nothing and return success to ensure it doesn't effect
subsequent execution.
This commit is contained in:
kn
2026-01-18 07:54:36 +00:00
parent 8be1667ad8
commit a09e8894fa
2 changed files with 11 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: cmd.c,v 1.6 2025/08/23 16:48:17 gkoehler Exp $ */
/* $OpenBSD: cmd.c,v 1.7 2026/01/18 07:54:36 kn Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -48,6 +48,7 @@ static int Xhelp(void);
static int Xls(void);
static int Xnop(void);
static int Xreboot(void);
static int Xtime(void);
#ifdef MACHINE_CMD
static int Xmachine(void);
extern const struct cmd_table MACHINE_CMD[];
@@ -70,6 +71,7 @@ const struct cmd_table cmd_table[] = {
#endif
{"reboot", CMDT_CMD, Xreboot},
{"set", CMDT_SET, Xset},
{"time", CMDT_CMD, Xtime},
{NULL, 0},
};
@@ -493,6 +495,12 @@ Xreboot(void)
return 0; /* just in case */
}
static int
Xtime(void)
{
return 0;
}
int
upgrade(void)
{

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: rdboot.c,v 1.10 2025/08/23 16:48:17 gkoehler Exp $ */
/* $OpenBSD: rdboot.c,v 1.11 2026/01/18 07:54:36 kn Exp $ */
/*
* Copyright (c) 2019-2020 Visa Hankala
@@ -51,7 +51,7 @@ void kexec(int);
struct cmd_state cmd;
int octbootfd = -1;
const char version[] = "1.5";
const char version[] = "1.6";
int
main(void)