[General Questions and Answers] Matt07211:
This is in relation to this and my post on xda.

The main reason I want to make a custom kernel is to gain root and once I successfully have then add other CPU governors, and since this is considered a low activity device on xda I will have to do this myself. Also I you are just gonna say use twrp to flash SuperSU, well I can't as it seems to not work with the device when its running Lollipop 5.1.1

Device Specifications:

Current Android Version: Android Lollipop 5.1.1

Chipset: Marvell Armada PXA1908 (Note: Due to this being a rarely used chip, the CF-Auto root won't work)

Custom Recovery Status: TWRP 3.0.2-0 (More on this later on)

Root Status (This is why I am here): Android KitKat 4.4.4 (Root) , Android Lollipop 5.1.1 (NO ROOT Yet)

ARMv8 64-bit

Now let's get into my steps up to the point and then my problem.

Note: In the kernel readme it states to use the toolchain 4.8 but when I use it, it complains of not being able to find gcc. Also in the read me it states "get Toolchain download and install arm-eabi-4.8 toolchain for ARM EABI.(64bit)" and when reading up on it, https://developer.android.com/ndk/guides/standalone_toolchain.html#syt , it says to use aarch64 for ARM 64 Bit devices.

Device Source Code can be found at Here

cd ~/android
export CROSS_COMPILE=~/android/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-
cd ~/android/kernel
make ARCH=arm64 pxa1908_xcover3lte_eur_defconfig
make ARCH=arm64

This outputs: Image, Image.gz, .dts and .dtb files.

Where's the kernel readme (I believe this hasn't been update since kitkat) says the output will be,

- Kernel : Kernel/arch/arm/boot/zImage

- module : Kernel/drivers/*/*.ko

Note: when trying to compile with the 32- bit ARM toolchain it fails, as the config is found in arm64, wheres other configs are found in arm.

So know I have a kernel (Image or Image.gz), and some .dts and .dtb files. Now to unpack boot.img, this is where problems occur. When trying to use tools like abootimg or the various different versions of unmkbootimg, they complain about non-standard boot.img.

[IMG="Non-Standard boot.img"]http://i.stack.imgur.com/ID21j.png[/IMG] or [IMG="Non-Standard boot.img 2"]http://i.stack.imgur.com/SOpdl.png[/IMG]

While also try saving it as a zImage when its meant to be a Image.gz, or they extract it without throwing any errors, but when looking at the extracted files with a hex editor, it is all 00 throughout the files, therefore a useless file.

So their for I tried manually unpacking with a hex editor and managed to get the kernel. Left is my Compiled and Right is the hex version. [IMG="Kernels, Hex and Compiled"]http://i.stack.imgur.com/satHz.png[/IMG]

Notice the difference in size, is this because the kernel in boot.img is stripped of its debugging items while mine isn't? If so I should look up on how to fix that.

But am having troubles trying to extract the ramdisk via hex.

So is anyone able to either:

a) Help me extract the boot.img properly (with tools like unmkbootimg or with a hex editor)

or

b) do this for me and explain how you achieved it so I myself is am able to do it when needed.

I have attached necessary files if you want to have a look at them yourself.

Any help is appreciated.

FIles(XDA attachments not working): https://drive.google.com/file/d/0B_5mtquWAP3MZjJQay1ERFprbnM/view?usp=sharing