Difference between revisions of "How to Build FriendlyWrt"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
Line 1: Line 1:
[[How to Build OpenWrt/zh|查看中文]]
+
[[How to build FriendlyWrt/zh|查看中文]]
  
==Introduction==
+
==FriendlyWrt简介==
OpenWrt is a highly extensible GNU/Linux distribution for embedded devices.Unlike many other distributions for routers, OpenWrt is built from the ground up to be a full-featured, easily modifiable operating system for embedded devices. In practice, this means that you can have all the features you need with none of the bloat, powered by a modern Linux kernel.
+
FriendlyWrt是友善电子基于OpenWrt定制的系统,完全开源,用于企业物联网二次开发,个人定制NAS,家庭物联网网关等。
For more details you can refer to:[https://openwrt.org/ OpenWrt Website]<br>
+
TODO <br />
<br>
+
==下载体验版固件==
This Wiki pages mainly explains how to compile an OpenWrt system for FriendlyElec's ARM boards but doesn't have details about how to customize an OpenWrt system.
+
TODO <br />
OpenWrt is maintained by open source communities and its website has rich resources. If you want to customize an OpenWrt you can refer to: [https://openwrt.org/docs/start openwrt doc]
+
解压后用 dd 或者 win32image 烧写到 SD 卡。
 +
==帐户与密码==
 +
用户名: root<br />
 +
密码: fa<br />
 +
<br />
 +
==获取项目源代码==
 +
===安装 repo 工具===
 +
首先需要安装 repo 工具:
 +
<syntaxhighlight lang="bash">
 +
git clone https://github.com/friendlyarm/repo
 +
cp repo/repo /usr/bin/
 +
</syntaxhighlight>
 +
===下载项目源代码===
 +
有以下两种途径获取项目源代码,中国大陆用户建议使用方法1的途径下载:
 +
====方法一:使用网盘里的repo压缩包====
 +
网盘下载地址: [http://download.friendlyarm.com/nanopineo 点击进入]<br />
 +
文件位于网盘的以下路径:sources/friendlywrt-YYYYMMDD.tar (YYYYMMDD表示打包的日期)<br />
 +
从网盘中获取的 repo 压缩包在解压之后,需要执行一下以下命令做一次解包动作:
 +
<syntaxhighlight lang="bash">
 +
tar xvf /path/to/netdisk/sources/friendlywrt-YYYYMMDD.tar
 +
cd friendlywrt
 +
repo sync -l --no-clone-bundle
 +
</syntaxhighlight>
 +
用此方法得到的源代码版本是repo打包时的版本,如果想拉取到官方最新的版本,可以去掉 -l 参数,执行一次 repo sync, 例如:
 +
<syntaxhighlight lang="bash">
 +
cd friendlywrt
 +
repo sync --no-clone-bundle
 +
</syntaxhighlight>
 +
====方法二:从github下载====
 +
<syntaxhighlight lang="bash">
 +
mkdir friendlywrt
 +
cd friendlywrt
 +
repo init -u https://github.com/friendlyarm/friendlywrt_manifests -b master -m h3.xml --repo-url=https://github.com/friendlyarm/repo  --no-clone-bundle
 +
repo sync -c  --no-clone-bundle
 +
</syntaxhighlight>
 +
====同步项目到最新版本====
 +
<syntaxhighlight lang="bash">
 +
cd friendlywrt
 +
repo sync -c --no-clone-bundle
 +
</syntaxhighlight>
 +
同步过程中,由于网络原因出现中断,可以使用下面脚本同步代码:
 +
<syntaxhighlight lang="bash">
 +
#! /bin/bash
 +
repo sync -c --no-clone-bundle
 +
while [ $? -ne 0 ];
 +
do 
 +
    repo sync -c --no-clone-bundle
 +
done
 +
</syntaxhighlight>
  
==H3 SoC==
+
==如何编译==
* You need to compile an OpenWrt system as a non-root user.In our test we logged in and switched to a non-root user "fa" by running the following command:
+
===搭建编译环境===
<syntaxhighlight lang="text">
+
在PC的Ubuntu系统下 (建议使用版本18.04-64bit),执下以下命令安装所需的软件:
$ su fa
+
<syntaxhighlight lang="bash">
 +
wget -O - https://raw.githubusercontent.com/friendlyarm/build-env-on-ubuntu-bionic/master/install.sh | bash
 
</syntaxhighlight>
 
</syntaxhighlight>
All the following commands should be run as a non-root user.
 
  
<br>
+
===查看帮助===
* For FriendlyElec's ARM boards OpenWrt's version 18.06.1. is integrated. Run the following commands to clone a branch:
+
不带参数执行 build.sh,默认是打印帮助信息:
<syntaxhighlight lang="text">
+
<syntaxhighlight lang="bash">
$ cd /home/fa/
+
./build.sh
$ git clone https://github.com/friendlyarm/openwrt -b master-v18.06.1
+
 
</syntaxhighlight>
 
</syntaxhighlight>
After cloning is successful a "openwrt" directory will be generated.<br>
+
显示的帮助信息如下:
Currently version 18.06.1 works with FriendlyElec's H3 based NanoPi NEO and NanoPi M1 Plus. You can make an OpenWrt system for other FriendlyElec's H3 based boards as well by using a config for NanoPi M1 Plus.
+
<syntaxhighlight lang="bash">
Here are the steps to make an OpenWrt system for the NanoPi M1 Plus. Before proceed we highly recommend you to carefully read this document:[https://openwrt.org/docs/guide-developer/build-system/use-buildsystem openwrt buildsystem].<br>
+
USAGE: ./build.sh <parameter>
  
<br>
+
# 选择目标的硬件平台:
* To compile an OpenWrt system it needs various software packages. To make a compilation process more quickly and smoothly we suggest you download these packages before you start compilation. Here is a link to the tar ball of all necessary packages:[http://download.friendlyarm.com/nanopir1 prebuilt/openwrt-18.06.1_sunxi-cortexa7_prebuilt_YYYYMMDD.tar.gz]。<br>
+
  ./build.sh nanopi_r1.mk
After you download the tar ball extract the ball and copy the whole "dl" directory to your OpenWrt's root directory:
+
  ./build.sh nanopi_duo.mk
<syntaxhighlight lang="text">
+
  ./build.sh nanopi_neo_core.mk
$ cd /home/fa/
+
  ./build.sh nanopi_neo.mk
$ tar xzf openwrt-18.06.1_sunxi-cortexa7_prebuilt_YYYYMMDD.tar.gz -C ./
+
  ./build.sh nanopi_neo_s.mk
$ ls ./openwrt-18.06.1_sunxi-cortexa7_prebuilt
+
  ./build.sh nanopi_m1_plus.mk
bin  dl
+
  ./build.sh nanopi_m1.mk
 +
  ./build.sh nanopi_neo_air.mk
 +
 
 +
# 编译各个模块:
 +
  ./build.sh all                -编译所有组件
 +
  ./build.sh uboot              -单独编译uboot
 +
  ./build.sh kernel            -单独编译kernel
 +
  ./build.sh friendlywrt        -单独编译friendlywrt
 +
  ./build.sh sd-img            -生成sd启动的镜像文件
 +
  ./build.sh emmc-img          -生成用于安装到emmc的镜像文件 (镜像文件需要dd到sd卡,通过sd卡启动安装程序)
 +
# 清理:
 +
  ./build.sh cleanall
 
</syntaxhighlight>
 
</syntaxhighlight>
The "bin" directory will have all the image files generated after compiling an OpenWrt system. The "dl" directory has all the necessary packages needed for compilation:
+
===全自动方式编译===
<syntaxhighlight lang="text">
+
初次编译,需要选择目标的硬件平台,当前只有H3可用,后续会加入更多的硬件支持:
$ cp -r ./openwrt-18.06.1_sunxi-cortexa7_prebuilt/dl /home/fa/openwrt/
+
<syntaxhighlight lang="bash">
 +
./build.sh nanopi_r1.mk
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
执行上述命令,会自动编译所有组件,其中包括u-boot, kernel 和 friendlywrt,并生成sd启动的烧写镜像文件。
<br>
+
===编译单独的模块===
* Run the following commands to compile an OpenWrt system for FriendlyElec's H3 based boards(NanoPi NEO / NanoPi M1 Plus):
+
====kernel====
<syntaxhighlight lang="text">
+
<syntaxhighlight lang="bash">
$ cd /home/fa/openwrt/friendlyelec
+
./build.sh kernel
$ ./build.sh nanopi-h3
+
 
</syntaxhighlight>
 
</syntaxhighlight>
After compilation is done the following files will be generated:
+
====u-boot====
<syntaxhighlight lang="text">
+
<syntaxhighlight lang="bash">
$ tree bin/targets/sunxi/cortexa7/ -L 1
+
./build.sh uboot
bin/targets/sunxi/cortexa7/
+
├── config.seed
+
├── openwrt-18.06.1-sunxi-cortexa7-device-sun8i-h3-nanopi-m1-plus.manifest
+
├── openwrt-18.06.1-sunxi-cortexa7.manifest
+
├── openwrt-18.06.1-sunxi-cortexa7-sun8i-h3-nanopi-m1-plus-ext4-sdcard.img.gz
+
├── openwrt-18.06.1-sunxi-cortexa7-sun8i-h3-nanopi-m1-plus-squashfs-sdcard.img.gz
+
├── openwrt-18.06.1-sunxi-cortexa7-sun8i-h3-nanopi-neo-ext4-sdcard.img.gz
+
├── openwrt-18.06.1-sunxi-cortexa7-sun8i-h3-nanopi-neo-squashfs-sdcard.img.gz
+
├── openwrt-imagebuilder-18.06.1-sunxi-cortexa7.Linux-x86_64.tar.xz
+
├── openwrt-sdk-18.06.1-sunxi-cortexa7_gcc-7.3.0_musl_eabi.Linux-x86_64.tar.xz
+
├── packages
+
└── sha256sums
+
 
</syntaxhighlight>
 
</syntaxhighlight>
openwrt-18.06.1-sunxi-cortexa7-sun8i-h3-nanopi-m1-plus-ext4-sdcard.img.gz is used to make a bootable TF card for the NanoPi M1 Plus.<br>
+
====friendlywrt====
openwrt-18.06.1-sunxi-cortexa7-sun8i-h3-nanopi-neo-ext4-sdcard.img.gz is used to make a bootable TF card for the NanoPi NEO.<br>
+
<syntaxhighlight lang="bash">
These two are very typical OpenWrt system.
+
./build.sh friendlywrt
 +
</syntaxhighlight>
 +
===生成sdcard固件===
 +
<syntaxhighlight lang="bash">
 +
sudo ./build.sh sd-img
 +
</syntaxhighlight>
 +
打包img成功后,终端会显示如下信息,可以参考下面的dd命令将img写入sd卡,注意/dev/sdX需要替换成真实的sd卡设备:<br />
 +
<syntaxhighlight lang="bash">
 +
Run the following for sdcard install:
 +
    sudo dd if=out/FriendlyWrt_20190828_NanoPi-R1_armhf_sd.img bs=1M of=/dev/sdX
 +
</syntaxhighlight>
 +
===生成emmc (eflasher) 固件===
 +
<syntaxhighlight lang="bash">
 +
sudo ./build.sh emmc-img
 +
</syntaxhighlight>
 +
打包img成功后,终端会显示如下信息,可以参考下面的dd命令将img写入sd卡,注意/dev/sdX需要替换成真实的sd卡设备:<br />
 +
<syntaxhighlight lang="bash">
 +
Run the following for sdcard install:
 +
    sudo dd if=out/FriendlyWrt_20190828_NanoPi-R1_armhf_eflasher.img bs=1M of=/dev/sdX
 +
</syntaxhighlight>
 +
用此sd卡启动eflasher系统,执行eflasher命令,将系统写入emmc,之后就可以拨掉sd卡,从emmc启动friendlywrt了。
 +
==friendlywrt定制与开发==
 +
===源代码目录结构===
 +
<syntaxhighlight lang="bash">
 +
├── friendlywrt
 +
│  ├── friendlywrt -> friendlywrt源代码
 +
|  └── configs -> 保存预设好的friendlywrt defconfig文件
 +
|  └── toolchain -> 交叉编译器,仅用于编译u-boot与kernel
 +
│  ├── build.sh -> 全自动编译脚本
 +
│  ├── device/friendlyelec -> 用于适配友善电子开发板的相关文件
 +
│  ├── kernel -> 内核
 +
│  └── u-boot -> u-boot
 +
│  └── scripts -> 打包img的相关脚本
 +
</syntaxhighlight>
 +
===配置friendlywrt的软件包===
 +
* 使用make menuconfig更改配置
 +
<syntaxhighlight lang="bash">
 +
cd friendlywrt
 +
make menuconfig
 +
</syntaxhighlight>
 +
* 另存你个人的软件包配置
 +
<syntaxhighlight lang="bash">
 +
make menuconfig
 +
./scripts/diffconfig.sh > ../configs/my_config
 +
</syntaxhighlight>
 +
* 让以后的编译使用你的friendlywrt配置
 +
以NanoPi-R1为例,编辑以下文件:
 +
<syntaxhighlight lang="bash">
 +
device/friendlyelec/h3/nanopi_r1.mk
 +
</syntaxhighlight>
 +
将TARGET_FRIENDLYWRT_CONFIG的值改为你的配置。
 +
* 重新编译friendlywrt并制成sd启动镜像
 +
<syntaxhighlight lang="bash">
 +
./build.sh friendlywrt
 +
./build.sh sd-img
 +
</syntaxhighlight>
 +
===固化个人文件到friendlywrt===
 +
将文件或目录放入以下目录即可,打包img时会把它们都打包进去:
 +
<syntaxhighlight lang="bash">
 +
device/friendlyelec/h3/common-files
 +
</syntaxhighlight>
 +
也可以放在新建的目录里,以NanoPi-R1为例,然后编辑以下文件:
 +
<syntaxhighlight lang="bash">
 +
device/friendlyelec/h3/nanopi_r1.mk
 +
</syntaxhighlight>
 +
在文件中新增一行 (XXX替换为你的目录名):
 +
<syntaxhighlight lang="bash">
 +
FRIENDLYWRT_FILES+=(device/friendlyelec/h3/XXX)
 +
</syntaxhighlight>
 +
===修改friendlywrt系统的默认配置(如网络、防火墙等)===
 +
进入如下目录:
 +
<syntaxhighlight lang="bash">
 +
device/friendlyelec/h3/default-settings/files/root/board
 +
</syntaxhighlight>
 +
编辑你所用的开发板目录所在的配置文件即可,比如下面是NanoPi-R1的配置文件:
 +
<syntaxhighlight lang="bash">
 +
NanoPi-R1
 +
└── etc
 +
    └── config
 +
        ├── network
 +
        └── system
 +
</syntaxhighlight>
 +
===更改u-boot和kernel配置===
 +
同样是编辑如下文件:
 +
<syntaxhighlight lang="bash">
 +
device/friendlyelec/h3/nanopi_r1.mk
 +
</syntaxhighlight>
 +
可通过以下设置,将uboot的配置改为你自已的:
 +
<syntaxhighlight lang="bash">
 +
TARGET_UBOOT_CONFIG=nanopi_h3_defconfig
 +
</syntaxhighlight>
 +
可通过以下设置,将kernel的配置改为你自已的:
 +
<syntaxhighlight lang="bash">
 +
TARGET_KERNEL_CONFIG=sunxi_defconfig
 +
</syntaxhighlight>
 +
===更换其他源代码===
 +
编辑如下 xml 文件,即可替换 kernel 、uboot以及friendlywrt的源代码:
 +
<syntaxhighlight lang="bash">
 +
.repo/manifests/h3.xml
 +
</syntaxhighlight>
 +
想了解 xml 文件各个节点的含义和用法,请参考:[https://gerrit.googlesource.com/git-repo/+/refs/heads/master/docs/manifest-format.md repo Manifest Format]<br />
 +
编辑完成后,需要用 repo 命令同步一下,比如更换了 kernel 的源代码,用以下命令同步一次:
 +
<syntaxhighlight lang="bash">
 +
repo sync --force-sync kernel
 +
</syntaxhighlight>
 +
同步后单独重新内核即可:
 +
<syntaxhighlight lang="bash">
 +
./build.sh kernel
 +
</syntaxhighlight>
 +
 
 +
==常见问题及注意事项==
 +
* Ubuntu下不能使用 root 用户来编译,需要使用普通用户
 +
* 在 vnc 环境下编译可能会编译失败
  
<br>
+
==参考资料==
* Notes:
+
[https://source.android.com/setup/develop/repo repo使用指南]<br />
OpenWrt is an all-in-one system that integrates U-boot, Linux Kernel, Rootfs utilities, package management utilities and etc.<br>
+
When this WiKi was being written the U-boot(u-boot-2017.11.tar.bz2 under the "dl" directory) and Linux code(linux-4.14.63.tar.xz under the "dl" directory) for the OpenWrt version were maintained and supported by third party open source communities instead of FriendlyElec.<br>
+
U-boot and Linux code that are maintained by open source communities are updated very frequently.Therefore if you want to use a stable OpenWrt with stable U-boot and Linux kernel you'd better use a FriendlyElec's version or generate an image by compiling a FriendlyElec's BSP. Here are two reference links:<br>
+
1) [[Building U-boot and Linux for H5/H3/H2+]], Compile FriendlyElec's U-boot and Linux kernel;<br>
+
2) [[How to make your own SD-bootable ROM]], Make a customized image following the steps verified by FriendlyElec. FriendlyElec's nanopi-r1_sd_openwrt_4.14_armhf_YYYYMMDD.img.zip is generated by following these steps;
+

Revision as of 03:16, 28 August 2019

查看中文

1 FriendlyWrt简介

FriendlyWrt是友善电子基于OpenWrt定制的系统,完全开源,用于企业物联网二次开发,个人定制NAS,家庭物联网网关等。 TODO

2 下载体验版固件

TODO
解压后用 dd 或者 win32image 烧写到 SD 卡。

3 帐户与密码

用户名: root
密码: fa

4 获取项目源代码

4.1 安装 repo 工具

首先需要安装 repo 工具:

git clone https://github.com/friendlyarm/repo
cp repo/repo /usr/bin/

4.2 下载项目源代码

有以下两种途径获取项目源代码,中国大陆用户建议使用方法1的途径下载:

4.2.1 方法一:使用网盘里的repo压缩包

网盘下载地址: 点击进入
文件位于网盘的以下路径:sources/friendlywrt-YYYYMMDD.tar (YYYYMMDD表示打包的日期)
从网盘中获取的 repo 压缩包在解压之后,需要执行一下以下命令做一次解包动作:

tar xvf /path/to/netdisk/sources/friendlywrt-YYYYMMDD.tar
cd friendlywrt
repo sync -l --no-clone-bundle

用此方法得到的源代码版本是repo打包时的版本,如果想拉取到官方最新的版本,可以去掉 -l 参数,执行一次 repo sync, 例如:

cd friendlywrt
repo sync --no-clone-bundle

4.2.2 方法二:从github下载

mkdir friendlywrt
cd friendlywrt
repo init -u https://github.com/friendlyarm/friendlywrt_manifests -b master -m h3.xml --repo-url=https://github.com/friendlyarm/repo  --no-clone-bundle
repo sync -c  --no-clone-bundle

4.2.3 同步项目到最新版本

cd friendlywrt
repo sync -c --no-clone-bundle

同步过程中,由于网络原因出现中断,可以使用下面脚本同步代码:

#! /bin/bash
repo sync -c --no-clone-bundle
while [ $? -ne 0 ]; 
do  
    repo sync -c --no-clone-bundle
done

5 如何编译

5.1 搭建编译环境

在PC的Ubuntu系统下 (建议使用版本18.04-64bit),执下以下命令安装所需的软件:

wget -O - https://raw.githubusercontent.com/friendlyarm/build-env-on-ubuntu-bionic/master/install.sh | bash

5.2 查看帮助

不带参数执行 build.sh,默认是打印帮助信息:

./build.sh

显示的帮助信息如下:

USAGE: ./build.sh <parameter>
 
# 选择目标的硬件平台:
  ./build.sh nanopi_r1.mk
  ./build.sh nanopi_duo.mk
  ./build.sh nanopi_neo_core.mk
  ./build.sh nanopi_neo.mk
  ./build.sh nanopi_neo_s.mk
  ./build.sh nanopi_m1_plus.mk
  ./build.sh nanopi_m1.mk
  ./build.sh nanopi_neo_air.mk
 
# 编译各个模块:
  ./build.sh all                -编译所有组件
  ./build.sh uboot              -单独编译uboot
  ./build.sh kernel             -单独编译kernel
  ./build.sh friendlywrt        -单独编译friendlywrt
  ./build.sh sd-img             -生成sd启动的镜像文件
  ./build.sh emmc-img           -生成用于安装到emmc的镜像文件 (镜像文件需要dd到sd卡,通过sd卡启动安装程序)
# 清理:
  ./build.sh cleanall

5.3 全自动方式编译

初次编译,需要选择目标的硬件平台,当前只有H3可用,后续会加入更多的硬件支持:

./build.sh nanopi_r1.mk

执行上述命令,会自动编译所有组件,其中包括u-boot, kernel 和 friendlywrt,并生成sd启动的烧写镜像文件。

5.4 编译单独的模块

5.4.1 kernel

./build.sh kernel

5.4.2 u-boot

./build.sh uboot

5.4.3 friendlywrt

./build.sh friendlywrt

5.5 生成sdcard固件

sudo ./build.sh sd-img

打包img成功后,终端会显示如下信息,可以参考下面的dd命令将img写入sd卡,注意/dev/sdX需要替换成真实的sd卡设备:

Run the following for sdcard install:
    sudo dd if=out/FriendlyWrt_20190828_NanoPi-R1_armhf_sd.img bs=1M of=/dev/sdX

5.6 生成emmc (eflasher) 固件

sudo ./build.sh emmc-img

打包img成功后,终端会显示如下信息,可以参考下面的dd命令将img写入sd卡,注意/dev/sdX需要替换成真实的sd卡设备:

Run the following for sdcard install:
    sudo dd if=out/FriendlyWrt_20190828_NanoPi-R1_armhf_eflasher.img bs=1M of=/dev/sdX

用此sd卡启动eflasher系统,执行eflasher命令,将系统写入emmc,之后就可以拨掉sd卡,从emmc启动friendlywrt了。

6 friendlywrt定制与开发

6.1 源代码目录结构

├── friendlywrt
│   ├── friendlywrt -> friendlywrt源代码
|   └── configs -> 保存预设好的friendlywrt defconfig文件
|   └── toolchain -> 交叉编译器,仅用于编译u-boot与kernel
│   ├── build.sh -> 全自动编译脚本
│   ├── device/friendlyelec -> 用于适配友善电子开发板的相关文件
│   ├── kernel -> 内核
│   └── u-boot -> u-boot
│   └── scripts -> 打包img的相关脚本

6.2 配置friendlywrt的软件包

  • 使用make menuconfig更改配置
cd friendlywrt
make menuconfig
  • 另存你个人的软件包配置
make menuconfig
./scripts/diffconfig.sh > ../configs/my_config
  • 让以后的编译使用你的friendlywrt配置

以NanoPi-R1为例,编辑以下文件:

device/friendlyelec/h3/nanopi_r1.mk

将TARGET_FRIENDLYWRT_CONFIG的值改为你的配置。

  • 重新编译friendlywrt并制成sd启动镜像
./build.sh friendlywrt
./build.sh sd-img

6.3 固化个人文件到friendlywrt

将文件或目录放入以下目录即可,打包img时会把它们都打包进去:

device/friendlyelec/h3/common-files

也可以放在新建的目录里,以NanoPi-R1为例,然后编辑以下文件:

device/friendlyelec/h3/nanopi_r1.mk

在文件中新增一行 (XXX替换为你的目录名):

FRIENDLYWRT_FILES+=(device/friendlyelec/h3/XXX)

6.4 修改friendlywrt系统的默认配置(如网络、防火墙等)

进入如下目录:

device/friendlyelec/h3/default-settings/files/root/board

编辑你所用的开发板目录所在的配置文件即可,比如下面是NanoPi-R1的配置文件:

NanoPi-R1
└── etc
    └── config
        ├── network
        └── system

6.5 更改u-boot和kernel配置

同样是编辑如下文件:

device/friendlyelec/h3/nanopi_r1.mk

可通过以下设置,将uboot的配置改为你自已的:

TARGET_UBOOT_CONFIG=nanopi_h3_defconfig

可通过以下设置,将kernel的配置改为你自已的:

TARGET_KERNEL_CONFIG=sunxi_defconfig

6.6 更换其他源代码

编辑如下 xml 文件,即可替换 kernel 、uboot以及friendlywrt的源代码:

.repo/manifests/h3.xml

想了解 xml 文件各个节点的含义和用法,请参考:repo Manifest Format
编辑完成后,需要用 repo 命令同步一下,比如更换了 kernel 的源代码,用以下命令同步一次:

repo sync --force-sync kernel

同步后单独重新内核即可:

./build.sh kernel

7 常见问题及注意事项

  • Ubuntu下不能使用 root 用户来编译,需要使用普通用户
  • 在 vnc 环境下编译可能会编译失败

8 参考资料

repo使用指南