Difference between revisions of "DESK-MX8M-L/Development/Building Linux kernel"

From DAVE Developer's Wiki
Jump to: navigation, search
(Updates for DESK-MX8-L 4.0.0 release)
Line 11: Line 11:
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|First DESK-MX8M-L release
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|First DESK-MX8M-L release
 
|-
 
|-
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |{{oldid|17542|17542}}
+
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |{{oldid|17542|17542}}
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |24/02/2023
+
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |24/02/2023
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |DESK-MX8M-L-2.0.0 release
+
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |DESK-MX8M-L-2.0.0 release
 +
|-
 +
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |{{oldid|18033|18033}}
 +
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |25/07/2023
 +
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |DESK-MX8M-L-4.0.0 release
 
|-
 
|-
 
|}
 
|}
Line 30: Line 34:
 
|-
 
|-
 
! stable branch
 
! stable branch
| desk-mx8m-l-2.x.x
+
| desk-mx8m-l-4.x.x
 
|-
 
|-
 
! stable tag
 
! stable tag
| desk-mx8m-l-2.0.0
+
| desk-mx8m-l-4 .0.0
 
|}
 
|}
  
Line 52: Line 56:
 
|-
 
|-
 
| [[SBC Axel SBC | SBC AXEL]]
 
| [[SBC Axel SBC | SBC AXEL]]
|  imx8mm-mito8mmini.dts
+
|  imx8mm-mito8mmini-cb100a.dts
 
|-
 
|-
 
| [[ORCA SBC| SBC ORCA]]
 
| [[ORCA SBC| SBC ORCA]]
Line 65: Line 69:
 
