Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Firefox OS build process summary

Сборка и установка Firefox OS требует значительного количества времени, пропускной способности сети и вычислительную мощность. К сожалению, по пути, что то может пойти не так. Эта страница излагает цели процесса сборки и его этапы, для того, чтобы помочь пользователям в пути. Подробная информация о каждом шаге рассматривается в связанных страницах..

Примечание: В процессе сборки Firefox OS будет множество ссылок на 'B2G' или 'Boot2Gecko'. 'Boot2Gecko' это оригинальное название пректа Firefox OS.

Цель моделирования: четыре файла 'образа'

Общая цель процесса сборки является построить четыре файлы, которые можно скопировать на устройство Firefox OS.

boot.img Ядро Linux и корень файловой системы образа, последний обеспечивает полезный набор основных инструментов Unix.
system.img Ядро Firefox OS включающее части Gonk, порт Gecko, и исполняемый фаил b2g.
userdata.img Профиль пользователя Gecko и веб приложения для устройства Gaia.
recovery.img Ядро Linux и корень файловой системы образа совместно с простым инструментом, чтобы исправить неправильную установку.

После создания четырех образов, необходимо перенести их на устройство.

Firefox OS строится на вершине базовой основы для Android Open Source Project (AOSP). AOSP инструменты adb и fastboot обеспечивают мощные способы доступа и управлеия устройства.Примечательно, что команда adb reboot-bootloader может подключиться к устройству чтобы перезагрузить и приостановить загрузку на ранней стадии, где команда fastboot flash $partition $image может использоваться для копирования образа на устройстве.

Загрузочный образ

Загрузочный образ (boot.img) представляет собой сочетание ядро и начального корневого раздела, обеспечивающего основную утилиту программного обеспечения и сценарий инициализации. Последнее будет скопирован в память устройства для эффективного использования устройства и, следовательно, называется "электронный диск". Загрузочный образ будет скопирован в раздел "загрузки"  на устройстве и содержимое электронного диска видны начиная с корневого каталога при проверке файловой системы устройства доступ во время выполнения, например, при использовании adb оболочки.

Загрузочный образ также устанавливает права доступа пользователя в  корневой файл default.prop в корневом каталоге.

Можно также изменять существующие загрузочные образы путем проверки файла, разделив файл на образ ядра и загрузочный образ, извлеките содержимое загрузочного образа, измените его содержимое, повторно сберите загрузочный образ, а затем восстановите функции boot.img , См, например, Alcatel One Touch Fire Hacking (Mini) Guide .

Загрузочный образ перед установкой необходимо проверить на 'sideloading' ; устройство можно запускать и останавливать в загрузчике, затем быструю загрузку можно будет использовать для загрузки из загрузочного образа, без установки его с помощью команды fastboot boot /some/path/to/boot.img.

Системный образ

Системный образ (system.img) обеспечивает основу Firefox OS:

  • Gonk: компоненты низкого уровня операционной системы
  • Gecko: порт для Firefox HTML отображения и JavaScript движка
  • B2G: ядро процесса выполняющегося операционной системой

Смотрите the Firefox OS platform руководство для получения более подробной информации об архитектуре платформы.

Системный образ будет скопирован в системный раздел устройства и будет виден в директории / system /  при проверке файловой системы устройства доступны во время выполнения.

Note: The System Image also provides the binary blobs that may be used by the device, notably the RIL (Radio Interface Layer) blob controlling the cellular radio on the device.

The User Data Image

The User Data Image (userdata.img) provides the Gaia applications loaded at runtime.

The User Data Image will be copied to the userdata partition on the device and the contents will be visible in the /data/ directory when the device filesystem is accessed at runtime. Notably the /data/b2g/ directory contains the Mozilla Gecko profile of the device user while the /data/local/webapps/ directory contains the actual web applications available to the user.

The Recovery Image

The Recovery Image (recovery.img) contains the same kernel and a similar ramdisk as are present on the Boot Image partition. The recovery image however uses a different initialization script, which leads the user to a set of recovery commands accessible using the hardware buttons on the device.

The Recovery Image will be copied to the recovery partition on the device, which is not mounted onto the filesystem at regular runtime.

The Build Process: setup, configure, build, install

The overall process of building and installing Firefox OS involves four steps:

Setup Obtain copies of all the programs used by the build process, such as the right compilers and libraries.
Configure Download the source code that will be built and create the .configure file that defines environmental variables specifying the paths and other values used in the build.
Build Build the Gecko profile of the user and the Gaia web applications for the device.
Install Install the files on a device.

 

Setup

Inital setup must be done to ensure the computer running the build has all of the software required during the build, such as compilers and build tools.

This step can be done by hand or using a script. Details are discussed in the Firefox OS build prerequisites page.

Note: On UNIX and UNIX-like machines, the presence of the required software can be checked using the unix command which with the name of the required program as a parameter.

Configuration

The actual build process starts with obtaining a copy of the Firefox OS (or B2G) software, usually by creating a Git clone of the B2G project. The build configuration will both obtain copies of all the source code which is to be built and create the .config file that specifies variables for the build.

This is run with the config.sh script. Details are discussed in the Preparing for your first B2G build page.

The configure script needs a parameter specifying the type of device to build. The build names are code names linked to the CPU architecture rather than a specific device, and there is currently no way to establish which build works for which physical device. A list of available code names can be found here.

The configure step will also use the Android Open Source Project repo tool to download (or update) a copy of all the code used in the build. These copies will be stored in the .repo/projects directory. Due to this activity, the configure step can take a long time and will download a lot of data.

Build

The build step will actually compile all of the source code and produce the output images.

This is run with the build.sh script. Details are discussed in the Building Firefox OS page.

By default, the build step is monolithic, attempting to build everything at once from the Android Open Source Project tools to the Linux kernel to the Gaia web applications. When the build fails, it can sometimes be unclear in which step it has failed.

It is possible to build only certain parts of the whole Firefox  stack. For example, the Gecko system only can be built by calling the build script with the gecko parameter. Similarly, Gaia can be built on its own using the gaia parameter. These parts can then be installed separately onto the device as explained next.

It is also possible to build the images discussed in the first part of this page. For example, the system image can be built using ./build.sh out/platform/$target/system.img, where the $target parameter is the same as given in the Configuration step.

Install

The install step will place the newly compiled code onto a device. This is run with the flash.sh script.

Individual parts of the build can be installed by adding a parameter to the flash script. For example, it is possible to install only the gaia web applications by specifying ./flash.sh gaia.

Метки документа и участники

 Внесли вклад в эту страницу: chrisdavidmills, Tihoem
 Обновлялась последний раз: chrisdavidmills,