diff options
author | Ori Bernstein <ori@eigenstate.org> | 2021-09-25 16:57:58 +0000 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2021-09-25 16:57:58 +0000 |
commit | 235ef367d793db705b1b4ef20913c697eccd13a6 (patch) | |
tree | 1cfcf70270ff44e82684ab90fe0609c4173bb654 /sys/src/cmd/vmx | |
parent | 6e8b8c8f1a34f5229075fa06eff5f22ab25eb901 (diff) |
vmx: update openbsd kernel heuristics
in OpenBSD 6.9 and up, the kernel (bsd, bsd.mp) still has
the ostype symbols, but bsd.rd appears to have lost them,
even when decompressed.
so, as a result, we should use what we have, which isn't
much.
Diffstat (limited to 'sys/src/cmd/vmx')
-rw-r--r-- | sys/src/cmd/vmx/ksetup.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/src/cmd/vmx/ksetup.c b/sys/src/cmd/vmx/ksetup.c index 4af05ef80..34f9d96a8 100644 --- a/sys/src/cmd/vmx/ksetup.c +++ b/sys/src/cmd/vmx/ksetup.c @@ -728,7 +728,7 @@ obsdload(void) static int tryelf(void) { - char *s; + char *s, *t; if(!elfheaders()) return 0; elfdata(); @@ -736,6 +736,11 @@ tryelf(void) s = symaddr(elfsym("ostype")); if(s != nil && strcmp(s, "OpenBSD") == 0) return obsdload(); + /* from 6.9 up, bsd.rd has just these syms */ + s = symaddr(elfsym("rd_root_image")); + t = symaddr(elfsym("rd_root_size")); + if(s != nil && t != nil) + return obsdload(); return 0; } |