Chameleon

Chameleon Commit Details

Date:2010-08-13 09:48:55 (13 years 8 months ago)
Author:Azimutz
Commit:360
Parents: 359
Message:End "search algo" related stuff. Check Mac OS X version on processBootOptions() so we can override Boot.plist from OS specific folders. This check doesn't print to screen so, we still check Mac OS X version on boot.c as before. Initializing gMacOSVersion on options.c instead of boot.c. Also "Draw background, turn off any GUI elements and update VRAM" a bit early (as early as possible) on common_boot, so we can catch verbose from loadOverrideConfig. If i didn't forgot something, this concludes the search algo as is atm :)
Changes:
M/branches/azimutz/CleanCut/i386/boot2/options.c
M/branches/azimutz/CleanCut/i386/boot2/boot.c

File differences

branches/azimutz/CleanCut/i386/boot2/boot.c
6666
6767
6868
69
7069
7170
7271
......
346345
347346
348347
349
348
349
350350
351351
352352
......
359359
360360
361361
362
363
364
365
366
367
368
369
370
371
372
373
362374
363375
364376
......
381393
382394
383395
384
385
386
387
388396
389
390
391
392
393
394
395
396
397
398
399
400397
398
399
401400
402401
403402
404403
405404
406
407
405
406
408407
409408
410409
......
493492
494493
495494
496
495
497496
498497
499498
//char *gPlatformName = gCacheNameAdler; disabled
char gRootDevice[512];
char gMKextName[512];
char gMacOSVersion[8];
bool gEnableCDROMRescan;
bool gScanSingleDrive;
bool tryresumedefault;
bool forceresume;
config_file_t systemVersion;// system.plist of booting partition
config_file_t systemVersion;// system.plist of booting partition
char osxVersion[8]; // replaces gMacOSVersion here, for now.
// additional variable for testing alternate kernel image locations on boot helper partitions.
char bootFileSpec[512];
status = getBootOptions(firstRun);
firstRun = false;
if (status == -1) continue;
//Azi: doing this earlier to get the verbose from loadOverrideConfig.
// Draw background, turn off any GUI elements and update VRAM.
if ( bootArgs->Video.v_display == GRAPHICS_MODE )
{
drawBackground(); // order matters!!
gui.devicelist.draw = false; // Needed when the verbose "flips" the screen.
gui.bootprompt.draw = false; // ?
gui.menu.draw = false; // ?
gui.infobox.draw = false; // Enter doesn't work with this drawn; most probably it's not needed!?
updateVRAM();
}
status = processBootOptions();
// Status==1 means to chainboot
}
// Other status (e.g. 0) means that we should proceed with boot.
if( bootArgs->Video.v_display == GRAPHICS_MODE )
drawBackground();
// Found and loaded a config file. Proceed with boot.
// Turn off any GUI elements
if( bootArgs->Video.v_display == GRAPHICS_MODE )
{
gui.devicelist.draw = false;
gui.bootprompt.draw = false;
gui.menu.draw = false;
gui.infobox.draw = false;
drawBackground();
updateVRAM();
}
//Azi: still calling this here. The call on processBootOptions() gets hidden from verbose and
// for some reason gMacOSVersion doesn't get initialized on boot.c like on the others. Later...
// Find out which version mac os we're booting.
if (!loadConfigFile("System/Library/CoreServices/SystemVersion.plist", &systemVersion)) {
if (getValueForKey(kProductVersion, &val, &len, &systemVersion)) {
// getValueForKey uses const char for val
// so copy it and trim
strncpy(gMacOSVersion, val, MIN(len, 4));
gMacOSVersion[MIN(len, 4)] = '\0';
strncpy(osxVersion, val, MIN(len, 4));
osxVersion[MIN(len, 4)] = '\0';
}
}
(gMKextName[0] == '\0') &&
(gBootKernelCacheFile[0] != '\0'));
verbose("Loading Darwin %s\n", gMacOSVersion);
verbose("Loading Darwin %s\n", osxVersion);
if (trycache) do {
branches/azimutz/CleanCut/i386/boot2/options.c
2929
3030
3131
32
3233
3334
3435
......
3940
4041
4142
43
4244
4345
4446
......
11291131
11301132
11311133
1134
1135
11321136
11331137
11341138
......
11371141
11381142
11391143
1144
11401145
11411146
11421147
......
11701175
11711176
11721177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
11731191
11741192
11751193
#include "gui.h"
#include "embedded.h"
#include "pci.h"
#include "sl.h"
static bool shouldboot = false;
//extern intmenucount;
extern intgDeviceCount;
chargMacOSVersion[8];
intselectIndex = 0;
MenuItem * menuItems = NULL;
const char * cp = gBootArgs;
const char * val = 0;
const char * kernel;
const char*value;
int len;
int cnt;
int userCnt;
int cntRemaining;
bool uuidSet = false;
char * configKernelFlags;
char * valueBuffer;
config_file_t systemVersion;
valueBuffer = malloc(VALUE_SIZE);
else
return -1;
// Needed to enable search for override Boot.plist on OS specific folders
// from loadOverrideConfig(). Find out which version mac os we're booting.
if (!loadConfigFile("/System/Library/CoreServices/SystemVersion.plist", &systemVersion))
{
if (getValueForKey(kProductVersion, &value, &len, &systemVersion))
{
// getValueForKey uses const char for val
// so copy it and trim
strncpy(gMacOSVersion, value, MIN(len, 4));
gMacOSVersion[MIN(len, 4)] = '\0';
}
} // doesn't print to screen here!
//Azi: implemented at loadOverrideConfig.
// Load config table specified by the user, or use the default.
//if (!getValueForBootKey(cp, "config", &val, &cnt)) {

Archive Download the corresponding diff file

Revision: 360