Chameleon

Chameleon Commit Details

Date:2011-11-05 23:23:18 (7 years 11 months ago)
Author:MacMan
Commit:1691
Parents: 1690
Message:Chimera 1.6.0: Back ported 2.1svn r1649 FaceTime Fix, enhanced verbose messages in ati.c and added additional AMD graphics card support. Sorry for the confusion,
Changes:
M/branches/Chimera/i386/libsaio/fake_efi.c
M/branches/Chimera/i386/libsaio/nvidia.c
M/branches/Chimera/i386/boot2/boot.h
M/branches/Chimera/i386/libsaio/ati.c
M/branches/Chimera/i386/boot2/options.c
M/branches/Chimera/package/Scripts/Standard/postinstall
M/branches/Chimera/i386/boot2/prompt.c
M/branches/Chimera/i386/boot2/boot.c

File differences

branches/Chimera/i386/libsaio/nvidia.c
801801
802802
803803
804
804805
805806
806807
{ 0x10DE1040, "GeForce GT 520" },
// 1050 - 105F
{ 0x10DE1050, "GeForce GT 520M" },
{ 0x10DE1056, "Quadro NVS 4200M" },
// 1060 - 106F
// 1070 - 107F
// 1080 - 108F
branches/Chimera/i386/libsaio/ati.c
398398
399399
400400
401
402
403401
404402
405403
......
410408
411409
412410
413
411
414412
415413
416414
......
480478
481479
482480
483
481
482
484483
485484
486485
......
490489
491490
492491
492
493493
494494
495495
......
501501
502502
503503
504
505
504506
505507
508
509
506510
507511
508512
......
572576
573577
574578
579
580
575581
576
582
577583
584
578585
579586
580587
581588
582589
590
591
583592
584593
585594
586595
596
597
587598
588599
589600
......
592603
593604
594605
595
606
596607
608
609
597610
598611
599612
600
613
601614
602615
603616
......
681694
682695
683696
697
698
684699
685700
686701
687702
688703
689704
690
705
691706
692707
708
709
710
693711
694
695
696712
697713
698714
......
13051321
13061322
13071323
1308
1324
1325
13091326
13101327
13111328
......
13131330
13141331
13151332
1316
1333
13171334
13181335
13191336
......
13271344
13281345
13291346
1330
1347
13311348
13321349
13331350
......
14381455
14391456
14401457
1441
1442
1443
1458
1459
14441460
14451461
1462
14461463
14471464
14481465
{ 0x9589,0x30001462, CHIP_FAMILY_RV630,"ATI Radeon HD 3610",kNull},
{ 0x9589,0x30001642, CHIP_FAMILY_RV630,"ATI Radeon HD 3610",kNull},
{ 0x9589,0x0E41174B, CHIP_FAMILY_RV630,"ATI Radeon HD 3600 Series",kNull},
{ 0x9589,0x30001787, CHIP_FAMILY_RV630,"ATI Radeon HD 3600 Series",kNull},
{ 0x9598,0xB3831002, CHIP_FAMILY_RV635,"ATI All-in-Wonder HD",kNull},
{ 0x9598,0x30001043, CHIP_FAMILY_RV635,"HD3730",kNull},
{ 0x9598,0x30001043, CHIP_FAMILY_RV635,"ATI Radeon HD 3730",kNull},
{ 0x9598,0x30011043, CHIP_FAMILY_RV635,"ATI Radeon HD 4570",kNull},
{ 0x9598,0x3000148C, CHIP_FAMILY_RV635,"ATI Radeon HD 3730",kNull},
{ 0x689C,0x30201682, CHIP_FAMILY_HEMLOCK,"ATI Radeon HD 5970",kUakari},
{ 0x68A1,0x144D103C,CHIP_FAMILY_CYPRESS,"ATI Mobility Radeon HD 5800",kNomascus},
{ 0x68A1,0x144D103C,CHIP_FAMILY_CYPRESS,"ATI Mobility Radeon HD 5850",kNomascus},
{ 0x68A1,0x1522103C, CHIP_FAMILY_CYPRESS,"ATI Mobility Radeon HD 5850",kHoolock},
{ 0x68A8,0x050E1025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M",kUakari},
{ 0x68B8,0x29911682, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0x1482174B, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0xE144174B, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kHoolock},
{ 0x68B8,0xE147174B, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0x21D71458, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",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},
{ 0x68C1,0x9071104D,CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5650",kEulemur},
{ 0x68C8,0x2306103C, CHIP_FAMILY_REDWOOD,"ATI FirePro V4800 (FireGL)",kNull},
{ 0x68D8,0x03561043, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5670",kBaboon},
{ 0x6739,0x24411462, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6739,0x31101682, 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},
{ 0x6740,0x165A103C, CHIP_FAMILY_TURKS,"AMD Radeon HD 6770M",kNull},
{ 0x6741,0x050E1025, CHIP_FAMILY_TURKS,"AMD Radeon HD 6650M",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},
{ 0x6758,0x22051458,CHIP_FAMILY_TURKS,"AMD Radeon HD 6670",kBulrushes},
{ 0x6758,0xE194174B,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},
{ 0x6759,0xE193174B, CHIP_FAMILY_TURKS,"AMD Radeon HD 6570",kNull},
{ 0x6760,0x1CB21043, CHIP_FAMILY_RV730,"AMD Radeon HD 6470M",kNull},
{ 0x6760,0x04CC1028,CHIP_FAMILY_CAICOS,"AMD Radeon HD 6490M",kNull},
{ 0x6760,0x1CB21043, CHIP_FAMILY_CAICOS,"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},
{ 0x6718,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970 Series",kNull},
{ 0x6719,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950 Series",kNull},
{ 0x6720,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6900M Series",kNull},
{ 0x6738,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6870 Series",kDuckweed},
{ 0x6739,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850 Series",kDuckweed},
{ 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 6600M/6700M 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_CAICOS,"AMD Radeon HD 6400M Series",kNull},
{ 0x6761,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6430M 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",kBulrushes},
if (!card->info->device_id || !card->info->cfg_name)
{
printf("Unsupported card!\n");
verbose("Unsupported ATI card! Device ID: [%04x:%04x] Subsystem ID: [%08x] \n",
pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id);
return false;
}
card->mmio= (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_2) & ~0x0f);
card->io= (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_4) & ~0x03);
verbose("Framebuffer @0x%08X MMIO @0x%08XI/O Port @0x%08X ROM Addr @0x%08X\n",
verbose("ATI Framebuffer Addr: @0x%08X MMIO Addr: @0x%08X I/O Port Addr: @0x%08X ROM Addr: @0x%08X\n",
card->fb, card->mmio, card->io, pci_config_read32(pci_dev->dev.addr, PCI_ROM_ADDRESS));
card->posted = radeon_card_posted();
{
if (!load_vbios_file(kUseAtiROM, pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys_id))
{
verbose("reading VBIOS from %s", card->posted ? "legacy space" : "PCI ROM");
verbose("reading Video BIOS from %s", card->posted ? "legacy space" : "PCI ROM");
if (card->posted)
read_vbios(false);
else
stringlength = string->length;
// -------------------------------------------------
verbose("ATI %s %s %dMB (%s) [%04x:%04x] (subsys [%04x:%04x]):: %s\n",
chip_family_name[card->info->chip_family], card->info->model_name,
(uint32_t)(card->vram_size / (1024 * 1024)), card->cfg_name,
verbose("%s %dMB [%04x:%04x] (subsys [%04x:%04x]) (%s:%s) :: %s\n",
card->info->model_name, (uint32_t)(card->vram_size / (1024 * 1024)),
ati_dev->vendor_id, ati_dev->device_id,
ati_dev->subsys_id.subsys.vendor_id, ati_dev->subsys_id.subsys.device_id,
chip_family_name[card->info->chip_family], card->cfg_name,
devicepath);
free(card);
branches/Chimera/i386/libsaio/fake_efi.c
434434
435435
436436
437
438
439
440
441437
442438
443439
......
529525
530526
531527
528
532529
533530
534531
......
606603
607604
608605
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624606
625607
626608
......
639621
640622
641623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
642639
643640
644641
......
702699
703700
704701
702
703
704
705705
706706
707707
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
EFI_CHAR16* ret16 = 0;
size_t len = 0;
Node*node;
node = DT__FindNode("/", false);
// 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
}
}
/*
}
/*
* Populate the chosen node
*/
void setupChosenNode()
{
Node *chosenNode;
chosenNode = DT__FindNode("/chosen", false);
if (chosenNode == 0)
stop("Couldn't get chosen node");
int bootUUIDLength = strlen(gBootUUIDString);
if (bootUUIDLength)
DT__AddProperty(chosenNode, "boot-uuid", bootUUIDLength + 1, gBootUUIDString);
}
/*
* Load the smbios.plist override config file if any
*/
static void setupSmbiosConfigFile(const char *filename)
gST64->Hdr.CRC32 = 0;
gST64->Hdr.CRC32 = crc32(0L, gST64, gST64->Hdr.HeaderSize);
}
// Setup the chosen node
setupChosenNode();
}
void saveOriginalSMBIOS(void)
branches/Chimera/i386/boot2/prompt.c
2828
2929
3030
31
31
3232
3333
3434
#include <vers.h>
char bootBanner[] = "\nDarwin/x86 boot v" I386BOOT_VERSION " - Chimera v1.5.4 r1394" "\n"
char bootBanner[] = "\nDarwin/x86 boot v" I386BOOT_VERSION " - Chimera v" I386BOOT_CHAMELEONVERSION " r" I386BOOT_CHAMELEONREVISION "\n"
"Build date: " I386BOOT_BUILDDATE "\n"
"%dMB memory\n";
branches/Chimera/i386/boot2/boot.c
7272
7373
7474
75
75
7676
7777
7878
static chargCacheNameAdler[64 + 256];
char*gPlatformName = gCacheNameAdler;
chargRootDevice[512];
chargRootDevice[ROOT_DEVICE_SIZE];
chargMKextName[512];
chargMacOSVersion[8];
static chargBootKernelCacheFile[512];
branches/Chimera/i386/boot2/boot.h
101101
102102
103103
104
105104
106105
107106
......
148147
149148
150149
150
151151
152152
153153
......
225225
226226
227227
228
229
230
228
229
230
231
232
231233
232234
233235
#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 */
* A global set by boot() to record the device that the booter
* was loaded from.
*/
#define ROOT_DEVICE_SIZE 512
extern int gBIOSDev;
extern long gBootMode;
extern bool sysConfigValid;
/*
* options.c
*/
extern int getBootOptions(bool firstRun);
extern int processBootOptions();
extern int selectAlternateBootDevice(int bootdevice);
extern char gBootUUIDString[];
extern int getBootOptions(bool firstRun);
extern int processBootOptions();
extern int selectAlternateBootDevice(int bootdevice);
extern bool promptForRescanOption(void);
void showHelp();
branches/Chimera/i386/boot2/options.c
10621062
10631063
10641064
1065
10651066
10661067
10671068
......
10701071
10711072
10721073
1074
1075
1076
10731077
10741078
10751079
......
10801084
10811085
10821086
1083
10841087
1088
10851089
10861090
10871091
......
10991103
11001104
11011105
1102
1103
1104
1106
1107
1108
1109
11051110
11061111
11071112
......
11181123
11191124
11201125
1121
1122
1123
1124
1126
1127
1128
11251129
11261130
11271131
......
11301134
11311135
11321136
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1137
1138
1139
1140
1141
1142
1143
1144
1145
11441146
11451147
11461148
......
11961198
11971199
11981200
1199
1200
1201
12011202
12021203
12031204
1204
1205
1206
12071205
1208
1206
12091207
12101208
12111209
......
12211219
12221220
12231221
1224
1225
1226
1227
1228
1229
1222
1223
1224
12301225
12311226
12321227
12331228
12341229
1235
1236
1230
1231
12371232
1238
1239
1240
1233
1234
1235
12411236
12421237
12431238
1244
1245
1246
1247
1248
1249
1239
1240
1241
1242
1243
1244
1245
12501246
12511247
1252
1248
1249
12531250
12541251
12551252
......
12571254
12581255
12591256
1260
1257
12611258
12621259
12631260
......
12761273
12771274
12781275
1279
1280
1281
1282
1276
1277
1278
1279
1280
12831281
12841282
12851283
......
13231321
13241322
13251323
1326
13271324
1328
1325
1326
13291327
13301328
13311329
......
13371335
13381336
13391337
1340
1338
13411339
13421340
1343
1344
1345
1341
1342
1343
1344
13461345
13471346
1348
1347
13491348
13501349
13511350
1351
1352
1353
1354
1355
13521356
13531357
13541358
//==========================================================================
char gBootUUIDString[32+4+1] = ""; // UUID of the boot volume e.g. 5EB1869F-C4FA-3502-BDEB-3B8ED5D87292
extern unsigned char chainbootdev;
extern unsigned char chainbootflag;
int argLen = argName ? strlen(argName) : 0;
int len = argLen + cnt + 1; // +1 to account for space
if (argName)
len++; // +1 to account for '='
if (len > *cntRemainingP) {
error("Warning: boot arguments too long, truncating\n");
return false;
*argP += argLen;
*argP[0] = '=';
(*argP)++;
len++; // +1 to account for '='
}
strncpy( *argP, val, cnt );
*argP += cnt;
*argP[0] = ' ';
const char *userString, // Typed-in boot arguments
const char *kernelFlags, // Kernel flags from config table
const char *configTable,
char **argP, // Output value
int *cntRemainingP, // Output count
char *foundVal // found value
char **argP, // Output value
int *cntRemainingP, // Output count
char *foundVal, // found value
int foundValSize // max found value size
)
{
const char *val;
copyArgument(argName, val, cnt, argP, cntRemainingP);
found = true;
}
if (found && foundVal) {
strlcpy(foundVal, val, cnt+1);
}
return found;
if (found && foundVal)
strlcpy(foundVal, val, foundValSize);
return found;
}
// Maximum config table value size
int
processBootOptions()
{
const char * cp = gBootArgs;
const char * val = 0;
const char * kernel;
int cnt;
int userCnt;
int cntRemaining;
char * argP;
char uuidStr[64];
bool uuidSet = false;
char * configKernelFlags;
char * valueBuffer;
const char*cp = gBootArgs;
const char*val = 0;
const char*kernel;
intcnt;
intuserCnt;
intcntRemaining;
char*argP;
char*configKernelFlags;
char*valueBuffer;
valueBuffer = malloc(VALUE_SIZE);
gOverrideKernel = false;
if (( kernel = extractKernelName((char **)&cp) )) {
strcpy( bootInfo->bootFile, kernel );
gOverrideKernel = true;
strlcpy( bootInfo->bootFile, kernel, sizeof(bootInfo->bootFile) );
} else {
if ( getValueForKey( kKernelNameKey, &val, &cnt, &bootInfo->bootConfig ) ) {
strlcpy( bootInfo->bootFile, val, cnt+1 );
if (strcmp( bootInfo->bootFile, kDefaultKernel ) != 0) {
gOverrideKernel = true;
}
} else {
strcpy( bootInfo->bootFile, kDefaultKernel );
strlcpy( bootInfo->bootFile, kDefaultKernel, sizeof(bootInfo->bootFile) );
}
}
configKernelFlags = malloc(cnt + 1);
strlcpy(configKernelFlags, val, cnt + 1);
if (processBootArgument(kBootUUIDKey, cp, configKernelFlags, bootInfo->config, &argP, &cntRemaining, 0)) {
// boot-uuid was set either on the command-line
// or in the config file.
uuidSet = true;
} else {
// boot-uuid can be set either on the command-line or in the config file
if (!processBootArgument(kBootUUIDKey, cp, configKernelFlags, bootInfo->config,
&argP, &cntRemaining, gBootUUIDString, sizeof(gBootUUIDString))) {
//
// Try an alternate method for getting the root UUID on boot helper partitions.
//
if (gBootVolume->flags & kBVFlagBooter)
{
if((loadHelperConfig(&bootInfo->helperConfig) == 0)
&& getValueForKey(kHelperRootUUIDKey, &val, &cnt, &bootInfo->helperConfig) )
// Load the configuration store in the boot helper partition
if (loadHelperConfig(&bootInfo->helperConfig) == 0)
{
getValueForKey(kHelperRootUUIDKey, &val, &cnt, &bootInfo->helperConfig);
copyArgument(kBootUUIDKey, val, cnt, &argP, &cntRemaining);
uuidSet = true;
val = getStringForKey(kHelperRootUUIDKey, &bootInfo->helperConfig);
if (val != NULL)
strlcpy(gBootUUIDString, val, sizeof(gBootUUIDString));
}
}
if (!uuidSet && gBootVolume->fs_getuuid && gBootVolume->fs_getuuid (gBootVolume, uuidStr) == 0) {
verbose("Setting boot-uuid to: %s\n", uuidStr);
copyArgument(kBootUUIDKey, uuidStr, strlen(uuidStr), &argP, &cntRemaining);
uuidSet = true;
}
// Try to get the volume uuid string
if (!strlen(gBootUUIDString) && gBootVolume->fs_getuuid)
gBootVolume->fs_getuuid(gBootVolume, gBootUUIDString);
// If we have the volume uuid add it to the commandline arguments
if (strlen(gBootUUIDString))
copyArgument(kBootUUIDKey, gBootUUIDString, strlen(gBootUUIDString), &argP, &cntRemaining);
}
if (!processBootArgument(kRootDeviceKey, cp, configKernelFlags, bootInfo->config, &argP, &cntRemaining, gRootDevice)) {
if (!processBootArgument(kRootDeviceKey, cp, configKernelFlags, bootInfo->config,
&argP, &cntRemaining, gRootDevice, ROOT_DEVICE_SIZE)) {
cnt = 0;
if ( getValueForKey( kBootDeviceKey, &val, &cnt, &bootInfo->chameleonConfig)) {
valueBuffer[0] = '*';
strlcpy(valueBuffer + 1, val, cnt);
val = valueBuffer;
} else {
if (uuidSet) {
if (strlen(gBootUUIDString)) {
val = "*uuid";
cnt = 5;
} else {
/*
* Removed. We don't need this anymore.
*
if (!processBootArgument(kPlatformKey, cp, configKernelFlags, bootInfo->config, &argP, &cntRemaining, gPlatformName)) {
getPlatformName(gPlatformName);
copyArgument(kPlatformKey, gPlatformName, strlen(gPlatformName), &argP, &cntRemaining);
}
if (!processBootArgument(kPlatformKey, cp, configKernelFlags, bootInfo->config,
&argP, &cntRemaining, gPlatformName, sizeof(gCacheNameAdler))) {
getPlatformName(gPlatformName);
copyArgument(kPlatformKey, gPlatformName, strlen(gPlatformName), &argP, &cntRemaining);
}
*/
if (!getValueForBootKey(cp, kSafeModeFlag, &val, &cnt) &&
}
if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) )
{
strlcpy(gMKextName, val, cnt + 1);
}
else
gMKextName[0]=0;
free(configKernelFlags);
free(valueBuffer);
//==========================================================================
// Load the help file and display the file contents on the screen.
static void showTextBuffer(char *buf, int size)
static void showTextBuffer(char *buf_orig, int size)
{
char*bp;
intline;
intline_offset;
intc;
char* buf;
intline;
intline_offset;
intc;
if (bootArgs->Video.v_display != VGA_TEXT_MODE) {
showInfoBox( "Press q to quit\n",buf );
showInfoBox( "Press q to continue, space for next page.\n",buf_orig );
return;
}
// Create a copy so that we don't mangle the original
buf = malloc(size + 1);
memcpy(buf, buf_orig, size);
bp = buf;
while (size-- > 0) {
if (*bp == '\n') {
branches/Chimera/package/Scripts/Standard/postinstall
5050
5151
5252
53
5354
5455
5556
......
291292
292293
293294
294
295
295
296
296297
297298
298
299
299300
300
301
301
302
302303
303304
304305
......
317318
318319
319320
320
321
321
322
322323
323324
324325
......
332333
333334
334335
335
336
336337
337338
338339
......
342343
343344
344345
345
346
346347
347348
348349
......
357358
358359
359360
360
361
362
363
364361
echo "bootdisk: Disk device is ${bootdisk}"
echo "bootrdisk: Disk raw device is ${bootrdisk}"
echo "diskloader: Disk loader is ${diskloader}"
echo "diskloaderdualboot: Disk loader is ${diskloaderdualboot}"
echo "partitionloaderhfs: Partition loader is ${partitionloaderhfs}"
echo "partitionloaderfat: Partition loader is ${partitionloaderfat}"
echo "filesystemloader: Filesystem loader is ${filesystemloader}"
#---------------------------------------------------------------------
if [ ${disksignature} == "00000000" ]; then
echo "Executing command: fdisk440 -u -f /usr/standalone/i386/${diskloader} -y ${bootdisk}"
fdisk440 -u -f "${bootvolume}/usr/standalone/i386/${diskloader}" -y ${bootdisk}
echo "Executing command: ${bootvolume}/usr/sbin/fdisk440 -u -f ${bootvolume}/usr/standalone/i386/${diskloader} -y ${bootdisk}"
"${bootvolume}/usr/sbin/fdisk440" -u -f "${bootvolume}/usr/standalone/i386/${diskloader}" -y ${bootdisk}
else
#---------------------------------------------------------------------
# If it exists then Windows is also installed on the HDD and we need to write boot0hfs
# If it exists then Windows is also installed on the HDD and we need to write $diskloaderdualboot
#---------------------------------------------------------------------
echo "Executing command: fdisk440 -u -f /usr/standalone/i386/${diskloaderdualboot} -y ${bootdisk}"
fdisk440 -u -f "${bootvolume}/usr/standalone/i386/${diskloaderdualboot}" -y ${bootdisk}
echo "Executing command: ${bootvolume}/usr/sbin/fdisk440 -u -f {bootvolume}/usr/standalone/i386/${diskloaderdualboot} -y ${bootdisk}"
"${bootvolume}/usr/sbin/fdisk440" -u -f "${bootvolume}/usr/standalone/i386/${diskloaderdualboot}" -y ${bootdisk}
fi
else
echo "Diskupdate is false, so no stage 0 file was written"
echo "Executing command: cp /usr/standalone/i386/${filesystemloader} ${bootvolume}"
cp "${bootvolume}/usr/standalone/i386/${filesystemloader}" "${bootvolume}"
echo "Executing command: ${bootresources}/Tools/SetFile -a V ${bootvolume}/${filesystemloader}"
"${bootresources}/Tools/SetFile" -a V "${bootvolume}/${filesystemloader}"
echo "Executing command: "${bootvolume}/usr/bin/chflags" hidden ${bootvolume}/${filesystemloader}"
"${bootvolume}/usr/bin/chflags" hidden "${bootvolume}/${filesystemloader}"
echo "-----------------------------------------------"
echo ""
if [ ${disksignature} == "00000000" ]; then
# echo "Windows is not installed so let's change the active partition"
partitionactive=$( fdisk440 -d ${bootrdisk} | grep -n "*" | awk -F: '{print $1}')
partitionactive=$( "${bootvolume}/usr/sbin/fdisk440" -d ${bootrdisk} | grep -n "*" | awk -F: '{print $1}')
echo "Current Active Partition: ${partitionactive}"
if [ "${partitionactive}" = "${bootslice}" ]; then
# BadAxe requires EFI partition to be flagged active.
# but it doesn't' hurt to do it for any non-windows partition.
fdisk440 -e ${bootrdisk} <<-MAKEACTIVE
"${bootvolume}/usr/sbin/fdisk440" -e ${bootrdisk} <<-MAKEACTIVE
print
flag ${bootslice}
write
echo ""
echo ""
# hide boot file
chflags hidden "${3}/boot"
echo "boot file hidden ${3}/boot"
exit

Archive Download the corresponding diff file

Revision: 1691