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

From DAVE Developer's Wiki
Jump to: navigation, search
(Update Linux sources for DESK-MX6-L v4.0.0 release)
Line 1: Line 1:
 
<section begin="History" />
 
<section begin="History" />
 
{| style="border-collapse:collapse; "
 
{| style="border-collapse:collapse; "
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
+
! colspan="4" style="width:100%; text-align:left" ; border-bottom:solid 2px #ededed" |History
 
|-  
 
|-  
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|ID#
+
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white" |ID#
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Issue Date
+
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white" |Issue Date
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
+
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white" |Notes
 
|-
 
|-
|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"|{{oldid|14123|14123}}
+
| 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" |{{oldid|14123|14123}}
|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"|16/07/2021
+
| 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" |16/07/2021
|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 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 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" |{{oldid|16987|16987}}
 
| 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" |{{oldid|16987|16987}}
Line 18: Line 18:
 
! 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" |26/09/2022
 
! 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" |26/09/2022
 
! 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 3.0.1 minor update
 
! 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 3.0.1 minor update
 +
|-
 +
! 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" |
 +
! 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" |TBD/04/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 4.0.0 release
 
|-
 
|-
 
|}
 
|}
Line 34: Line 38:
 
|-
 
|-
 
! stable branch
 
! stable branch
| desk-mx6-l-3.x.x
+
| desk-mx6-l-4.x.x
 
|-
 
|-
 
! stable tag
 
! stable tag
| desk-mx6-l-3.0.1
+
| desk-mx6-l-4.0.0
 
|}
 
|}
  
Line 67: Line 71:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
cd desk-mx-l/linux
+
cd ~/desk-mx-l/linux
 
</pre>
 
</pre>
  
Line 79: Line 83:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
source ~/desk-mx-l/desk-mx6-l-3.0.0_env.sh
+
source ~/desk-mx-l/desk-mx6-l-4.0.0_env.sh
 
</pre>
 
</pre>
  
Line 91: Line 95:
 
'''NOTE''': this is the default configuration suitable for latest target.
 
'''NOTE''': this is the default configuration suitable for latest target.
  
:The former command selects the default DESK-MX6-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-MX6-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/uImage</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>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/uImage</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:

Revision as of 16:31, 3 April 2023

History
ID# Issue Date Notes

14123

16/07/2021 First DESK release

16987

04/03/2022 DESK 3.0.0 release

17061

26/09/2022 DESK 3.0.1 minor update
TBD/04/2023 DESK 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-mx6-l-4.x.x
stable tag desk-mx6-l-4.0.0

Build Information
defconfig imx_v7_desk_defconfig
Kernel binary UIMAGE_LOADADDR=0x10008000 uImage
Platform DTB
SBCX imx6dl-sbcx-cb0012.dtb

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 kernel source code
cd ~/desk-mx-l/linux
  • in case of needs you can update your local repository with the following git command
git pull
  • configure the build environment
source ~/desk-mx-l/desk-mx6-l-4.0.0_env.sh
  • enter the source tree directory and run the following commands:
make imx_v7_desk_defconfig
make UIMAGE_LOADADDR=0x10008000 uImage imx6dl-sbcx-cb0012.dtb

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

The former command selects the default DESK-MX6-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 uImage make target to update the binary image. Once the build process is complete, the kernel binary image is stored into the arch/arm/boot/uImage 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:

cp arch/arm/boot/uImage /tftpboot/desk-mx-l/
cp arch/arm/boot/dts/*.dtb /tftpboot/desk-mx-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:

make modules
mkdir modules-install
make INSTALL_MOD_PATH=modules-install modules_install

cd modules-install && tar cvzf ../modules.tar.gz . && cd ..

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

tar xvzf modules.tar.gz -C /