# Unpacking 'Non-Standard' Boot.img Problems for 64 Bit Device

This is in relation to this XDA thread and my thread on xda. This is a cross post from XDA, trying my luck on here. I also asked this question on Stackoverflow, but am covering all my bases and trying my luck here as well.

Device specs, just in case someone asks

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 (Not working with lollipop)
• Root Status (This is technically 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, 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.

or

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 therefor I tried manually unpacking with a hex editor and managed to get the kernel. Left is my Compiled and Right is the hex version.

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 I am having troubles trying to extract the ramdisk via hex. So is anyone able to Teach/Help me extract the boot.img properly (with tools like unmkbootimg or with a hex editor)

I have attached necessary files if you want to have a look at them yourself. Files: Samsung xCover3 Files

Any help is appreciated.