Chameleon

Chameleon Commit Details

Date:2010-02-12 11:34:59 (9 years 8 months ago)
Author:JrCs
Commit:75
Parents: 74
Message:New SystemId option to force system-id EFI property
Changes:
M/branches/JrCs/i386/libsaio/fake_efi.c
M/branches/JrCs/i386/boot2/boot.h

File differences

branches/JrCs/i386/libsaio/fake_efi.c
1313
1414
1515
16
1617
1718
1819
......
7980
8081
8182
82
83
8384
8485
8586
......
326327
327328
328329
330
329331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
330373
331374
332375
......
385428
386429
387430
431
432
433
434
435
388436
389437
390438
#include "dsdt_patcher.h"
#include "smbios_patcher.h"
#include "device_inject.h"
#include "convert.h"
#include "pci.h"
#include "sl.h"
static EFI_UINT32 const FIRMWARE_REVISION = 132; /* FIXME: Find a constant for this. */
/* Default platform system_id (fix by IntVar) */
static EFI_CHAR8 const SYSTEM_ID[] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10};//random value gen by uuidgen
static EFI_CHAR8 const SYSTEM_ID[] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10}; //random value gen by uuidgen
/* Just a ret instruction */
static uint8_t const VOIDRET_INSTRUCTIONS[] = {0xc3};
static char FIRMWARE_ABI_PROP[] = "firmware-abi";
static char FIRMWARE_VENDOR_PROP[] = "firmware-vendor";
static char FIRMWARE_ABI_PROP_VALUE[] = "EFI64";
static const char const SYSTEM_ID_PROP[] = "system-id";
/* return a binary UUID value from the overriden SystemID,
* or from a fixed value if none found
*/
static const EFI_CHAR8* getSystemID()
{
bool pause = FALSE;
int len;
const char* StrSystemId = NULL;
const EFI_CHAR8* SystemId = NULL;
// unable to determine UUID for host. Error: 35 fix
getValueForKey(kSystemID, &StrSystemId, &len, &bootInfo->bootConfig);
if (StrSystemId != NULL) {
SystemId = getUUIDFromString(StrSystemId);
if (SystemId == NULL) {
error("Error: invalid SystemID '%s'\n", StrSystemId);
pause = TRUE;
}
}
if (SystemId == NULL) {
// EFI_CHAR8* ret = getUUIDFromString(sysId);
//
// if(!sysId || !ret) { // try bios dmi info UUID extraction
// ret = getSmbiosUUID();
// sysId = 0;
// }
// if(!ret) // no bios dmi UUID available, set a fixed value for system-id
SystemId = SYSTEM_ID;
error("Using a fixed SystemID: '%s'\n", getStringFromUUID(SystemId));
//
// verbose("Customizing SystemID with : %s\n", getStringFromUUID(ret)); // apply a nice formatting to the displayed output
}
if (pause) getc();
return SystemId;
}
void
setupEfiDeviceTree(void)
{
if(Platform.CPU.CPUFrequency != 0)
DT__AddProperty(efiPlatformNode, CPU_Frequency_prop, sizeof(uint64_t), &Platform.CPU.CPUFrequency);
/* Set EFI system-id. */
const EFI_CHAR8* systemId = getSystemID();
verbose("Customizing %s with: %s\n", SYSTEM_ID_PROP, getStringFromUUID(systemId));
DT__AddProperty(efiPlatformNode, SYSTEM_ID_PROP, UUID_LEN, systemId);
/* Fill /efi/device-properties node.
*/
setupDeviceProperties(node);
branches/JrCs/i386/boot2/boot.h
5858
5959
6060
61
6162
6263
6364
#define kGUIKey "GUI"
#define kBootBannerKey "Boot Banner"
#define kWaitForKeypressKey "Wait"
#define kSystemID "SystemId" /* fake_efi.c */
#define kRestartFix "RestartFix" /* dsdt_patcher.c */
#define kSystemType "SystemType" /* fake_efi.c */

Archive Download the corresponding diff file

Revision: 75