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

From DAVE Developer's Wiki
Jump to: navigation, search
(Created page with "{{subst:Building-Linux kernel | nome-som=ORCA | kit-code=MX8M | kit = mx8m | kit-repo = desk-mx-l}}")
 
Line 7: Line 7:
 
!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"|X.Y.Z
+
|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"|1.0.0
|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"|Month Year
+
|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"|Jan 2022
|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"|TBD
+
|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 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"|[TBD_link X.Y.Z]
 
|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"|Month Year
 
|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"|TBD
 
 
|-
 
|-
 
|}
 
|}
Line 28: Line 23:
 
|-
 
|-
 
! URL
 
! URL
| git@git.dave.eu:desk-mx-l/linux-'''TBD'''.git
+
| git@git.dave.eu:desk-mx-l/linux-imx.git
 
|-
 
|-
 
! stable branch
 
! stable branch
Line 34: Line 29:
 
|-
 
|-
 
! stable tag
 
! stable tag
| desk-mx-l-1.x.x
+
| desk-mx-l-2.x.x
 
|}
 
|}
  
Line 43: Line 38:
 
|-
 
|-
 
! defconfig
 
! defconfig
| colspan="2" | ''<defconfig>''
+
| colspan="2" | imx_v8_defconfig
 
|-
 
|-
 
! Kernel binary
 
! Kernel binary
| colspan="2" | UIMAGE_LOADADDR=''<loadaddr>'' uImage
+
| colspan="2" | Image
 
|-
 
|-
 
! rowspan="3" | Device trees
 
! rowspan="3" | Device trees
Line 52: Line 47:
 
! DTB
 
! DTB
 
|-
 
|-
| ''SBC''
+
| SBCX
| ''<carrier>''.dtb
+
| imx8mm-mito8mmini.dtsb
 
|-
 
|-
| EVB
+
| SBC ORCA
| ''<carrier>''.dtb
+
| imx8mp-mito8mplus-cb1001.dts
 
|-
 
|-
 
|}
 
|}
Line 69: Line 64:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
cd {{{kit-repo}}}/linux
+
cd desk-mx-l/linux
 
</pre>
 
</pre>
  
Line 87: Line 82:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
make imx_v7_{{{kit-repo}}}_defconfig
+
make imx_v8_defconfig
make UIMAGE_LOADADDR=''<loadaddr>'' uImage ''<carrier>''.dtb
+
make Image freescale/imx8mm-mito8mmini.dtb freescale/imx8mp-mito8mplus-cb1001.dtb
 
</pre>
 
</pre>
  
'''NOTE''': this is the default configuration suitable for 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/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/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">
cp arch/arm/boot/uImage /tftpboot/{{{kit-repo}}}/
+
cp arch/arm/boot/Image /tftpboot/desk-mx-l/
cp arch/arm/boot/dts/*.dtb /tftpboot/{{{kit-repo}}}/
+
cp arch/arm/boot/dts/*.dtb /tftpboot/desk-mx-l/
 
</pre>
 
</pre>
  
Usually, kernel modules are installed with <code>make modules_install</code> command, but this method installs the modules into the <code>/lib/modules</code> directory of you MVM, which is not what you want.  
+
Usually, kernel modules are installed with <code>make modules_install</code> command, but this method installs the modules into the <code>/lib/modules</code> directory of your MVM, which is not what you want.  
  
 
A better way to deploy kernel modules while cross-compiling is
 
A better way to deploy kernel modules while cross-compiling is
Line 125: Line 120:
 
----
 
----
  
[[Category:ORCA]]
+
 
 +
[[Category:MITO 8M]] [[Category:MITO 8M Mini]] [[Category:ORCA]]

Revision as of 16:18, 28 December 2021

History
Version Issue Date Notes
1.0.0 Jan 2022 First DESK-MX8M 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-mx-l
stable tag desk-mx-l-2.x.x

Build Information
defconfig imx_v8_defconfig
Kernel binary Image
Device trees Platform DTB
SBCX imx8mm-mito8mmini.dtsb
SBC ORCA imx8mp-mito8mplus-cb1001.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 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 ~/env.sh
  • enter the source tree directory and run the following commands:
make imx_v8_defconfig
make Image freescale/imx8mm-mito8mmini.dtb freescale/imx8mp-mito8mplus-cb1001.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 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/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:

cp arch/arm/boot/Image /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:

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 /