Building a Debian Style Kernel

NOTE: This will probably go easier if you have extended the 16M boot partition, this can be done and have the process still work. Mine is currently at 48M but could do with being 64M or bigger.

Using the Debian image on the mele, I have compiled a Debian style kernel (and header) package.

Config here: http://dl.dropbox.com/u/1397036/mele/initial_config

This is the one posted on around the 9th of May on the mailing list. I will be trying to add extra bits to this as time allows.

Git tree used https://github.com/amery/linux-allwinner (allwinner-v3.0-android) branch. 3.0.31 at the time of writing.

Had to change scripts/package/builddeb

Comment out "make headers_check" the android headers are a bit messed up. Consequently I don't know if the headers package actually works, oh well.

do a make clean; make oldconfig (should be one thing to say no to....)

then the magic:

fakeroot make KBUILD_DEBARCH=armhf EXTRAVERSION=-1-allwinner KDEB_PKGVERSION=1.0.allwinner deb-pkg

Obviously the EXTRAVERSION and KDEB_PKGVERSION are arbitrary, possbily sun4i would be more appropriate.

Wait.........

Now to get the auto install to work install "flash-kernel" (think this pulls in the uboot tools), you may also want "initramfs-tools".

Add the following stanza to /usr/share/flash-kernel/db/all.db

Machine: sun4i\
Kernel-Flavors: dg+\
Machine-Id: 3495\
U-Boot-Kernel-Address: 0x40008000\
U-Boot-Initrd-Address: 0x0\
Boot-Kernel-Path: /boot/uImage.sun4i\
Boot-Initrd-Path: /boot/uInitrd.sun4i\
Required-packages: u-boot-tools\
Bootloader-sets-root: yes\

Now some of the settings in here will change, but this will get you an automatically generated uImage and uInitrd with the kernel source as it stands. Currently the android kernels are ignoring the machine-id, but this will change.

Before you install the kernel you will probably want to edit /etc/initramfs-tools/initramfs.conf and change MODULE=most to MODULES=dep or you will get a colossal uInitrd.

Here are the links to my packages (update 11/5/2012 Packages contain less reserved RAM):

http://dl.dropbox.com/u/1397036/mele/linux-headers-3.0.31-2-allwinner-dg%2B_1.1.allwinner_armhf.deb http://dl.dropbox.com/u/1397036/mele/linux-image-3.0.31-2-allwinner-dg%2B_1.1.allwinner_armhf.deb

Note: the above packages can not be installed on the Ubuntu image talked about on this wiki as these debs are armhf whereas the ubuntu image is armel.

You need to change the uboot (via a serial connection) to boot this:

I have:

           boot_deb  set to "fatload mmc 0 0x48000000 uImage.sun4i; fatload mmc 0 0x55000000 uInitrd.sun4i; bootm 0x48000000 0x55000000"\
           bootargs    set to "console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait fbmem=1"    (key here remove the init=)\
           bootcmd    set to "run load4 boot_deb"\
           load4          set to "fatload mmc 0 43000000 mele_stock.bin"\