#include <util.h>
#include <bsm/libbsm.h>
#include <bsm/audit_uevents.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
#include <vproc.h>
#include <vproc_priv.h>
}
+static bool
+kextdDisabled(void)
+{
+ uint32_t disabled = 0;
+ size_t sizeOfDisabled = sizeof(disabled);
+ if (sysctlbyname("hw.use_kernelmanagerd", &disabled, &sizeOfDisabled, NULL, 0) != 0) {
+ return false;
+ }
+ return (disabled != 0);
+}
+
+
// XX copied from reboot.tproj/reboot.c; it would be nice to share the code
#define WAITFORLOCK 1
int busyStatus = ELAST + 1;
mountpoint_t busyVol;
+ if (kextdDisabled()) {
+ /* no need to talk with kextd if it's not running */
+ return 0;
+ }
+
macherr = bootstrap_look_up2(bootstrap_port, KEXTD_SERVER_NAME, &kxport, 0, BOOTSTRAP_PRIVILEGED_SERVER);
if (macherr) goto finish;