Difference between revisions of "Modify, rebuild and reload the Linux® kernel"

[quality revision] [quality revision]
m
m

1 Overview[edit]

This stage explains how modify, rebuild and reload the Linux® kernel.
You will first be guided to install the Linux® kernel source code in the Developer Package directory. Then step by step you will execute procedures to modify, rebuild and reload the Linux® kernel.

2 Download the the Linux® kernel source code[edit]

The software package is provided AS IS, and by downloading it, you agree to be bound to the terms of the software license agreement (SLA). The detailed content licenses can be found here.

Warning white.png Warning
To download a package, it is recommended to be logged in to your "myst" account [1]. If, trying to download, you encounter a “403 error”, you could try to empty your browser cache to workaround the problem. We are working on the resolution of this problem.
We apologize for this inconvenience
Download the STM32MP15-Ecosystem-v1
2.1 For ecosystem release v1v2.2.0[edit]
.
2.0 Developer Package Sources to the following directory:
$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.2.0/Developer-Package
  • Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments
  • cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.2.0/Developer-Package tar xvf en.SOURCES-kernel-stm32mp1-openstlinux-20-02-19.tar.xz 2.2 For ecosystem release v1.1.0
    0 More info.png[edit]
    v1 1. Developer Package Sources to the following directory:
    $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1 1. / -
  • Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments
  • cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.1.0/Developer-Package tar xvf en.SOURCES-kernel-stm32mp1-openstlinux-4.19-thud-mp1-19-10-09.tar.xz
    2.3 For ecosystem release v1.0.0[edit]
    Download the STM32MP15-Ecosystem-v1.0.0 Developer Package
    • Sources to the following directory:
      $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-
    v1
    • v2.0.0/Developer-Package
    • Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments
     cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-
    
    v1
    v2.0.0/Developer-Package
     tar xvf en.SOURCES-kernel-stm32mp1-openstlinux-5-4
    
    .19
    -
    
    thud
    dunfell-mp1-
    
    19
    20-
    
    02
    06-
    
    20
    24.tar.xz
    
    

    3 Prepare the Linux® kernel source code[edit]

    • Extract the Linux® kernel source
    For ecosystem release  
    
    v1
    v2.
    
    2
    0.0 More info.png 
     cd stm32mp1-openstlinux-
    
    20-02-19/sources/arm-ostl-linux-gnueabi/linux-stm32mp-4.19-r0 tar xvf linux-4.19.94.tar.xz For ecosystem release v1.1.0 cd stm32mp1-openstlinux-4.19-thud-mp1-19-10-09
    5.4-dunfell-mp1-20-06-24/sources/arm-
    
    openstlinux_weston
    ostl-linux-gnueabi/linux-stm32mp-5.4.
    
    19
    31-r0
     tar xvf linux-
    
    4.19.49.tar.xz For ecosystem release v1.0.0 cd stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0 tar xvf linux-4.19.9.tar.
    5.4.31.tar.xz
    
    
    
    • Apply the ST patches
     cd linux-
    
    4.19.94/ /* For ecosystem release v1.2.0 */ cd linux-4.19.49/
    5.4.31 /* For ecosystem release  
    
    v1
    v2.
    
    1.
    0
    
    */ cd linux-4
    .
    
    19.9//*For ecosystem release v1.
    0
    
    .0
     More info.png  */
     
    
    for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
    
    
    • Apply fragments
     make ARCH=arm multi_v7_defconfig "fragment*.config"
     for f in `ls -1 ../fragment*.config`; do scripts/kconfig/merge_config.sh -m -r .config $f; done
     yes '' | make ARCH=arm oldconfig
    
    

    4 Build the Linux® kernel source code for the first time[edit]

    Info white.png Information
    The first time the kernel is build it could take several minutes.
    • Build kernel images (uImage and vmlinux) and device tree (dtbs)
     make ARCH=arm uImage vmlinux dtbs LOADADDR=0xC2000040
    
    
    • Build kernel module
     make ARCH=arm modules
    
    
    • Generate output build artifacts
     mkdir -p $PWD/install_artifact/
     make ARCH=arm INSTALL_MOD_PATH="$PWD/install_artifact" modules_install
    
    

    5 Deploy the Linux® kernel on the board[edit]

    5.1 Push the Linux® kernel into the board[edit]

     scp arch/arm/boot/uImage root@<board ip address>:/boot
    
    

    5.2 Push the devicetree into the board[edit]

     scp arch/arm/boot/dts/stm32mp157*.dtb root@<board ip address>:/boot
    
    

    5.3 Push the kernel modules into the board[edit]

    For ecosystem release v1.2.0 :

    • Remove the link created inside the install_artifact/lib/modules/
    4.19.94
    • <kernel version> directory
    For 
    
    rm install_artifact/lib/modules/4.19.94/build install_artifact/lib/modules/4.19.94/source

    For ecosystem release v1.1.0 :

    • Remove the link created inside the install_artifact/lib/modules/4.19.49 directory
    rm install_artifact/lib/modules/4.19.49/build install_artifact/lib/modules/4.19.49/source

    For ecosystem release v1.0.0 :

    • Remove the link created inside the install_artifact/lib/modules/4.19.9 directory
    ecosystem release  v2.0.0 More info.png :
     rm install_artifact/lib/modules/5.4.
    
    19.9
    31/build install_artifact/lib/modules/5.4.
    
    19.9
    31/source
    
    
    • Optionally, strip kernel modules (to reduce the size of each kernel modules)
     find install_artifact/ -name "*.ko" | xargs $STRIP --strip-debug --remove-section=.comment --remove-section=.note --preserve-dates
    
    
    • Copy Kernel modules
     scp -r install_artifact/lib/modules/* root@<ip of board>:/lib/modules
    
    
    • Using the Linux console, re-generate the list of module dependencies (modules.dep) and the list of symbols provided by modules (modules.symbols)
     /sbin/depmod -a
    
    
    • Synchronize data on disk with memory
     sync
    
    

    5.4 Reboot the board[edit]

     reboot
    
    

    6 Modifying a built-in Linux kernel device driver[edit]

    This simple example adds unconditional log information when the display driver is probed.

    • Using the Linux console, check that there is no log information when the display driver is probed
     dmesg | grep -i stm_drm_platform_probe
    
    
    
    • Go to the Linux® kernel source directory
    For ecosystem release  
    
    v1.2.0 : cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.2.0/Developer-Package/stm32mp1-openstlinux-20-02-19/sources/arm-ostl-linux-gnueabi/linux-stm32mp-4.19-r0/linux-4.19.94 For ecosystem release v1.1.0 : cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.1.0/Developer-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-10-09/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0/linux-4.19.49 For ecosystem release v1.0.0 
    v2.0.0 More info.png :
     cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-
    
    v1
    v2.0.0/Developer-Package/stm32mp1-openstlinux-5.4
    
    .19
    -
    
    thud
    dunfell-mp1-
    
    19
    20-
    
    02
    06-
    
    20
    24/sources/arm-
    
    openstlinux_weston
    ostl-linux-gnueabi/linux-stm32mp-5.4.
    
    19
    31-
    
    r0/linux-5.4.
    
    19.9
    31
    
    
    
    • Edit the ./drivers/gpu/drm/stm/drv.c source file
    • Add a log information in the stm_drm_platform_probe function as follow
    static int stm_drm_platform_probe(struct platform_device *pdev)
    {
    	struct device *dev = &pdev->dev;
    	struct drm_device *ddev;
    	int ret;
    	[...]
    
    	DRM_INFO("Simple example - %s\n", __func__);
    
    	return 0;
    	[...]
    }
    
    
    • Save the file
    • Rebuitd the Linux® kernel
     make uImage LOADADDR=0xC2000040
    
    
    • Update the Linux kernel image into board
     scp arch/arm/boot/uImage root@<board ip address>:/boot
    
    
    • Reboot the board
     reboot
    
    
    • Check that there is now log information when the display driver is probed
     dmesg | grep -i stm_drm_platform_probe
    [    2.764080] [drm] Simple example - stm_drm_platform_probe
    
    


    ==Overview==
    This stage explains how modify, rebuild and reload the Linux® kernel.<br>
    
    You will first be guided to install the Linux® kernel source code in the Developer Package directory. Then step by step you will execute procedures to modify, rebuild and reload the Linux® kernel.
    
    ==Download the the Linux® kernel source code==
    {{SoftwareLicenseAgreement | distribution=OpenSTLinux | chapter=Kernel partitions:}}
    
    ======For {{EcosystemRelease | revision=1.2.0 }}======
    
    * Download the [https://www.st.com/content/ccc/resource/technical/sw-updater/firmware2/group0/73/ca/80/91/b4/13/45/f8/STM32cube_Standard_A7_BSP_components_kernel/files/SOURCES-kernel-stm32mp1-openstlinux-20-02-19.tar.xz/jcr:content/translations/en.SOURCES-kernel-stm32mp1-openstlinux-20-02-19.tar.xz STM32MP15-Ecosystem-v1.2.0 Developer Package Sources] to the following directory:<br> '''$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.2.0/Developer-Package'''
    * Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments
     {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.2.0/Developer-Package
     {{PC$}} tar xvf en.SOURCES-kernel-stm32mp1-openstlinux-20-02-19.tar.xz
    <div class="mw-collapsible mw-collapsed">
    
    ======For {{EcosystemRelease | revision=1.1.0}}======<div class="mw-collapsible-content">
    
    
    * Download the [https://www.st.com/content/ccc/resource/technical/sw-updater/firmware2/group0/95/24/76/37/07/79/42/e2/STM32cube_Standard_A7_BSP_components_kernel/files/SOURCES-kernel-stm32mp1-openstlinux-4.19-thud-mp1-19-10-09.tar.xz/jcr:content/translations/en.SOURCES-kernel-stm32mp1-openstlinux-4.19-thud-mp1-19-10-09.tar.xz STM32MP15-Ecosystem-v1.1.0}}======
    * Download the [{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=url}}/{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=name}} STM32MP15-Ecosystem-v2.0.0 Developer Package Sources] to the following directory:<br> '''$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.1v2.0.0/Developer-Package'''
    * Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments
     {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.1v2.0.0/Developer-Package
     {{PC$}} tar xvf en.SOURCES-kernel-stm32mp1-openstlinux-4.19-thud-mp1-19-10-09.tar.xz</div>
    <div class="mw-collapsible mw-collapsed">
    
    ======For {{EcosystemRelease | revision=1.0.0}}======<div class="mw-collapsible-content">
    
    
    * Download the [https://www.st.com/content/ccc/resource/technical/sw-updater/firmware2/group0/d1/01/38/fc/a8/61/4f/e9/STM32cube_Standard_A7_BSP_components_kernel/files/SOURCES-kernel-stm32mp1-openstlinux-4.19-thud-mp1-19-02-20.tar.xz/jcr:content/translations/en.SOURCES-kernel-stm32mp1-openstlinux-4.19-thud-mp1-19-02-20.tar.xz STM32MP15-Ecosystem-v1.0.0 Developer Package Sources] to the following directory:<br> '''$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Developer-Package'''
    * Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments
     {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Developer-Package
     {{PC$}} tar xvf en.SOURCES-kernel-stm32mp1-openstlinux-4.19-thud-mp1-19-02-20.tar.xz</div></div>
    
    {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=name}}
    ==Prepare the Linux® kernel source code==
    * Extract the Linux® kernel source
     For {{EcosystemRelease | revision=1.2.0.0}}
     {{PC$}} cd stm32mp1-openstlinux-20-02-19/sources/arm-ostl-linux-gnueabi/linux-stm32mp-4.19-r0
     {{PC$}} tar xvf linux-4.19.94.tar.xz
    
     For {{EcosystemRelease | revision=1.1.0}}<span class="mw-collapsible mw-collapsed">
    
     {{PC$}} cd stm32mp1-openstlinux-4.19-thud-mp1-19-10-09/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0
     {{PC$}} tar xvf linux-4.19.49.tar.xz</span>
    
     For {{EcosystemRelease | revision=1.0.0}}<span class="mw-collapsible mw-collapsed">
    
     {{PC$}} cd stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0
     {{PC$}} tar xvf linux-4.19.9.tar.xz</span>
    
    {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=path}}
     {{PC$}} tar xvf {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel source | request=name}}
    * Apply the ST patches<span style="color: {{STPink}};">{{PC$}} cd linux-4.19.94/ /* '''For {{EcosystemRelease | 
     revision=1.2.0 }} '''*/</span><span class="mw-collapsible mw-collapsed">
    
     {{PC$}} cd linux-4.19.49/ /* '''For {{EcosystemRelease | 
     revision=1.1.0 }} '''*/</span><span class="mw-collapsible mw-collapsed">{{PC$}} cd linux-4.19.9//*'''For {{EcosystemRelease | revision=1.0.0}} ''' */</span>
    
    {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel source | request=path}} /* '''For {{EcosystemRelease | revision=2.0.0 }} '''*/{{PC$}} for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
    
    * Apply fragments
     {{PC$}} make ARCH=arm multi_v7_defconfig "fragment*.config"
     {{PC$}} for f in `ls -1 ../fragment*.config`; do scripts/kconfig/merge_config.sh -m -r .config $f; done
     {{PC$}} yes <nowiki>''</nowiki> | make ARCH=arm oldconfig
    
    ==Build the Linux® kernel source code for the first time==
    {{Info|The first time the kernel is build it could take several minutes.}}
    * Build kernel images (uImage and vmlinux) and device tree (dtbs)
     {{PC$}} make ARCH=arm uImage vmlinux dtbs LOADADDR=0xC2000040
    * Build kernel module
     {{PC$}} make ARCH=arm modules
    * Generate output build artifacts
     {{PC$}} mkdir -p $PWD/install_artifact/
     {{PC$}} make ARCH=arm INSTALL_MOD_PATH="$PWD/install_artifact" modules_install
    
    ==Deploy the Linux® kernel on the board==
    ===Push the Linux® kernel into the board===
     {{PC$}} scp arch/arm/boot/uImage root@<board ip address>:/boot
    ===Push the devicetree into the board===
     {{PC$}} scp arch/arm/boot/dts/stm32mp157*.dtb root@<board ip address>:/boot
    ===Push the kernel modules into the board==='''For {{EcosystemRelease | revision=1.2.0}}''':<br />
    * Remove the link created inside the '''install_artifact/lib/modules/4.19.94<kernel version>''' directory{{PC$}} rm install_artifact/lib/modules/4.19.94/build install_artifact/lib/modules/4.19.94/source<div class="mw-collapsible mw-collapsed">
    
    '''For {{EcosystemRelease | revision=1.1.0 }}''':<div class="mw-collapsible-content">
    
    * Remove the link created inside the '''install_artifact/lib/modules/4.19.49''' directoryFor {{EcosystemRelease | revision=2.0.0}}:{{PC$}} rm install_artifact/lib/modules/5.4.19.4931/build install_artifact/lib/modules/4.19.49/source</div>
    <div class="mw-collapsible mw-collapsed">
    
    '''For {{EcosystemRelease | revision=1.0.0 }}''':<div class="mw-collapsible-content">
    
    * Remove the link created inside the '''install_artifact/lib/modules/4.19.9''' directory
     {{PC$}} rm install_artifact/lib/modules/4.19.9/build install_artifact/lib/modules/4.19.9/source</div></div>
    
    5.4.31/source
    * Optionally, strip kernel modules (to reduce the size of each kernel modules)
     {{PC$}} find install_artifact/ -name "*.ko" | xargs $STRIP --strip-debug --remove-section=.comment --remove-section=.note --preserve-dates
    * Copy Kernel modules
     {{PC$}} scp -r install_artifact/lib/modules/* root@<ip of board>:/lib/modules
    * Using the Linux console, re-generate the list of module dependencies (modules.dep) and the list of symbols provided by modules (modules.symbols)
     {{Board$}} /sbin/depmod -a
    * Synchronize data on disk with memory
     {{Board$}} sync
    
    ===Reboot the board===
     {{Board$}} reboot
    
    ==Modifying a built-in Linux kernel device driver==
    This simple example adds unconditional log information when the display driver is probed.<br><br>
    
    
    * Using the Linux console, check that there is no log information when the display driver is probed
     {{Board$}} dmesg | grep -i stm_drm_platform_probe
     {{Board$}}
    
    * Go to the Linux® kernel source directory
     For {{EcosystemRelease | revision=1.2.0.0}}:
     {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.2v2.0.0/Developer-Package/stm32mp1-openstlinux-20-02-19/sources/arm-ostl-linux-gnueabi/linux-stm32mp-4.19-r0/linux-4.19.94
    
     For {{EcosystemRelease | revision=1.1.0}}:<span class="mw-collapsible mw-collapsed">
    
     {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.1.0/Developer-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-10-09/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0/linux-4.19.49</span>
    
     For {{EcosystemRelease | revision=1.0.0}}:<span class="mw-collapsible mw-collapsed">
    
     {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Developer-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19- r0/linux-4.19.9</span>
    {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=path}}/{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel source | request=path}}
    * Edit the ''./drivers/gpu/drm/stm/drv.c'' source file
    * Add a log information in the ''stm_drm_platform_probe'' function as follow
     static int stm_drm_platform_probe(struct platform_device *pdev)
     {
     	struct device *dev = &pdev->dev;
     	struct drm_device *ddev;
     	int ret;
     	[...]
    
     	{{Highlight|DRM_INFO("Simple example - %s\n", __func__);}}
    
     	return 0;
     	[...]
     }
    * Save the file
    * Rebuitd the Linux® kernel
     {{PC$}} make uImage LOADADDR=0xC2000040
    * Update the Linux kernel image into board
     {{PC$}} scp arch/arm/boot/uImage root@<board ip address>:/boot
    * Reboot the board
     {{Board$}} reboot
    * Check that there is now log information when the display driver is probed
     {{Board$}} dmesg | grep -i stm_drm_platform_probe
     [    2.764080] [drm] Simple example - stm_drm_platform_probe
    <noinclude>
    
    {{NoIndex}}
    __NOTOC__
    [[Category:Sub-articles]]
    {{PublicationRequestId | Auto}}</noinclude>
    Line 6: Line 6:
     
    {{SoftwareLicenseAgreement | distribution=OpenSTLinux | chapter=Kernel partitions:}}
     
    {{SoftwareLicenseAgreement | distribution=OpenSTLinux | chapter=Kernel partitions:}}
       
    ======For {{EcosystemRelease | revision=1.2.0 }}======
    +
    ======For {{EcosystemRelease | revision=2.0.0}}======
     
    +
    * Download the [{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=url}}/{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=name}} STM32MP15-Ecosystem-v2.0.0 Developer Package Sources] to the following directory:<br> '''$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.0.0/Developer-Package'''
    * Download the [https://www.st.com/content/ccc/resource/technical/sw-updater/firmware2/group0/73/ca/80/91/b4/13/45/f8/STM32cube_Standard_A7_BSP_components_kernel/files/SOURCES-kernel-stm32mp1-openstlinux-20-02-19.tar.xz/jcr:content/translations/en.SOURCES-kernel-stm32mp1-openstlinux-20-02-19.tar.xz STM32MP15-Ecosystem-v1.2.0 Developer Package Sources] to the following directory:<br> '''$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.2.0/Developer-Package'''
     
    * Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments
     
    {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.2.0/Developer-Package
     
    {{PC$}} tar xvf en.SOURCES-kernel-stm32mp1-openstlinux-20-02-19.tar.xz
     
     
     
    <div class="mw-collapsible mw-collapsed">
     
    ======For {{EcosystemRelease | revision=1.1.0}}======
     
    <div class="mw-collapsible-content">
     
     
     
    * Download the [https://www.st.com/content/ccc/resource/technical/sw-updater/firmware2/group0/95/24/76/37/07/79/42/e2/STM32cube_Standard_A7_BSP_components_kernel/files/SOURCES-kernel-stm32mp1-openstlinux-4.19-thud-mp1-19-10-09.tar.xz/jcr:content/translations/en.SOURCES-kernel-stm32mp1-openstlinux-4.19-thud-mp1-19-10-09.tar.xz STM32MP15-Ecosystem-v1.1.0 Developer Package Sources] to the following directory:<br> '''$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.1.0/Developer-Package'''
     
     
    * Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments
     
    * Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments
      {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.1.0/Developer-Package
    +
      {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.0.0/Developer-Package
      {{PC$}} tar xvf en.SOURCES-kernel-stm32mp1-openstlinux-4.19-thud-mp1-19-10-09.tar.xz
    +
      {{PC$}} tar xvf {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=name}}
    </div>
     
    <div class="mw-collapsible mw-collapsed">
     
    ======For {{EcosystemRelease | revision=1.0.0}}======
     
    <div class="mw-collapsible-content">
     
     
     
    * Download the [https://www.st.com/content/ccc/resource/technical/sw-updater/firmware2/group0/d1/01/38/fc/a8/61/4f/e9/STM32cube_Standard_A7_BSP_components_kernel/files/SOURCES-kernel-stm32mp1-openstlinux-4.19-thud-mp1-19-02-20.tar.xz/jcr:content/translations/en.SOURCES-kernel-stm32mp1-openstlinux-4.19-thud-mp1-19-02-20.tar.xz STM32MP15-Ecosystem-v1.0.0 Developer Package Sources] to the following directory:<br> '''$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Developer-Package'''
     
    * Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments
     
    {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Developer-Package
     
    {{PC$}} tar xvf en.SOURCES-kernel-stm32mp1-openstlinux-4.19-thud-mp1-19-02-20.tar.xz
     
    </div></div>
     
       
     
    ==Prepare the Linux® kernel source code==
     
    ==Prepare the Linux® kernel source code==
     
    * Extract the Linux® kernel source
     
    * Extract the Linux® kernel source
      For {{EcosystemRelease | revision=1.2.0}}
    +
      For {{EcosystemRelease | revision=2.0.0}}
      {{PC$}} cd stm32mp1-openstlinux-20-02-19/sources/arm-ostl-linux-gnueabi/linux-stm32mp-4.19-r0
    +
      {{PC$}} cd {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=path}}
      {{PC$}} tar xvf linux-4.19.94.tar.xz
    +
      {{PC$}} tar xvf {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel source | request=name}}
     
       
     
       
    For {{EcosystemRelease | revision=1.1.0}}<span class="mw-collapsible mw-collapsed">
     
    {{PC$}} cd stm32mp1-openstlinux-4.19-thud-mp1-19-10-09/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0
     
    {{PC$}} tar xvf linux-4.19.49.tar.xz
     
    </span>
     
    For {{EcosystemRelease | revision=1.0.0}}<span class="mw-collapsible mw-collapsed">
     
    {{PC$}} cd stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0
     
    {{PC$}} tar xvf linux-4.19.9.tar.xz
     
    </span>
     
     
     
     
    * Apply the ST patches
     
    * Apply the ST patches
      <span style="color: {{STPink}};">{{PC$}} cd linux-4.19.94/ /* '''For {{EcosystemRelease |  
    +
      {{PC$}} cd {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel source | request=path}} /* '''For {{EcosystemRelease | revision=2.0.0 }} '''*/
    revision=1.2.0 }} '''*/</span><span class="mw-collapsible mw-collapsed">
     
    {{PC$}} cd linux-4.19.49/ /* '''For {{EcosystemRelease |  
     
    revision=1.1.0 }} '''*/</span><span class="mw-collapsible mw-collapsed">{{PC$}} cd linux-4.19.9//*'''For {{EcosystemRelease | revision=1.0.0}} ''' */</span>
     
     
     
      {{PC$}} for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
     
      {{PC$}} for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
     
       
     
    * Apply fragments
     
    * Apply fragments
    Line 75: Line 40:
     
    ===Push the Linux® kernel into the board===
     
    ===Push the Linux® kernel into the board===
     
      {{PC$}} scp arch/arm/boot/uImage root@<board ip address>:/boot
     
      {{PC$}} scp arch/arm/boot/uImage root@<board ip address>:/boot
      +
     
    ===Push the devicetree into the board===
     
    ===Push the devicetree into the board===
     
      {{PC$}} scp arch/arm/boot/dts/stm32mp157*.dtb root@<board ip address>:/boot
     
      {{PC$}} scp arch/arm/boot/dts/stm32mp157*.dtb root@<board ip address>:/boot
      +
     
    ===Push the kernel modules into the board===
     
    ===Push the kernel modules into the board===
    '''For {{EcosystemRelease | revision=1.2.0}}''':<br />
    +
    * Remove the link created inside the '''install_artifact/lib/modules/<kernel version>''' directory
    * Remove the link created inside the '''install_artifact/lib/modules/4.19.94''' directory
    +
      For {{EcosystemRelease | revision=2.0.0}}:
    {{PC$}} rm install_artifact/lib/modules/4.19.94/build install_artifact/lib/modules/4.19.94/source
    +
      {{PC$}} rm install_artifact/lib/modules/5.4.31/build install_artifact/lib/modules/5.4.31/source
    <div class="mw-collapsible mw-collapsed">
     
    '''For {{EcosystemRelease | revision=1.1.0 }}''':
     
    <div class="mw-collapsible-content">
     
    * Remove the link created inside the '''install_artifact/lib/modules/4.19.49''' directory
     
      {{PC$}} rm install_artifact/lib/modules/4.19.49/build install_artifact/lib/modules/4.19.49/source
     
    </div>
     
    <div class="mw-collapsible mw-collapsed">
     
    '''For {{EcosystemRelease | revision=1.0.0 }}''':
     
    <div class="mw-collapsible-content">
     
    * Remove the link created inside the '''install_artifact/lib/modules/4.19.9''' directory
     
      {{PC$}} rm install_artifact/lib/modules/4.19.9/build install_artifact/lib/modules/4.19.9/source
     
    </div></div>
     
     
     
       
     
    * Optionally, strip kernel modules (to reduce the size of each kernel modules)
     
    * Optionally, strip kernel modules (to reduce the size of each kernel modules)
    Line 116: Line 70:
       
     
    * Go to the Linux® kernel source directory
     
    * Go to the Linux® kernel source directory
      For {{EcosystemRelease | revision=1.2.0}}:
    +
      For {{EcosystemRelease | revision=2.0.0}}:
      {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.2.0/Developer-Package/stm32mp1-openstlinux-20-02-19/sources/arm-ostl-linux-gnueabi/linux-stm32mp-4.19-r0/linux-4.19.94
    +
      {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.0.0/Developer-Package/{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=path}}/{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel source | request=path}}
     
       
     
       
    For {{EcosystemRelease | revision=1.1.0}}:<span class="mw-collapsible mw-collapsed">
     
    {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.1.0/Developer-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-10-09/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0/linux-4.19.49
     
    </span>
     
    For {{EcosystemRelease | revision=1.0.0}}:<span class="mw-collapsible mw-collapsed">
     
    {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Developer-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19- r0/linux-4.19.9
     
    </span>
     
     
    * Edit the ''./drivers/gpu/drm/stm/drv.c'' source file
     
    * Edit the ''./drivers/gpu/drm/stm/drv.c'' source file
     
    * Add a log information in the ''stm_drm_platform_probe'' function as follow
     
    * Add a log information in the ''stm_drm_platform_probe'' function as follow