User Tools

Site Tools


kernel_build

This is an old revision of the document!


Objectives of this tuto is to build module compatible with current AKF kernel

Kernel version of the force is 5.15.89-inmusic-2023-01-18-rt56

To build same kernel/module as force you'll need :

- Arm processor to build source, you can cross compile but it is easier to do it on an arm processor ( so you can use raspberry pi, arm chromebook etc.., on my side i use an ARM chromebook with a RK3288; same chip as akaiforce.

- Linux kernel source version 5.15 https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.tar.xz

- Linux kernel patch version 5.15.86 https://cdn.kernel.org/pub/linux/kernel/v5.x/patch-5.15.86.xz

- Linux incremental patch 5.15.86-87 https://cdn.kernel.org/pub/linux/kernel/v5.x/incr/patch-5.15.86-87.xz

- Linux incremental patch 5.15.87-88 https://cdn.kernel.org/pub/linux/kernel/v5.x/incr/patch-5.15.87-88.xz

- Linux incremental patch 5.15.88-89 https://cdn.kernel.org/pub/linux/kernel/v5.x/incr/patch-5.15.88-89.xz

- Linux realtime ( RT ) patch 5.15.86-rt56 https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.15/older/patches-5.15.86-rt56.tar.gz

- dos2unix tool (apt-get)

- config file from AKF kernel.

Extract kernel source 5.15 with

 tar -xf linux-5.15.tar.xz 

Unzip all patches

unxz patch-5.15.86.xz 
unxz patch-5.15.86-87.xz
unxz patch-5.15.87-88.xz 
unxz patch-5.15.88-89.xz 
tar xvzf patches-5.15.86-rt56.tar.gz

apply dos2unix on each patches and in folder patches ( extracted from patches-5.15.86-rt56)

dos2unix patch* 
dos2unix *.patch 

Go to kernel source and patch like below

cd linux-5.15
/linux-5.15$ patch -p1 < ../patch-5.15.86
/linux-5.15$ cat ../patches/*.patch | patch -p1
/linux-5.15$ patch -p1 < ../patch-5.15.86-87
/linux-5.15$ patch -p1 < ../patch-5.15.87-88
/linux-5.15$ patch -p1 < ../patch-5.15.88-89

now you have 5.15.89-rt56

go to source tree folder :

Change localversion in file localversion-rt

 change -rt56 to -inmusic-2023-01-18-rt56 

Get kernel config from AkaiForce kernel : this file is named config.gz and we can find it in /proc/ (on AKF ) gunzip the file,

gunzip config.gz 

It gives a config file.

Copy this file in source tree with .config name.

go to source tree to build menuconfig

 make menuconfig 

.config taken from force changed feature like :

- General Setup / Local version string, now it's empty (let it empty ) - General Setup / Preemption model ⇒ Fully Preemptible Kernel ( Real-Time ) : this give the rt56.

     this option is only available after patching with rt56 patch. 
     

As we have the kernel configuration, you can see what features are already in the kernel, and which are not. To test kernel, i will compile a module which is not there by default , I will do it with “Joystick Interface” :

It's in : DeviceDrivers »> Input device support »> Joystick Interface

Just put a M like below , then save & Exit menuconfig

Now when your back in source tree type

 make modules_prepare 

then go to your module folder in source tree. For joystick it's in /src/builddemo/linux-5.15/drivers/input

and launch :

 ~/src/builddemo/linux-5.15/drivers/input$ make -C ~/src/builddemo/linux-5.15/ M=$PWD 
kernel_build.1737495392.txt.gz · Last modified: 2025/01/21 22:36 by ounsatn

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki