Chameleon

Chameleon Commit Details

Date:2011-09-11 01:19:00 (8 years 1 month ago)
Author:ErmaC
Commit:1524
Parents: 1523
Message:Merge last changes from chimera branch, also add the choice (and tiny description English&Italian for now...) for builded pkg (SkipFTFix flag).
Changes:
A/branches/ErmaC/package/Scripts/BaseOptions/SkipFTFix/postinstall
A/branches/ErmaC/package/Scripts/BaseOptions/SkipFTFix
M/branches/ErmaC/i386/libsaio/fake_efi.c
M/branches/ErmaC/package/Resources/en.lproj/Localizable.strings
M/branches/ErmaC/i386/boot2/boot.h
M/branches/ErmaC/package/Resources/It.lproj/Welcome.rtfd/TXT.rtf
M/branches/ErmaC/i386/libsaio/ati.c
M/branches/ErmaC/package/Resources/It.lproj/Localizable.strings
M/branches/ErmaC/i386/libsaio/gma.c

File differences

branches/ErmaC/i386/libsaio/gma.c
4646
4747
4848
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
49109
50110
51111
......
67127
68128
69129
130
131
132
133
134
135
70136
71137
72138
......
88154
89155
90156
157
91158
92159
93160
......
95162
96163
97164
165
98166
99167
100168
......
155223
156224
157225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
158287
159288
160289
{ 0x00,0x00,0x00,0x00 }
};
uint8_t HD2000_vals[16][4] = {
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x14,0x00,0x00,0x00 },
{ 0xfa,0x00,0x00,0x00 },
{ 0x2c,0x01,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x14,0x00,0x00,0x00 },
{ 0xf4,0x01,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x01,0x00,0x00,0x00 },
};
uint8_t HD3000_vals[16][4] = {
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x14,0x00,0x00,0x00 },
{ 0xfa,0x00,0x00,0x00 },
{ 0x2c,0x01,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x14,0x00,0x00,0x00 },
{ 0xf4,0x01,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x01,0x00,0x00,0x00 },
};
uint8_t HD2000_tbl_info[18] = {
0x30,0x44,0x02,0x02,0x02,0x02,0x00,0x00,0x00,
0x00,0x01,0x02,0x02,0x02,0x00,0x01,0x02,0x02
};
uint8_t HD2000_os_info[20] = {
0x30,0x49,0x01,0x11,0x11,0x11,0x08,0x00,0x00,0x01,
0xf0,0x1f,0x01,0x00,0x00,0x00,0x10,0x07,0x00,0x00
};
// The following values came from a Sandy Bridge MacBook Air
uint8_t HD3000_tbl_info[18] = {
0x30,0x44,0x02,0x02,0x02,0x02,0x00,0x00,0x00,
0x00,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01
};
// The following values came from a Sandy Bridge MacBook Air
uint8_t HD3000_os_info[20] = {
0x30,0x49,0x01,0x12,0x12,0x12,0x08,0x00,0x00,0x01,
0xf0,0x1f,0x01,0x00,0x00,0x00,0x10,0x07,0x00,0x00
};
uint8_t reg_TRUE[]= { 0x01, 0x00, 0x00, 0x00 };
uint8_t reg_FALSE[] = { 0x00, 0x00, 0x00, 0x00 };
{ 0x80862A13, "GMAX3100"},
{ 0x80862A42, "GMAX3100"},
{ 0x80862A43, "GMAX3100"},
{ 0x80860102, "Intel HD Graphics 2000"},
{ 0x80860106, "Intel HD Graphics 2000 Mobile"},
{ 0x80860112, "Intel HD Graphics 3000"},
{ 0x80860116, "Intel HD Graphics 3000 Mobile"},
{ 0x80860122, "Intel HD Graphics 3000"},
{ 0x80860126, "Intel HD Graphics 3000 Mobile"},
};
char *get_gma_model(uint32_t id) {
char*model;
uint8_t BuiltIn =0x00;
uint8_t ClassFix[4] ={ 0x00, 0x00, 0x03, 0x00 };
unsigned intdevice_id;
devicepath = get_pci_dev_path(gma_dev);
regs = (uint8_t *) (bar[0] & ~0x0f);
model = get_gma_model((gma_dev->vendor_id << 16) | gma_dev->device_id);
device_id = gma_dev->device_id;
verbose("Intel %s [%04x:%04x] :: %s\n",
model, gma_dev->vendor_id, gma_dev->device_id, devicepath);
devprop_add_value(device, "AAPL01,Stretch",GMAX3100_vals[21], 4);
devprop_add_value(device, "class-code",ClassFix, 4);
}
else if (model == (char *)"Intel HD Graphics 2000 Mobile")
{
devprop_add_value(device, "class-code", ClassFix, 4);
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
devprop_add_value(device, "AAPL00,PixelFormat", HD2000_vals[0], 4);
devprop_add_value(device, "AAPL00,T1", HD2000_vals[1], 4);
devprop_add_value(device, "AAPL00,T2", HD2000_vals[2], 4);
devprop_add_value(device, "AAPL00,T3", HD2000_vals[3], 4);
devprop_add_value(device, "AAPL00,T4", HD2000_vals[4], 4);
devprop_add_value(device, "AAPL00,T5", HD2000_vals[5], 4);
devprop_add_value(device, "AAPL00,T6", HD2000_vals[6], 4);
devprop_add_value(device, "AAPL00,T7", HD2000_vals[7], 4);
devprop_add_value(device, "AAPL00,LinkType", HD2000_vals[8], 4);
devprop_add_value(device, "AAPL00,LinkFormat", HD2000_vals[9], 4);
devprop_add_value(device, "AAPL00,DualLink", HD2000_vals[10], 4);
devprop_add_value(device, "AAPL00,Dither", HD2000_vals[11], 4);
devprop_add_value(device, "AAPL00,DataJustify", HD3000_vals[12], 4);
devprop_add_value(device, "graphic-options", HD2000_vals[13], 4);
devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20);
}
else if (model == (char *)"Intel HD Graphics 3000 Mobile")
{
devprop_add_value(device, "class-code", ClassFix, 4);
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
devprop_add_value(device, "AAPL00,PixelFormat", HD3000_vals[0], 4);
devprop_add_value(device, "AAPL00,T1", HD3000_vals[1], 4);
devprop_add_value(device, "AAPL00,T2", HD3000_vals[2], 4);
devprop_add_value(device, "AAPL00,T3", HD3000_vals[3], 4);
devprop_add_value(device, "AAPL00,T4", HD3000_vals[4], 4);
devprop_add_value(device, "AAPL00,T5", HD3000_vals[5], 4);
devprop_add_value(device, "AAPL00,T6", HD3000_vals[6], 4);
devprop_add_value(device, "AAPL00,T7", HD3000_vals[7], 4);
devprop_add_value(device, "AAPL00,LinkType", HD3000_vals[8], 4);
devprop_add_value(device, "AAPL00,LinkFormat", HD3000_vals[9], 4);
devprop_add_value(device, "AAPL00,DualLink", HD3000_vals[10], 4);
devprop_add_value(device, "AAPL00,Dither", HD3000_vals[11], 4);
devprop_add_value(device, "AAPL00,DataJustify", HD3000_vals[12], 4);
devprop_add_value(device, "graphic-options", HD3000_vals[13], 4);
devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20);
}
else if (model == (char *)"Intel HD Graphics 2000")
{
devprop_add_value(device, "built-in", &BuiltIn, 1);
devprop_add_value(device, "class-code", ClassFix, 4);
devprop_add_value(device, "device-id", (uint8_t*)&device_id, sizeof(device_id));
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20);
}
else if (model == (char *)"Intel HD Graphics 3000")
{
devprop_add_value(device, "built-in", &BuiltIn, 1);
devprop_add_value(device, "class-code", ClassFix, 4);
device_id = 0x00000126;// Inject a valid mobile GPU device id instead of patching kexts
devprop_add_value(device, "device-id", (uint8_t*)&device_id, sizeof(device_id));
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20);
}
stringdata = malloc(sizeof(uint8_t) * string->length);
if (!stringdata)
branches/ErmaC/i386/libsaio/ati.c
496496
497497
498498
499
499
500
501
500502
501503
502504
503
505
504506
505507
506508
......
552554
553555
554556
557
558
555559
560
561
556562
563
564
565
566
567
568
569
570
557571
558572
559573
574
575
576
577
560578
561579
562580
......
564582
565583
566584
585
586
567587
568
569
588
589
590
591
592
593
594
570595
571596
572597
598
599
573600
601
602
574603
575604
576605
......
659688
660689
661690
662
691
663692
664
693
665694
666695
696
697
667698
668
699
669700
670701
671702
{ 0x68B8,0x200B1787, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0x22881787, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68BF,0x220E1458, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 6750",kVervet},
{ 0x68C0,0x1594103C, CHIP_FAMILY_REDWOOD,"AMD Radeon HD 6570M",kNull},
{ 0x68C0,0x392717AA, CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5730",kNull},
{ 0x68C1,0x033E1025, CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5650",kNull},
{ 0x68C8,0x2306103C, CHIP_FAMILY_REDWOOD,"ATI FirePro V4800 (FireGL)",kNull},
{ 0x6718,0x31301682, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970",kNull},
{ 0x6738,0x00D01002,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x21FA1002,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x67381002, CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x21FA1458,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x31031682,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x31041682,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0xE178174B,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x20101787,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x23051787,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6739,0x67391002, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6739,0x21F81458, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6739,0x24411462, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6739,0xE177174B,CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6740,0x1657103C, CHIP_FAMILY_TURKS,"AMD Radeon HD 6770M",kNull},
{ 0x6741,0x05131025, CHIP_FAMILY_TURKS,"AMD Radeon HD 6650M",kNull},
{ 0x6741,0x1646103C, CHIP_FAMILY_TURKS,"AMD Radeon HD 6750M",kNull},
{ 0x6741,0x9080104D, CHIP_FAMILY_TURKS,"AMD Radeon HD 6630M",kNull},
{ 0x6758,0x67581002,CHIP_FAMILY_TURKS,"AMD Radeon HD 6670",kBulrushes},
{ 0x6741,0x9080104D, CHIP_FAMILY_TURKS,"AMD Radeon HD 6630M",kNull,},
{ 0x6758,0x22051458,CHIP_FAMILY_TURKS,"AMD Radeon HD 6670",kBulrushes},
{ 0x6758,0x31811682,CHIP_FAMILY_TURKS,"AMD Radeon HD 6670",kBulrushes},
{ 0x6758,0x31831682,CHIP_FAMILY_TURKS,"AMD Radeon HD 6670",kBulrushes},
{ 0x6758,0xE1941746,CHIP_FAMILY_TURKS,"AMD Radeon HD 6670",kBulrushes},
{ 0x6759,0xE193174B, CHIP_FAMILY_TURKS,"AMD Radeon HD 6570",kNull},
{ 0x6760,0x1CB21043, CHIP_FAMILY_RV730,"AMD Radeon HD 6470M",kNull},
{ 0x6779,0x64501092,CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450",kBulrushes},
{ 0x6779,0xE164174B,CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450",kBulrushes},
/* standard/default models */
{ 0x9400,0x00000000, CHIP_FAMILY_R600,"ATI Radeon HD 2900 XT",kNull},
{ 0x9405,0x00000000, CHIP_FAMILY_R600,"ATI Radeon HD 2900 GT",kNull},
{ 0x673E,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6790 Series",kNull},
{ 0x6740,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6700M Series",kNull},
{ 0x6741,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6600/6700M Series",kNull},
{ 0x6741,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6600M/6700M Series", kNull},
{ 0x6758,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670 Series",kNull},
{ 0x6758,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670 Series",kBulrushes},
{ 0x6759,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6500 Series",kNull},
{ 0x6760,0x00000000, CHIP_FAMILY_RV730,"AMD Radeon HD 6470M",kNull},
{ 0x6770,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400 Series",kNull},
{ 0x6779,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450 Series",kNull},
{ 0x6779,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450 Series",kBulrushes},
{ 0x0000,0x00000000, CHIP_FAMILY_UNKNOW,NULL,kNull}
};
branches/ErmaC/i386/libsaio/fake_efi.c
434434
435435
436436
437
438
439
440
437441
438442
439443
......
602606
603607
604608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
605624
606625
607626
static const char const SYSTEM_TYPE_PROP[] = "system-type";
static const char const MODEL_PROP[] = "Model";
static const char const BOARDID_PROP[] = "board-id";
// Facetime fix from olegpronin @ insanelymac
// Breaks booting from RAID
static const char const BOOT_UUID_PROP[] = "boot-uuid";
static char uuidStr[64];
/*
* Get an smbios option string option to convert to EFI_CHAR16 string
// Fill /efi/device-properties node.
setupDeviceProperties(node);
// Facetime fix from olegpronin @ insanelymac
// Thanks to Lnx2Mac for the idea of using the key SkipFTFix=Yes as a temporary work around for this breaking RAID booting
bool skipFTFix=false;
getBoolForKey(kSkipFTFix, &skipFTFix, &bootInfo->chameleonConfig);
if (!skipFTFix) {
//Facetime temp fix start
Node *ChoosenNode;
if (gBootVolume->fs_getuuid && gBootVolume->fs_getuuid (gBootVolume, uuidStr) == 0)
{
ChoosenNode = DT__FindNode("/chosen", false);
DT__AddProperty(ChoosenNode, BOOT_UUID_PROP, 64, uuidStr);
}
//Facetime fix end
}
}
/*
branches/ErmaC/i386/boot2/boot.h
101101
102102
103103
104
104105
105106
106107
#define kSMBIOSdefaults"SMBIOSdefaults"/* smbios_patcher.c */
#define kSystemID"SystemId"/* fake_efi.c */
#define kSystemType"SystemType"/* fake_efi.c */
#define kSkipFTFix"SkipFTFix"/* fake_efi.c */ //For Work around to bypass olegpronin's Facetime fix
#define kUseMemDetect"UseMemDetect" /* platform.c */
branches/ErmaC/package/Scripts/BaseOptions/SkipFTFix/postinstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python
# Script to add SkipFTFix for Chameleon boot loaders
import sys
import os
import shutil
vol = str(sys.argv[3])
boot = "/Extra/org.chameleon.Boot.plist"
plist = vol + boot
if not os.path.exists(plist):
shutil.copy('/Library/Preferences/SystemConfiguration/com.apple.Boot.plist', plist)
infile = open(plist, "r")
# check if SkipFTFix has been written or not
SkipFTFixCheck = False
body = ""
for line in infile:
# if we finish the tags and haven't written SkipFTFix Yet
if "</dict>" in line and SkipFTFixCheck == False:
line = " <key>SkipFTFix</key>\n"
line += " <string>Yes</string>\n"
line += "</dict>\n"
SkipFTFixCheck = True
body += line
infile.close()
outfile = open(plist, "w")
outfile.write(body)
outfile.close()
branches/ErmaC/package/Resources/It.lproj/Welcome.rtfd/TXT.rtf
3333
3434
3535
36
36
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\fs26 \cf0 Copyright \'a9 2011
\b \cf3 Italian translation: ErmaC e scrax}
\b \cf3 Tradotto da : ErmaC e scrax}

Archive Download the corresponding diff file

Revision: 1524