Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

Linux Kernel 4.9.y

85 bytes added, 10:28, 11 March 2019
no edit summary
=What is Linux?=
Linux is a clone the result of merging the computational Kernel made by Linux Torval and the operating scheme present in any Unix operative system Unix, Kernel was written from scratch by Linus Torvalds with assistance from and a loosely-knit team of hackers across the Net. It aims towards POSIX standard and Single UNIX Specification compliance.
It has all the features you would expect in a modern fully-fledged Unix, including true multitasking, virtual memory, shared libraries, demand loading, shared copy-on-write executables, proper memory management, and multistack networking including IPv4 and IPv6.
<span style="color: #000000;">In order to build the Linux Kernel for IGEP PROCESSOR BOARDS it is recommended to cross-compile the kernel, that means to build the kernel in your HOST machine for a target architecture.</span>
To [index[Ubuntu 16.php/04 LTS Toolchain|Ubuntu_16.04_LTS_Toolchain setup the cross-compiling04]] there are two fundamental variables that the kernel uses to select the target architecture. Normally these values are guessed based on your build environment, but of course that environment here does not match our target embedded system, so we'll need to override them. The variables in question are:
* <u>''' ARCH'''</u>''':''' The ARCH variable is the architecture you're targeting as the kernel knows it. For IGEP PROCESSOR BOARDS you'll set to "arm" architecture.
{{Message/Information Message|message=The following steps has been tested using '''Ubuntu 16.04''' and the '''4.9 version''' of the '''arm-linux-'''<span class="mw-headline">'''gnueabihf''' compiler</span>}}
<span class="mw-headline">In order First we have to compile set up the Linux Kernel Cross Compiler correctly if it is necessary to prepare a suitable work environment by checking . In this [[Set Up the compiler and its version Cross Compiler|post]] there are the correspondingsome steps that can be followed in order to do it. </span>
<span class="mw-headline">If we want to install a particular compiler, for example the 4.9 it is necessary we can use the following commands to install itthis extra packages that could be necessaries:<code></code></span>
<span class="mw-headline">sudo apt-get install g++-4.9-arm-linux-gnueabihf<br data-attributes="%20/">sudo apt-get install cpp-4.9-arm-linux-gnueabihf<br data-attributes="%20/">sudo apt-get install gcc-4.9-arm-linux-gnueabihf<br data-attributes="%20/">sudo apt-get install gcc-4.9-arm-linux-gnueabihf-base<code></code></span><span class="mw-headline">We can change between compilers using the following commands:</span>  <span class="mw-headline">sudo update-alternatives --set arm-linux-gnueabihf-g++ "/usr/bin/arm-linux-gnueabihf-g++-4.9"<br data-attributes="%20/">sudo update-alternatives --set arm-linux-gnueabihf-cpp "/usr/bin/arm-linux-gnueabihf-cpp-4.9"<br data-attributes="%20/">sudo update-alternatives --set arm-linux-gnueabihf-gcc-ar "/usr/bin/arm-linux-gnueabihf-gcc-ar-4.9"<br data-attributes="%20/">sudo update-alternatives --set arm-linux-gnueabihf-gcc-nm "/usr/bin/arm-linux-gnueabihf-gcc-nm-4.9"<br data-attributes="%20/">sudo update-alternatives --set arm-linux-gnueabihf-gcc-ranlib "/usr/bin/arm-linux-gnueabihf-gcc-ranlib-4.9"<br data-attributes="%20/">sudo update-alternatives --set arm-linux-gnueabihf-gcov "/usr/bin/arm-linux-gnueabihf-gcov-4.9"</span><span class="mw-headline">In addition we can install this extra packages that could be necessaries: </span>  <span class="mw-headline">sudo apt-get install libc6-armel-cross libc6-armhf-cross libc6-dev-armel-cross libc6libncurses5-dev<br><br>sudo apt-armhf-crossbinutils-arm-linux-gnueabihf libncurses5-devget install lzop<br></span>
<span class="mw-headline">The next step is to clone the corresponding git repository. There are different git repositories depending on the model of the processor of the board. The following table shows the steps for each of the <span style="color: #000000;">IGEP PROCESSOR BOARDS</span>:<br data-attributes="%20/"></span>
! style="width: 324.217px;"|GIT REPOSITORY
! style="width: 275.783px;"|BRANCH
|-
| style="width: 97px;"|OMAP5432
| style="width: 324.217px;"|git@git.isee.biz:linux-kernel/linux-omap-2.6.git
| style="width: 275.783px;"|isee-linux-v.4.9.y
|-
| style="width: 97px;"|DM3730
| style="width: 324.217px;"|git@https://git.isee.biz:/linux-kernel/linux-omap-2.6.git
| style="width: 275.783px;"|isee-linux-v.4.9.y
|-
| style="width: 97px;"|AM335X
| style="width: 324.217px;"|git@https://git.isee.biz:/linux-kernel/linux-omap-2.6.git
| style="width: 275.783px;"|isee-linux-v.4.9.y
|-
| style="width: 97px;"|iMX6
| style="width: 324.217px;"|git@https://git.isee.biz:/linux-kernel/linux-imx.git
| style="width: 275.783px;"|
isee-imx_4.9.11_1.0.0_ga
|}
 
