Hacking the bq, Part 4: Building and booting a kernel
NOTE: Thanks to Ondrej Kubik and Oliver Grawert from Canonical for their input.
Sometimes you want to run your own kernel on the device because the production kernels don’t have all the interesting options enabled. Or you want to change the kernel commandline used by the bootloader. The following instructions have been tested with the bq Aquaris E4.5 Ubuntu Edition.
Installing the prerequisites
Without these installed, the build will silently fail.
Building the kernel
Check out the aquaris-E4.5-ubuntu-master
branch:
Change the kernel configuration (if necessary):
Build the kernel:
Build the Android boot image:
You should end up with a boot.img
file.
Booting the new kernel once
Boot the phone into Fastboot mode and then run the following command on the host:
The image will be downloaded, the phone will take a bit to process it and then run the modified kernel until the next reboot.
Permanently booting the new kernel
Boot the phone into Fastboot mode and then run the following commands on the host:
The new kernel has now been permanently flashed to the device and will be booted until it is overwritten by the user or an OTA update.
Changing the kernel command line
An Android boot image consists of the kernel image, an initrd and a bootimg.cfg
parameter file for the bootloader. The bootimg.cfg
supports a cmdline
parameter, whose value will be appended to the default kernel command line.
The easiest way to change this is to use abootimg
and change this parameter in-place:
Now boot the image as shown above.
If you know better and/or something has changed, please find me on Launchpad.net or the Freenode IRC and do get in contact!