michael
michael

Reputation: 3945

Porting AOSP to specific hardware device

UPDATE: Based on this Here is following question: Create specific device tree for AOSP

I followed this: https://source.android.com/source/building.html and set up the environment and downloaded the latest AOSP. Now I wnat to flash it on my specific device, let's say Galaxy S2.

  1. In the "Configuring USB Access: 51-android.rules", how it should look? Because in above official tutorial each entry looks like:

    //adb protocol for device X

    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="user"

    //fastboot protocol for device X

    SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="user"

    But in many places I found this:

    SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666", GROUP="plugdev"

    Of course adding user to plugdev group is obvious, but still: In Google`s way there is separate entries for adb & fastboot, and the mode is different...

    What would be the ultimate test to see if this step works?

  2. Suppose I modify the correct lines of code & config files for my specific device like stated here: Android device configuration for AOSP. Which means I have a directory with full AOSP files. In the stage of $ lunch aosp_arm-eng what parameters should be for specific hardware device?

  3. Now suppose I have in my output directory built & compiled AOSP files. How should I flash it on my device? It's not very clear from Google`s above tutorial. I prefer to get just a single zip file in order to flash it via CWM recovery etc.

  4. Is there a way to test the result before flashing it on hardware device (To reduce the chances for brick...)?

Thanks,

Upvotes: 2

Views: 3966

Answers (1)

mateor
mateor

Reputation: 1369

  1. The adb rules are to enable adb to work over USB. If you can connect to your device over ADB then the adb rules worked. You may have to enable ADB in the device's Developer Settings.
  2. After you have synced AOSP you can build for your device. You can choose your device in the lunch menu. Run the build/setenv.sh script. Then run lunch. It will have a list of specific devices you can choose from. You can add to that list by syncing new device trees into the tree.
  3. By default it will build system.imgs that you flash through fastboot. If you are building AOSP, make otapackage will make a flashable zip.
  4. The build will make an emulator image that you can test by running emulator. That will give you a general idea of if your build works, but will not give you the full story with regards to your specific device. For instance, the emulator build might run but if you forgot to add the correct proprietary files the build might not boot on your specific device. But you are very unlikely to hard brick your device by flashing a system.img.

Upvotes: 2

Related Questions