Difference between revisions of "Building Linux kernel (XUELK)"

From DAVE Developer's Wiki
Jump to: navigation, search
(History)
 
(11 intermediate revisions by 4 users not shown)
Line 12: Line 12:
 
!Notes
 
!Notes
 
|-
 
|-
|1.0.0
+
|{{oldid|5335|1.0.0}}
 
|August 2016
 
|August 2016
 
|[[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#XUELK_1.0.0|XUELK 1.0.0]]
 
|[[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#XUELK_1.0.0|XUELK 1.0.0]]
 
|
 
|
 
|-
 
|-
|1.1.3
+
|{{oldid|6637|1.1.3}}
 
|March 2017
 
|March 2017
 
|[[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#XUELK_1.1.3|XUELK 1.1.3]]
 
|[[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#XUELK_1.1.3|XUELK 1.1.3]]
 
|
 
|
 
|-
 
|-
 +
|1.2.0
 +
|May 2017
 +
|[[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#XUELK_1.2.0|XUELK 1.2.0]]
 +
|Update for new XUELK release
 +
|-
 +
|2.0.1
 +
|Sep 2017
 +
|[[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#XUELK_2.0.1.2F2.0.2.2F2.0.3|XUELK 2.0.1]]
 +
|Update for new XUELK release
 +
|-
 +
|2.0.2
 +
|Feb 2018
 +
|[[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#XUELK_2.0.1.2F2.0.2.2F2.0.3|XUELK 2.0.2]]
 +
|Add kernel modules documentation
 +
|-
 +
|2.0.3
 +
|Jan 2019
 +
|[[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#XUELK_2.0.1.2F2.0.2.2F2.0.3|XUELK 2.0.3]]
 +
|Add support for NOR ISSY
 
|}
 
|}
  
Line 36: Line 55:
 
|-
 
|-
 
! stable tag
 
! stable tag
| xuelk-1.1.3
+
| xuelk-2.0.3
 
|}
 
|}
  
Line 63: Line 82:
 
| N/A
 
| N/A
 
| imx6ul-lynx-som000c.dtb
 
| imx6ul-lynx-som000c.dtb
 +
|-
 +
| SBC Lynx
 +
| 0x00000013
 +
| 0x0000002D<br>0x0000002E<br>0x0000002F<br>0x00000030
 +
| imx6ul-lynx-som0013-cb002d.dtb<br>imx6ul-lynx-som0013-cb002e.dtb<br>imx6ul-lynx-som0013-cb002f.dtb<br>imx6ul-lynx-som0013-cb0030.dtb
 
|-
 
|-
 
| Axel ULite
 
| Axel ULite
| 0x0000000B
+
| 0x0000000B<br>0x00000014
 
| 0x00000010
 
| 0x00000010
 
| imx6ul-axelulite-cb0010.dtb
 
| imx6ul-axelulite-cb0010.dtb
|-
 
| SBC Lynx
 
| 0x00000013
 
| N/A
 
| imx6ul-lynx-som000c.dtb
 
 
|}
 
|}
 
  
 
== Detailed Instructions ==
 
== Detailed Instructions ==
Line 103: Line 121:
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
 
make imx_v7_lynx_defconfig
 
make imx_v7_lynx_defconfig
make IMAGE_LOADADDR=0x80008000 uImage mx6ul-lynx.dtb imx6ul-lynx-som000c.dtb imx6ul-axelulite-cb0010.dtb
+
make UIMAGE_LOADADDR=0x80008000 uImage imx6ul-lynx-som000c.dtb imx6ul-lynx-som0013-cb002f.dtb imx6ul-axelulite-cb0010.dtb
 +
make modules
 
</pre>
 
</pre>
  
:The former command selects the default XUELK configuration, while the latter builds the kernel binary image with the required u-boot header and the kernel device tree.
+
:The first command selects the default XUELK configuration, the second builds the kernel binary image with the required u-boot header and the kernel device tree, while the last command build kernel modules (if present in kernel configuration).
  
 
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/lynx/</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/lynx/</code> with the following commands:
Line 113: Line 132:
 
cp arch/arm/boot/uImage /tftpboot/lynx/
 
cp arch/arm/boot/uImage /tftpboot/lynx/
 
cp arch/arm/boot/dts/*.dtb /tftpboot/lynx/
 
cp arch/arm/boot/dts/*.dtb /tftpboot/lynx/
 +
</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>
 
</pre>

Latest revision as of 15:48, 16 August 2019

Info Box
AXEL ULite-top.png Applies to AXEL ULite
SBC Lynx-top.png Applies to SBC Lynx

History[edit | edit source]

Version Date XUELK version Notes

1.0.0

August 2016 XUELK 1.0.0

1.1.3

March 2017 XUELK 1.1.3
1.2.0 May 2017 XUELK 1.2.0 Update for new XUELK release
2.0.1 Sep 2017 XUELK 2.0.1 Update for new XUELK release
2.0.2 Feb 2018 XUELK 2.0.2 Add kernel modules documentation
2.0.3 Jan 2019 XUELK 2.0.3 Add support for NOR ISSY

Quick reference[edit | edit source]

Repository Information
URL git@git.dave.eu:lynx/linux-2.6-imx.git
stable branch lynx
stable tag xuelk-2.0.3
Build Information
defconfig imx_v7_lynx_defconfig
Kernel binary UIMAGE_LOADADDR=0x80008000 uImage
Device trees Platform SOM ConfigID CB ConfigID DTB
SBC Lynx 0x00000008 0x0000000E imx6ul-lynx.dtb
SBC Lynx 0x0000000C N/A imx6ul-lynx-som000c.dtb
SBC Lynx 0x00000013 0x0000002D
0x0000002E
0x0000002F
0x00000030
imx6ul-lynx-som0013-cb002d.dtb
imx6ul-lynx-som0013-cb002e.dtb
imx6ul-lynx-som0013-cb002f.dtb
imx6ul-lynx-som0013-cb0030.dtb
Axel ULite 0x0000000B
0x00000014
0x00000010 imx6ul-axelulite-cb0010.dtb

Detailed 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 lynx/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


  • to build the binaries run the following commands:
make imx_v7_lynx_defconfig
make UIMAGE_LOADADDR=0x80008000 uImage imx6ul-lynx-som000c.dtb imx6ul-lynx-som0013-cb002f.dtb imx6ul-axelulite-cb0010.dtb
make modules
The first command selects the default XUELK configuration, the second builds the kernel binary image with the required u-boot header and the kernel device tree, while the last command build kernel modules (if present in kernel configuration).

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/lynx/ with the following commands:

cp arch/arm/boot/uImage /tftpboot/lynx/
cp arch/arm/boot/dts/*.dtb /tftpboot/lynx/

Usually, kernel modules are installed with make modules_install command, but this method installs the modules into the /lib/modules directory of you 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 /