User Tools

Site Tools


kernel_build

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
kernel_build [2025/01/21 23:10] ounsatnkernel_build [2025/01/21 23:45] (current) ounsatn
Line 33: Line 33:
 Extract kernel source 5.15 with  Extract kernel source 5.15 with 
 <code> tar -xf linux-5.15.tar.xz </code> <code> tar -xf linux-5.15.tar.xz </code>
 +
 +it will create a folder linux-5.15, this is what i call __**source tree**__ ( or kernel source ) 
  
 {{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/KernelSourceFile.JPG}} {{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/KernelSourceFile.JPG}}
Line 53: Line 55:
  
  
-apply dos2unix on each patches and in folder patches ( extracted from patches-5.15.86-rt56) +apply dos2unix on each patchesand in folder patches ( extracted from patches-5.15.86-rt56) 
-<code>dos2unix patch* +<code>dos2unix patch-5 
 +cd patches 
 dos2unix *.patch </code> dos2unix *.patch </code>
  
-Go to kernel source and patch like below +__Go to kernel source__ and patch like below 
  
  
Line 68: Line 71:
 </code> </code>
  
-now you have 5.15.89-rt56+Order is : 5.15.86, Rtpatch 5.15.86-rt56 , 5.15.86-87 , 5.15.87-88 , 5.15.88-89
  
 +Now we have 5.15.89-rt56 8-)
  
-go to source tree folder : + 
 +__stay in source tree folder :__ 
  
 Change localversion in file localversion-rt Change localversion in file localversion-rt
 <code> change -rt56 to -inmusic-2023-01-18-rt56 </code> <code> change -rt56 to -inmusic-2023-01-18-rt56 </code>
 +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/localversion_change.JPG}}
 +
  
 Get kernel config from AkaiForce kernel : this file is named config.gz and we can find it in /proc/ (on AKF ) Get kernel config from AkaiForce kernel : this file is named config.gz and we can find it in /proc/ (on AKF )
-gunzip the file+unzip the file with gunzip
 <code>gunzip config.gz </code> <code>gunzip config.gz </code>
  
-It gives a config file+It gives a file named "config"  
  
-Copy this file in source tree with .config name. +Copy this file in source tree folder as **".config"** name. 
  
- +go to source tree folder to build menuconfig 
-go to source tree to build menuconfig +
 <code> make menuconfig </code> <code> make menuconfig </code>
  
 +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/Make_menuconfig.JPG}}
  
  
-.config taken from force changed feature like :  
  
-- General Setup / Local version string, now it's empty (let it empty )  +.config taken from force has features like :  
-- General Setup / Preemption model => Fully Preemptible Kernel ( Real-Time ) : this give the rt56+ 
 + - General Setup / Local version string, now it's empty (let it empty )  
 + 
 + - General Setup / Preemption model => Fully Preemptible Kernel ( Real-Time ) : this give the rt features
        this option is only available after patching with rt56 patch.         this option is only available after patching with rt56 patch. 
 +
 +( and of course other features ...) 
 +
 +
 +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/Menuconfig_generalsetup.JPG}}
 +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/Menuconfig_Premptionmodel.JPG}}
 +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/Menuconfig_CheckRTl.JPG}}
 +
                
-As we have the kernel configuration, you can see what features are already in the kernel, and which are not. +As we have the kernel configuration, you can see what features are already in the kernel, and whiches are not. 
-To test kernel, i will compile a module which is not there by default , I will do it with "Joystick Interface" :+To test kernel viability, 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+It's in  : DeviceDrivers >> Input device support >> Joystick Interface
  
 Just put a M like below , then save & Exit menuconfig Just put a M like below , then save & Exit menuconfig
  
  
-Now when your back in source tree type +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/JoystickModule.JPG}} 
 + 
 + 
 +Now when your back in source tree folder type 
 <code> make modules_prepare </code> <code> make modules_prepare </code>
  
-then go to your module folder in source tree.  +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/make_module_prepare.JPG}} 
-For joystick it's in /src/builddemo/linux-5.15/drivers/input + 
 +Then go to your module folder in source tree.  
 +For joystick module we've checked in kernel config, it'located in /src/builddemo/linux-5.15/drivers/input 
  
 and launch : and launch :
-<code> ~/src/builddemo/linux-5.15/drivers/input$ make -C ~/src/builddemo/linux-5.15/ M=$PWD </code> 
  
-Make detect you have check joystick device as module in kernel config, so it compile the associated module source file. +<code>  
 +syntax is : make -C <path_to_kernel_dir> M=$PWD 
 + 
 +so i do :  
 +~/src/builddemo/linux-5.15/drivers/input$ make -C ~/src/builddemo/linux-5.15/ M=$PWD  
 + 
 +</code> 
 + 
 +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/Make_module.JPG}} 
 + 
 + 
 +Make detects that you have checked joystick device as module in kernel config, so it compiles the associated module source file.  
 + 
 + 
 +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/Make_module_2.JPG}}
  
 Then you have your module.  Then you have your module. 
 +
 you can check version in module with command  you can check version in module with command 
 <code> grep -a inm joydev.ko </code> <code> grep -a inm joydev.ko </code>
  
 +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/grep_inmusic.JPG}}
  
  
 Now it's time to copy module on your force. Now it's time to copy module on your force.
 +
  
 On AKF :  On AKF : 
 +
 remount / partition in rw :  remount / partition in rw : 
 +
 <code> mount remount / -o rw,exec,remount </code>  <code> mount remount / -o rw,exec,remount </code> 
 +
 copy module file to /usr/lib/modules/5.15.89-inmusic-2023-01-18-rt56/kernel/drivers/input  copy module file to /usr/lib/modules/5.15.89-inmusic-2023-01-18-rt56/kernel/drivers/input 
  
-Each time i copy a module, i try to respect the source tree path, so if you don't have drivers/input folder, create it and put module inside.  +Each time i copy a module, i try to respect the source tree path, so if you don't have **drivers/input** folder, create it and put module inside.  
-then do command depmod+then do command depmod to says system new module is there.  
 <code> depmod </code> <code> depmod </code>
  
 +Issue command lsmod to see current loaded modules : 
 +
 +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/lsmod_before.JPG}}
 +
 +do modprobe joydev 
 +
 +Issue it again, tadaaaa it's there. 
  
 +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Kernel/modprobe_joydev.JPG}}
  
  
kernel_build.1737497454.txt.gz · Last modified: 2025/01/21 23:10 by ounsatn

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki