[Android Q&A, Help & Troubleshooting] lawgic:
Hi all,

My aim has been to compile a kernel for an Allwinner a10 F1-LY tablet (pengpod 700) that features PS3 and other gamepad support. I can upgrade my ROM to Cyanogenmod 10 to achieve this but then the hard buttons and screen rotation stop working.

After days of searching, reading and testing, I feel like I am close but need help getting over the line. I am running a virtualbox installation of Xubuntu.

Once I have this running, I will contribute a guide with screenshots back to the community.

My steps:

0. My device is running this ROM, which is JB 4.1.1 with root and CWM 5.5 installed. The image is based on a Seby build, and modified by Magica.

1. Install virtualbox and then 32 bit Ubuntu 13.0.4. Make sure you have 3D acceleration enabled and a decent amount of RAM allocated or it will run incredibly slow.

2. Install guest additions and a shared folder with the windows host machine.

3. Install some packages for later use:

sudo apt-get install gedit git ncurses5 jre-default

4. Make a folder in the home directory to work from. Open a terminal in it and then install the kernal library:

git clone https://github.com/linux-sunxi/linux-sunxi linux-sunxi
cd linux-sunxi
git checkout sunxi-3.0

5. Install the cross compile tool chain.

Download http://www.codesourcery.com/sgpp/lite/arm/portal/package7853/public/arm-none-linux-gnueabi/arm-2010.09-50-arm-none-linux-gnueabi.bin

Install with:

sudo ./arm-2010.09-50-arm-none-linux-gnueabi.bin

6. Setup kernel config.

make ARCH=arm sun4i_crane_defconfig
make menuconfig ARCH=arm

The second line opens up a GUI for configuring the kernel, where I activated the following options using here as a guide::

--- Networking support <*>
Bluetooth subsystem support --->
<*> HIDP protocol support
Bluetooth device drivers --->
<*> HCI USB driver
[*] HID Devices --->
Special HID drivers --->
<*> Sony PS3 controller
<*> DragonRise Inc. game controller
[*] DragonRise Inc. force feedback
<*> Pantherlord/GreenAsia game controller
[*] Pantherlord force feedback support
<*> GreenAsia (Product ID 0x12) game controller support
[*] GreenAsia (Product ID 0x12) force feedback support
<*> SmartJoy PLUS PS2/USB adapter support
[*] SmartJoy PLUS PS2/USB adapter force feedback support

I'm not sure if my thinking is correct here, but I went through the config and changed any modular options to included, to avoid the need for additional files to be copied to the device.

7. Compile kernel:

make ARCH=arm CROSS_COMPILE=/root/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-

This runs for a long time and will eventually produce a zImage file in the linux-sunxi/arch-arm-boot/ folder.

8. Get original boot.img from device.

To do this I booted into recovery mode and used the backup feature. This made a folder on my external SD card with boot.img and other archives. I then copied boot.img to the shared folder on my windows host.

9. Split original boot.img into zImage and ramdisk, replace zImage

Make a new folder in your home directory to keep this clean. Copy the original boot.img into this folder.

I downloaded and unzipped Adi_Pat's scripts from here. into the new folder.

The boot.img file will be unpacked with:

./extract.sh

I then deleted the zImage in the kernel folder and replaced it with the one compiled earlier from linux-sunxi/arch/arm/boot/. The ramdisk was left alone.

10. Modify script and repack boot.img

I'm aware that Adi_pat's script is for a different device, so I modified the pack_boot.sh script to suit the a10. Line 31 becomes:

./tools/mkbootimg --kernel kernel/zImage --ramdisk ramdisk.gz -o out/boot.img --base 0x40000000 --cmdline 'console=ttyS0,115200 tw init=/init loglevel=8' --pagesize 2048

This is based on searching and the the information given when running extract.sh. The updated script can now be executed:

./pack_boot.sh

A new boot.img is created at out/boot.img.

11. Put new boot.img onto device and flash.

I copied the new boot.img into my shared folder and then onto a SD card. Using a root file explorer on the device, move the boot.img file to the /sdcard directory. Open Novo7 tools and then go to the flash boot.img option.

12. Reboot device

When the device reboots, it hangs on the first Android logo, so clearly something has been done incorrectly. Fortunately I can recover to a working device from the backup in CWM recovery in just a few minutes.

Obviously I'm doing something wrong here, and would appreciate any pointers to get it working.

I have searched and read for days, so I am sorry if I have missed a thread that answers this for me.

Many thanks in advance.