Starting a CyanogenMod device tree

From linux-sunxi.org
Jump to: navigation, search

This guide will get you started on adapting CyanogenMod to a new Allwinner device


Contents

Prepare the Build Environment

NOTE: You only need to do these steps the first time you build. If you previously prepared your build environment, skip to creating your device tree.

Install the ADB

Install the Android SDK

Install the Build Packages

Install using the package manager of your choice:

For 32-bit & 64-bit systems:

git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jdk pngcrush schedtool

For 64-bit only systems:

g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib
NOTE: gcc-4.3-multilib g++-4.3-multilib is no longer available for Ubuntu 11.04 64-bit, but should still build without issue.

Create the Directories

You will need to set up some directories in your build environment.

To create them:

mkdir -p ~/bin
mkdir -p ~/android/system

Install the Repository

Enter the following to download make executable the "repo" binary:

curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
NOTE: You may need to reboot for these changes to take effect.

It's time to choose your desired flavour, Ice Cream Sandwitch or Jelly Bean:

For use the ICS Repository

Now enter the following to initialize the repository:

cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b ics
wget http://turl.linux-sunxi.org/local_manifest.xml -O .repo/local_manifest.xml
repo sync -j16

For use the JB Repository

Now enter the following to initialize the repository:

cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
wget http://turl.linux-sunxi.org/local_manifest_jb.xml -O .repo/local_manifest_jb.xml
repo sync -j16

Creating a basic new device tree

There is an example basic tree to support new Allwinner devices. It contains a convenience script to change most of the basic stuff:

cd ~/android/system/device/allwinner/
git clone https://github.com/allwinner-dev-team/android_device_allwinner_example.git <yourdevice>
cd <yourdevice>
./initialize.sh <yourdevice> <yourdevicepretty> <yourvendorpretty>

With <yourdevice> being a single word, lowercase identifier (e.g. zatab), <yourdevicepretty> being a mixed case, user-friendly name (e.g. ZaTab), and <yourvendorpretty> being the user-friendly name of your vendor (e.g. ZaReason).

Once the naming is all set up, you might want to:

  • Adjust CWM recovery key mappings (see recovery_keys.c)
  • Make a kernel defconfig for your device (generally <yourdevice>_defconfig, it can be adjusted on BoardConfig.mk)
  • Adjust kernel modules to be loaded on boot, see init.sun4i.modules.rc
  • Adjust WiFi configuration, see BoardConfig.mk on device/allwinner/common/ for the configuration variables, and adjust them on your own BoardConfig.mk
  • Adjust proprietary files list, see proprietary-files.txt

Copy proprietary files

To copy the proprietary files, connect the device to the computer and ensure that ADB is working properly.

cd ~/android/system/device/allwinner/<yourdevice>/
./extract-files.sh

Building CyanogenMod

Fetch Prebuilts

NOTE: This only needs to be done when an update to the prebuilts is released. If you are-up-to date, you may skip to the next step.

Download the prebuilts which are needed by the build:

~/android/system/vendor/cm/get-prebuilts

Configure Build & Compile

To build using your new device tree, issue

. build/envsetup.sh && brunch yourdevice

Install

  1. Copy your .zip file from ~/android/system/out/target/product/yourdevice/cm-XXXXX.zip to the root of the SD card.
    Optional: Download Google Apps for CyanogenMod 9 and place it on the root of the SD card.
  2. Flash both of these .zip files from recovery.
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox