Skip to content

Instantly share code, notes, and snippets.

@Sharpie
Created September 24, 2011 07:03
Show Gist options
  • Save Sharpie/1239064 to your computer and use it in GitHub Desktop.
Save Sharpie/1239064 to your computer and use it in GitHub Desktop.
VirtualBox Lion Support
diff -Naru VirtualBox-4.1.2_OSE.orig/include/iprt/system.h VirtualBox-4.1.2_OSE/include/iprt/system.h
--- VirtualBox-4.1.2_OSE.orig/include/iprt/system.h 2011-01-14 21:15:06.000000000 +0100
+++ VirtualBox-4.1.2_OSE/include/iprt/system.h 2011-09-21 20:47:05.000000000 +0200
@@ -168,6 +168,8 @@
RTSYSDMISTR_PRODUCT_SERIAL,
/** The system manufacturer. */
RTSYSDMISTR_MANUFACTURER,
+ /** The product board ID. */
+ RTSYSDMISTR_PRODUCT_BOARD_ID,
/** The end of the valid strings. */
RTSYSDMISTR_END,
/** The usual 32-bit hack. */
diff -Naru VirtualBox-4.1.2_OSE.orig/src/VBox/Devices/EFI/DevEFI.cpp VirtualBox-4.1.2_OSE/src/VBox/Devices/EFI/DevEFI.cpp
--- VirtualBox-4.1.2_OSE.orig/src/VBox/Devices/EFI/DevEFI.cpp 2011-01-14 21:15:14.000000000 +0100
+++ VirtualBox-4.1.2_OSE/src/VBox/Devices/EFI/DevEFI.cpp 2011-09-21 20:30:46.000000000 +0200
@@ -1005,6 +1005,10 @@
"DmiSystemUuid\0"
"DmiSystemVendor\0"
"DmiSystemVersion\0"
+ "DmiBoardVendor\0"
+ "DmiBoardProduct\0"
+ "DmiBoardVersion\0"
+ "DmiBoardSerial\0"
"DmiChassisVendor\0"
"DmiChassisVersion\0"
"DmiChassisSerial\0"
diff -Naru VirtualBox-4.1.2_OSE.orig/src/VBox/Devices/PC/DevFwCommon.cpp VirtualBox-4.1.2_OSE/src/VBox/Devices/PC/DevFwCommon.cpp
--- VirtualBox-4.1.2_OSE.orig/src/VBox/Devices/PC/DevFwCommon.cpp 2011-01-14 21:15:14.000000000 +0100
+++ VirtualBox-4.1.2_OSE/src/VBox/Devices/PC/DevFwCommon.cpp 2011-09-21 20:46:45.000000000 +0200
@@ -60,6 +60,10 @@
static const char *s_szDefDmiSystemSerial = "0";
static const char *s_szDefDmiSystemSKU = "";
static const char *s_szDefDmiSystemFamily = "Virtual Machine";
+static const char *s_szDefDmiBoardVendor = "innotek GmbH";
+static const char *s_szDefDmiBoardProduct = "VirtualBox";
+static const char *s_szDefDmiBoardVersion = "1.2";
+static const char *s_szDefDmiBoardSerial = "0";
static const char *s_szDefDmiChassisVendor = "Sun Microsystems, Inc.";
static const char *s_szDefDmiChassisVersion = "";
static const char *s_szDefDmiChassisSerial = "";
@@ -67,6 +71,7 @@
static char g_szHostDmiSystemProduct[64];
static char g_szHostDmiSystemVersion[64];
+static char g_szHostDmiBoardProduct[64];
/*******************************************************************************
@@ -384,6 +389,14 @@
s_szDefDmiSystemVersion = g_szHostDmiSystemVersion;
LogRel(("DMI: Using DmiSystemVersion from host: %s\n", g_szHostDmiSystemVersion));
}
+
+ rc = RTSystemQueryDmiString(RTSYSDMISTR_PRODUCT_BOARD_ID,
+ g_szHostDmiBoardProduct, sizeof(g_szHostDmiBoardProduct));
+ if (RT_SUCCESS(rc))
+ {
+ s_szDefDmiBoardProduct = g_szHostDmiBoardProduct;
+ LogRel(("DMI: Using DmiBoardProduct from host: %s\n", g_szHostDmiBoardProduct));
+ }
}
/**
@@ -641,6 +654,23 @@
READCFGSTR(pSystemInf->u8Family, DmiSystemFamily);
TERM_STRUCT;
+ /**********************************
+ * DMI board information (Type 2) *
+ **********************************/
+ PDMIBOARDINF pBoardInf = (PDMIBOARDINF)pszStr;
+ CHECKSIZE(sizeof(*pBoardInf));
+ pszStr = (char *)(pBoardInf + 1);
+ iStrNr = 1;
+ pBoardInf->header.u8Type = 2; /* Board Information */
+ pBoardInf->header.u8Length = sizeof(*pBoardInf);
+ pBoardInf->header.u16Handle = 0x0004;
+ READCFGSTR(pBoardInf->u8Manufacturer, DmiBoardVendor);
+ READCFGSTR(pBoardInf->u8Product, DmiBoardProduct);
+ READCFGSTR(pBoardInf->u8Version, DmiBoardVersion);
+ READCFGSTR(pBoardInf->u8SerialNumber, DmiBoardSerial);
+
+ TERM_STRUCT;
+
/********************************************
* DMI System Enclosure or Chassis (Type 3) *
********************************************/
diff -Naru VirtualBox-4.1.2_OSE.orig/src/VBox/Devices/PC/DevPcBios.cpp VirtualBox-4.1.2_OSE/src/VBox/Devices/PC/DevPcBios.cpp
--- VirtualBox-4.1.2_OSE.orig/src/VBox/Devices/PC/DevPcBios.cpp 2011-08-15 14:28:32.000000000 +0200
+++ VirtualBox-4.1.2_OSE/src/VBox/Devices/PC/DevPcBios.cpp 2011-09-21 20:30:46.000000000 +0200
@@ -964,6 +964,10 @@
"DmiBIOSReleaseMinor\0"
"DmiBIOSFirmwareMajor\0"
"DmiBIOSFirmwareMinor\0"
+ "DmiBoardVendor\0"
+ "DmiBoardProduct\0"
+ "DmiBoardVersion\0"
+ "DmiBoardSerial\0"
"DmiSystemSKU\0"
"DmiSystemFamily\0"
"DmiSystemProduct\0"
diff -Naru VirtualBox-4.1.2_OSE.orig/src/VBox/Devices/PC/DevPcBios.h VirtualBox-4.1.2_OSE/src/VBox/Devices/PC/DevPcBios.h
--- VirtualBox-4.1.2_OSE.orig/src/VBox/Devices/PC/DevPcBios.h 2011-01-14 21:15:14.000000000 +0100
+++ VirtualBox-4.1.2_OSE/src/VBox/Devices/PC/DevPcBios.h 2011-09-21 20:30:46.000000000 +0200
@@ -30,7 +30,7 @@
* the size should be at least 16-byte aligned for a proper alignment of
* the MPS table.
*/
-#define VBOX_DMI_TABLE_SIZE 352
+#define VBOX_DMI_TABLE_SIZE 364
/** @def VBOX_LANBOOT_SEG
diff -Naru VirtualBox-4.1.2_OSE.orig/src/VBox/Runtime/r3/darwin/RTSystemQueryDmiString-darwin.cpp VirtualBox-4.1.2_OSE/src/VBox/Runtime/r3/darwin/RTSystemQueryDmiString-darwin.cpp
--- VirtualBox-4.1.2_OSE.orig/src/VBox/Runtime/r3/darwin/RTSystemQueryDmiString-darwin.cpp 2011-01-14 21:15:19.000000000 +0100
+++ VirtualBox-4.1.2_OSE/src/VBox/Runtime/r3/darwin/RTSystemQueryDmiString-darwin.cpp 2011-09-21 20:43:49.000000000 +0200
@@ -49,6 +49,7 @@
#define PROP_PRODUCT_SERIAL "IOPlatformSerialNumber"
#define PROP_PRODUCT_UUID "IOPlatformUUID"
#define PROP_MANUFACTURER "manufacturer"
+#define PROP_PRODUCT_BOARD_ID "board-id"
RTDECL(int) RTSystemQueryDmiString(RTSYSDMISTR enmString, char *pszBuf, size_t cbBuf)
@@ -61,11 +62,12 @@
CFStringRef PropStringRef = NULL;
switch (enmString)
{
- case RTSYSDMISTR_PRODUCT_NAME: PropStringRef = CFSTR(PROP_PRODUCT_NAME); break;
- case RTSYSDMISTR_PRODUCT_VERSION: PropStringRef = CFSTR(PROP_PRODUCT_VERSION); break;
- case RTSYSDMISTR_PRODUCT_SERIAL: PropStringRef = CFSTR(PROP_PRODUCT_SERIAL); break;
- case RTSYSDMISTR_PRODUCT_UUID: PropStringRef = CFSTR(PROP_PRODUCT_UUID); break;
- case RTSYSDMISTR_MANUFACTURER: PropStringRef = CFSTR(PROP_MANUFACTURER); break;
+ case RTSYSDMISTR_PRODUCT_NAME: PropStringRef = CFSTR(PROP_PRODUCT_NAME); break;
+ case RTSYSDMISTR_PRODUCT_VERSION: PropStringRef = CFSTR(PROP_PRODUCT_VERSION); break;
+ case RTSYSDMISTR_PRODUCT_SERIAL: PropStringRef = CFSTR(PROP_PRODUCT_SERIAL); break;
+ case RTSYSDMISTR_PRODUCT_UUID: PropStringRef = CFSTR(PROP_PRODUCT_UUID); break;
+ case RTSYSDMISTR_MANUFACTURER: PropStringRef = CFSTR(PROP_MANUFACTURER); break;
+ case RTSYSDMISTR_PRODUCT_BOARD_ID: PropStringRef = CFSTR(PROP_PRODUCT_BOARD_ID); break;
default:
return VERR_NOT_SUPPORTED;
}
@@ -96,6 +98,7 @@
if ( enmString == RTSYSDMISTR_PRODUCT_NAME
|| enmString == RTSYSDMISTR_PRODUCT_VERSION
|| enmString == RTSYSDMISTR_MANUFACTURER
+ || enmString == RTSYSDMISTR_PRODUCT_BOARD_ID
)
{
CFDataRef DataRef = (CFDataRef)IORegistryEntryCreateCFProperty(ServiceObject, PropStringRef,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment