How to backport Linux device drivers

3 min read読了の目安(約2700字

What is backporting ?

The official site ( has good definition.

"Backporting" is the process of making new software run on something old. A version of something new that's been modified to run on something old is called a "backport".

Of course you can backport device drivers by yourself, you can backport more easily with tools developed by Linux backports project. This document explains procedure of backporting with backports project tools.


This document explains procedure of backporting Linux 4.4 device drivers to Linux 3.10.108.

Obtain linux-next

Because backports relying on linux-next tree.

cd ~/
mkdir git
cd ~/git
git clone git://

Obtain backporting source tree

cd ~/git
git clone git://
cd linux-stable
git checkout v3.10.108

Obtain backporting destination tree

cd ~/git
git clone git://
cd backports
git checkout linux-4.4.y

Install coccinelle

If your coccinelle version of distribution package is less than 1.0.5, install with package.

sudo apt install coccinelle

If more than 1.0.6, install a older version with source. Because the coccinelle changes syntax[1] from 1.0.6.
This is the procedure of building with 1.0.4 [2] .

git clone
cd coccinelle
git checkout 1.0.4
sudo apt install pkg-config ocaml-native-compilers ocaml-findlib menhir libmenhir-ocaml-dev libpcre-ocaml-dev texlive-fonts-extra texlive-latex-base
make clean
sudo make install

This is a workaround. In the future, backports requires more than 1.0.6. The maintainer Johannes said.

run the backporting

cd ~/git/backports
./ --copy-list ./copy-list --integrate --clean --git-revision v4.4 ~/git/linux-next ~/git/linux-stable

This is the result.

Get original source files from git ...
Applying patches from patches to [your home]/git/linux-stable/backports/ ...
Modify Kconfig tree ...
Rewrite Makefiles and Kconfig files ...
Applying patches from integration-patches/ to [your home]/git/linux-stable ...


Change the kernel config and build.

cd ~/git/linux-stable
make menuconfig
[*] Backport Linux v4.4-0-gafd2ff9 (backports v4.4.2-1-0-gbec4037)  --->
make -j9
  1. To get more information for syntax change refer here. ↩︎

  2. We use 1.0.4 because 1.0.5 could not be built. ↩︎