It is assumed that the development environment has been set up properly as described [[DESK-MX8M-L#Quick_start_guide|here]].
 
It is assumed that the development environment has been set up properly as described [[DESK-MX8M-L#Quick_start_guide|here]].
 
* start the Linux development VM and login into the system
 
* start the Linux development VM and login into the system
* open a terminal window and ''cd'' into Linux kernel source code
+
* open a terminal window and ''cd'' into <code>linux</code> directory
  
<pre>
+
<pre class="workstation-terminal">
cd desk-mx-l/linux
+
dvdk@vagrant:~$ cd ~/desk-mx-l/linux
 +
dvdk@vagrant:~/desk-mx-l/linux$
 
</pre>
 
</pre>
  
 
* in case of needs you can update your local repository with the following git command
 
* in case of needs you can update your local repository with the following git command
  
<pre>
+
<pre class="workstation-terminal">
git pull
+
dvdk@vagrant:~/desk-mx-l/linux$ git pull
 
</pre>
 
</pre>
  
* checkout the right branch
+
* configure the build environment
<pre>
 
git checkout desk-mx8m-l-2.0.0
 
</pre>
 
  
* configure the build environment: the '''proper SDK''' has to be installed in the DVDK as described in the [[DESK-MX8M-L/General/DVDK_Virtual_Machine | DVDK Virtual Machine]] wiki page
+
<pre class="workstation-terminal">
 
+
dvdk@vagrant:~/desk-mx-l/linux$ source ~/desk-mx-l/desk-mx8m-l-4.0.0_env.sh  
<pre>
 
source /home/dvdk/desk-mx-l/desk-mx8m-l-2.0.0_env.sh
 
 
</pre>
 
</pre>
  
Line 92: Line 92:
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
 
dvdk@vagrant:~/desk-mx-l/linux$ make imx_v8_defconfig
 
dvdk@vagrant:~/desk-mx-l/linux$ make imx_v8_defconfig
dvdk@vagrant:~/desk-mx-l/linux$ make Image modules freescale/imx8mm-mito8mmini.dtb freescale/imx8mp-mito8mplus-cb1008.dtb
+
dvdk@vagrant:~/desk-mx-l/linux$ make -j$(nproc) Image modules freescale/imx8mm-mito8mmini-cb100a.dtb freescale/imx8mp-mito8mplus-cb1008.dtb
 
</pre>
 
</pre>
  
 
'''NOTE''': this is the default configuration suitable for the latest target.
 
'''NOTE''': this is the default configuration suitable for the latest target.
  
:The former command selects the default DESK-MX8M-L configuration, while the latter builds the kernel binary image with the required u-boot header and the kernel device tree.
+
:The former command selects the default DESK-MX8M-L configuration, while the latter builds the kernel binary image with the required U-Boot header and the kernel device tree.
  
Default Linux kernel configuration can be changed by using the standard <code>menuconfig</code>, <code>xconfig</code>, or <code>gconfig</code> make target. Subsequent builds just require <code>uImage</code> make target to update the binary image. Once the build process is complete, the kernel binary image is stored into the <code>arch/arm/boot/Image</code> file. Both this file and the kernel device tree can be copied to the tftp root directory <code>/tftpboot/desk-mx-l/</code> with the following commands:
+
Default Linux kernel configuration can be changed by using the standard <code>menuconfig</code>, <code>xconfig</code>, or <code>gconfig</code> make target. Subsequent builds just require <code>Image</code> make target to update the binary image. Once the build process is complete, the kernel binary image is stored into the <code>arch/arm64/boot/Image</code> file. Both this file and the kernel device tree can be copied to the tftp root directory <code>/tftpboot/desk-mx-l/</code> with the following commands:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
dvdk@vagrant:~/desk-mx-l$ cp arch/arm64/boot/Image /tftpboot/desk-mx-l/
+
dvdk@vagrant:~/desk-mx-l/linux$ cp arch/arm64/boot/Image /tftpboot/desk-mx8m-l/
dvdk@vagrant:~/desk-mx-l$ cp arch/arm64/boot/dts/freescale/*.dtb /tftpboot/desk-mx-l/
+
dvdk@vagrant:~/desk-mx-l/linux$ cp arch/arm64/boot/dts/freescale/*.dtb /tftpboot/desk-mx8m-l/
 
</pre>
 
</pre>
  

Revision as of 07:33, 25 July 2023

History
ID# Issue Date Notes

16137

17/02/2022 First DESK-MX8M-L release

17542

24/02/2023 DESK-MX8M-L-2.0.0 release

18033

25/07/2023 DESK-MX8M-L-4.0.0 release



Building Linux[edit | edit source]

Quick reference[edit | edit source]

Repository Information
URL git@git.dave.eu:desk-mx-l/linux-imx.git
stable branch desk-mx8m-l-4.x.x
stable tag desk-mx8m-l-4 .0.0

Build Information
defconfig imx_v8_defconfig
Kernel binary Image
Device trees Platform DTB
SBC AXEL imx8mm-mito8mmini-cb100a.dts
SBC ORCA imx8mp-mito8mplus-cb1008.dts

Instructions[edit | edit source]

It is assumed that the development environment has been set up properly as described here.

  • start the Linux development VM and login into the system
  • open a terminal window and cd into linux directory
dvdk@vagrant:~$ cd ~/desk-mx-l/linux
dvdk@vagrant:~/desk-mx-l/linux$
  • in case of needs you can update your local repository with the following git command
dvdk@vagrant:~/desk-mx-l/linux$ git pull
  • configure the build environment
dvdk@vagrant:~/desk-mx-l/linux$ source ~/desk-mx-l/desk-mx8m-l-4.0.0_env.sh 
  • enter the source tree directory and run the following commands:
dvdk@vagrant:~/desk-mx-l/linux$ make imx_v8_defconfig
dvdk@vagrant:~/desk-mx-l/linux$ make -j$(nproc) Image modules freescale/imx8mm-mito8mmini-cb100a.dtb freescale/imx8mp-mito8mplus-cb1008.dtb

NOTE: this is the default configuration suitable for the latest target.

The former command selects the default DESK-MX8M-L configuration, while the latter builds the kernel binary image with the required U-Boot header and the kernel device tree.

Default Linux kernel configuration can be changed by using the standard menuconfig, xconfig, or gconfig make target. Subsequent builds just require Image make target to update the binary image. Once the build process is complete, the kernel binary image is stored into the arch/arm64/boot/Image file. Both this file and the kernel device tree can be copied to the tftp root directory /tftpboot/desk-mx-l/ with the following commands:

dvdk@vagrant:~/desk-mx-l/linux$ cp arch/arm64/boot/Image /tftpboot/desk-mx8m-l/
dvdk@vagrant:~/desk-mx-l/linux$ cp arch/arm64/boot/dts/freescale/*.dtb /tftpboot/desk-mx8m-l/

Usually, kernel modules are installed with make modules_install command, but this method installs the modules into the /lib/modules directory of your MVM, which is not what you want.

A better way to deploy kernel modules while cross-compiling is

  • generate a .tar.gz archive
  • install this archive into the target root file system

User can create such an archive, for example, using the following commands:

dvdk@vagrant:~/desk-mx-l/linux$ mkdir modules-install
dvdk@vagrant:~/desk-mx-l/linux$ make INSTALL_MOD_PATH=modules-install modules_install
dvdk@vagrant:~/desk-mx-l/linux$ cd modules-install
dvdk@vagrant:~/desk-mx-l/linux/modules-install$ tar cvzf ../modules.tar.gz . && cd ..
dvdk@vagrant:~/desk-mx-l/linux$ 

Now copy modules.tar.gz into the target root file system and install them as root with the following command

root@desk-mx8mp:~# tar xvzf modules.tar.gz -C /