Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
Letzte ÜberarbeitungBeide Seiten der Revision
software:linux:realtime:preempt_rt:build_kernel [2019-02-13 16:55] mgehrig2software:linux:realtime:preempt_rt:build_kernel [2019-02-15 10:52] mgehrig2
Zeile 19: Zeile 19:
 ==== Get the Linux sources ==== ==== Get the Linux sources ====
   * Clone the kernel <code>git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git</code>   * Clone the kernel <code>git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git</code>
-  * Check out the same version as choosen for the patch <code>git checkout -b RTPatch tags/v4.4.148</code>+  * Check out the same version as chosen for the patch <code>git checkout -b RTPatch tags/v4.4.148</code>
  
 ==== Install the compatible generic kernel ==== ==== Install the compatible generic kernel ====
Zeile 30: Zeile 30:
 ===== Build the kernel ===== ===== Build the kernel =====
 ==== Patch the kernel sources ==== ==== Patch the kernel sources ====
-  * Go into the kenrel source directory +  * Go into the kernel source directory 
-  * Applay the patch<code>cd <pathToKernelSrc>+  * Apply the patch<code>cd <pathToKernelSrc>
 patch -p1 < <pathToPatch>/patch-4.4.148-rt166-rc1.patch</code> patch -p1 < <pathToPatch>/patch-4.4.148-rt166-rc1.patch</code>
  
Zeile 40: Zeile 40:
  
  
-  * **a.) Full module support** **(recommended)** A normal Linux distribution, like Ubuntu, will install a kernel and most of the available kernel modules. Many of them are never used, because they are drivers for hardware, wich is not installed on the PC. This variant contains the same modules like a full Ubuntu kernel. +  * **a.) Full module support** **(The easy way)** A normal Linux distribution, like Ubuntu, will install a kernel and most of the available kernel modules. Many of them are never used, because they are drivers for hardware, which is not installed on the PC. This variant contains the same modules like a full Ubuntu kernel. 
-  * **b.) Minimal**: This will only build modules which are essential. Some basic function like Wifi drivers may be missing. Some basic Ethernet drive are in the monolitic part of the kernel and will still work. You can add all modules you need manually.+  * **b.) Minimal**: **(The propper way)** This will only build modules which are essential. Some basic functionality, like WiFi driversmay be missing. Some common Ethernet drive are in the monolithic part of the kernel and will still work. You can add all modules you need manually. This method is recommended in order to obtain a system that is as stable as possible. If fewer drivers are loaded, there is less risk that an unused driver will cause high latency.
  
 ==== Configure the kernel ==== ==== Configure the kernel ====
Zeile 49: Zeile 49:
 cp /boot/<yourDistributionConfig> ./.config</code> cp /boot/<yourDistributionConfig> ./.config</code>
   - Applay the configuration to the patched kernel sources.<code>make oldconfig</code>   - Applay the configuration to the patched kernel sources.<code>make oldconfig</code>
-    * This will applay the configuration. However, since the kernel is patched and not identical to the generic kernel, not all configurations are defined. Acccept all presented options with ''ENTER''.+    * This will apply the configuration. However, since the kernel is patched and not identical to the generic kernel, not all configurations are defined. Acccept all presented options with ''ENTER''.
  
  
 === b.) Minimal === === b.) Minimal ===
-TODO+You have three different options: 
 +  * **1.)** Configure the kernel to add only the bare minimum. Add all additional modules manually. 
 +  * **2.)** Configure the kernel to add all modules, which are currently loaded on the host pc. 
 +  * **3.)** Configure the kernel to add all modules, which are currently loaded on a different pc.
  
 +== 1.) Bare minimum ==
 +  - ''cd <pathToKernelSrc>''
 +  - Depending on the CPU architecture:
 +    - X86 - 64bit ''make x86_64_defconfig''
 +    - X86 - 32bit ''make i386_defconfig''
 +    - See ''<pathToKernelSrc>/arch/<architecture>/configs'' for more possibilities
 +  - Open the configuration menu ''make menuconfig''
 +  - Add all modules and drivers you need.
 +
 +== 2.) Copy module configuration from host ==
 +  - ''cd <pathToKernelSrc>''
 +  - ''make localmodconfig''
 +  - Open the configuration menu ''make menuconfig''
 +  - Add all additional modules and drivers you need.
 +
 +**Note**: Most modules are only loaded when they are needed.
 +
 +
 +== 3.) Copy module configuration from a different machine ==
 +On target machine (with generic kernel loaded):
 +  - ''lsmod > /tmp/mylsmod''
 +
 +On host:
 +  - ''cd <pathToKernelSrc>''
 +  - Copy the '//mylsmod//' file:
 +    - ''scp <targetUsername>@<targetHostname>:/tmp/mylsmod ./''
 +  - ''make LSMOD=./mylsmod localmodconfig''
 +  - Open the configuration menu ''make menuconfig''
 +  - Add all additional modules and drivers you need.
  
 === Additional configurations === === Additional configurations ===