BananaPi bananian newer Kernel


can anybody instruct me how to build a new Kernel for first Bananapi

frank@bananapi:~$ uname -r

frank@bananapi:~$ cat /proc/cpuinfo 
Processor	: ARMv7 Processor rev 4 (v7l)
processor	: 0
BogoMIPS	: 2008.24

processor	: 1
BogoMIPS	: 2015.48

Features	: swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 4

Hardware	: sun7i
Revision	: 0000
Serial		: 0541920d514848488048578816516647

frank@bananapi:~$ ls /boot/
config-3.4.108-bananian      modes.txt            vmlinuz-3.4.108-bananian
config-3.4.113-bananian                    vmlinuz-3.4.113-bananian

actually i’m using 3.4.113-bananian (last bananian release) i have there the config, but my experience with R2 shows that there is a DTB appended and the zImage is used…since the image on bananian is called vmlinuz-3.4.113-bananian and i’ve found no uenv.txt i have no glue if dtb is appended (possible before 4.x??) and how to instruct bootloader (uboot??) to use my own kernel

i don’t want to setup a full new system…only a newer Kernel

regards Frank

First - you need to find the sources for the kernel on the net. Then you need arm toolchain (arm gcc, etc). To compile kernel you need to do:

cd /usr/src/linux-kernel
cp /boot/config-3.4.113-bananian ./.config
make ARCH=arm CROSS_COMPILE=arm-none-eabi-

the binary of the kernel should be in /usr/src/linux-kernel/arch/arm/boot/uImage or zImage. The DTB should be in /usr/src/linux-kernel/arch/arm/dts/*.dtb.

Then you need to find out which bootloader your system uses. If it is uboot you can use following command:

bootz 0x40008000 - 0x44000000

but first you need to load the kernel and DTB to memory from uboot level. For example:

fatload mmc 0:1 0x40008000 zImage
fatload mmc 0:1 0x44000000 devicetree

If you are booting your system from MMC/SD card.

can i find out bootloader in running system? or do i need to reboot with debug uart and show what is printed?

m1 uses eabi instead of eabihf? for r2 i use the ubuntu-gcc toolchain (gnu-eabihf)

The simplest way to find out which bootloader you are using is to connect cable to DEBUG UART port and run some terminal program (minicom, picocom, etc) and reboot the bananapi.

Sorry, but I don’t know which toolchain should be used for your bananapi: eabi or eabihf. I am using Banana PI M2 Ultra.

How do i say the bootloader which file should be used without loading it via console? on r2 i have an uenv.txt where the filename of kernel is specified

Can i test if eabi/eabihf is used in runtime

It depends of course on the bootlader you have got. I gave you recipe for uboot (bootz …). But maybe you use another bootloader. I don’t know.

Try to use “file” command:

file arm_binary jessie/main file armhf 1:5.22+15-2+deb8u3

depending on apt armhf is used

frank@bananapi:~$ file /bin/bash
/bin/bash: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/, for GNU/Linux 2.6.32, BuildID[sha1]=90132c73f3c9d
4dacfda87128daa35cb6618f4e7, stripped