Chameleon

Chameleon Commit Details

Date:2014-06-30 14:19:29 (4 years 11 months ago)
Author:ErmaC
Commit:2390
Parents: 2389
Message:Minor typo correct.
Changes:
M/trunk/i386/boot2/drivers.c
M/trunk/i386/boot2/boot.c
M/trunk/i386/boot2/gui.c
M/trunk/i386/libsaio/bootstruct.c
M/trunk/i386/libsaio/disk.c
M/trunk/i386/libsaio/smbios.c
M/trunk/i386/libsaio/ati.c
M/trunk/i386/boot2/lzss.c
M/trunk/i386/boot2/options.c

File differences

trunk/i386/libsaio/bootstruct.c
125125
126126
127127
128
129
130
128
131129
132130
133131
......
156154
157155
158156
159
157
158
160159
161160
162161
void *oldAddr = bootArgs;
bootArgs = (boot_args *)AllocateKernelMemory(sizeof(boot_args));
bcopy(oldAddr, bootArgs, sizeof(boot_args));
}
else
{
} else {
void *oldAddr = bootArgsPreLion;
bootArgsPreLion = (boot_args_pre_lion *)AllocateKernelMemory(sizeof(boot_args_pre_lion));
bcopy(oldAddr, bootArgsPreLion, sizeof(boot_args_pre_lion));
bootArgs->MemoryMapDescriptorSize = sizeof(EfiMemoryRange);
bootArgs->MemoryMapDescriptorVersion = 0;
for (i = 0; i < memoryMapCount; i++, memoryMap++) {
for (i = 0; i < memoryMapCount; i++, memoryMap++)
{
range = &bootInfo->memoryMap[i];
switch(range->type) {
case kMemoryRangeACPI:
trunk/i386/libsaio/ati.c
14391439
14401440
14411441
1442
1442
14431443
14441444
14451445
......
16041604
16051605
16061606
1607
1607
16081608
16091609
16101610
......
16191619
16201620
16211621
1622
1622
16231623
1624
1624
16251625
16261626
16271627
//{ 0x983E,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull },
//{ 0x983F,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull },
// MULLINS
// MULLINS
{ 0x9850,0x00000000, CHIP_FAMILY_MULLINS,"AMD Radeon HD", kNull }, // Mobile
{ 0x9851,0x00000000, CHIP_FAMILY_MULLINS,"AMD Radeon HD", kNull }, // Mobile
{ 0x9852,0x00000000, CHIP_FAMILY_MULLINS,"AMD Radeon HD", kNull }, // Mobile
{ 0x6770,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400 Series",kBulrushes},
{ 0x6772,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7400A Series",kBulrushes},
{ 0x6778,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7000 Series",kBulrushes},
{ 0x6779,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7450 Series",kBulrushes},
{ 0x6779,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450/7450/8450/R5 230",kBulrushes},
{ 0x677B,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7400 Series",kBulrushes},
/* Southen Islands */
{ 0x6790,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6791,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6792,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6798,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7970 X-Edition",kFutomaki},
{ 0x6798,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7970X/8970/R9 280X",kFutomaki},
{ 0x6799,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7990 Series",kAji},
{ 0x679A,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon R9 280",kFutomaki},
{ 0x679A,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7950/8950/R9 280",kFutomaki},
{ 0x679B,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x679E,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7870 XT",kFutomaki},
{ 0x679F,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7950 Series",kFutomaki},
trunk/i386/libsaio/disk.c
15721572
15731573
15741574
1575
1575
1576
15761577
15771578
15781579
......
15821583
15831584
15841585
1585
1586
1587
15861588
15871589
15881590
15891591
1590
1592
1593
15911594
15921595
15931596
const char *val;
int len;
if (getValueForKey(kProductVersion, &val, &len, &systemVersion)) {
if (getValueForKey(kProductVersion, &val, &len, &systemVersion))
{
// getValueForKey uses const char for val
// so copy it and trim
*str = '\0';
}
}
if(!valid) {
if(!valid)
{
int fh = -1;
sprintf(dirSpec, "hd(%d,%d)/.PhysicalMediaInstall", BIOS_DEV_UNIT(bvr), bvr->part_no);
fh = open(dirSpec, 0);
if (fh >= 0) {
if (fh >= 0)
{
valid = true;
bvr->OSisInstaller = true;
strcpy(bvr->OSVersion, "10.7"); // 10.7 +
trunk/i386/libsaio/smbios.c
430430
431431
432432
433
433434
435
434436
435
436
437
438
437
438
439
439440
440
441
442
443
444
445
441446
442
443
444
445
447
448
449
446450
447451
448452
......
458462
459463
460464
465
466
461467
462468
463469
464470
465471
466
467
472
473
474
475
468476
477
478
479
480
481
469482
470483
471484
......
475488
476489
477490
478
479
480
481
491
492
493
494
482495
483
484
496
497
498
499
485500
501
502
503
504
505
486506
487
488
489
490
507
508
509
491510
492511
493512
......
506525
507526
508527
509
528
510529
511530
512531
......
514533
515534
516535
517
536
518537
519538
520
521
522
523
524
539
540
541
542
525543
526544
527545
......
529547
530548
531549
532
533
534
535
550
551
552
536553
554
555
556
557
558
559
560
561
537562
538563
539564
#define kDefaultMacMiniBoardProduct"Mac-F4208EAA"
// MacMini5,1 Mac-8ED6AF5B48C039E1 - MM51.88Z.0077.B0F.1110201309
// MacMini5,2 Mac-4BC72D62AD45599E
// MacMini5,3
//#define kDefaultMacMini"Macmini5,3"
//#define kDefaultMacMiniBIOSVersion" MM51.88Z.0077.B10.1201241549"
//#define kDefaultMacMiniBoardProduct"Mac-F65AE981FFA204ED"
//#define kDefaultMacMiniBIOSReleaseDate"01/24/2012"
// Bios: MM51.88Z.0077.B10.1201241549
// Board: Mac-F65AE981FFA204ED
// Data: 01/24/2012
// MacMini 6,1 - Mac-F65AE981FFA204ED
// MacMini 6,1
// Bios: MM61.88Z.0106.B03.1211161202
// Board: Mac-F65AE981FFA204ED
// Data: 10/14/2012
// MacMini 6,2
//#define kDefaultMacMini62"Macmini6,2"
//#define kDefaultMacMini62BIOSVersion" MM61.88Z.0106.B00.1208091121"
//#define kDefaultMacMini62BoardProduct"Mac-F65AE981FFA204ED"
//#define kDefaultMacMini62BIOSReleaseDate"10/14/2012"
// Bios: MM61.88Z.0106.B03.1211161202
// Board: Mac-FC02E91DDD3FA6A4
// Data: 10/14/2012
//=========== MacBook ===========
#define kDefaultMacBookFamily"MacBook"
// MacBookAir4,1 - Mac-C08A6BB70A942AC2
// MacBookAir4,2 - Mac-742912EFDBEE19B3
// MacBookAir5,2
#define kDefaultMacBookAir"MacBookAir5,2"
#define kDefaultMacBookAirBIOSVersion" MBA51.88Z.00EF.B00.1205221442"
#define kDefaultMacBookAirBIOSReleaseDate"05/10/12"
#define kDefaultMacBookBoardAirProduct"Mac-2E6FAB96566FE58C"
// MacBookAir6,1 - Mac-35C1E88140C3E6CF - MBA61.88Z.0099.B04.1309271229
// MacBookAir6,2 - Mac-7DF21CB3ED6977E5 - MBA62.88Z.00EF.B00.1205221442
// MacBookAir6,1
// Bios: MBA61.88Z.0099.B04.1309271229
// Board: Mac-35C1E88140C3E6CF
// Data: 24/06/13
// MacBookAir6,2
// Bios: MBA62.88Z.00EF.B00.1205221442
// Board: Mac-7DF21CB3ED6977E5
// Data: 24/06/13
//=========== MacBookPro ===========
#define kDefaultMacBookProFamily"MacBook Pro"
//#define kDefaultMacBookProBoardAssetTagNumber"MacBook-Aluminum"
#define kDefaultMacBookProBIOSReleaseDate"02/27/08"
#define kDefaultMacBookProBoardProduct"Mac-F42C89C8"
//#define kDefaultMacBookPro"MacBookPro8,1"
//#define kDefaultMacBookProBIOSVersion" MBP81.88Z.0047.B24.1110141131"
//#define kDefaultMacBookProBoardProduct"Mac-94245B3640C91C81"
//#define kDefaultMacBookProBIOSReleaseDate"10/14/11"
// MacBookPro8,1
// Bios: MBP81.88Z.0047.B24.1110141131
// Board: Mac-94245B3640C91C81
// Data: 10/14/11
// MacBookPro8,2 - Mac_94245A3940C91C80
// MacBookPro8,3 - Mac-942459F5819B171B
// MacBookPro8,2
// Bios:
// Board: Mac_94245A3940C91C80
// Data: 10/14/11
// MacBookPro8,3
// Bios:
// Board: Mac-942459F5819B171B
// Data: 10/31/11
// MacBookPro10,2
//#define kDefaultMacBookProIvy"MacBookPro10,2"
//#define kDefaultMacBookProIvyBIOSVersion" MBP102.88Z.0106.B01.1208311637"
//#define kDefaultMacBookProIvyBoardProduct"Mac-AFD8A9D944EA4843"
//#define kDefaultMacBookProIvyBIOSReleaseDate"10/02/2012"
// Bios: MBP102.88Z.0106.B01.1208311637
// Board: Mac-AFD8A9D944EA4843
// Data: 10/02/2012
// MacBookPro11,2 - Mac-3CBD00234E554E41 - MBP112.88Z.0138.B03.1310291227
// MacBookPro11,3 - Mac-2BD1B31983FE1663 - MBP112.88Z.0138.B02.1310181745
// iMac11,1 core i3/i5/i7
#define kDefaultiMacNehalem"iMac11,1"
#define kDefaultiMacNehalemBIOSVersion" IM111.88Z.0034.B02.1003171314"
#define kDefaultiMacNehalemBIOSReleaseDate"03/30/10"
#define kDefaultiMacNehalemBIOSReleaseDate"03/17/10"
#define kDefaultiMacNehalemBoardProduct"Mac-F2268DAE"
// iMac11,2
// iMac11,3
// iMac12,1
#define kDefaultiMacSandy"iMac12,1"
#define kDefaultiMacSandyBIOSVersion" IM121.88Z.0047.B00.1102091756"
#define kDefaultiMacSandyBIOSReleaseDate"01/02/08"
#define kDefaultiMacSandyBIOSReleaseDate"04/22/11"
#define kDefaultiMacSandyBoardProduct"Mac-942B5BF58194151B"
// iMac12,2 Mac-942B59F58194171B
//#define kDefaultiMacSandy"iMac12,2"
//#define kDefaultiMacSandyBIOSVersion" IM121.88Z.0047.B1D.1110171110"
//#define kDefaultiMacSandyBIOSReleaseDate"10/17/11"
//#define kDefaultiMacSandyBoardProduct"Mac-942B59F58194171B"
// iMac12,2
// Bios: IM121.88Z.0047.B1D.1110171110"
// Data: 10/17/11
// Board: Mac-942B59F58194171B"
// iMac13,1
// Bios: IM131.88Z.010A.B05.1211151146
// Board: Mac-00BE6ED71E35EB86
// iMac13,2
//#define kDefaultiMacIvy"iMac13,2"
//#define kDefaultiMacIvyBIOSVersion" IM131.88Z.00CE.B00.1203281326"
//#define kDefaultiMacIvyBIOSReleaseDate"03/28/2012"
//#define kDefaultiMacIvyBoardProduct"Mac-FC02E91DDD3FA6A4"
// Bios: IM131.88Z.00CE.B00.1203281326
// Data: 03/28/2012
// Board: Mac-FC02E91DDD3FA6A4
// iMac14,1
// iMac14,2
// iMac14,3
// iMac14,4
// Bios: IM144.88Z.0179.B03.1405241029
// Data: 05/20/2014
// Board: Mac-81E3E92DD6088272
//=========== MacPro ===========
#define kDefaultMacProFamily"MacPro" // MacPro's family = "MacPro" not "Mac Pro"
//#define KDefauktMacProBoardAssetTagNumber"Pro-Enclosure"
trunk/i386/boot2/drivers.c
529529
530530
531531
532
532533
533534
534535
if (ret != 0) {
break;
}
// Allocate memory for the driver path and the plist.
module->executablePath = tmpExecutablePath;
trunk/i386/boot2/boot.c
252252
253253
254254
255
256
257
255
258256
259257
260258
......
332330
333331
334332
333
335334
336335
337
336
337
338338
339339
340340
......
343343
344344
345345
346
346
347
347348
348349
349350
......
669670
670671
671672
673
672674
673
675
674676
677
675678
676679
677680
......
710713
711714
712715
713
716
717
714718
715719
716720
......
761765
762766
763767
764
768
765769
766770
767771
{
strlcpy(kernelCacheFile, cacheFile, sizeof(kernelCacheFile));
verbose("Specified kernel cache file path = %s\n", cacheFile);
}
else
{
} else {
// Lion, Mountain Lion and Mavericks prelink kernel cache file
if ((checkOSVersion("10.7")) || (checkOSVersion("10.8")) || (checkOSVersion("10.9")))
{
// Check if the kernel cache file is more recent (mtime)
// than the kernel file or the S/L/E directory
ret = GetFileInfo(NULL, bootInfo->bootFile, &flags, &kerneltime);
// Check if the kernel file is more recent than the cache file
if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeFlat)
&& (kerneltime > cachetime)) {
&& (kerneltime > cachetime))
{
DBG("Kernel file (%s) is more recent than Kernel Cache (%s)! Ignoring Kernel Cache.\n",
bootInfo->bootFile, kernelCacheFile);
return -1;
ret = GetFileInfo("/System/Library/", "Extensions", &flags, &exttime);
// Check if the S/L/E directory time is more recent than the cache file
if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)
&& (exttime > cachetime)) {
&& (exttime > cachetime))
{
DBG("Folder: '/System/Library/Extensions' is more recent than Kernel Cache file (%s)! Ignoring Kernel Cache.\n",
kernelCacheFile);
return -1;
// bootFile must start with a / if it not start with a device name
if (!bootFileWithDevice && (bootInfo->bootFile)[0] != '/')
{
snprintf(bootFile, sizeof(bootFile), "/%s", bootInfo->bootFile); // append a leading /
else
} else {
strlcpy(bootFile, bootInfo->bootFile, sizeof(bootFile));
}
// Try to load kernel image from alternate locations on boot helper partitions.
ret = -1;
sleep(8);
#endif
if (ret <= 0) {
if (ret <= 0)
{
printf("Can't find %s\n", bootFile);
sleep(1);
}
*/
bool checkOSVersion(const char * version)
bool checkOSVersion(const char * version)
{
return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1])
&& (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3]));
trunk/i386/boot2/gui.c
955955
956956
957957
958
958
959959
960
960
961961
962962
963963
devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID : iDeviceHFS);
break;
}
break;
}
case kPartitionTypeHPFS:
devicetype = iDeviceNTFS;// Use HPFS / NTFS icon
trunk/i386/boot2/lzss.c
6565
6666
6767
68
68
69
70
71
6972
7073
7174
......
222225
223226
224227
225
228
226229
227
228
230
231
229232
230
231233
232234
235
233236
234237
235
238
236239
240
237241
238242
239
240243
244
241245
242246
243247
......
246250
247251
248252
253
249254
250255
256
251257
252258
253259
254260
255
261
262
256263
257264
258265
......
260267
261268
262269
270
263271
264272
265273
......
286294
287295
288296
289
297
290298
291299
292300
......
295303
296304
297305
306
298307
299308
300309
301310
302311
303312
313
304314
305315
306316
317
307318
308319
309320
310321
311322
323
312324
313325
314326
......
317329
318330
319331
332
320333
321334
322335
323336
324337
325
338
326339
327
328
329
330
340
341
331342
};
int
decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen)
decompress_lzss(
u_int8_t * dst,
u_int8_t * src,
u_int32_t srclen)
{
/* ring buffer of size N, with extra F-1 bytes to aid string comparison */
u_int8_t text_buf[N + F - 1];
}
u_int8_t *compress_lzss(
u_int8_t * dst,
u_int8_t *dst,
u_int32_t dstlen,
u_int8_t * src,
u_int32_t srclen)
u_int8_t *src,
u_int32_t srcLen)
{
u_int8_t * result = NULL;
/* Encoding state, mostly tree but some current match stuff */
struct encode_state *sp;
int i, c, len, r, s, last_match_length, code_buf_ptr;
u_int8_t code_buf[17], mask;
u_int8_t * srcend = src + srclen;
u_int8_t *srcend = src + srcLen;
u_int8_t *dstend = dst + dstlen;
/* initialize trees */
sp = (struct encode_state *) malloc(sizeof(*sp));
if (!sp) goto finish;
init_state(sp);
/*
* code_buf[1..16] saves eight units of code, and code_buf[0] works
* as eight flags, "1" representing that the unit is an unencoded
*/
code_buf[0] = 0;
code_buf_ptr = mask = 1;
/* Clear the buffer with any character that will appear often. */
s = 0; r = N - F;
/* Read F bytes into the last F bytes of the buffer */
for (len = 0; len < F && src < srcend; len++)
sp->text_buf[r + len] = *src++;
if (!len)
goto finish;
return (void *) 0; /* text of size zero */
/*
* Insert the F strings, each of which begins with one or more
* 'space' characters. Note the order in which these strings are
*/
for (i = 1; i <= F; i++)
insert_node(sp, r - i);
/*
* Finally, insert the whole string just read.
* The global variables match_length and match_position are set.
if (dst < dstend)
*dst++ = code_buf[i];
else
goto finish;
return (void *) 0;
code_buf[0] = 0;
code_buf_ptr = mask = 1;
}
delete_node(sp, s); /* Delete old strings and */
c = *src++;
sp->text_buf[s] = c; /* read new bytes */
/*
* If the position is near the end of buffer, extend the buffer
* to make string comparison easier.
*/
if (s < F - 1)
sp->text_buf[s + N] = c;
/* Since this is a ring buffer, increment the position modulo N. */
s = (s + 1) & (N - 1);
r = (r + 1) & (N - 1);
/* Register the string in text_buf[r..r+F-1] */
insert_node(sp, r);
}
while (i++ < last_match_length) {
delete_node(sp, s);
/* After the end of text, no need to read, */
s = (s + 1) & (N - 1);
r = (r + 1) & (N - 1);
insert_node(sp, r);
}
} while (len > 0); /* until length of string to be processed is zero */
if (code_buf_ptr > 1) { /* Send remaining code. */
for (i = 0; i < code_buf_ptr; i++)
if (dst < dstend)
*dst++ = code_buf[i];
else
goto finish;
return (void *) 0;
}
result = dst;
finish:
if (sp) free(sp);
return result;
return dst;
}
trunk/i386/boot2/options.c
10981098
10991099
11001100
1101
11011102
1103
11021104
1103
1104
1105
1106
1105
1106
1107
1108
11071109
1108
1109
1110
1111
1112
1113
1110
1111
1112
1113
1114
1115
11141116
1115
1116
1117
1118
1117
1118
1119
1120
11191121
1120
1121
1122
1123
11221124
11231125
11241126
......
12201222
12211223
12221224
1223
1225
1226
12241227
12251228
1226
1229
1230
12271231
12281232
12291233
12301234
12311235
1232
1236
1237
12331238
12341239
12351240
......
12381243
12391244
12401245
1241
1246
1247
12421248
12431249
12441250
......
12471253
12481254
12491255
1250
1256
1257
12511258
12521259
12531260
1254
1261
1262
12551263
1256
1264
1265
12571266
1258
1267
1268
12591269
12601270
12611271
12621272
12631273
12641274
1265
1275
1276
12661277
12671278
12681279
12691280
1270
1281
1282
12711283
12721284
12731285
1274
1286
1287
12751288
12761289
12771290
12781291
12791292
12801293
1281
1294
1295
12821296
1283
1297
1298
12841299
12851300
12861301
12871302
12881303
1289
1304
1305
12901306
12911307
12921308
......
12971313
12981314
12991315
1300
1316
1317
13011318
13021319
13031320
......
13071324
13081325
13091326
1310
1327
1328
13111329
13121330
13131331
13141332
13151333
13161334
1317
1318
1335
1336
1337
1338
13191339
13201340
13211341
......
13231343
13241344
13251345
1326
1327
1346
1347
1348
1349
13281350
13291351
13301352
......
13331355
13341356
13351357
1336
1358
1359
13371360
13381361
13391362
13401363
13411364
13421365
1343
1366
1367
13441368
13451369
13461370
13471371
13481372
13491373
1350
1374
1375
13511376
13521377
13531378
13541379
1355
1380
1381
13561382
13571383
13581384
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;
}
if (len > *cntRemainingP) {
error("Warning: boot arguments too long, truncating\n");
return false;
}
if (argName) {
strncpy( *argP, argName, argLen );
*argP += argLen;
*argP[0] = '=';
(*argP)++;
}
if (argName) {
strncpy( *argP, argName, argLen );
*argP += argLen;
*argP[0] = '=';
(*argP)++;
}
strncpy( *argP, val, cnt );
*argP += cnt;
*argP[0] = ' ';
(*argP)++;
strncpy(*argP, val, cnt);
*argP += cnt;
*argP[0] = ' ';
(*argP)++;
*cntRemainingP -= len;
return true;
*cntRemainingP -= len;
return true;
}
//
// to be used.
gOverrideKernel = false;
if (( kernel = extractKernelName((char **)&cp) )) {
if (( kernel = extractKernelName((char **)&cp) ))
{
strlcpy( bootInfo->bootFile, kernel, sizeof(bootInfo->bootFile) );
} else {
if ( getValueForKey( kKernelNameKey, &val, &cnt, &bootInfo->bootConfig ) ) {
if ( getValueForKey( kKernelNameKey, &val, &cnt, &bootInfo->bootConfig ) )
{
strlcpy( bootInfo->bootFile, val, cnt+1 );
} else {
strlcpy( bootInfo->bootFile, kDefaultKernel, sizeof(bootInfo->bootFile) );
}
}
if (strcmp( bootInfo->bootFile, kDefaultKernel ) != 0) {
if (strcmp( bootInfo->bootFile, kDefaultKernel ) != 0)
{
gOverrideKernel = true;
}
// Get config kernel flags, if not ignored.
if (getValueForBootKey(cp, kIgnoreBootFileFlag, &val, &cnt) ||
!getValueForKey( kKernelFlagsKey, &val, &cnt, &bootInfo->bootConfig )) {
!getValueForKey( kKernelFlagsKey, &val, &cnt, &bootInfo->bootConfig ))
{
val = "";
cnt = 0;
}
// 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))) {
&argP, &cntRemaining, gBootUUIDString, sizeof(gBootUUIDString)))
{
//
// Try an alternate method for getting the root UUID on boot helper partitions.
//
if (gBootVolume->flags & kBVFlagBooter) {
if (gBootVolume->flags & kBVFlagBooter)
{
// Load the configuration store in the boot helper partition
if (loadHelperConfig(&bootInfo->helperConfig) == 0) {
if (loadHelperConfig(&bootInfo->helperConfig) == 0)
{
val = getStringForKey(kHelperRootUUIDKey, &bootInfo->helperConfig);
if (val != NULL) {
if (val != NULL)
{
strlcpy(gBootUUIDString, val, sizeof(gBootUUIDString));
}
}
}
/*
// Try to get the volume uuid string
if (!strlen(gBootUUIDString) && gBootVolume->fs_getuuid) {
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)) {
if (strlen(gBootUUIDString))
{
copyArgument(kBootUUIDKey, gBootUUIDString, strlen(gBootUUIDString), &argP, &cntRemaining);
}
// Try to get the volume uuid string
if (!strlen(gBootUUIDString) && gBootVolume->fs_getuuid) {
if (!strlen(gBootUUIDString) && gBootVolume->fs_getuuid)
{
gBootVolume->fs_getuuid(gBootVolume, gBootUUIDString);
DBG("boot-uuid: %s\n", gBootUUIDString);
}
}
if (!processBootArgument(kRootDeviceKey, cp, configKernelFlags, bootInfo->config,
&argP, &cntRemaining, gRootDevice, ROOT_DEVICE_SIZE)) {
&argP, &cntRemaining, gRootDevice, ROOT_DEVICE_SIZE))
{
cnt = 0;
if ( getValueForKey( kBootDeviceKey, &val, &cnt, &bootInfo->chameleonConfig)) {
if ( getValueForKey( kBootDeviceKey, &val, &cnt, &bootInfo->chameleonConfig))
{
valueBuffer[0] = '*';
cnt++;
strlcpy(valueBuffer + 1, val, cnt);
val = valueBuffer;
} else { /*
if (strlen(gBootUUIDString)) {
if (strlen(gBootUUIDString))
{
val = "*uuid";
cnt = 5;
} else { */
/* } */
}
if (cnt > 0) {
if (cnt > 0)
{
copyArgument( kRootDeviceKey, val, cnt, &argP, &cntRemaining);
}
strlcpy( gRootDevice, val, (cnt + 1));
* Removed. We don't need this anymore.
*
if (!processBootArgument(kPlatformKey, cp, configKernelFlags, bootInfo->config,
&argP, &cntRemaining, gPlatformName, sizeof(gCacheNameAdler))) {
&argP, &cntRemaining, gPlatformName, sizeof(gCacheNameAdler)))
{
getPlatformName(gPlatformName);
copyArgument(kPlatformKey, gPlatformName, strlen(gPlatformName), &argP, &cntRemaining);
}
*/
if (!getValueForBootKey(cp, kSafeModeFlag, &val, &cnt) &&
!getValueForBootKey(configKernelFlags, kSafeModeFlag, &val, &cnt)) {
if (gBootMode & kBootModeSafe) {
!getValueForBootKey(configKernelFlags, kSafeModeFlag, &val, &cnt))
{
if (gBootMode & kBootModeSafe)
{
copyArgument(0, kSafeModeFlag, strlen(kSafeModeFlag), &argP, &cntRemaining);
}
}
// Store the merged kernel flags and boot args.
cnt = strlen(configKernelFlags);
if (cnt) {
if (cnt > cntRemaining) {
if (cnt)
{
if (cnt > cntRemaining)
{
error("Warning: boot arguments too long, truncating\n");
cnt = cntRemaining;
}
cntRemaining -= cnt;
}
userCnt = strlen(cp);
if (userCnt > cntRemaining) {
if (userCnt > cntRemaining)
{
error("Warning: boot arguments too long, truncating\n");
userCnt = cntRemaining;
}
strncpy(&argP[cnt], cp, userCnt);
argP[cnt+userCnt] = '\0';
if(!shouldboot) {
if(!shouldboot)
{
gVerboseMode = getValueForKey( kVerboseModeFlag, &val, &cnt, &bootInfo->chameleonConfig ) ||
getValueForKey( kSingleUserModeFlag, &val, &cnt, &bootInfo->chameleonConfig );
gBootMode = ( getValueForKey( kSafeModeFlag, &val, &cnt, &bootInfo->chameleonConfig ) ) ?
kBootModeSafe : kBootModeNormal;
if ( getValueForKey( kIgnoreCachesFlag, &val, &cnt, &bootInfo->chameleonConfig ) ) {
if ( getValueForKey( kIgnoreCachesFlag, &val, &cnt, &bootInfo->chameleonConfig ) )
{
gBootMode = kBootModeSafe;
}
}
if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) ) {
if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) )
{
strlcpy(gMKextName, val, cnt + 1);
} else {
gMKextName[0]=0;

Archive Download the corresponding diff file

Revision: 2390