am f9e275b0: merge from open-source master

Merge commit 'f9e275b0c785aa8ed83606e5b98f37d2050a528e' into kraken

* commit 'f9e275b0c785aa8ed83606e5b98f37d2050a528e':
  Add support for x86 VirtualBox Emulation
diff --git a/target/board/generic_x86/AndroidBoard.mk b/target/board/generic_x86/AndroidBoard.mk
index 9d64d52..ff46149 100644
--- a/target/board/generic_x86/AndroidBoard.mk
+++ b/target/board/generic_x86/AndroidBoard.mk
@@ -6,3 +6,12 @@
 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
 LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
 include $(BUILD_PREBUILT)
+
+ifeq ($(TARGET_PREBUILT_KERNEL),)
+LOCAL_KERNEL := prebuilt/android-x86/kernel/kernel
+else
+LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
+endif
+
+PRODUCT_COPY_FILES += \
+    $(LOCAL_KERNEL):kernel
diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk
index cdc48f3..be8aeb7 100644
--- a/target/board/generic_x86/BoardConfig.mk
+++ b/target/board/generic_x86/BoardConfig.mk
@@ -9,12 +9,10 @@
 TARGET_CPU_ABI := x86
 TARGET_USERIMAGES_USE_EXT2 := true
 TARGET_BOOTIMAGE_USE_EXT2 := true
-TARGET_USE_DISKINSTALLER := false
 
-# For KVM
-# BOARD_KERNEL_CMDLINE := console=tty0 console=ttyS1,115200n8 console=tty0 androidboot.hardware=generic_x86 vga=788
-
-# For mrst_ref
-BOARD_KERNEL_CMDLINE := init=/init pci=noearly console=ttyS0 console=ttyS1,115200n8 console=tty0 earlyprintk=mrst loglevel=8 notsc no_percpu_apbt androidboot.hardware=generic_x86 s0ix_latency=160
-
+BOARD_KERNEL_CMDLINE := init=/init console=tty0 androidboot.hardware=generic_x86 vga=788
+TARGET_USE_DISKINSTALLER := true
+TARGET_DISK_LAYOUT_CONFIG := build/target/board/generic_x86/disk_layout.conf
 BOARD_BOOTIMAGE_MAX_SIZE := 8388608
+BOARD_SYSLOADER_MAX_SIZE := 7340032
+BOARD_FLASH_BLOCK_SIZE := 512
diff --git a/target/board/generic_x86/README.txt b/target/board/generic_x86/README.txt
index 3b88b44..97e2d5b 100644
--- a/target/board/generic_x86/README.txt
+++ b/target/board/generic_x86/README.txt
@@ -1,6 +1,6 @@
-The generic_x86 board target provides basic services on
-very basic hardware. To build with generic_x86, you will
-need an appropriate kernel for your device (or emulation).
+The generic_x86 board target provides basic services on very basic
+hardware (really for an emulation). To build with generic_x86, you will
+need an appropriate kernel for your emulation (or device).
 
 A1. Create a new top level directory and pull the AOSP repository
         mkdir $HOME/AOSP
@@ -23,4 +23,11 @@
         make -j8
 
 The build will generate some image files whose format may or may not be correct for your
-device.
+device. You can build an installer image disk for the VirtualBox emulator using the command:
+
+A5. Build a VirtualBox installer image
+	cd $HOME/AOSP
+        source build/envsetup.sh
+        lunch generic_x86-eng
+        make -j8 installer_vdi
+
diff --git a/target/board/generic_x86/disk_layout.conf b/target/board/generic_x86/disk_layout.conf
new file mode 100644
index 0000000..7b073ee
--- /dev/null
+++ b/target/board/generic_x86/disk_layout.conf
@@ -0,0 +1,54 @@
+device {
+    path /dev/block/sda
+
+    scheme mbr
+
+    # bytes in a disk sector (== 1 LBA), must be a power of 2!
+    sector_size 512
+
+    # What LBA should the partitions start at?
+    start_lba 2048
+
+    # Autodetect disk size if == 0
+    num_lba 0
+
+    partitions {
+        sysloader {
+            active y
+            type linux
+            len 7M
+        }
+
+        recovery {
+            active y
+            type linux
+            len 16M
+        }
+
+        boot {
+            active y
+            type linux
+            len 8M
+        }
+
+        cache {
+            type linux
+            len 512M
+        }
+
+        system {
+            type linux
+            len 512M
+        }
+
+        third_party {
+            type linux
+            len 512M
+        }
+
+        data {
+            type linux
+            len -1
+        }
+    }
+}