Chameleon

Chameleon Commit Details

Date:2010-09-14 05:10:42 (13 years 7 months ago)
Author:Azimutz
Commit:520
Parents: 519
Message:Cleaning boot.h, while adding more stuff. Removed setting CPU_TYPE_I386, with -legacy kernel flag. Reverted 32 & 64 flags to the trunk way, arch=i386/x86_64; don't want to contribute to confusion. The rest is mainly comment edit.
Changes:
M/branches/azimutz/Chazi/i386/boot2/options.c
M/branches/azimutz/Chazi/i386/libsaio/stringTable.c
M/branches/azimutz/Chazi/doc-azi/CHANGES.txt
M/branches/azimutz/Chazi/i386/boot2/drivers.c
M/branches/azimutz/Chazi/i386/boot2/boot.c
M/branches/azimutz/Chazi/i386/boot2/boot.h
M/branches/azimutz/Chazi/i386/boot2/ramdisk.c

File differences

branches/azimutz/Chazi/doc-azi/CHANGES.txt
4949
5050
5151
52
52
5353
5454
55
56
5755
5856
5957
......
6967
7068
7169
72
70
7371
7472
7573
7674
7775
78
76
7977
8078
8179
82
83
8480
8581
8682
......
9187
9288
9389
94
90
9591
9692
9793
......
113109
114110
115111
116
112
117113
118114
119115
......
310306
311307
312308
309
310
311
312
313
314
315
316
317
318
319
313320
314321
315322
---------------//---------------//---------------
- (rev 335)
- (rev 335) (REVERTED to trunk way, rev 520)
Change: merged the educational side of arch=i386 + the practical one of -x32, into a simple 32
booter flag.
Type just 32 to get you booted into i386 arch.
Note: -x32 was removed from trunk on rev 377.
---------------//---------------//---------------
- (rev 335)
- (rev 335) (REMOVED, rev 520)
Change: added -legacy kernel flag. This flag tells the booter to load i386 arch before is passed to
the kernel. This procedure only needs to be done on Snow Leopard. -legacy tells the kernel
to disable "64 Bit Mode", which allows 64 bit processors to run 64 bit apps under i386
mach kernel.
Type -legacy to get you booted into i386 arch, Legacy Mode.
Type -legacy to get you booted into Legacy Mode.
Note: only useful on 64 bit processors.
Note: this flag is not really needed; typing "32 -legacy" (no "") does the trick. It's just handy!
Note: just out of curiosity and for those who don't know, Legacy Mode is in fact the mode used
by 32 bit "only" processors! Since OS X kernel can handle 64 bit apps even on i386 arch,
64 bit processors need this flag to disable any handling of 64 bit instructions, when
---------------//---------------//---------------
- (rev 335)
- (rev 335) (REVERTED to trunk way, rev 520)
Change: added 64 bit booter flag, to keep company to the 32 one :)
Motif: mainly to override 32 or -legacy if they are flagged on the Boot.plist.
---------------//---------------//---------------
- (revs 337 --> 360)
Changes: file loading related changes (search algo). The short story:
Changes: file loading related (search algo). The short story:
Change: added a key to disable "override" Boot.plist from overriding the values on the "default"
Boot.plist. Only the values overriding is disabled, not the file loading.
---------------//---------------//---------------
- (rev 520)
Change: removed -legacy flag interaction with the booter and reverted 32/64 flags to the trunk way.
Type arch=i386 to load i386 kernel architecture.
arch=x86_64 overrides i386 arch, if flagged on Boot.plist.
On Snow type arch=i386 -legacy to load i386 arch Legacy Mode.
Motif: don't want to contribute to confusion.
---------------//---------------//---------------
- (rev )
Change:template
branches/azimutz/Chazi/i386/libsaio/stringTable.c
656656
657657
658658
659
659
660660
661661
662662
......
674674
675675
676676
677
678
679
680
681
677682
678683
679684
int count, ret, fd, len = 0;
// Take in account user overriding the override :P
if (getValueForKey(kTestConfigKey, &override_pathname, &len, &bootInfo->bootConfig))
if (getValueForKey(kAltConfigKey, &override_pathname, &len, &bootInfo->bootConfig))
{
// Specify a path to a file, e.g. config=/Extra/test.plist
strcpy(dirSpecBplist, override_pathname);
fd = open(dirSpecBplist, 0);
//if (fd >= 0) goto success_fd;
//restore?? can be useful with ramdisks...
//sprintf(dirSpecBplist, "bt(0,0)/Extra/%s", filename);
//fd = open(dirSpecBplist, 0);
//if (fd >= 0) goto success_fd;
//Azi: i really don't like these two!
// "/Extra/com.apple.Boot.plist"
// "/Library/Preferences/SystemConfiguration/com.apple.Boot.plist"
branches/azimutz/Chazi/i386/boot2/boot.c
489489
490490
491491
492
493
494
495
496
497
492
493
498494
499
500
495
496
501497
502498
503499
504
505
500
501
506502
507
508
503
504
509505
510
506
507
508
509
510
511
511512
512513
513514
......
546547
547548
548549
549
550
550551
551552
552553
// Other status (e.g. 0) means that we should proceed with boot.
// If cpu doesn't handle 64 bit instructions,...
if (!platformCPUFeature(CPU_FEATURE_EM64T) ||
// ... user forced i386 kernel architecture on cpu with "em64t"...
getValueForKey(kArchI386Flag, &val, &len, &bootInfo->bootConfig) ||
// ... or forced Legacy Mode...
getValueForKey(kLegacyModeFlag, &val, &len, &bootInfo->bootConfig))
// If cpu handles 64 bit instructions...
if (platformCPUFeature(CPU_FEATURE_EM64T))
{
// ... use i386 kernel arch.
archCpuType = CPU_TYPE_I386;
// use x86_64 kernel arch,...
archCpuType = CPU_TYPE_X86_64;
}
else
{
// Else use x86_64 kernel arch.
archCpuType = CPU_TYPE_X86_64;
// else use i386 kernel arch.
archCpuType = CPU_TYPE_I386;
}
// Override i386/-legacy, if flagged on Boot.plist.
if (getValueForKey(kArchX86_64Flag, &val, &len, &bootInfo->bootConfig))
// If user override...
if (getValueForKey(kArchKey, &val, &len, &bootInfo->bootConfig))
{
archCpuType = CPU_TYPE_X86_64;
// matches i386...
if (strncmp(val, "i386", 4) == 0)
{
// use i386 kernel arch.
archCpuType = CPU_TYPE_I386;
}
}
if (!getBoolForKey (kWakeKey, &tryresume, &bootInfo->bootConfig)) {
break;
if (!forceresume && ((sleeptime+3)<bvr->modTime)) {
printf ("Hibernate image is too old by %d seconds. Use ForceWake=y to override\n",bvr->modTime-sleeptime);
printf ("Hibernate image is too old by %d seconds. Use ForceWake=y to override.\n",bvr->modTime-sleeptime);
break;
}
branches/azimutz/Chazi/i386/boot2/boot.h
2929
3030
3131
32
32
3333
3434
3535
3636
37
37
3838
3939
4040
......
5454
5555
5656
57
57
5858
5959
6060
......
6262
6363
6464
65
66
67
68
69
70
71
72
73
74
75
76
7765
7866
7967
80
81
82
83
84
68
8569
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
105133
106
107134
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158135
159136
160
161
162
163
164
165
166
167
137
138
139
140
141
142
168143
169144
170145
#ifndef __BOOT2_BOOT_H
#define __BOOT2_BOOT_H
//Azi: keep it minimal for now.
//Azi:
// Todo: don't include headers like boot.h on other headers, unless...!
// move keys to the headers of the files they're in, if they have it!?
// check header wrappers...
//#include "saio_internal.h" // the only one needed by boot.h it self, afaics.
//#include "saio_internal.h" // the only one needed by boot.h it self.
#include "bootstruct.h"
/*
*/
/*
* Undeclared (or undeclared here) keys.
* Undeclared (or undeclared here)
*/
/*
"-checkers" gui.c, getValFK;
"timeout" mboot.c, getValFBK
"partno" mboot.c, getValFBK
"DumpSPD" spd.c, getBollFK
kNVCAP nvidia.c, getValFK - key is declared as a "variable", char kNVCAP[12], on setup_nvidia_devprop().
Check: http://efixusers.com/showthread.php?t=644, Update Version 1.1.9 (Asere's booter).
"If you want to override the NVCAP value, you must determine the PCI DeviceID of your graphic card.
For instance: my new GTX260 has the DeviceID 0×05e2. Knowing the DeviceID add this to your com.apple.Boot.plist:
<key>NVCAP_05e2</key>
<string>0000000000000000000000000000000000000000</string>
The NVCAP value is exactly 20 bytes long. You have to specify it using ASCII-HEX (0-9,a-f)."
ramdisk specific:
"Info" // ramdisk.c, getValFK
"BTAlias" // ramdisk.c, getBollFK
*/
/*
* Internal or "default" Boot.plist only keys (firstrun) - these end with "Key".
*
* keys that make no sense on "override" Boot.plist or at boot prompt;
* like so, they won't be present on BootHelp.txt.
*
* Keys used in system Boot.plist - these end with "Key".
*/
//identifier string location
#define kTextModeKey "Text Mode" // graphics.c
#define kProductVersionKey "ProductVersion" // options.c (boot.c on trunk)
#define kDefaultPartitionKey "Default Partition" // sys.c
#define kHidePartitionKey "Hide Partition" // disk.c
#define kRenamePartitionKey "Rename Partition" // disk.c
#define kInstantMenuKey "Instant Menu" // boot.c
#define kQuietBootKey "Quiet Boot" // boot.c
#define kTimeoutKey "Timeout" // options.c
#define kThemeNameKey "Theme" // gui.c
#define kGUIKey "GUI" // boot.c
#define kBootBannerKey "Boot Banner" // options.c
#define kDebugInfoKey "DebugInfo" // gui.c, graphics.c
#define kCDROMPromptKey "CD-ROM Prompt" // options.c
#define kCDROMOptionKey "CD-ROM Option Key" // options.c
#define kRescanPromptKey "Rescan Prompt" // boot.c
#define kRescanKey "Rescan" // boot.c
#define kScanSingleDriveKey "Scan Single Drive" // boot.c
#define kDevicePropertiesKey "device-properties" // device_inject.c
//identifier string locationtypecomment
#define kTextModeKey "Text Mode" // graphics.cgetNumberArraiFP- default 80x25 - kFlag - does it work??
//#define kProductVersionKey "ProductVersion" // options.cgetValFK- (boot.c on trunk) - reverted
#define kDefaultPartitionKey "Default Partition" // sys.cgetStringFK
#define kHidePartitionKey "Hide Partition" // disk.cgetValFK
#define kRenamePartitionKey "Rename Partition" // disk.cgetStringFK
#define kInstantMenuKey "Instant Menu" // boot.cgetBoolFK
#define kQuietBootKey "Quiet Boot" // boot.cgetBoolFK- kFlag
#define kTimeoutKey "Timeout" // options.cgetIntFK
#define kThemeNameKey "Theme" // gui.cgetValFK
#define kGUIKey "GUI" // boot.cgetBoolFK
#define kBootBannerKey "Boot Banner" // options.cgetBoolFK
#define kDebugInfoKey "DebugInfo" // gui.c, graphics.cgetBoolFK
#define kRescanPromptKey "Rescan Prompt" // boot.cgetBoolFK- cdrom only - firstrun
#define kRescanKey "Rescan" // boot.cgetBoolFK- cdrom only?? - firstrun
#define kCDROMPromptKey "CD-ROM Prompt" // options.cgetValFK- internal??
#define kCDROMOptionKey "CD-ROM Option Key" // options.cgetIntFK- internal?? (F8)
#define kScanSingleDriveKey "Scan Single Drive" // boot.cgetBoolFK
#define kDevicePropertiesKey "device-properties" // device_inject.cgetValFK- here because ??
#define kWaitForKeypressKey "Wait" // boot.cgetBoolFK
#define kAltConfigKey "config" // stringTable.cgetValFK- kFlag - hum.. handle like kFlag??
#define kCanOverrideKey "CanOverride" // stringTable.cgetBoolFK
#define kRootDeviceKey "rd" // options.cprocessBootArg- kFlag
#define kBootDeviceKey "Boot Device" // options.cgetValFK- kFlag/option??????
#define kBootUUIDKey "boot-uuid" // options.cprocessBootArg- kFlag
#define kHelperRootUUIDKey "Root UUID" // options.cgetValFK
#define kArchKey "arch" // boot.cgetValFK- kFlag
#define kKernelNameKey "Kernel" // options.cgetValFK
#define kKernelCacheKey "Kernel Cache" // boot.cgetValFK- kFlag
#define kKernelFlagsKey "Kernel Flags" // options.cgetValFK
#define kKPatcherKey "PatchKernel" // kernel_patcher.cgetBoolFK
#define kAltExtensionsKey "kext" // drivers.cgetValFK
#define kMKextCacheKey "MKext Cache" // options.cgetValFK- kFlag
#define kMD0ImageKey "md0" // ramdisk.cgetValFK
#define kWakeKey "Wake" // boot.cgetBoolFK
#define kForceWakeKey "ForceWake" // boot.cgetBoolFK
#define kWakeKeyImageKey "WakeImage" // boot.cgetValFK
#define kUseAtiROMKey "UseAtiROM" // ati.cgetBoolFK
#define kUseNvidiaROMKey "UseNvidiaROM" // nvidia.cgetBoolFK
#define kVBIOSKey "VBIOS" // nvidia.cgetBoolFK
#define kGraphicsModeKey "Graphics Mode" // graphics.cgetNumberArraiFP- kFlag
#define kAutoResolutionKey "AutoResolution" // boot.cgetBoolFK
#define kGraphicsEnablerKey "GraphicsEnabler" // pci_setup.cgetBoolFK
#define kLegacyLogoKey "Legacy Logo" // gui.cgetBoolFK
#define kDSDTKey "DSDT" // acpi_patcher.cgetValFK
#define kDropSSDTKey "DropSSDT" // acpi_patcher.cgetBoolFK
#define kRestartFixKey "RestartFix" // acpi_patcher.cgetBoolFK
#define kGeneratePStatesKey "GeneratePStates" // acpi_patcher.cgetBoolFK
#define kGenerateCStatesKey "GenerateCStates" // acpi_patcher.cgetBoolFK
#define kEnableC4StatesKey "EnableC4State" // acpi_patcher.cgetBoolFK
#define kUseMemDetectKey "UseMemDetect" // platform.cgetBoolFK
#define kSMBIOSdefaultsKey "SMBIOSdefaults" // smbios_patcher.cgetBoolFK
#define kSMBIOSKey "SMBIOS" // fake_efi.cgetValFK
#define kSystemIDKey "SystemId" // fake_efi.cgetStringFK- change to SystemID?
#define kSystemTypeKey "SystemType" // fake_efi.cgetStringFK
#define kPCIRootUIDKey "PciRoot" // pci_root.cgetValFK
#define kEthernetBuiltInKey "EthernetBuiltIn" // pci_setup.cgetBoolFK
#define kForceHPETKey "ForceHPET" // pci_setup.cgetBoolFK
#define kUSBBusFixKey "USBBusFix" // usb.cgetBoolFK
#define kEHCIacquireKey "EHCIacquire" // usb.cgetBoolFK
#define kEHCIhardKey "EHCIhard" // usb.cgetBoolFK- ??
#define kUHCIresetKey "UHCIreset" // usb.cgetBoolFK
#define kLegacyOffKey "USBLegacyOff" // usb.cgetBoolFK
/*
* Prompt or Boot.plist keys (secondrun) - these end with "Key".
*
* Keys that make some/all sense at boot prompt or any Boot.plist.
*
*/
#define kWaitForKeypressKey "Wait" // boot.c
#define kTestConfigKey "config" // stringTable.c
#define kCanOverrideKey "CanOverride" // stringTable.c
#define kRootDeviceKey "rd" // options.c
#define kBootDeviceKey "Boot Device" // options.c - ????? internal
#define kBootUUIDKey "boot-uuid" // options.c
#define kHelperRootUUIDKey "Root UUID" // options.c
#define kKernelNameKey "Kernel" // options.c
#define kKernelCacheKey "Kernel Cache" // boot.c
#define kKernelFlagsKey "Kernel Flags" // options.c
#define kKPatcherKey "PatchKernel" // kernel_patcher.c
#define kExtensionsKey "kext" // drivers.c
#define kMKextCacheKey "MKext Cache" // options.c
#define kMD0ImageKey "md0" // ramdisk.c
#define kWakeKey "Wake" // boot.c
#define kForceWakeKey "ForceWake" // boot.c
#define kWakeKeyImageKey "WakeImage" // boot.c
#define kUseAtiROMKey "UseAtiROM" // ati.c
#define kUseNvidiaROMKey "UseNvidiaROM" // nvidia.c
#define kVBIOSKey "VBIOS" // nvidia.c
#define kGraphicsModeKey "Graphics Mode" // graphics.c - here because of AutoResolution patch, which uses it + F2!!
#define kAutoResolutionKey "AutoResolution" // boot.c
#define kGraphicsEnablerKey "GraphicsEnabler" // pci_setup.c
#define kLegacyLogoKey "Legacy Logo" // gui.c
#define kDSDTKey "DSDT" // acpi_patcher.c
#define kDropSSDTKey "DropSSDT" // acpi_patcher.c
#define kRestartFixKey "RestartFix" // acpi_patcher.c
#define kGeneratePStatesKey "GeneratePStates" // acpi_patcher.c
#define kGenerateCStatesKey "GenerateCStates" // acpi_patcher.c
#define kEnableC4StatesKey "EnableC4State" // acpi_patcher.c
#define kUseMemDetectKey "UseMemDetect" // platform.c
#define kSMBIOSdefaultsKey "SMBIOSdefaults" // smbios_patcher.c
#define kSMBIOSKey "SMBIOS" // fake_efi.c
#define kSystemIDKey "SystemId" // fake_efi.c
#define kSystemTypeKey "SystemType" // fake_efi.c
#define kPCIRootUIDKey "PciRoot" // pci_root.c
#define kEthernetBuiltInKey "EthernetBuiltIn" // pci_setup.c
#define kForceHPETKey "ForceHPET" // pci_setup.c
#define kUSBBusFixKey "USBBusFix" // usb.c
#define kEHCIacquireKey "EHCIacquire" // usb.c
#define kEHCIhardKey "EHCIhard" // usb.c - ????? internal
#define kUHCIresetKey "UHCIreset" // usb.c
#define kLegacyOffKey "USBLegacyOff" // usb.c
/*
* Flags to the booter and/or kernel - these end with "Flag".
*/
#define kVerboseModeFlag "-v" // options.c
#define kSafeModeFlag "-x" // options.c
#define kIgnoreCachesFlag "-f" // options.c
#define kIgnoreBootFileFlag "-F" // options.c
#define kSingleUserModeFlag "-s" // options.c
#define kLegacyModeFlag "-legacy" // boot.c
#define kArchI386Flag "32" // boot.c - to be reverted!?
#define kArchX86_64Flag "64" // boot.c - to be reverted!?
//identifier string locationtypecomment
#define kVerboseModeFlag "-v" // options.cgetValFK- kFlag
#define kSafeModeFlag "-x" // options.cgetValFBootK & getValFK - ?? - kFlag
#define kIgnoreCachesFlag "-f" // options.cgetValFK- kFlag
#define kIgnoreBootFileFlag "-F" // options.cgetValFBootK- kFlag
#define kSingleUserModeFlag "-s" // options.cgetValFK- kFlag
/*
* Booter behavior control
branches/azimutz/Chazi/i386/boot2/drivers.c
184184
185185
186186
187
187
188188
189189
190190
else if ( gBootFileType == kBlockDeviceType )
{
// Take in account user overriding.
if (getValueForKey(kExtensionsKey, &override_pathfolder, &len, &bootInfo->bootConfig))
if (getValueForKey(kAltExtensionsKey, &override_pathfolder, &len, &bootInfo->bootConfig))
{
// Specify a path to a folder, ending with / e.g. kext=/Extra/testkext/
strcpy(dirSpecExtra, override_pathfolder);
branches/azimutz/Chazi/i386/boot2/ramdisk.c
2525
2626
2727
28
29
28
3029
3130
3231
......
246245
247246
248247
248
249
249250
250251
251
252
252253
253254
254255
int fh = -1;
int len;
if(getValueForKey(kMD0ImageKey, &override_filename, &len,
&bootInfo->bootConfig))
if(getValueForKey(kMD0ImageKey, &override_filename, &len, &bootInfo->bootConfig))
{
// Use user specified md0 file
sprintf(filename, "%s", override_filename);
int loadPrebootRAMDisk()
{
mountRAMDisk("bt(0,0)/Extra/Preboot.dmg");
// change md0 to be handled with the menu below??
if (gRAMDiskMI != NULL)
{
printf("\n");
printf("\n"); // damn line break :P
return 0;
}
else
branches/azimutz/Chazi/i386/boot2/options.c
777777
778778
779779
780
780
781
782
781783
782784
783
785
786
787
784788
785789
786790
791
787792
788793
789794
790795
791
796
797
792798
793
799
800
801
794802
795803
796804
......
968976
969977
970978
971
979
972980
973
974
981
975982
976983
977984
......
13281335
13291336
13301337
1331
1332
1333
1338
1339
1340
13341341
1335
1336
1342
1343
1344
13371345
13381346
13391347
13401348
13411349
1342
1343
1350
1351
13441352
1345
1346
1347
1353
1354
1355
13481356
13491357
13501358
1351
1359
1360
13521361
13531362
13541363
13551364
13561365
13571366
1358
1367
1368
13591369
1360
1370
1371
13611372
13621373
13631374
13641375
1365
1366
1376
1377
1378
1379
1380
13671381
13681382
1369
1383
1384
1385
13701386
13711387
13721388
13731389
13741390
1375
1376
1391
1392
1393
1394
13771395
13781396
13791397
13801398
13811399
13821400
1383
1384
1401
1402
1403
1404
13851405
13861406
13871407
......
14481468
14491469
14501470
1451
1471
14521472
14531473
14541474
int cnt;
int optionKey;
if (getValueForKey(kCDROMPromptKey, &val, &cnt, &bootInfo->bootConfig)) {
//Azi:---
if (getValueForKey(kCDROMPromptKey, &val, &cnt, &bootInfo->bootConfig))
{
prompt = malloc(cnt + 1);
strncat(prompt, val, cnt);
} else {
}
else
{
name = malloc(80);
getBootVolumeDescription(gBootVolume, name, 79, false);
prompt = malloc(256);
//Azi: too long for 80X25, GUI=n, vmware, depending on the device name (more than 5 char).
sprintf(prompt, "Press any key to start up from %s, or press F8 to enter startup options.", name);
free(name);
}
if (getIntForKey( kCDROMOptionKey, &optionKey, &bootInfo->bootConfig )) {
if (getIntForKey( kCDROMOptionKey, &optionKey, &bootInfo->bootConfig ))
{
// The key specified is a special key.
} else {
}
else
{
// Default to F8.
optionKey = 0x4200;
}
{
lspci();
}
else if (strcmp(booterCommand, "more") == 0) //Azi:?more
else if (strcmp(booterCommand, "more") == 0)
{
//showTextFile(booterParam);
showTextFile("bt(0,0)/Extra/BootExtra.txt");
showTextFile(booterParam);
}
else if (strcmp(booterCommand, "rd") == 0)
{
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.
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 {
}
else
{
//
// 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) )
if ((loadHelperConfig(&bootInfo->helperConfig) == 0) &&
getValueForKey(kHelperRootUUIDKey, &val, &cnt, &bootInfo->helperConfig) )
{
getValueForKey(kHelperRootUUIDKey, &val, &cnt, &bootInfo->helperConfig);
copyArgument(kBootUUIDKey, val, cnt, &argP, &cntRemaining);
uuidSet = true;
getValueForKey(kHelperRootUUIDKey, &val, &cnt, &bootInfo->helperConfig);
copyArgument(kBootUUIDKey, val, cnt, &argP, &cntRemaining);
uuidSet = true;
}
}
if (!uuidSet && gBootVolume->fs_getuuid && gBootVolume->fs_getuuid (gBootVolume, uuidStr) == 0) {
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;
}
}
if (!processBootArgument(kRootDeviceKey, cp, configKernelFlags, bootInfo->config, &argP, &cntRemaining, gRootDevice)) {
if (!processBootArgument(kRootDeviceKey, cp, configKernelFlags, bootInfo->config, &argP, &cntRemaining, gRootDevice))
{
cnt = 0;
if ( getValueForKey( kBootDeviceKey, &val, &cnt, &bootInfo->bootConfig)) {
if ( getValueForKey( kBootDeviceKey, &val, &cnt, &bootInfo->bootConfig))
{
valueBuffer[0] = '*';
cnt++;
strlcpy(valueBuffer + 1, val, cnt);
val = valueBuffer;
} else {
if (uuidSet) {
}
else
{
if (uuidSet)
{
val = "*uuid";
cnt = 5;
} else {
}
else
{
// Don't set "rd=.." if there is no boot device key
// and no UUID.
val = "";
cnt = 0;
}
}
if (cnt > 0) {
}
if (cnt > 0)
{
copyArgument( kRootDeviceKey, val, cnt, &argP, &cntRemaining);
}
strlcpy( gRootDevice, val, (cnt + 1));
}
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);
}
}
if (valid)
{
if (getValueForKey(kProductVersionKey, &val, &len, &systemVersion))
if (getValueForKey("ProductVersion", &val, &len, &systemVersion))
{
// getValueForKey uses const char for val
// so copy it and trim

Archive Download the corresponding diff file

Revision: 520