www.rodneybeede.com "I would love to change the world, but they won't give me the source code" - unknown
 Navigation

Customize an Android system.img - Last Modified 2011-11-30 02:08 UTC - Created 2011-11-30 02:08 UTC

I needed to customize the system.img for a generic build (emulator) of an Android 2.3.7b1 ROM. I wanted to add Google Maps to it (as well as Market, etc) and run it in the emulator for a school project of a custom ROM.

I tried adding the necessary files to a running ROM, but the system.img file is reset each time you restart the emulator. There was a temporary copy of the modified in-memory version in my account profile temp folder, but copying it just gave an unbootable image. In the end I found doing a ROM build on my Linux machine and extracting the system.img from the build, adding the files, and repackaging worked.

You need:

Steps

  1. mkdir EXTRACTED
  2. cd EXTRACTED
  3. ~/unyaffs ~/system.img
  4. Copy whatever you need into the extracted content
    • Example: cp ~/GoogleServicesFramework.apk ~/EXTRACTED/app/
  5. mkyaffs2image EXTRACTED newsystem.img