Chameleon

Chameleon Commit Details

Date:2011-08-16 15:13:46 (12 years 8 months ago)
Author:Evan Lojewski
Commit:1407
Parents: 1406
Message:Revert drivers.c so that kexts are only loaded when OSBundleRequired is set and that value is not safe mode.
Changes:
M/trunk/i386/boot2/drivers.c

File differences

trunk/i386/boot2/drivers.c
726726
727727
728728
729
729
730730
731731
732732
......
746746
747747
748748
749
750
751
752
753
754
755
756
757
758
759
760
749
750
751
752
753
754
755
756
761757
762
763
764
765
766
767
768
769
770
771758
772759
773760
ParseXML( char * buffer, ModulePtr * module, TagPtr * personalities )
{
long length, pos;
TagPtr moduleDict;
TagPtr moduleDict, required;
ModulePtr tmpModule;
pos = 0;
if (length == -1) return -1;
// NOTE: This currenlt knows nothing about /Extra/. If you have a kext in there that
// does not have the required property, it will not load.
char* required = XMLCastString(XMLGetProperty(moduleDict, kPropOSBundleRequired));
if(!required) return -2; // don't load te kext.
// NOTE: Only valid values are
// kOSBundleRequiredConsole - Always required (for text? console)
// kOSBundleRequiredLocalRoot - Required for local disk booting
// kOSBundleRequiredNetworkRoot - required boot from network
// kOSBundleRequiredRoot - always needed
// kOSBundleRequiredSafeBoot - Only loaded for safe mode.
// Others - invalid
required = XMLGetProperty(moduleDict, kPropOSBundleRequired);
if ( (required == 0) ||
(required->type != kTagTypeString) ||
!strcmp(required->string, "Safe Boot"))
{
XMLFreeTag(moduleDict);
return -2;
}
if (!(gBootMode & kBootModeSafe) && strcmp(required, "Safe Boot") == 0)
{
// Don't load Safe Boot kexts if -x not specified.
XMLFreeTag(moduleDict);
return -2;
}
tmpModule = malloc(sizeof(Module));
if (tmpModule == 0)
{

Archive Download the corresponding diff file

Revision: 1407