Jun 19, 2015 0 Comments in Kernel, Learning by
Cosino’s Linux kernel

If you need to recompile the Linux kernel for your Cosino based board here you can find full instructions starting from getting the source code till the final installation of the binary images.

warning Note: this steps are valid for the Debian OS only! However you can easily adapt this step for every Linux distribution you’re willing to use.

Getting the code

First of all you have to clone the Linux repository on our GitHub page by using the following command on your host computer (not on Cosino!):

When finished you should have all the needed sources into the directory linux-cosino.

Kernel versions

In the tables below are reported all available kernel releases for each Cosino based board. These releases are the only supported by us.

Each kernel release can be extracted with the command

where <name> is the name you wish to use for the new branch holding the code of the kernel tag <tag>.

So, for instance, if you wish trying the cosino_mega2560-v3 tag you can use the following command:

To switch from one branch to another you can use the command:

where <branch> is the name of the branch you wish to work on. So, for instance, if you wish trying the linux-4.1-cosino branch you can use the following command:

Cosino Mega 2560

Branch Kernel tag Kernel version Note
linux-3.10.cosino cosino_mega2560-v1 3.10 PWM support added
cosino_mega2560-v2 3.10 USB support added
cosino_mega2560-v3 3.10 systemd support added
HEAD 3.10 Latest stable release
linux-4.1-cosino HEAD 4.1.0 Latest unstable release

The HEAD is not a tag, it represents the latest kernel release and it’s automatically extracted at each repository cloning or updating.

warning Note that unstable releases, even tested by us, are still under hard developing and should not be used in production environment!

Compiling the sources

Before compiling the code you must set up the cross compiler (on my Ubuntu I used the package gcc-arm-linux-gnueabi):

At this point you can cross compile the kernel by using:

warning Note: you can change the default configuration by issuing make menuconfig command before doing make zImage!

Installing the kernel

This step depends on the specific Cosino based board you’re using.

Cosino Mega 2560

To install a new kernel version on your Cosino Mega 2560 board just plug the microSD into your PC and then copy into the boot partition the new kernel image with the command:

warning Note: on my system the microSD is mounted on directory /media/giometti/boot/, please modify the above command in order to suite your system configuration.

Installing the modules, firmwares & headers

To copy the kernel modules, firmware images and headers into the microSD’s root partition the following commands can be used:

warning Note: on my system the microSD is mounted on directory /media/giometti/root/, please modify the above commands in order to suite your system configuration.

warning Note: see here how to build up a microSD with proper partitions.

Facebooktwitterlinkedin
Tags: