build vdi for vbox

3835阅读 0评论2012-07-24 vouloir_pouvoir
分类:LINUX

Build for vbox fellow below steps:
1, In you kernel code root path:
  1. $ make ARCH=x86 vbox_defconfig
  2. $ make ARCH=x86 menuconfig         
  3. $ make -j4 ARCH=x86 bzImage
2, After step 1 you can get two files, one is vmlinux, the other is arch/x86/boot/bzImage

  1. $ cp arch/x86/boot/bzImage $YOURAOSP/prebuilts/qemu-kernel/x86/kernel-vbox
  2. $ cp vmlinux $YOURAOSP/prebuilts/qemu-kernel/x86/vmlinux-vbox
3, Go to your AOSP code, maybe some code should be change for kgdb debug:

  1. /* external/grub/stage2/preset_menu.c */
  2. /* add below code in end */
  3. "\n"
  4. " title Android KGDB Startup from /dev/sda v0.x\n"
  5. "     kernel (hd0,2)/kernel qemu=1 console=ttyS0 console=tty0 vga=788 verbose androidboot.hardware=vbox_x86 androidboot.console=ttyS0 android.qemu=ttyS1 kgdboc=ttyS0,115200 kgdbwait\n"
  6. "     initrd (hd0,2)/rmdisk\n"
4, build vdi

  1. $ source build/envsetup.sh
  2. $ lunch
  3. choose vbox_x86-eng option here
  4. $ make -j4
  5. $ make -j4 android_disk_vdi
5, Two vdi file is in out/target/product/xbox_x86 by default. Set android_system_disk.vdi as IDE Primary Master and android_data_disk.vdi as IDE Primary Slave. Then it works.

6,if promoted storage space running out, please edit BOARD_USERDATAIMAGE_PARTITION_SIZE value in source/build/target/board/vbox_x86/BoardConfig.mk. Attention do not change the value to big, default is 50M, I change to 70M, it is work, but not with 500M -- it will pop "config invalid" error when build vdi file.
    After modification, please remove original *.img and *.vdi in out/target/product/vbox_x86/, and repeat step 4.

上一篇:Tips of gerrit & git
下一篇:BSP Jellybean: multi touch screen