Chameleon

Chameleon Commit Details

Date:2015-07-13 00:15:25 (8 years 9 months ago)
Author:ErmaC
Commit:2732
Parents: 2731
Message:Correction for "config=<file>" thx to deek5 see: http://www.insanelymac.com/forum/topic/306509-config-file/
Changes:
M/trunk/i386/boot2/options.c

File differences

trunk/i386/boot2/options.c
660660
661661
662662
663
663
664664
665665
666666
......
11711171
11721172
11731173
1174
1174
1175
11751176
11761177
11771178
11781179
11791180
11801181
1181
1182
1183
11821184
11831185
11841186
......
11971199
11981200
11991201
1200
1201
1202
1203
1204
12051202
12061203
12071204
......
12141211
12151212
12161213
1214
12171215
12181216
12191217
......
12281226
12291227
12301228
1231
1232
1229
12331230
12341231
12351232
......
12381235
12391236
12401237
1241
1238
1239
12421240
12431241
12441242
12451243
1246
1244
1245
12471246
12481247
1249
1248
1249
1250
12501251
12511252
1252
1253
1254
1255
12531256
12541257
12551258
1256
1259
1260
12571261
12581262
12591263
......
12751279
12761280
12771281
1278
1282
12791283
12801284
12811285
......
13201324
13211325
13221326
1323
1327
13241328
1325
1326
1329
1330
1331
1332
1333
1334
1335
13271336
1337
1338
13281339
1329
1330
1340
1341
13311342
1332
1333
1343
1344
1345
13341346
13351347
13361348
static void skipblanks( const char ** cpp )
{
while ( **(cpp) == ' ' || **(cpp) == '\t' ) ++(*cpp);
while (**(cpp) == ' ' || **(cpp) == '\t' ) ++(*cpp);
}
//==========================================================================
} while (0 == key);
done:
if (bootArgs->Video.v_display == VGA_TEXT_MODE) {
if (bootArgs->Video.v_display == VGA_TEXT_MODE)
{
clearScreenRows(kMenuTopRow, kScreenLastRow);
changeCursor(0, kMenuTopRow, kCursorTypeUnderline, 0);
}
shouldboot = false;
gui.menu.draw = false;
if (menuItems) {
if (menuItems)
{
free(menuItems);
menuItems = NULL;
}
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");
*argP += argLen;
*argP[0] = '=';
(*argP)++;
len++; // +1 to account for '='
}
strncpy(*argP, val, cnt);
//
// Returns TRUE if an argument was copied, FALSE otherwise
bool
processBootArgument(
bool processBootArgument(
const char *argName, // The argument to search for
const char *userString, // Typed-in boot arguments
const char *kernelFlags, // Kernel flags from config table
int *cntRemainingP, // Output count
char *foundVal, // found value
int foundValSize // max found value size
) {
)
{
const char *val;
int cnt;
bool found = false;
if (getValueForBootKey(userString, argName, &val, &cnt)) {
if (getValueForBootKey(userString, argName, &val, &cnt))
{
// Don't copy; these values will be copied at the end of argument processing.
found = true;
} else if (getValueForBootKey(kernelFlags, argName, &val, &cnt)) {
}
else if (getValueForBootKey(kernelFlags, argName, &val, &cnt))
{
// Don't copy; these values will be copied at the end of argument processing.
found = true;
} else if (getValueForKey(argName, &val, &cnt, &bootInfo->chameleonConfig)) {
}
else if (getValueForKey(argName, &val, &cnt, &bootInfo->chameleonConfig))
{
copyArgument(argName, val, cnt, argP, cntRemainingP);
found = true;
}
if (found && foundVal) {
if (found && foundVal)
{
strlcpy(foundVal, val, foundValSize);
}
return found;
char*valueBuffer;
valueBuffer = malloc(VALUE_SIZE);
skipblanks( &cp );
// Update the unit and partition number.
// Load config table specified by the user, or use the default.
if (!getValueForBootKey(cp, "config", &val, &cnt))
if (getValueForBootKey(cp, "config", &val, &cnt))
{
val = 0;
cnt = 0;
printf("Load config table specified by the user.\n");
printf(val);
printf("\n");
pause();
loadConfigFile(val,&bootInfo->chameleonConfig);
loadSystemConfig(&bootInfo->bootConfig);
}
else
{
// Load com.apple.Boot.plist from the selected volume
// and use its contents to override default bootConfig.
// Load org.chameleon.Boot.plist from the selected volume
// and use its contents to override default bootConfig.
loadSystemConfig(&bootInfo->bootConfig);
loadChameleonConfig(&bootInfo->chameleonConfig, NULL);
loadSystemConfig(&bootInfo->bootConfig);
loadChameleonConfig(&bootInfo->chameleonConfig, NULL);
}
// Use the kernel name specified by the user, or fetch the name
// in the config table, or use the default if not specified.

Archive Download the corresponding diff file

Revision: 2732