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.
This commit is contained in:
parent
6e8b8c8f1a
commit
235ef367d7
1 changed files with 6 additions and 1 deletions
|
@ -728,7 +728,7 @@ obsdload(void)
|
||||||
static int
|
static int
|
||||||
tryelf(void)
|
tryelf(void)
|
||||||
{
|
{
|
||||||
char *s;
|
char *s, *t;
|
||||||
|
|
||||||
if(!elfheaders()) return 0;
|
if(!elfheaders()) return 0;
|
||||||
elfdata();
|
elfdata();
|
||||||
|
@ -736,6 +736,11 @@ tryelf(void)
|
||||||
s = symaddr(elfsym("ostype"));
|
s = symaddr(elfsym("ostype"));
|
||||||
if(s != nil && strcmp(s, "OpenBSD") == 0)
|
if(s != nil && strcmp(s, "OpenBSD") == 0)
|
||||||
return obsdload();
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue