How To Build Linux Kernel/en: различия между версиями
(Новая страница: «or via ssh if you have an account: <pre> git clone git@github.com:contactless/linux.git KERNEL </pre>») |
(Новая страница: «'''3.''' Initialize external modules: <pre> cd KERNEL</pre> <pre> git submodule init</pre> <pre> git submodule update</pre> '''4.''' Install config for build o…») |
||
Строка 32: | Строка 32: | ||
</pre> | </pre> | ||
'''3.''' | '''3.''' Initialize external modules: | ||
<pre> | <pre> | ||
cd KERNEL</pre> | cd KERNEL</pre> | ||
Строка 39: | Строка 39: | ||
<pre> | <pre> | ||
git submodule update</pre> | git submodule update</pre> | ||
'''4.''' | '''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> |
Версия 19:02, 24 апреля 2019
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
Сборка
Сборка ядра с упаковкой в tar.gz архивы:
./build.sh
Сборка в пакет Debian
./build_deb.sh
Установка на Wiren Board
export kernel_version=3.19.0-imxv5-x0.1
(строку версии стоит взять из вывода сборочных скриптов из предыдущего пункта)
Скрипты:
- tools/copy_kernel_latest_deb.sh - копирует и устанавливает последний deb-пакет с ядром. Аргумент: папка с rootfs (или примонтированный eMMC/microSD накопитель Wiren Board)
- tools/scp_kernel_latest_deb.sh - - копирует и устанавливает последний deb-пакет с ядром. Аргумент: root@hostname, где hostname - это IP-адрес Wiren Board
Работа с конфигом ядра
Редактирование конфига ядра
cd KERNEL
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig
или
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- xconfig
Список изменений относительно стандартного конфига
./config_diff.sh
Применение изменений в стандартный конфиг
Этот пункт нужен, чтобы изменить стандартный конфиг Wiren Board, например чтобы отправить патч или pull request.
cd KERNEL
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- savedefconfig
cp defconfig ./arch/arm/configs/mxs_wirenboard_defconfig