//extern int␉␉menucount;␊ |
␊ |
extern int␉␉gDeviceCount;␊ |
char␉␉␉gMacOSVersion[8];␊ |
char␉␉␉gMacOSVersion[8]; //Azi: moved from boot.c␊ |
static bool getOSVersion(char *str); //␉␉␉||␊ |
␊ |
int␉␉␉selectIndex = 0;␊ |
MenuItem * menuItems = NULL;␊ |
|
␉␉position_t p = pos( gui.screen.width / 2 + 1 , ( gui.devicelist.pos.y + 3 ) + ( ( gui.devicelist.height - gui.devicelist.iconspacing ) / 2 ) );␊ |
␉␊ |
␉␉char dummy[80];␊ |
␉␉getBootVolumeDescription( gBootVolume, dummy, 80, true );␊ |
␉␉getBootVolumeDescription( gBootVolume, dummy, sizeof(dummy) - 1, true );␊ |
␉␉drawDeviceIcon( gBootVolume, gui.screen.pixmap, p, true );␊ |
␉␉drawStrCenteredAt( (char *) msg, &font_small, gui.screen.pixmap, gui.countdown.pos );␊ |
␉␉␊ |
|
␉// When booting from CD, default to hard drive boot when possible. ␊ |
␉if (isCDROM && firstRun) {␊ |
␉␉const char *val;␊ |
␉␉char *prompt;␊ |
␉␉char *name;␊ |
␉␉char *prompt = NULL;␊ |
␉␉char *name = NULL;␊ |
␉␉int cnt;␊ |
␉␉int optionKey;␊ |
␊ |
␉␉if (getValueForKey(kCDROMPromptKey, &val, &cnt, &bootInfo->bootConfig)) {␊ |
␉␉␉cnt += 1;␊ |
␉␉␉prompt = malloc(cnt);␊ |
␉␉␉strlcpy(prompt, val, cnt);␊ |
␉␉␉prompt = malloc(cnt + 1);␊ |
␉␉␉strncat(prompt, val, cnt);␊ |
␉␉} else {␊ |
␉␉␉name = malloc(80);␊ |
␉␉␉getBootVolumeDescription(gBootVolume, name, 80, false);␊ |
␉␉␉getBootVolumeDescription(gBootVolume, name, 79, false);␊ |
␉␉␉prompt = malloc(256);␊ |
␉␉␉sprintf(prompt, "Press any key to start up from %s, or press F8 to enter startup options.", name);␊ |
␉␉␉free(name);␊ |
␉␉␉cnt = 0;␊ |
␉␉}␊ |
␊ |
␉␉if (getIntForKey( kCDROMOptionKey, &optionKey, &bootInfo->bootConfig )) {␊ |
␉␉␉// The key specified is a special key.␊ |
␉␉} else if (getValueForKey( kCDROMOptionKey, &val, &cnt, &bootInfo->bootConfig ) && cnt >= 1) {␊ |
␉␉␉optionKey = val[0];␊ |
␉␉} else {␊ |
␉␉␉// Default to F8.␊ |
␉␉␉optionKey = 0x4200;␊ |
|
␉␉␉key = optionKey;␊ |
␉␉}␊ |
␊ |
␉␉if (cnt) {␊ |
␉␉if (prompt != NULL) {␊ |
␉␉␉free(prompt);␊ |
␉␉}␊ |
␊ |
|
␉␉// Associate a menu item for each BVRef.␊ |
␉␉for (bvr=bvChain, i=gDeviceCount-1, selectIndex=0; bvr; bvr=bvr->next) {␊ |
␉␉␉if (bvr->visible) {␊ |
␉␉␉␉getBootVolumeDescription(bvr, menuItems[i].name, 80, true);␊ |
␉␉␉␉getBootVolumeDescription(bvr, menuItems[i].name, sizeof(menuItems[i].name) - 1, true);␊ |
␉␉␉␉menuItems[i].param = (void *) bvr;␊ |
␉␉␉␉if (bvr == menuBVR) {␊ |
␉␉␉␉␉selectIndex = i;␊ |
|
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 here to enable search for override Boot.plist on OS specific folders.␊ |
␉// Moved here to enable search for override Boot.plist on OS specific folders.␊ |
␉// Find out which Mac OS version 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';␊ |
␉␉}␊ |
␉}␊ |
␉getOSVersion(gMacOSVersion);␊ |
␉␊ |
␉//Azi: implemented at loadOverrideConfig.␊ |
// Load config table specified by the user, or use the default.␊ |
|
strncpy(&argP[cnt], cp, userCnt);␊ |
argP[cnt+userCnt] = '\0';␊ |
␊ |
if(!shouldboot)␊ |
␉if(!shouldboot)␊ |
␉{␊ |
␉␉gVerboseMode = getValueForKey( kVerboseModeFlag, &val, &cnt, &bootInfo->bootConfig ) ||␊ |
␉␉␉getValueForKey( kSingleUserModeFlag, &val, &cnt, &bootInfo->bootConfig );␊ |
␊ |
␉␉␊ |
␉␉gBootMode = ( getValueForKey( kSafeModeFlag, &val, &cnt, &bootInfo->bootConfig ) ) ?␊ |
␉␉␉kBootModeSafe : kBootModeNormal;␊ |
␉␉␊ |
␉␉if ( getValueForKey( kIgnoreCachesFlag, &val, &cnt, &bootInfo->bootConfig ) ) {␊ |
␉␉ gBootMode = kBootModeSafe;␊ |
␉␉}␊ |
␊ |
if ( getValueForKey( kIgnoreCachesFlag, &val, &cnt, &bootInfo->bootConfig ) ) {␊ |
gBootMode = kBootModeSafe;␊ |
}␊ |
␉}␊ |
␊ |
␉if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) )␊ |
␉{␊ |
␉␉strlcpy(gMKextName, val, cnt + 1);␊ |
␉}␊ |
␉ ␊ |
␊ |
free(configKernelFlags);␊ |
free(valueBuffer);␊ |
␊ |
return 0;␊ |
}␊ |
␊ |
static bool getOSVersion(char *str) //Azi: moved from boot.c␊ |
{␊ |
␉bool valid = false;␊ |
␉config_file_t systemVersion;␊ |
␉const char *val;␊ |
␉int len;␊ |
␊ |
␉if (!loadConfigFile("/System/Library/CoreServices/SystemVersion.plist", &systemVersion))␊ |
␉{ //Azi: so, is this path on selected or current volume??␊ |
␉␉valid = true;␊ |
␉}␊ |
␉else if (!loadConfigFile("/System/Library/CoreServices/ServerVersion.plist", &systemVersion))␊ |
␉{␊ |
␉␉valid = true;␊ |
␉}␊ |
␊ |
␉if (valid)␊ |
␉{␊ |
␉␉if (getValueForKey(kProductVersion, &val, &len, &systemVersion))␊ |
␉␉{␊ |
␉␉␉// getValueForKey uses const char for val␊ |
␉␉␉// so copy it and trim␊ |
␉␉␉*str = '\0';␊ |
␉␉␉strncat(str, val, min(len, 4));␊ |
␉␉}␊ |
␉␉else␊ |
␉␉␉valid = false;␊ |
␉}␊ |
␊ |
␉return valid;␊ |
}␊ |
␊ |
//==========================================================================␊ |
// Load the help file and display the file contents on the screen.␊ |
␊ |