Changes

Jump to: navigation, search

DESK-MX6UL-L/Development/Building Linux kernel

5,089 bytes added, 16:25, 20 April 2021
Created page with "{{subst:Building-Linux kernel | nome-som=AXEL ULite | kit-code=MX6UL | kit = mx6ul | kit-repo = desk-mx-l}}"
<section begin=History/>
{| style="border-collapse:collapse; "
!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"|Version
!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:#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"|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
|-
|-
|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
|-
|}
<section end=History/>
__FORCETOC__
<section begin=Body/>

==Building Linux==

===Quick reference===
{| class="wikitable" border="1"
|+Repository Information
|-
! URL
| git@git.dave.eu:desk-mx-l/linux-'''TBD'''.git
|-
! stable branch
| desk-mx-l
|-
! stable tag
| desk-mx-l-1.x.x
|}

<span id="linux_defconfigs">

{| class="wikitable" border="1"
|+Build Information
|-
! defconfig
| colspan="2" | ''<defconfig>''
|-
! Kernel binary
| colspan="2" | UIMAGE_LOADADDR=''<loadaddr>'' uImage
|-
! rowspan="4" | Device trees
! Platform
! DTB
|-
| ''SBC''
| ''<carrier>''.dtb
|-
| EVB
| ''<carrier>''.dtb
|-
|}

</span>

=== Instructions ===

It is assumed that the development environment has been set up properly as described [[DESK-MX6UL-L#Quick_start_guide|here]].
* start the Linux development VM and login into the system
* open a terminal window and ''cd'' into Linux kernel source code

<pre class="workstation-terminal">
cd {{{kit-repo}}}/linux
</pre>

* in case of needs you can update your local repository with the following git command

<pre class="workstation-terminal">
git pull
</pre>

* configure the build environment

<pre class="workstation-terminal">
source ~/env.sh
</pre>

* enter the source tree directory and run the following commands:

<pre class="workstation-terminal">
make imx_v7_{{{kit-repo}}}_defconfig
make UIMAGE_LOADADDR=''<loadaddr>'' uImage ''<carrier>''.dtb
</pre>

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

:The former command selects the default DESK-MX6UL-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:

<pre class="workstation-terminal">
cp arch/arm/boot/uImage /tftpboot/{{{kit-repo}}}/
cp arch/arm/boot/dts/*.dtb /tftpboot/{{{kit-repo}}}/
</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.

A better way to deploy kernel modules while cross-compiling is
* generate a <code>.tar.gz</code> archive
* install this archive into the target root file system

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

<pre class="workstation-terminal">
mkdir modules-install
make INSTALL_MOD_PATH=modules-install modules_install

cd modules-install && tar cvzf ../modules.tar.gz . && cd ..
</pre>

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

<pre class="workstation-terminal">
tar xvzf modules.tar.gz -C /
</pre>

----

[[Category:AXEL ULite]]
8,226
edits

Navigation menu