https://wiki.st.com/stm32mpu-ecosystem-v2/index.php?title=How_to_customize_the_Linux_kernel&feed=atom&action=history
How to customize the Linux kernel - Revision history
2024-03-29T14:29:06Z
Revision history for this page on the wiki
MediaWiki 1.31.16
https://wiki.st.com/stm32mpu-ecosystem-v2/index.php?title=How_to_customize_the_Linux_kernel&diff=67259&oldid=prev
Jean Christophe Trotin at 07:50, 3 February 2020
2020-02-03T07:50:15Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 07:50, 3 February 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"><noinclude></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">{{ArticleMainWriter | ChristopheM}}</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">{{ArticleApprovedVersion | ChristopheM | BernardP, Jean-ChristopheT, NathalieS | No previous approved version | PhilipS - 29Aug'18 - 8461 | 19Sep'18}}</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">[[Category:How to customize software]]</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">[[Category:Distribution Package]]</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></noinclude></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Purpose of article==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Purpose of article==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This article gives the main steps needed to add kernel customization within the Yocto build process (with a Distribution Package).</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This article gives the main steps needed to add kernel customization within the Yocto build process (with a Distribution Package).</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l58" >Line 58:</td>
<td colspan="2" class="diff-lineno">Line 50:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>     file://<kernel version>/<kernel version>.<revision>/0002-Driver-change.patch \</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>     file://<kernel version>/<kernel version>.<revision>/0002-Driver-change.patch \</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>     "</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>     "</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"><noinclude></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:How to customize software]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:Distribution Package]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{PublicationRequestId | 8461 | 2018-08-29 | PhilipS}}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></noinclude></ins></div></td></tr>
</table>
Jean Christophe Trotin
https://wiki.st.com/stm32mpu-ecosystem-v2/index.php?title=How_to_customize_the_Linux_kernel&diff=42388&oldid=prev
Frq08988 at 12:59, 19 November 2018
2018-11-19T12:59:15Z
<p></p>
<p><b>New page</b></p><div><noinclude><br />
{{ArticleMainWriter | ChristopheM}}<br />
{{ArticleApprovedVersion | ChristopheM | BernardP, Jean-ChristopheT, NathalieS | No previous approved version | PhilipS - 29Aug'18 - 8461 | 19Sep'18}}<br />
<br />
[[Category:How to customize software]]<br />
[[Category:Distribution Package]]<br />
</noinclude><br />
<br />
==Purpose of article==<br />
This article gives the main steps needed to add kernel customization within the Yocto build process (with a Distribution Package).<br />
<br />
==Pre-requesites==<br />
You are already familiar with the Yocto build process and OpenSTLinux distribution.<br />
<br />
You have already created a customer layer ([[How to create a new open embedded layer]]) to update, for your own needs, the OpenSTLinux distribution.<br><br />
<br />
We describe here what you must do once you have:<br />
* [[How to cross-compile with the Distribution Package#modifying_kernel_configuration|modified the kernel configuration]]<br />
* [[How to cross-compile with the Distribution Package#Modifying_the_Linux_kernel_device_tree|modified the Linux kernel device tree]]<br />
* [[How to cross-compile with the Distribution Package#Modifying_a_built-in_Linux_kernel_device_driver|modified a built-in device driver]]<br />
so that these modifications are taken into account in your build process.<br />
<br />
==Adding kernel customization (including Linux kernel device tree, configuration, driver modification)==<br />
<br />
* First, create (in your custom layer) a <name of kernel recipe>.bbappend file<br />
{{PC$}} touch ../meta-my-custo-layer/recipes-kernel/linux/<name of kernel recipe>.bbappend<br />
<br />
===Adding kernel configuration modifications===<br />
* Identify all new configs you set or unset with: {{PC$}} bitbake <name of kernel recipe> -c menuconfig<br />
* Put them inside a new fragment file and copy the fragment here:<br />
{{PC$}} cp <custom-fragment>.config ../meta-my-custo-layer/recipes-kernel/linux/<name of kernel recipe>/<kernel version>/<br />
* Update accordingly <name of kernel recipe>.bbappend:<br />
KERNEL_CONFIG_FRAGMENTS_append += "${WORKDIR}/fragments/<kernel version>/<custom-fragment>.config"<br />
SRC_URI_append = " file://<kernel version>/<custom-fragment>.config;subdir=fragments "<br />
<br />
For the use case described in the [[How to cross-compile with the Distribution Package#modifying_kernel_configuration]] example, you should:<br />
* Create fragment-cma-size.config with the following line:<br />
CONFIG_CMA_SIZE_MBYTES=256<br />
* Copy fragment-cma-size.config to ../meta-my-custo-layer/recipes-kernel/linux/linux-stm32mp/4.14/<br />
* Update ../meta-my-custo-layer/recipes-kernel/linux/linux-stm32mp.bbappend accordingly by adding these lines:<br />
KERNEL_CONFIG_FRAGMENTS_append += "${WORKDIR}/fragments/4.14/fragment-cma-size.config"<br />
SRC_URI_append = " file://4.14/fragment-cma-size.config;subdir=fragments "<br />
<br />
===Adding kernel driver or device tree modifications===<br />
The example given below is associated with the STM32MP15 Evaluation board, but the method is independent of the board.<br />
<br />
Once you have made the changes for the device tree in <build dir>/workspace/sources/<name of kernel recipe>/arch/arm/boot/dts/stm32mp157c-ed1.dts '''AND''', for built-in device driver in <build dir>/workspace/sources/<name of kernel recipe>/drivers/gpu/drm/stm/drv.c, you must:<br />
<br />
* Create the corresponding patch files:<br />
{{PC$}} cd <build dir>/workspace/sources/<name of kernel recipe>/<br />
{{PC$}} git format-patch -2<br />
* Copy these patch files into the custom layer<br />
{{PC$}} cp *.patch ../meta-my-custo-layer/recipes-kernel/linux/<name of kernel recipe>/<kernel version>/<kernel version>.<revision>/<br />
{{Warning|Patches are linked to a kernel version, which means that these patches are rebuilt if the kernel version changes, and copied to the according kernel version sub-folder}}<br />
* Update <name of kernel recipe>.bbappend accordingly:<br />
SRC_URI_append = " \<br />
file://<kernel version>/<kernel version>.<revision>/0001-DT-leds-change.patch \<br />
file://<kernel version>/<kernel version>.<revision>/0002-Driver-change.patch \<br />
"</div>
Frq08988