-/*********************************************************************
-*********************************************************************/
-OSReturn
-KLDBootstrap::readMkextExtensions(
- OSString * deviceTreeName,
- OSData * booterData)
-{
- OSReturn result = kOSReturnError;
-
- uint32_t checksum;
- IORegistryEntry * registryRoot = NULL; // do not release
- OSData * checksumObj = NULL; // must release
-
- OSKextLog(/* kext */ NULL,
- kOSKextLogStepLevel |
- kOSKextLogDirectoryScanFlag | kOSKextLogArchiveFlag,
- "Reading startup mkext archive from device tree entry %s.",
- deviceTreeName->getCStringNoCopy());
-
- /* If we successfully read the archive,
- * then save the mkext's checksum in the IORegistry.
- * assumes we'll only ever have one mkext to boot
- */
- result = OSKext::readMkextArchive(booterData, &checksum);
- if (result == kOSReturnSuccess) {
-
- OSKextLog(/* kext */ NULL,
- kOSKextLogProgressLevel |
- kOSKextLogArchiveFlag,
- "Startup mkext archive has checksum 0x%x.", (int)checksum);
-
- registryRoot = IORegistryEntry::getRegistryRoot();
- assert(registryRoot);
- checksumObj = OSData::withBytes((void *)&checksum, sizeof(checksum));
- assert(checksumObj);
- if (checksumObj) {
- registryRoot->setProperty(kOSStartupMkextCRC, checksumObj);
- }
- }
-
- return result;
-}
-