Hi,
On Wed, 13 Sep 2017 14:52:59 +1000
Jonathan Gray <[email protected]> wrote:
> config(8) creates ioconf.c containing
"timezone" command of config(8) is also broken.
% config -e bsd.mp
WARNING no output file specified
WARNING this kernel doesn't contain all information needed!
WARNING the commands add and change might not work.
OpenBSD 6.2 (GENERIC.MP) #128: Mon Oct 2 23:18:13 MDT 2017
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
Enter 'help' for information
ukc> t
timezone = 95510072, dst = 48017180
ukc>
timezone and dst must be 0. On my test, kernel panics when timezone
is altered by the config command.
The diff following fixes the problem.
Index: sys/conf/param.c
===================================================================
RCS file: /cvs/src/sys/conf/param.c,v
retrieving revision 1.37
diff -u -p -r1.37 param.c
--- sys/conf/param.c 6 May 2016 19:45:35 -0000 1.37
+++ sys/conf/param.c 3 Oct 2017 09:01:26 -0000
@@ -81,7 +81,7 @@
int hz = HZ;
int tick = 1000000 / HZ;
int tickadj = 240000 / (60 * HZ); /* can adjust 240ms in 60s */
-struct timezone tz = { TIMEZONE, DST };
+struct timezone tz __attribute__ ((section(".data"))) = { TIMEZONE, DST };
#define NPROCESS (30 + 16 * MAXUSERS)
#define NTEXT (80 + NPROCESS / 8) /* actually the object
cache */
#define NVNODE (NPROCESS * 2 + NTEXT + 100)