Fuchsia learning notes 0 download and compile

Time:2021-8-21

Download code

Code download is provided on the official website

Run script

curl -s "https://fuchsia.googlesource.com/fuchsia/+/HEAD/scripts/bootstrap?format=TEXT" | base64 --decode | bash
  1. Create Fuchsia directory
  2. Download the code management tool JiriAnd binary package management toolscipd
  3. Introduce Jiri project and run it automaticallyjiri updateDownload source code

It will be very slow unless your agent is very fast. A better way is to download the code from the domestic image warehouse

Domestic image download method

Download CIPD Jiri tool

 mkdir fuchsia && cd fuchsia
 curl --location --create-dirs --output .jiri_root/bin/cipd             https://fuchsia.fsf.org.cn/bootstrap/cipd-linux-amd64
 curl --location --create-dirs --output .jiri_root/bin/jiri             https://fuchsia.fsf.org.cn/bootstrap/jiri-linux-amd64
 chmod +x .jiri_root/bin/jiri .jiri_root/bin/jiri
 export PATH=${PATH}:${PWD}/.jiri_root/bin

Download code

Scheme I
mkdir -p build && echo "internal_access = false" >build/cipd.gni
jiri init -keep-git-hooks=true
jiri import -name=integration flower https://fuchsia.fsf.org.cn/git/fuchsia-integration
jiri update -v
echo "have_firmware = false" >zircon/prebuilt/config.gni
Scheme II

Manifest file fromhttps://fuchsia.fsf.org.cn/ma…Select to ensure that documents within one month are valid.

mkdir -p build && echo "internal_access = false" >build/cipd.gni
jiri init -keep-git-hooks=true
curl --location --output .jiri_manifest https://fuchsia.fsf.org.cn/manifest/fuchsia-20060102.xml
jiri update -v
echo "have_firmware = false" >zircon/prebuilt/config.gni

Switch domestic image

Delete related files first

rm -rf integration jiri .jiri_manifest .jiri_root

Download the CIPD Jiri tool and use the domestic image. See the tutorial above.

Restore official warehouse

 rm -rf integration jiri .jiri_manifest .jiri_root
 curl -s https://fuchsia.googlesource.com/jiri/+/master/scripts/bootstrap_jiri?format=TEXT | base64 --decode | bash -s ${PWD}
 jiri init -keep-git-hooks=true
 jiri import -name=integration flower https://fuchsia.googlesource.com/integration
 jiri update -v

Problems encountered

When downloading some module codes from the domestic image, the 404 error is reported. It is impossible to retry many times. The solution is to download most of the codes through the domestic image, delete the Jiri, and then download the Jiri update code through the Google official website

Prepare environment

Linux

sudo apt-get install build-essential curl git python unzip

macOS

xcode-select --install
  • The version of Ubuntu 20.04 that I used was always reported with strange syntax errors when I used MacOS. I tried to modify it, but I couldn’t. finally, I gave up. I suspected that there was a version problem for some time

compile

fx set workstation.x64 --with //bundles:tests
//Build is set as the workstation product running on x64 platform, and the test package is compiled together.
FX build // compile
[email protected]:fx list-boards
arm64
as370
c18
chromebook-x64
cleo
*
kirin970
msm8998
msm8x53-som
mt8167s_ref
qemu-arm64
qemu-x64
toulouse
vim2
vim3
vs680
x64
x64-reduced-perf-variation  
[email protected] -Nuc8i5beh: FX list products // view supported products
Bringup // the smallest system, which is used to debug the underlying functions, such as the configuration of zicron kernel and board driver
Core // in addition to bringup, some system services are added, including network functions, OTA upgrade, etc
Terminal // contains simple graphical interface and shell terminal
Workstation // general development environment, including high-level feature and UI

It takes about 1 or 2 hours to compile

Fuchsia learning notes 0 download and compile

function

fx emu -N
FX EMU -- headless // disable the graphical interface
//There will be some problems with the graphic program display. Google checked the following and found a solution. That's it for the time being.

Fuchsia learning notes 0 download and compile

Fuchsia learning notes 0 download and compile