Why my compiled system.img is different from google official system.img?

232 views
Skip to first unread message

Smith Tom

unread,
Sep 10, 2016, 10:49:50 AM9/10/16
to Android Building
I want to learn some system infos of Android, and found a strange place.

1, environment:
ubuntu 12.04  + openjdk-7
source :  repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r25 
        make   :  
source build/envsetup.sh
lunch asop_x86-eng
make -j4
build success and run emualator is OK
750MB

2, then I checked the google sdk 
ls -h ~/bin/android-sdk/system-images/android-22/default/x86/system.img 
850MB, is about 100M big than mine
   I checked the two "installed-files.txt" files, found many different file names.

   Why why my compiled system.img is different from google official system.img?

3, I run the emulator, found the process name is emulator64-x86, when I use official tools create avd, found the process name is qemu-system-i386.
  It's different emulators, why?

4, I wanted to use my compiled system.img to replace official system.img, when I run the emulator, it failed.

So, did I do something wrong? Why can't make the same system.img like official system.img?

simms22

unread,
Sep 11, 2016, 3:58:17 PM9/11/16
to Android Building
well, aosp is different than googles "stock" android, and has many non open source items in it. so compiling aosp will never be the same as googles stock android. it never has been..

James Musselwhite

unread,
Sep 21, 2016, 1:24:05 AM9/21/16
to Android Building
To the best of my knowledge a stock Google system.img is going to be full of Google Apps which are not part of AOSP. Things like Google Play Services, the Play Store, and all the "Google ___" apps. Those are installed in the system partition when they come stock which is why you can't delete them. Your compiled system.img will not have any of those.

Hiram Lew

unread,
Sep 21, 2016, 3:19:16 PM9/21/16
to Android Building
The qemu-system-i386 image is a ARM build which runs on top of qemu as the emulation layer. When you build the emulator64-x86 image, you're building an image to run on x86. If you try to run the x86 image on qemu, you shouldn't expect the system image to work as the compiled binaries are all set to produce x86 instructions.

You need to compile the x86 emulator binaries to run the x86 system image. Please have a read here: https://android.googlesource.com/platform/external/qemu.git/+/28a24c94e7350a80d5e7e186289cde6a1300bdfb/docs/BUILDING.TXT

Since I haven't actually done this myself, I'm just hoping to point you in the right direction.


On Saturday, September 10, 2016 at 7:49:50 AM UTC-7, Smith Tom wrote:
Reply all
Reply to author
Forward
0 new messages