I tried compiling my own kernel, but it doesn't boot

Search This thread

dikidera

Senior Member
May 18, 2010
128
10
I tried compiling the original kernel I have running on my Nexus 7 2013.

So I did

git clone https://android.googlesource.com/kernel/msm -b android-msm-flo-3.4-kitkat-mr2
git checkout -f ac9222cf61b2646a1862fb222365e52a0d1c498d
export ARCH=arm flo_defconfig
export SUBARCH=arm
export CROSS_COMPILE/home/armtoolchain-prebuilt-4.8/bin:$PATH
make -j2

that last checkout of commit ac9222cf61b2646a1862fb222365e52a0d1c498d is the one my Nexus 7 2013 Wi-Fi originally came with. Now since I used the prebuilt binaries of GCC 4.8, it has some stricter rules for compilation so I had to remove some flags like -Wall from the main Makefile so my compile would continue, furthermore I had to edit a Makefile in arch/arm/boot/compressed so that -Wa,-march=armv7-a instead of -march=all otherwise again I could not compile due to some errors.

After this I get a nice zImage, then I do fastboot boot zImage and my tablet hangs on the bootloader menu, nothing happens at all, I have to hold down power to fix it. Basically my kernel does NOT work in the least and I am unsure what the problem is. I am hoping somebody with experience here could help me.

The reason I posted in this subforum is because more devs would see it, however if Moderators are against it, please move the thread to the appropriate forum rather than deleting it, thank you!
 
Last edited:

poondog

Inactive Recognized Contributor
Dec 11, 2011
14,998
12,953
Melbourne
I tried compiling the original kernel I have running on my Nexus 7 2013.

So I did



that last checkout of commit ac9222cf61b2646a1862fb222365e52a0d1c498d is the one my Nexus 7 2013 Wi-Fi originally came with. Now since I used the prebuilt binaries of GCC 4.8, it has some stricter rules for compilation so I had to remove some flags like -Wall from the main Makefile so my compile would continue, furthermore I had to edit a Makefile in arch/arm/boot/compressed so that -Wa,-march=armv7-a instead of -march=all otherwise again I could not compile due to some errors.

After this I get a nice zImage, then I do fastboot boot zImage and my tablet hangs on the bootloader menu, nothing happens at all, I have to hold down power to fix it. Basically my kernel does NOT work in the least and I am unsure what the problem is. I am hoping somebody with experience here could help me.

The reason I posted in this subforum is because more devs would see it, however if Moderators are against it, please move the thread to the appropriate forum rather than deleting it, thank you!

Hi, I assume you're using kitkat branch for kitkat kernel?

You'll need these two commits to boot with a toolchain above GCC 4.7 regardless

https://github.com/poondog/kernel_msm/commit/c6f209b4ac195fbc19286ebe6d77bae939ac00b7
https://github.com/poondog/kernel_msm/commit/ea510c9b9dba084332ca88acee4a2064c9c80056

That will fix your zImage.