Raspberry Pi to Banana Pi migration

Customized Kernel

Raspbian for the Bananapi 3.1 includes a 3.4.90 linux kernel, which doesn’t seem as much ripened as the Raspberry Pi kernel. It includes a lot of features that are probably not needed for the average user. It’s my impression that it requires too much resources.

Furthermore, a lot of dispensable drivers are compiled into the kernel, stealing some of Banana Pi’s precious RAM. Therefore, I made a new kernel with as much drivers as possible compiled as a module.

Compiling a new kernel for the machine requires a cross tool-chain for the ARM platform. On an Ubuntu system, the required packages are:

build-essential u-boot-tools binutils-arm-linux-gnueabihf gcc-4.7-arm-linux-gnueabihf-base g++-4.7-arm-linux-gnueabihf gcc-arm-linux-gnueabihf cpp-arm-linux-gnueabihf libusb-1.0-0 libusb-1.0-0-dev git wget fakeroot kernel-package zlib1g-dev libncurses5-dev

I tried to set-up a tool-chain for OpenSuSe 12.3 from the distribution’s repositories, but failed. Therefore, I first compiled a new kernel on the Banana Pi, which is possible but horribly slow. The bananapi-linux kernel sources can be retrieved from github:

git clone -b bananapi-3.4 https://github.com/LeMaker/linux-bananapi.git

Make sure to have enough space left on your SD card. Then, configure the kernel with:

make menuconfig
make uImage modules
make INSTALL_MOD_PATH=output modules_install
mkdir -p output/boot/
cp arch/arm/boot/uImage output/boot/

As a starting point for configuring the new kernel, I loaded the /proc/config.gz of the pre-compiled kernel into menuconfig. Then, I disabled kernel-features which I don’t need. When the compilation is done (it takes about half an hour), move ./output/boot/uImage to /boot/bananian (backup your old uImage, in case your new kernel doesn’t boot). Move the ./output/lib/modules/3.4.90-xxxx+ directory into to /lib/modules.

Results

I was able to shrink the kernel size to less than 3.6 MB. However, there were some issues with the Realtek 8192cu wireless driver that I couldn’t solve. The USB wlan dongle was properly recognized, but it failed to connect to the router, with the blue dongle LED remaining constantly on. A Ralink 28xx dongle was able to connect using the same kernel configuration. However, the connection dropped frequently, so that I rolled back to the original Raspbian for Bananapi 3.1 kernel.

Leave a Reply

  Subscribe  
Notify of