Firmware image building

Материал из Wiren Board
Версия от 13:45, 3 июня 2019; RomanKulibaba (обсуждение | вклад) (Новая страница: «* ''path_to_new_rootfs'' - the name of the directory in which to create the root filesystem. The directory will be created automatically; * ''board_ver'' - contro…»)

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

A special set of scripts has been prepared to build the controller firmware images. The image build process consists of two steps:

  1. Preparing the root filesystem (rootfs)
  2. Build an image to upload to the controller

The scripts are located in the wirenboard repository. Then the paths will be indicated from the repository folder



Build an image to upload to the controller


Preparing rootfs

The script for preparing the root FS is located in the rootfs folder.

How to use create_rootfs.sh script:

 $ ./create_rootfs.sh <path_to_new_rootfs> <board_ver> [<list of additional repos>]

Here:

  • path_to_new_rootfs - the name of the directory in which to create the root filesystem. The directory will be created automatically;
  • board_ver - controller revision version. Valid values:
    • 5 - for Wiren Board 5
    • 55 - for Wiren Board 5.5
    • 4 - for Wiren Board 4
    • 32 - for WB Smart Home (3.2)
    • 28
    • NETMON
    • MKA3
    • CQC10
    • MKA31
    • AC-E1
  • list of additional repos -addresses of additional repositories with test packages (see below). This parameter is optional.

Пример. Собираем базовую (без доп. репозиториев) корневую ФС в директории rootfs/rootfs для Wiren Board 5.5:

 $ cd rootfs
 $ ./create_rootfs.sh ./rootfs/ 55


Дополнительные репозитории

Добавление дополнительных репозиториев необходимо, если вы хотите добавить свои версии пакетов в собираемую корневую ФС.

В скрипт передаются только адреса репозиториев. Например:

 $ ./create_rootfs.sh ./rootfs/ 55 http://server1.net/ http://server2.net:8086/

Формат репозиториев соответствует тому, который создаётся с помощью утилиты wbrepo. Конкретно, к дополнительному репозиторию предъявляются следующие требования:

  • В корне на сервере репозитория должен храниться публичный GPG-ключ в файле /repo.gpg.key. Например, если репозиторий расположен по адресу http://localhost:8086/, то ключ должен быть доступен по ссылке http://localhost:8086/repo.gpg.key
  • Имя используемого дистрибутива - testing
  • Используемый компонент - main

То есть, если передан адрес репозитория http://localhost:8086/, то в sources.list он будет представлен как

 deb http://localhost:8086/ testing main


Сборка образа для загрузки на контроллер

TODO: раздел требует дополнения

Скрипты для сборки образов находятся в директории images. Перед сборкой образа необходима готовая корневая ФС.

Дополнительно на хост-машине потребуются утилиты (названия приведены для Debian/Ubuntu):

  • kpartx
  • device-tree-compiler
  • u-boot-tools

Пример: собираем образ прошивки для Wiren Board 5, корневая ФС находится по пути rootfs/rootfs/:

 $ cd image
 $ ./create_images_wb5.sh ../rootfs/rootfs/ <tag>

Здесь tag - суффикс, который будет добавлен к имени файла образа.

Готовый образ будет лежать по пути image/image/wb5/<current_datetime>/<current_datetime>_emmc_<tag>.img.


См. также