Close

Building the Kernel for Android - Maybe

A project log for Breaking Androidâ„¢

Building and breaking the Android AOSP on the BBB. Android is a trademark of Google Inc.

jlbrian7jlbrian7 03/15/2017 at 22:420 Comments
#Instructions modified from https://github.com/csimmonds/a4b-scripts/blob/master/build-beagleboneblack.sh

cd ~/android-AOSP/device

mkdir ti
cd ti

git clone https://github.com/csimmonds/a4b-beagleboneblack
cd a4b*
git checkout m6.0

cd ..
mkdir beagleboneblack
mv -v ~/android-AOSP/device/a4b-beagleboneblack/* ~/android-AOSP/device/ti/beagleboneblack/
rm -rf a4b-beagleboneblack

THIS IS STILL MUDDY WATER. There needs to be a different patch file because I modified some of the files. WARNING: Don't follow the instructions here.

cd ~/BBB

mkdir u-boot_stock
mv -v u-boot/* u-boot_stock/
rm -rf u-boot

git clone https://github.com/csimmonds/u-boot.git
cd u-boot
git checkout am335x-v2013.01.01-bbb-fb
cd ..
mkdir u-boot_droid
mv -v u-boot/* u-boot_droid/
rm -rf u-boot

git clone https://github.com/beagleboard/bb.org-overlays.git
git clone https://github.com/csimmonds/a4b-scripts.git

cd a4b*
git checkout m6.0
cd ..

cd bb-kernel
mkdir patches/a4b
cp ~/android-AOSP/device/ti/beagleboneblack/ti-kernel-patches/config-android-4.1 patches/defconfig 
cp  ~/android-AOSP/device/ti/beagleboneblack/ti-kernel-patches/*.patch patches/a4b

patch -p1 < patches/a4b/0001-Add-a4b-patch.patch

Output:
patch -p1 < patches/a4b/0001-Add-a4b-patch.patch
patching file patch.sh
Hunk #1 succeeded at 1174 with fuzz 2 (offset 223 lines).
Hunk #2 FAILED at 988.
1 out of 2 hunks FAILED -- saving rejects to file patch.sh.rej



Solution:
add `a4b` to line# 1218 of patch.sh, and save file
comment out selinux patches in patch.sh (just not putting them into patch.sh would be better. come back to this.)

NOTE:

When I did this a second time, re-pulling the kernel to get a fresh start it I had the same problem, but with a different error message, the solution was roughly the same regardless. Also, the second time I downloaded the kernel I got 4.4.53 instead of 4.4.52

Also, as I stated in the I disabled all touchscreen inuput, and DVB front end modules and built-ins. I was getting compiler errors, so I shut it all off. The kernel built, but I'll have to see if it works.

./build_kernel.sh

cd KERNEL

***

cat arch/arm/boot/zImage arch/arm/boot/dts/am335x-boneblack-emmc-overlay.dtb > zImage-dtb
mkdir ~/android-AOSP/device/ti/beagleboneblack-kernel
cp zImage-dtb ~/android-AOSP/device/ti/beagleboneblack-kernel

*** I am not really sure about this step, because later when I move files 
to the sd card for android I create a different image.

mkdir ~/android-AOSP/device/ti/beagleboneblack/modules
MODULES=`find -name "*.ko"`
for f in $MODULES; do
	cp $f ~/android-AOSP/device/ti/beagleboneblack/modules/`basename $f`
done

cd ../../bb.org-overlays
make DTC=../bb-kernel/KERNEL/scripts/dtc/dtc
cp src/arm/*.dtbo ~/android-AOSP/device/ti/beagleboneblack/dtbo

cd ../u-boot_droid
. ../bb-kernel/.CC

Yeah, u-boot is a mess too. I'm not sure how this is going to work out.

cd ~/android-AOSP
make -j8

Now, time to get some beer. I'm done for the night.

Discussions