To get to desired branch we will use:
 
git checkout [your_branch]
=<span id="How_to_cross_compile_the_linux_kernel" class="mw-headline">Compile the Linux Kernel<br data-attributes="%20/"></span>=
In the following table it can be found the name of each default configuration associated to each IGEP PROCESSORS BOARDS:
{| class="contenttable sortable" style="width: 890px888px;"|-! style="width: 160px;"|BOARD! style="width: 163px;"|DEFCONFIG! style="width: 527px;"|EXAMPLE
|-
! | style="width: 160.1px160px;"|BOARDIGEPv5 OMAP5432! | style="width: 124.9px163px;"|DEFCONFIG[https://git.isee.biz/linux-kernel/linux-omap-2.6/blob/isee-linux-v.4.9.y/arch/arm/configs/omap2plus_defconfig omap2plus_defconfig]! | style="width: 566px527px;"|EXAMPLE<span style="color: #000000;"><code class="java plain">make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- omap2plus_defconfig  <br /></code></span>
|-
| style="width: 160.1px160px;"|IGEPv5 OMAP5432IGEPv2 DM3730| style="width: 124.9px163px;"|[https://git.isee.biz/linux-kernel/linux-omap-2.6/blob/isee-linux-3v.84.9.y-omap5/arch/arm/configs/omap2plus_defconfig omap2plus_defconfig]| style="width: 566px527px;"|<span style="color: #000000;"><code class="java plain">make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- <br /> omap2plus_defconfig</code></span>
|-
| style="width: 160.1px160px;"|IGEPv2 DM3730IGEP COM AQUILA AM335x| style="width: 124.9px163px;"|[https://git.isee.biz/linux-kernel/linux-omap-2.6/blob/isee-linux-3v.174.9.y/arch/arm/configs/omap3-igep00x0_defconfig omap3-igep00x0_defconfigam335x_igep0034_defconfig am335x_igep0034_defconfig]| style="width: 566px527px;"|<span style="color: #000000;"><code class="java plain">make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-am335x_igep0034_defconfig</code></span>
|-
| style="width: 160.1px160px;"|IGEP COM AQUILA AM335xMODULE DM3730/AM3703| style="width: 124.9px163px;"|[https://git.isee.biz/linux-kernel/linux-omap-2.6/blob/isee-linux-v.4.19.y-am335x/arch/arm/configs/am335x_igep0033_defconfig am335x_igep0033_defconfigomap2plus_defconfig omap2plus_defconfig]| style="width: 566px527px;"|<span style="color: #000000;"><code class="java plain">make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-omap2plus_defconfig</code></span>
|-
| style="width: 160.1px160px;"|IGEP COM MODULE DM3730/AM3703SMARC AM335x| style="width: 124.9px163px;"|[https://git.isee.biz/linux-kernel/linux-omap-2.6/blob/isee-linux-3v.4.179.y/arch/arm/configs/omap3-igep00x0_defconfig omap3-igep00x0_defconfigam335x_igep0034_defconfig am335x_igep0034_defconfig]| style="width: 566px527px;"|<span style="color: #000000;"><code class="java plain">make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_igep0034_defconfig</code></span>
|-
| style="width: 160.1px160px;"|IGEP SMARC iMX6iMX6S/DL/Q| style="width: 124.9px163px;"|[https://git.isee.biz/linux-kernel/linux-imx/blob/isee-imx_4.9.11_1.0.0_ga/arch/arm/configs/imx6_igep0046_defconfig imx6_igep0046_defconfig]| style="width: 566px527px;"|<span style="color: #000000;"><code class="java plain">make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- imx6_igep0046_defconfig</code></span>
|-
| style="width: 160.1px160px;"|IGEP SMARC AM335xiMX6UL/ULL| style="width: 124.9px;"|[https://git.isee.biz/linux-kernel/linux-omap-2.6imx/blob/isee-linux-vimx_4.9.411_1.90.y0_ga/arch/arm/configs/am335x_igep0034_defconfig am335x_igep0034_defconfigimx6_igep0146_defconfig imx6_igep0146_defconfig]| style="width: 566px527px;"|<span style="color: #000000;"><code class="java plain">make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_igep0034_defconfig imx6_igep0146_defconfig</code></span>
|}
Once the default configuration has been loaded, it is time to compile the Linux Kernel. There are three important elements to compile:
In order to compile this three elements we have to type:
<span style="color: #000000;"><code class="java plain">make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImages zImage dtbs modules</code></span>
Finally we will find the resulting compiled Kernel in the '''''arch/arm/boot''''' folder:
|-
| style="width: 281.467px;"|IGEP COM AQUILA AM335x
| style="width: 588.533px;"|[https://git.isee.biz/linux-kernel/linux-omap-2.6/blob/isee-linux-v.4.9.y/arch/arm/boot/dts/am335x-igep0033base0033.dtsi dts am335x-igep0033base0033.dtsidts]
|-
| style="width: 281.467px;"|IGEPv5 OMAP5432
| style="width: 281.467px;"|IGEP SMARC iMX6 Dual Lite
| style="width: 588.533px;"|[https://git.isee.biz/linux-kernel/linux-imx/blob/isee-imx_4.9.11_1.0.0_ga/arch/arm/boot/dts/imx6dl-igep-base0040rd102.dts imx6dl-igep-base0040rd102.dts]
|-
| style="width: 281.467px;"|IGEP SMARC iMX6 Ultra Lite
||[https://git.isee.biz/linux-kernel/linux-imx/blob/isee-imx_4.9.11_1.0.0_ga/arch/arm/boot/dts/imx6ul-igep-base0040rd102.dts imx6ul-igep-base0040rd102.dts], [https://git.isee.biz/linux-kernel/linux-imx/blob/isee-imx_4.9.11_1.0.0_ga/arch/arm/boot/dts/imx6ul-igep-base0040rd102-wifi.dts imx6ul-igep-base0040rd102-wifi.dts]
|}
''' '''
Once you have to compile the Kernel, you have to copy de Zimage and dtb in /media/user/boot.'''<br />''' zImage example: <span style="color: #000000;"><code class="java plain">cp arch/arm/boot/zimage /media/user/boot</code></span>  <span style="color: #000000;"><code class="java plain">cp arch/arm/boot/dts/omap3-igep0020-rev-f.dtb /media/user/boot</code></span>  '''Before to install the modules, you need to choose a [[IGEP Firmware set-up|rootfs]] and copy in your SDCard or Nand/MMC rootfs parition.'''  '''Finally''', the last step is to ''' install the modules inside the desired rootfs'''. It can be done by typingFor example, if the rootfs is located in a external storage device mounted on the /media folder sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=/media/user/rootfs/ modules_install==<span id="Linux_kernels" class="mw-headline">Linux kernels</span>==To get more information about our Kernel and their compatibilities * [[Linux Kernel 4.1.y|Linux Kernel 4.1]]* [[Linux Kernel 3.8.y|Linux Kernel 3.8]]
sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH= modules_install
For example, if the rootfs is located in a external storage device mounted on the /media folder:
sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=/media/rootfs/ modules_install[[Category:Linux]][[Category:Linux_Kernel]]
560
edits