[Desire 626 Android Development] BigCountry907:
Preparing and Building the Kernel

#1 Get the GCC Toolchain

First if you have a dev environment set up you should have a repo set up.

If not go to aosp site to see how yo set up a repo.

https://source.android.com/source/downloading.html

Then get the toolchain

cd
mkdir ~/android/Toolchains
mkdir ~/android/Toolchains/prebuilts
cd ~/android/Toolchains/prebuilts
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8

Were gonna use the 4.8 toolchain.

bigcountry@bigcountry-G551JW:~/android/Toolchains/prebuilts$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8

Cloning into 'arm-eabi-4.8'...

remote: Sending approximately 28.69 MiB ...

remote: Counting objects: 158, done

remote: Finding sources: 100% (158/158)

remote: Total 354 (delta 71), reused 354 (delta 71)

Receiving objects: 100% (354/354), 28.74 MiB | 2.09 MiB/s, done.

Resolving deltas: 100% (71/71), done.

Checking connectivity... done.

#2 Initialize the Kernel Build

Go to the home path of the kernel

cd
cd ~/android/device/a32e/

Export the required variables.

export TOP=~/android/Toolchains/
export PATH=$TOP/prebuilts/arm-eabi-4.8/bin:$PATH
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=~/android/Toolchains/prebuilts/arm-eabi-4.8/bin/arm-eabi-

Clean out any old left over stuff from previous builds.

make clean
make mrproper

Dont worry about this warning it's not a problem.

/home/bigcountry/android/device/a32e/arch/arm/boot/dts/Makefile:228: warning: overriding recipe for target `dtbs'

/home/bigcountry/android/device/a32e/arch/arm/boot/dts/Makefile:228: warning: ignoring old recipe for target `dtbs'

Initialize the configuration for our device.

make Big-Country_defconfig

This warning is also ok.

In file included from scripts/kconfig/zconf.tab.c:2503:0:

scripts/kconfig/menu.c: In function ‘get_symbol_str’:

scripts/kconfig/menu.c:567:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]

jump->offset = r->len - 1;

^

scripts/kconfig/menu.c:528:19: note: ‘jump’ was declared here

struct jump_key *jump;

^

If your curious and want to see how many settings there are.

Just don't change anything for the first run.

make menuconfig

Were ready to compile

set -j to the number of cores your computer has.

make prepare
make all -j8

In about 5 min or less you will have a compiled kernel.

after you see the zimage output message

The last 2 lines output from the build.

OBJCOPY arch/arm/boot/zImage

Kernel: arch/arm/boot/zImage is ready

make modules -j8

Then you should see:

bigcountry@bigcountry-G551JW:~/android/device/a32e$ make modules -j8

CHK include/generated/uapi/linux/version.h

CC scripts/mod/devicetable-offsets.s

GEN scripts/mod/devicetable-offsets.h

HOSTCC scripts/mod/file2alias.o

HOSTLD scripts/mod/modpost

CHK include/generated/utsrelease.h

make[1]: `include/generated/mach-types.h' is up to date.

CALL scripts/checksyscalls.sh

Building modules, stage 2.

MODPOST 24 modules

During the build:

You will see 1 warning message for an uninitialized jump.

And 4 warning messages about relying on default adress.

Thats the broken dtb issue.

No worry for now. We will repack the boot.img with the new kernel zImage and use the original dt.img.

Good enough for this test.

Also as i mentioned we have to build the wifi module out of the tree.

We will get to that. So in this state the kernel will boot and the device functions with exception to wifi.

Remember this run is just to test the baseline system and source code.