Chameleon

Chameleon Commit Details

Date:2010-08-10 10:57:58 (13 years 8 months ago)
Author:Azimutz
Commit:345
Parents: 344
Message:Spreading the "goto" disease :) Adding same functionality to smbios.plist loading. Here was were i lost the patience for /Extra path! Anyway, now we have drivers, dsdt and smbios, loading without user intervention from: - rd(0,0)/ - bt(0,0)/Extra/OSspecificFolders - bt(0,0)/Extra - and rdbt
Changes:
M/branches/azimutz/CleanCut/i386/libsaio/fake_efi.c
M/branches/azimutz/CleanCut/i386/boot2/boot.h

File differences

branches/azimutz/CleanCut/i386/libsaio/fake_efi.c
624624
625625
626626
627
627
628628
629
629
630
631
632
630633
631634
632
633
635
636
634637
635
636
638
639
640
641
642
637643
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
644671
645672
646673
......
678705
679706
680707
681
708
682709
683710
684711
* Load the smbios.plist override config file if any
*/
static void setupSmbiosConfigFile()
static void setupSmbiosConfigFile(const char *filename)
{
const char * value = getStringForKey(kSMBIOS, &bootInfo->bootConfig);
chardirSpecSMBIOS[128] = "";
const char *override_pathname = NULL;
intlen = 0, fd = 0;
extern char gMacOSVersion;
extern void scan_mem();
if (!value) value = "/Extra/smbios.plist";
if (loadConfigFile(value, &bootInfo->smbiosConfig) == -1)
// Take in account user overriding
if (getValueForKey(kSMBIOSKey, &override_pathname, &len, &bootInfo->bootConfig))
{
verbose("No SMBIOS replacement found\n");
}
// Specify a path to a file, e.g. /Extra/macProXY.plist
sprintf(dirSpecSMBIOS, override_pathname);
fd = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig);
if (fd >= 0) goto success_fd;
}
// get a chance to scan mem dynamically if user asks for it while having the config options loaded as well
// as opposed to when it was in scan_platform(), also load the orig. smbios so that we can access dmi info without
// patching the smbios yet
getSmbios(SMBIOS_ORIGINAL);
scan_mem();
smbios_p = (EFI_PTR32) getSmbios(SMBIOS_PATCHED); // process smbios asap
// Check rd's root.
sprintf(dirSpecSMBIOS, "rd(0,0)/%s", filename);
fd = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig);
if (fd >= 0) goto success_fd;
// Check booter volume/rdbt for OS specific folders.
sprintf(dirSpecSMBIOS, "bt(0,0)/Extra/%s/%s", &gMacOSVersion, filename);
fd = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig);
if (fd >= 0) goto success_fd;
// Check booter volume/rdbt Extra.
sprintf(dirSpecSMBIOS, "bt(0,0)/Extra/%s", filename);
fd = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig);
if (fd >= 0) goto success_fd;
if (loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig) == -1)
{
verbose("No SMBIOS replacement provided.\n");
}
// get a chance to scan mem dynamically if user asks for it while having the config options loaded as well,
// as opposed to when it was in scan_platform(); also load the orig. smbios so that we can access dmi info without
// patching the smbios yet
success_fd:
getSmbios(SMBIOS_ORIGINAL);
scan_mem();
smbios_p = (EFI_PTR32)getSmbios(SMBIOS_PATCHED);// process smbios asap
}
/*
setup_pci_devs(root_pci_dev);
// load smbios.plist file if any
setupSmbiosConfigFile();
setupSmbiosConfigFile("smbios.plist");
// Initialize the base table
if (archCpuType == CPU_TYPE_I386)
branches/azimutz/CleanCut/i386/boot2/boot.h
7878
7979
8080
81
81
8282
8383
8484
#define kDeviceProperties"device-properties"// device_inject.c
#define kHidePartition"Hide Partition"// disk.c
#define kRenamePartition"Rename Partition"// disk.c
#define kSMBIOS"SMBIOS"// fake_efi.c
#define kSMBIOSKey"SMBIOS"// fake_efi.c
#define kSystemID"SystemId"// fake_efi.c
#define kSystemType"SystemType"// fake_efi.c
#define kUseNvidiaROM"UseNvidiaROM"// nvidia.c

Archive Download the corresponding diff file

Revision: 345