Building Modules

Whenever you make a major change to the kernel, such as enabling ftrace or disabling printk's, you need to rebuild the dependant kernel modules, which are located in /system/lib/modules. Otherwise your system likely will not boot; you will get behavior such as continuous reboots or the "Unfortunately System UI has stopped" error message. You will need to rebuild the modules for WLAN and GFX; if you are using the proprietary GPS module, you will need to rebuild it as well.

If you are using the pre-built binaries and do not want to download or rebuild MYDROID just for the modules, you can follow the instructions below to quickly clone and build the code only for the WLAN and GFX modules. If you already have the MYDROID source code on your PC, you can follow similar instructions, but perform the changes in the /hardware/ti/wlan and /device/ti/proprietary-open directories that already exist in MYDROID. The instructions below were tested with the 4AI releases (kernel 3.0); changes may need to be made for use with older kernels.

=WLAN=

First, clone the WLAN git tree if you do not already have the MYDROID source code on your PC: git clone git://git.omapzoom.org/platform/hardware/ti/wlan.git cd wlan

To get the WLAN code from the top of the WLAN tree: git checkout --track -b p-ics-mr1 origin/p-ics-mr1

To get the WLAN code corresponding to the particular release, look at the xml file for your particular release: http://git.omapzoom.org/?p=platform/omapmanifest.git;a=shortlog;h=refs/heads/27.x and take the commit ID for the tree platform/hardware/ti/wlan. For example, for the 4AI.1.4 release: git checkout a4d25dfbfcaa8d3e2ada7311d56713426b534f5c

Next, build the WLAN modules: cd mac80211/compat export KLIB=/path/to/kernel export KLIB_BUILD=/path/to/kernel export ARCH=arm make

The resulting WLAN modules are: compat/compat.ko  net/wireless/cfg80211.ko   net/mac80211/mac80211.ko   drivers/net/wireless/ti/wl12xx/wl12xx.ko   drivers/net/wireless/ti/wl12xx/wl12xx_sdio.ko

=GFX=

First, clone the GFX git tree if you do not already have the MYDROID source code on your PC: git clone git://git.omapzoom.org/device/ti/proprietary-open.git cd proprietary-open

To get the GFX code from the top of the GFX tree: git checkout --track -b p-ics-mr1 origin/p-ics-mr1

To get the GFX code corresponding to the particular release, look at the xml file for your particular release: http://git.omapzoom.org/?p=platform/omapmanifest.git;a=shortlog;h=refs/heads/27.x and take the commit ID for the tree device/ti/proprietary-open. For example, for the 4AI.1.4 release: git checkout 5ddb17c3faa09cb00d8f9cfeeb4b9c6c5077cc28

Untar the sgx.tgz tarball located in proprietary-open/omap4. You should now have the directory proprietary-open/omap4/sgx. Follow instructions at device/ti/proprietary-open/omap4/sgx/README. Specifically: cd omap4/sgx cd src/eurasia_km/eurasiacon/build/linux2/omap4430_android export KERNELDIR=path_to_kernel

If you are building for OMAP4430/4460, use the make command: make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- TARGET_PRODUCT="blaze_tablet" BUILD=release TARGET_SGX=540 PLATFORM_VERSION=4.0

If you are building for OMAP4470, use the make command: make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- TARGET_PRODUCT="blaze_tablet" BUILD=release TARGET_SGX=544sc PLATFORM_VERSION=4.0

In either case, check that the TARGET_PRODUCT is set correctly to "blaze" or "blaze_tablet" depending on the platform you are using.

The resulting GFX modules for 4430/4460 are: target/kbuild/omaplfb_sgx540_120.ko  target/kbuild/pvrsrvkm_sgx540_120.ko (in the directory $MYDROID/device/ti/proprietary-open/omap4/sgx/src/eurasia_km/eurasiacon/binary2_540_120_omap4430_android_release/)

The resulting GFX modules for 4470 are: target/kbuild/omaplfb_sgx544_120.ko target/kbuild/pvrsrvkm_sgx544_112.ko (in the directory $MYDROID/device/ti/proprietary-open/omap4/sgx/src/eurasia_km/eurasiacon/binary2_544_112_omap4430_android_release/)

You can build both sets of GFX modules and include both sets in your system image. The system will determine the device type at runtime and load the correct modules.

Note: If you get errors such as this when building the GFX modules: CC [M] /home/gina/ics/4AI.1.3/mydroid/device/ti/proprietary- open/omap4/sgx/src/eurasia_km/eurasiacon/binary2_544_112_omap4430_android_release/ target/kbuild/services4/3rdparty/omaplfb_linux/omaplfb_bv.o cc1: fatal error: /home/gina/ics/4AI.1.3/mydroid/device/ti/proprietary- open/omap4/sgx/src/eurasia_km/eurasiacon/binary2_544_112_omap4430_android_release/ target/kbuild/services4/3rdparty/omaplfb_linux/omaplfb_bv.c: File name too long

This could be due to having an encryped home directory under Ubuntu, which can result in filenames becoming longer on the underlying filesystem. Instead, move the proprietary-open directory to your Ubuntu PC outside of the home directory and run "make" again.

=GPS= GPS is a proprietary module. Please contact your TI representative if you need access to this module.

=Replacing Modules=

The modules are located in /system/lib/modules. If you have an existing system.img, you can follow these instructions to unpack system.img, copy the new modules, and then re-pack system.img: Android_eMMC_Booting