How To Build Linux Kernel/en: различия между версиями

Материал из Wiren Board
(Новая страница: «Build the kernel»)
 
м (FuzzyBot переименовал страницу Сборка ядра/en в How To Build Linux Kernel/en без оставления перенаправления: Часть переводимой страницы Сборка ядра.)
 
(не показано 18 промежуточных версий 1 участника)
Строка 1: Строка 1:
<languages/>
<languages/>
Вам может понадобиться собрать своё ядро (например, чтобы включить нужные модули). Чтобы собрать ядро для Wiren Board, нужно взять использовать специальный репозиторий, содержащий ядро, адаптированное для Wiren Board.
You may need to build your kernel (for example, to enable the required modules). To build a kernel for the Wiren Board, you need to use a special repository that contains a kernel adapted for the Wiren Board.




'''0.''' Сборку ядра следует проводить на вашем настольном компьютере под управлением Linux (не на Wiren Board - теоретически это возможно, но потребует несколько гигабайт свободного места, и займёт много времени).
'''0.''' The kernel should be built on your Linux desktop (not on the Wiren Board - theoretically it is possible, but it will require several gigabytes of free space, and will take a long time).
Убедитесь, что у вас установлен git (http://en.wikipedia.org/wiki/Git_%28software%29). Если нет, установите его:<pre>
 
Make sure you have git installed(http://en.wikipedia.org/wiki/Git_%28software%29). If not, install it:<pre>
sudo apt-get install git
sudo apt-get install git
</pre>
</pre>
Установите произвольные имя пользователя и почту:
Select a random user name and email:
<pre>
<pre>
git config --global user.name "Imya Familiya"
git config --global user.name "Imya Familiya"
Строка 14: Строка 15:




'''1.''' Скачайте набор скриптов, который упрощает сборку:
'''1.''' Download a set of scripts that makes it easy to build:
<pre>
<pre>
git clone git://github.com/contactless/build_kernel.git
git clone git://github.com/contactless/build_kernel.git
cd build_kernel
cd build_kernel
</pre>
</pre>
'''2.''' Склонируйте и инициализируйте репозиторий Linux.
'''2.''' Clone and initialize the Linux repository.


Репозиторий можно склонировать с использованием https (если у вас нет аккаунта на github.com):
You can clone repository via https (if you have no account on github.com):
<pre>
<pre>
git clone https://github.com/contactless/linux KERNEL
git clone https://github.com/contactless/linux KERNEL
</pre>
</pre>


или ssh, если у вас есть аккаунт:
or via ssh if you have an account:
<pre>
<pre>
git clone git@github.com:contactless/linux.git KERNEL
git clone git@github.com:contactless/linux.git KERNEL
</pre>
</pre>


'''3.''' Инициализируйте внешние модули:
'''3.'''   Initialize external modules:
<pre>
<pre>
cd KERNEL</pre>
cd KERNEL</pre>
Строка 38: Строка 39:
<pre>
<pre>
git submodule update</pre>
git submodule update</pre>
'''4.''' Установите конфиг для сборки под Wiren Board<pre>
'''4.''' Install config for build on Wiren Board<pre>
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- mxs_wirenboard_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- mxs_wirenboard_defconfig
</pre>
</pre>


==Сборка==
==Building the kernel==


Сборка ядра с упаковкой в tar.gz архивы:
The kernel built with the package in tar.gz archives:
  ./build.sh
  ./build.sh
Сборка в пакет Debian
Build the Debian package
  ./build_deb.sh
  ./build_deb.sh




== Установка на Wiren Board ==
== Installing on Wiren Board ==


  export kernel_version=3.19.0-imxv5-x0.1
  export kernel_version=3.19.0-imxv5-x0.1
(строку версии стоит взять из вывода сборочных скриптов из предыдущего пункта)
(the version string should be taken from the output of the Assembly scripts from the previous paragraph)


Скрипты:  
Скрипты:  
* tools/copy_kernel_latest_deb.sh - копирует и устанавливает последний deb-пакет с ядром. Аргумент: папка с rootfs (или примонтированный eMMC/microSD накопитель Wiren Board)
* tools/copy_kernel_latest_deb.sh - copies and installs the latest. deb kernel package. Argument: folder with rootfs (or mounted eMMC/microSD drive Wiren Board)
* tools/scp_kernel_latest_deb.sh - - копирует и устанавливает последний deb-пакет с ядром. Аргумент: root@hostname, где hostname - это IP-адрес Wiren Board
* tools/scp_kernel_latest_deb.sh - copies and installs the latest deb package with the kernel. Argument: root@hostname, where hostname is the IP address of the Wiren Board




== Работа с конфигом ядра ==
== Managing kernel config ==




=== Редактирование конфига ядра ===
=== Editing the kernel config ===


cd KERNEL
cd KERNEL
Строка 71: Строка 72:




=== Список изменений относительно стандартного конфига ===
=== List of changes relative to the standard config ===


  ./config_diff.sh
  ./config_diff.sh




=== Применение изменений в стандартный конфиг ===
=== Applying the changes to the standard config ===
 
This item is needed to change the standard configuration of the Wiren Board, for example to send a patch or pull request.


Этот пункт нужен, чтобы изменить стандартный конфиг Wiren Board, например чтобы отправить патч или pull request.
  cd KERNEL
  cd KERNEL



Текущая версия на 05:36, 31 мая 2021

Другие языки:

You may need to build your kernel (for example, to enable the required modules). To build a kernel for the Wiren Board, you need to use a special repository that contains a kernel adapted for the Wiren Board.


0. The kernel should be built on your Linux desktop (not on the Wiren Board - theoretically it is possible, but it will require several gigabytes of free space, and will take a long time).

Make sure you have git installed(http://en.wikipedia.org/wiki/Git_%28software%29). If not, install it:

sudo apt-get install git

Select a random user name and email:

git config --global user.name "Imya Familiya"
git config --global user.email "vash@adres.ru"


1. Download a set of scripts that makes it easy to build:

git clone git://github.com/contactless/build_kernel.git
cd build_kernel

2. Clone and initialize the Linux repository.

You can clone repository via https (if you have no account on github.com):

git clone https://github.com/contactless/linux KERNEL

or via ssh if you have an account:

git clone git@github.com:contactless/linux.git KERNEL

3. Initialize external modules:

cd KERNEL
git submodule init
git submodule update

4. Install config for build on Wiren Board

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- mxs_wirenboard_defconfig

Building the kernel

The kernel built with the package in tar.gz archives:

./build.sh

Build the Debian package

./build_deb.sh


Installing on Wiren Board

export kernel_version=3.19.0-imxv5-x0.1

(the version string should be taken from the output of the Assembly scripts from the previous paragraph)

Скрипты:

  • tools/copy_kernel_latest_deb.sh - copies and installs the latest. deb kernel package. Argument: folder with rootfs (or mounted eMMC/microSD drive Wiren Board)
  • tools/scp_kernel_latest_deb.sh - copies and installs the latest deb package with the kernel. Argument: root@hostname, where hostname is the IP address of the Wiren Board


Managing kernel config

Editing the kernel config

cd KERNEL

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig

или

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- xconfig


List of changes relative to the standard config

./config_diff.sh


Applying the changes to the standard config

This item is needed to change the standard configuration of the Wiren Board, for example to send a patch or pull request.

cd KERNEL
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- savedefconfig
cp defconfig ./arch/arm/configs/mxs_wirenboard_defconfig