[Android General] limited_imagination:
Hi there [MENTION=7550078]pndwal[/MENTION], mentioning me here inspired me to have another bash at it, and I have finally met with some success.

I have now cobbled together a source code that gets to the bitter end and builds a full kernel Image.gz-dtb file.

In trying to build a full kernel, I started with trying to merge the two source codes that [MENTION=1533335]fran89[/MENTION] posted links to. I kept getting tons of errors, many referring to missing files or improper path addresses to those files. Lots of wasted time in trial and error.

One major issue I discovered the hard way, is the "case sensitive" file structure of Linux. There are a whole bunch of missing files in those two [MENTION=1533335]fran89[/MENTION] source code links, especially in the /net/netfilter directory, because the file names are the same except for upper case and lower case characters (eg. xt_RATEEST.c and xt_rateest.c, xt_TCPMSS.c and xt_tcpmss.c, etc.). The official Lenovo source code that the company posted must have been passed through a Windows or an OS X machine at some point, which over-wrote one of each of these files, because those operating systems are case insensitive. So you end up with only one of the two necessary files.

In the end, what worked was to start with the source code posted by Greg Kroah-Hartman here: https://android.googlesource.com/kernel/mediatek/+/android-3.18

I believe that Kroah-Hartman source code would build a kernel just fine on its own, but it's not specific to our particular device. I experimented with building it just as is, and the make script starts you out with a lot of configuration questions that have to be answered Y/N. Many of those configurations I had already set up previously in a .config file when doing a "make menuconfig" with the sources that [MENTION=1533335]fran89[/MENTION] posted, so I wanted to use that previous .config file that I had previously generated. And the Kroah-Hartman source code had none of the lcsh8735m files that the Lenovo source had.

So in the end, I searched for all the lcsh8735m* files from the Lenovo source and merged them into the Kroah-Hartman source, along with my previous .config file, along with a missing cust.dtsi file that I located from here: https://github.com/olegsvs/android_kernel_ark_benefit_m7_mm/blob/alps-mm/arch/arm/boot/dts/cust.dtsi

That all did the trick. The main changes I made from the default kernel configuration, was to enable FTDI serial USB support, and change the default CPU_FREQ_GOV from interactive to performance.

So now I have a complete source code folder with all the built objects in it, as well as the Image.gz-dtb file.

I am a little hesitant to go the next step with Android Kitchen and flash the kernel to my Tab3 8. I have never done a kernel flash before, and there were some warnings given during the build process that worry me a bit, although they weren't fatal errors, and the build completed with an Image.gz-dtb file produced.

I would appreciate someone more experienced than me having a look over my work at this point. Probably [MENTION=7383447]MotoJunkie01[/MENTION] is best equipped to check it out. I have zipped up the whole compiled source code folder as a tar.gz file, but it's still 700 MB, so I doubt it would work as a file attachment to a post here.

I don't have a git account, and I'm a little hazy on how to deal with this 700 MB tar.gz file now, so suggestions appreciated.

FWIW, I did this work on a Windows 10 64-bit PC, using VMware Workstation 12 Player to run Xubuntu 16.04. I'm aware that some people here have issues with running Linux in a virtual machine, but it seemed to work ok for me. I used the old android-ndk-r11c toolchain.

Here are my build commands from the terminal, once getting a copy of the toolchain and the source code folder in place:

cd /home/limited_imagination/Desktop/mediate-android-3.18/
export CROSS_COMPILE=/home/limited_imagination/android/android-ndk-r11c/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-
export ARCH=arm64 && export SUBARCH=arm64
make -j5 ARCH=arm64 CROSS_COMPILE=/home/limited_imagination/android/android-ndk-r11c/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-