-
Re: can't sysctlbyname(kern.safeboot)
JZdziarski Sep 16, 2016 5:55 AM (in response to JZdziarski)it looks like that err is EPERM; is there any other way to tell if I'm in safe boot from kpi?
-
Re: can't sysctlbyname(kern.safeboot)
JZdziarski Oct 21, 2016 9:00 AM (in response to JZdziarski)So it's looking like there must be no way to do this with the KPI, as nobody's responded with anything... normally this is something I'd do from userland, but in safe boot mode, no launch daemons or launch agents starts for me to connect to. Is there any good, safe code example somewhere to demonstrate how to spawn a new process from kernel space? I know some applications like VirtualBox do this, but I've been trying to avoid it if necessary. I suspect the only way to tell (reliably) if I'm in safe boot is to spawn a user process from the kernel, then have it pull this var for me. Open to any other suggestions.
-
Re: can't sysctlbyname(kern.safeboot)
eskimo Oct 24, 2016 2:15 AM (in response to JZdziarski)Is there any good, safe code example somewhere to demonstrate how to spawn a new process from kernel space?
There is no supported way to do that.
Getting back to the safe boot issue, I took a quick look into this earlier and couldn’t find any good options. If you want someone to dig deeper into this, my recommendation is that you open a DTS tech support incident.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
Re: can't sysctlbyname(kern.safeboot)
JZdziarski Oct 25, 2016 6:38 AM (in response to eskimo)Yeah, did open one a few days ago... not sure how long it typically takes to hear back, but I've heard they usually have pretty ingenous ideas / workarounds.
-
Re: can't sysctlbyname(kern.safeboot)
eskimo Oct 26, 2016 2:05 AM (in response to JZdziarski)Can you post the follow-up number you got? [Or, if you don’t want that public, email it to me; my address is in my signature.]
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
-
-
-
-
Re: can't sysctlbyname(kern.safeboot)
JZdziarski Oct 28, 2016 11:01 AM (in response to JZdziarski)For anyone else dealing with this, the workaround was to parse the boot args for -x:
char namep[16];
if (PE_parse_boot_argn("-x", namep, sizeof (namep)))
{
// safe boot
}
Thanks, DTS!