Chameleon

Chameleon Commit Details

Date:2014-11-15 04:43:15 (9 years 5 months ago)
Author:ErmaC
Commit:2485
Parents: 2484
Message:Merged proposed patch by N3 (Boot from vanilla Recovery HD, Installation DMG)
Changes:
M/trunk/i386/boot2/boot.c
M/trunk/i386/libsaio/state_generator.c
M/trunk/i386/boot2/gui.c
M/trunk/i386/libsaio/disk.c
M/trunk/CHANGES
M/trunk/i386/libsaio/stringTable.c

File differences

trunk/i386/libsaio/disk.c
15811581
15821582
15831583
1584
1584
1585
15851586
15861587
15871588
1589
15881590
15891591
1590
1592
1593
15911594
1592
1595
1596
15931597
15941598
15951599
1596
1600
15971601
15981602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
15991624
16001625
16011626
......
16391664
16401665
16411666
1642
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
16431680
16441681
16451682
config_file_t systemVersion;
char dirSpec[512];
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/SystemVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
// OS X Recovery
sprintf(dirSpec, "hd(%d,%d)/com.apple.recovery.boot/SystemVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
{
bvr->OSisInstaller = true;
valid = true;
}
else
if (!valid)
{
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/ServerVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
// OS X Standard
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/SystemVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
{
bvr->OSisServer = true;
bvr->OSisInstaller = true;
valid = true;
}
else
{
// OS X Server
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/ServerVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
{
bvr->OSisServer = true;
valid = true;
}
/*else
{
sprintf(dirSpec, "hd(%d,%d)/.IAProductInfo", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
{
}
}
*/
}
}
if (valid)
}
else
{
close(fh);
sprintf(dirSpec, "hd(%d,%d)/.IAPhysicalMedia", BIOS_DEV_UNIT(bvr), bvr->part_no);
fh = open(dirSpec, 0);
if (fh >= 0)
{
valid = true;
bvr->OSisInstaller = true;
strcpy(bvr->OSVersion, "10.9"); // 10.9 +
}
else
{
close(fh);
}
}
}
return valid;
trunk/i386/libsaio/stringTable.c
614614
615615
616616
617
618
617
618
619
620
621
619622
620623
621624
int loadSystemConfig(config_file_t *config)
{
char *dirspec[] = {
"/OS X Install Data/com.apple.Boot.plist",
"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",
"/Mac OS X Install Data/com.apple.Boot.plist",// OS X Installer (Lion 10.7)
"/OS X Install Data/com.apple.Boot.plist",// OS X Installer (10.8+)
"/.IABootFiles/com.apple.Boot.plist",// OS X Installer
"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",// com.boot.Apple.plist
"/com.apple.recovery.boot/com.apple.Boot.plist"// OS X Recovery
};
int i, fd, count, ret=-1;
trunk/i386/libsaio/state_generator.c
6969
7070
7171
72
7372
7473
7574
......
228227
229228
230229
231
232
230
231
233232
234
235
236
237
238
239
233
234
235
236
237
238
240239
241
242
243
244
245
240
241
242
243
244
246245
247246
248
249
250
251
247
248
249
250
251
252
253
254
252255
253256
254257
0x00, 0x00, 0x00, 0x79, 0x00,
};
struct acpi_2_ssdt *generate_pss_ssdt(struct acpi_2_dsdt* dsdt)
{
break;
}
case CPUID_MODEL_FIELDS:// Intel Core i5, i7, Xeon X34xx LGA1156 (45nm)
case CPUID_MODEL_DALES:
case CPUID_MODEL_DALES_32NM:// Intel Core i3, i5 LGA1156 (32nm)
case CPUID_MODEL_DALES://
case CPUID_MODEL_DALES_32NM:// Intel Core i3, i5 LGA1156 (32nm)
case CPUID_MODEL_NEHALEM:// Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm)
case CPUID_MODEL_NEHALEM_EX:// Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65xx
case CPUID_MODEL_WESTMERE:// Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core
case CPUID_MODEL_WESTMERE_EX:// Intel Xeon E7
case CPUID_MODEL_SANDYBRIDGE:// Intel Core i3, i5, i7 LGA1155 (32nm)
case CPUID_MODEL_JAKETOWN:// Intel Core i7, Xeon E5 LGA2011 (32nm)
case CPUID_MODEL_IVYBRIDGE:// Intel Core i3, i5, i7 LGA1155 (22nm)
case CPUID_MODEL_NEHALEM_EX:// Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65xx
case CPUID_MODEL_WESTMERE:// Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core
case CPUID_MODEL_WESTMERE_EX:// Intel Xeon E7
case CPUID_MODEL_SANDYBRIDGE:// Intel Core i3, i5, i7 LGA1155 (32nm)
case CPUID_MODEL_JAKETOWN:// Intel Core i7, Xeon E5 LGA2011 (32nm)
case CPUID_MODEL_IVYBRIDGE:// Intel Core i3, i5, i7 LGA1155 (22nm)
case CPUID_MODEL_HASWELL://
case CPUID_MODEL_IVYBRIDGE_XEON: //
//case CPUID_MODEL_HASWELL_H://
case CPUID_MODEL_HASWELL_SVR://
case CPUID_MODEL_HASWELL_ULT://
case CPUID_MODEL_CRYSTALWELL://
case CPUID_MODEL_IVYBRIDGE_XEON://
//case CPUID_MODEL_HASWELL_H://
case CPUID_MODEL_HASWELL_SVR://
case CPUID_MODEL_HASWELL_ULT://
case CPUID_MODEL_CRYSTALWELL://
{
if ((Platform.CPU.Model == CPUID_MODEL_SANDYBRIDGE) || (Platform.CPU.Model == CPUID_MODEL_JAKETOWN) ||
(Platform.CPU.Model == CPUID_MODEL_IVYBRIDGE) || (Platform.CPU.Model == CPUID_MODEL_HASWELL) ||
(Platform.CPU.Model == CPUID_MODEL_IVYBRIDGE_XEON) || (Platform.CPU.Model == CPUID_MODEL_HASWELL_SVR) ||
(Platform.CPU.Model == CPUID_MODEL_HASWELL_ULT) || (Platform.CPU.Model == CPUID_MODEL_CRYSTALWELL))
if ( (Platform.CPU.Model == CPUID_MODEL_SANDYBRIDGE) ||
(Platform.CPU.Model == CPUID_MODEL_JAKETOWN) ||
(Platform.CPU.Model == CPUID_MODEL_IVYBRIDGE) ||
(Platform.CPU.Model == CPUID_MODEL_HASWELL) ||
(Platform.CPU.Model == CPUID_MODEL_IVYBRIDGE_XEON) ||
(Platform.CPU.Model == CPUID_MODEL_HASWELL_SVR) ||
(Platform.CPU.Model == CPUID_MODEL_HASWELL_ULT) ||
(Platform.CPU.Model == CPUID_MODEL_CRYSTALWELL) )
{
maximum.Control = (rdmsr64(MSR_IA32_PERF_STATUS) >> 8) & 0xff;
}
trunk/i386/boot2/boot.c
314314
315315
316316
317
317
318318
319319
320320
321321
322
322
323323
324324
325325
326326
327
327
328328
329329
330
330
331331
332
332
333
334
335
336
337
338
333339
334340
335341
// If boot from a boot helper partition check the kernel cache file on it
if (gBootVolume->flags & kBVFlagBooter)
{
snprintf(kernelCachePath, sizeof(kernelCachePath), "com.apple.boot.P%s", kernelCacheFile);
snprintf(kernelCachePath, sizeof(kernelCachePath), "/com.apple.boot.P/%s", kernelCacheFile);
ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime);
if ((ret == -1) || ((flags & kFileTypeMask) != kFileTypeFlat))
{
snprintf(kernelCachePath, sizeof(kernelCachePath), "com.apple.boot.R%s", kernelCacheFile);
snprintf(kernelCachePath, sizeof(kernelCachePath), "/com.apple.boot.R/%s", kernelCacheFile);
ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime);
if ((ret == -1) || ((flags & kFileTypeMask) != kFileTypeFlat))
{
snprintf(kernelCachePath, sizeof(kernelCachePath), "com.apple.boot.S%s", kernelCacheFile);
snprintf(kernelCachePath, sizeof(kernelCachePath), "/com.apple.boot.S/%s", kernelCacheFile);
ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime);
if ((flags & kFileTypeMask) != kFileTypeFlat)
if ((ret == -1) || ((flags & kFileTypeMask) != kFileTypeFlat))
{
ret = -1;
snprintf(kernelCachePath, sizeof(kernelCachePath), "/com.apple.recovery.boot/kernelcache", kernelCacheFile);
ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime);
if ((flags & kFileTypeMask) != kFileTypeFlat)
{
ret = -1;
}
}
}
}
trunk/i386/boot2/gui.c
990990
991991
992992
993
994
995
996
997
998
993
994
995
996
997
998
999999
10001000
10011001
......
10301030
10311031
10321032
1033
1033
10341034
10351035
10361036
{
// ErmaC : TODO test needed for recovery icon
// Use HFSRECOVERY icon.
//if (device->flags & kBVFlagBooter)
//{
//devicetype = iDeviceHFSRECOVERY;
//}
//else
//{
if (device->flags & kBVFlagBooter)
{
devicetype = iDeviceHFSRECOVERY;
}
else
{
// Use HFS or HFSRAID icon depending on bvr flags. Fallbacks are handled by alt_image above.
switch (device->OSVersion[3]) {
devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID : iDeviceHFS);
break;
}
//}
}
break;
trunk/CHANGES
33
44
55
6
67
78
89
- ErmaC : Rename CPU_MODEL_xxx into CPUID_MODEL_xxx follow Apple source name
- ErmaC : Rename decompress_lzvn function to lzvn_decode follow Apple source name.
- ErmaC : Split out states generator from acpi_patcher (Credits to Clover Teams)
- ErmaC : Merged proposed patch by N3 (Boot from vanilla Recovery HD, Installation DMG)
- bitshoveler : Fix "sed: RE error: illegal byte sequence", which turns out to be from feeding sed a TIFF file (buildpkg.sh)
- bitshoveler : CacheInit(), CacheRead() prototypes: use u_int32_t instead of long where appropriate (saio_internal.h)
- bitshoveler : Improved defensiveness against malloc failure (disk.c)

Archive Download the corresponding diff file

Revision: 2485