Browse Source

Linux_SDK_V1.1.2

yanhe 1 year ago
parent
commit
f265d77a4f
2 changed files with 122 additions and 79 deletions
  1. 68 37
      README.md
  2. 54 42
      README_en.md

+ 68 - 37
README.md

@@ -2,63 +2,94 @@
 本文介绍了如何使用 Linux Yocto 构建环境下载和编译 TH1520 Linux SDK。Linux SDK 包含了源码和二进制文件,支持用户开发 Linux 应用程序,并可以构建运行在 evt 开发板上的完整镜像。
 
 - SDK 代码仓库:[https://gitee.com/thead-yocto](https://gitee.com/thead-yocto)
-- SDK 代码仓库 tag:**Linux_SDK_V1.0.3**
+- SDK 代码仓库 tag:**Linux_SDK_V1.1.2**
 # 搭建编译环境
 Linux SDK 使用 Yocto 构建镜像。Yocto 编译环境使用 Ubuntu 18.04,推荐使用Linux + docker 的方式部署,也可以直接在 Ubuntu 系统搭建编译环境。
 具体搭建环境方法,请查看文档《[T-Head曳影1520Yocto用户指南.pdf](https://gitee.com/thead-yocto/documents/blob/master/zh/user_guide/T-Head曳影1520Yocto用户指南.pdf)》。
 
 # 下载
-下载 Yocto 构建包(不含 SDK 源码):
-```
-git clone https://gitee.com/thead-yocto/xuantie-yocto.git -b Linux_SDK_V1.0.3
-```
+0. 下载开源软件包(仅在第一次获取 SDK 时下载):
 
-下载开源软件包(仅在第一次获取 SDK 时下载):
-构建时会从网络下载开源软件包,下载的时间依不同的网络和网速而不同切差异很大;有些开源软件位于 GitHub 仓库,受限于国内网络环境会下载失败。为了加速这一过程,可以到 gitee 下载离线开源软件包:
-```
-git clone https://gitee.com/thead-yocto/yocto-downloads.git
-```
+   构建时会从网络下载开源软件包,下载的时间依不同的网络和网速而不同切差异很大;有些开源软件位于 GitHub 仓库,受限于国内网络环境会下载失败。为了加速这一过程,可以到 gitee 下载离线开源软件包(假设将开源软件包下载到用户目录):
 
-加载目标设备的配置文件,加载环境变量:
-```
-cd xuantie-yocto
-source openembedded-core/oe-init-build-env build/light-fm
-```
+   ```bash
+   cd ~
+   git clone https://gitee.com/thead-yocto/yocto-downloads.git
+   ```
+
+1. 下载 Yocto 构建包(不含 SDK 源码):
+
+   ```bash
+   git clone https://gitee.com/thead-yocto/xuantie-yocto.git -b Linux_SDK_V1.1.2
+   ```
+   
+2. 加载目标设备的配置文件,加载环境变量:
+
+    ```bash
+    cd xuantie-yocto
+    source openembedded-core/oe-init-build-env thead-build/light-fm
+    ```
+
+3. 将前面下载的开源软件包通过共享 downloads 目录的方式软链接到 SDK 目录:
+
+    ```bash
+    ln -s ~/yocto-downloads ../downloads
+    ```
+
+# Machine/Target支持列表
+
+设置完环境变量后,可以看到如下打印信息:
 
-将前面下载的开源软件包通过共享 downloads 目录的方式软链接到 SDK 目录(假设 yocto-downloads 被下载到根目录下):
 ```
-ln -s /yocto-downloads ../downloads
+### Shell environment set up for builds. ###
+
+You can now run 'bitbake <target>'
+
+Common targets are:
+    thead-image-linux
+    thead-image-multimedia
+    thead-image-gui
+
+machines:
+    light-beagle
+    light-b-product
+    light-a-val
+    light-lpi4a
 ```
 
+其中,'targets' 表示 SDK 支持的镜像列表,'machines' 表示 SDK 支持的板级配置。关于支持的板级配置和镜像列表,说明如下:
+
+<u>target:</u>
+
+| **命名**               | **描述**                                                     |
+| ---------------------- | ------------------------------------------------------------ |
+| thead-image-linux      | 典型linux系统配置,最小系统加上必要的相关基础组件            |
+| thead-image-multimedia | 典型linux系统+视频视觉配置,加上视频子系统的组件(Gstreamer等) |
+| thead-image-gui        | 加上GUI相关组件的完整配置版本,包括Gnome桌面、weston、QT等应用组件等等 |
+
+<u>machine:</u>
+
+| **命名**        | **描述**            |
+| --------------- | ------------------- |
+| light-a-val     | TH1520-A EVB板      |
+| light-b-product | TH1520-B EVB板      |
+| light-beagle    | beagleV-Ahead开发板 |
+| light-lpi4a     | Lichee Pi 4A开发板  |
+
 # 构建固件
 
 构建命令如下:
 ```bash
-MACHINE=light-a-public-release bitbake light-fm-image-linux
+MACHINE={machine} bitbake {target}
 ```
 
-MACHINE 支持列表:
-
-* light-a-public-release:TH1520 light-a 开发板
-* light-b-public:TH1520 light-b 开发板
-* light-beagle:beagle-board 开发板
+其中,将 {machine} 和 {target} 替换为上一节支持的列表中的真实名称。例如,要编译一个典型 Linux 系统镜像并运行在 TH1520-A EVB 开发板上,则编译命令如下:
 
-# 手动清除 data 分区
-当前版本引入了 root 分区和 data 分区的 overlay 机制 -- 如果 root 分区和 data 分区有重名文件,系统会优先选择 data 分区文件。
-为了避免 data 分区影响,fastboot 烧录后,在 u-boot 模式下,请使用以下命令手动清除 data 分区:
-```c
-part start mmc 0 data start_blk
-part size mmc 0 data size_blk
-mmc erase ${start_blk} ${size_blk}
+```bash
+MACHINE=light-a-val bitbake thead-image-linux
 ```
-# deb 包安装
-默认工具类应用不会编译进镜像,以 deb 包的形式提供。deb 包会生成在编译后的镜像目录:build/light-fm/tmp-glibc/deploy/deb。
 
-安装 deb 包时,需要先将 deb 包拷贝(通过 adb 或者网络方式)到板子上,然后使用如下命令:
-```c
-dpkg -i "package_name"
-```
-如果该包依赖其他包,请根据提示依次安装。
+
 
 # 其他
 **light_deploy_images 仓库:**

+ 54 - 42
README_en.md

@@ -1,87 +1,99 @@
-# 1 Overview
+# Overview
 
 This article describes how to download and compile the TH1520 Linux SDK using the Linux Yocto build environment. The Linux SDK contains source code and binary files, which support users to develop Linux applications and build a complete image running on the evt development board.
 
 - SDK code repository: https://gitee.com/thead-yocto
-- SDK code repository tag: **Linux_SDK_V1.0.3**
+- SDK code repository tag: **Linux_SDK_V1.1.2**
 
-# 2 Build the Compilation Environment
+# Build the Compilation Environment
 
 The Linux SDK uses Yocto to build images. The Yocto compilation environment uses Ubuntu 18.04. It is recommended to use Linux + docker for deployment. You can also build a compilation environment directly on the Ubuntu system. For the specific method of setting up the environment, please check the document: "[T-Head_Yeying1520_Yocto_User_Guide.pdf](https://gitee.com/thead-yocto/documents/blob/master/en/user_guide/T-Head_Yeying1520_Yocto_User_Guide.pdf)".
 
-# 3 Download
-
-1. Download the Yocto buildpack (without SDK source code):
-
-   ```
-   git clone https://gitee.com/thead-yocto/xuantie-yocto.git -b Linux_SDK_V1.0.3
-   ```
+# Download
 
+0. Download open source software packages (only download when you get the SDK for the first time): 
 
+   Open source software packages are downloaded from the network when building. The download time varies greatly depending on different networks and network speeds. Some open source software is located in GitHub repositories, and download may fail due to the domestic network environment. To speed up the process, you can go to gitee to download offline open source packages:
 
-2. Download open source software packages (only download when you get the SDK for the first time): 
+    ```
+    cd ~
+    git clone https://gitee.com/thead-yocto/yocto-downloads.git
+    ```
 
-   Open source software packages are downloaded from the network when building. The download time varies greatly depending on different networks and network speeds. Some open source software is located in GitHub repositories, and download may fail due to the domestic network environment. To speed up the process, you can go to gitee to download offline open source packages:
+1. Download the Yocto buildpack (without SDK source code):
 
    ```
-   git clone https://gitee.com/thead-yocto/yocto-downloads.git
+   git clone https://gitee.com/thead-yocto/xuantie-yocto.git -b Linux_SDK_V1.1.2
    ```
 
-   
-
-3. Load the configuration file of the target device and load the environment variables:
+2. Load the configuration file of the target device and load the environment variables:
 
    ```
    cd xuantie-yocto
-   
-   source openembedded-core/oe-init-build-env build/light-fm
+   source openembedded-core/oe-init-build-env thead-build/light-fm
    ```
-
    
-
-4. Soft link the open source packages downloaded earlier to the SDK directory by sharing the downloads directory (assuming yocto-downloads is downloaded to the root directory):
+3. Soft link the open source packages downloaded earlier to the SDK directory by sharing the downloads directory (assuming yocto-downloads is downloaded to the root directory):
 
    ```
    ln -s /yocto-downloads ../downloads
    ```
 
-# 4 Build the Firmware
+# Machine/Target List
 
-The build command is as follows:
+After setting  the configuration file, you can see the following logs:
 
 ```
-MACHINE=light-a-public-release bitbake light-fm-image-linux
-```
+### Shell environment set up for builds. ###
 
-Supported MACHINE list:
+You can now run 'bitbake <target>'
 
-* light-a-public-release: TH1520 light-a board
-* light-b-public: TH1520 light-b board
-* light-beagle: beagle-board
+Common targets are:
+    thead-image-linux
+    thead-image-multimedia
+    thead-image-gui
 
-# 5 Manually Clear the Data Partition
+machines:
+    light-beagle
+    light-b-product
+    light-a-val
+    light-lpi4a
+```
 
-The current version introduces the overlay mechanism of the root partition and the data partition -- if the root partition and the data partition have files with the same name, the system preferentially selects the file in data partition. In order to avoid the influence of the data partition, please use the following command to manually clear the data partition in u-boot mode after fastboot is burned:
+Among them, 'targets' indicates the image list supported by the SDK, and 'machines' indicates the board configuration supported by the SDK. Board configurations and images are listed as follows:
 
-```
-part start mmc 0 data start_blk
-part size mmc 0 data size_blk
-mmc erase ${start_blk} ${size_blk}
-```
+<u>target:</u>
 
-# 6 deb Package Installation
+| Name                   | Description                                                  |
+| ---------------------- | ------------------------------------------------------------ |
+| thead-image-linux      | 典型linux系统配置,最小系统加上必要的相关基础组件            |
+| thead-image-multimedia | 典型linux系统+视频视觉配置,加上视频子系统的组件(Gstreamer等) |
+| thead-image-gui        | 加上GUI相关组件的完整配置版本,包括Gnome桌面、weston、QT等应用组件等等 |
 
-The default utility application is not compiled into the image and is provided as a deb package. The deb package will be generated in the compiled image directory: build/light-fm/tmp-glibc/deploy/deb.
+<u>machine:</u>
 
-When installing the deb package, you need to first copy the deb package (through adb or network) to the board, and then use the following command:
+| Name            | Description         |
+| --------------- | ------------------- |
+| light-a-val     | TH1520-A EVB板      |
+| light-b-product | TH1520-B EVB板      |
+| light-beagle    | beagleV-Ahead开发板 |
+| light-lpi4a     | Lichee Pi 4A开发板  |
+
+# Build the Firmware
+
+The build command is as follows:
 
 ```
-dpkg -i "package_name"
+MACHINE={machine} bitbake {target}
 ```
 
-If the package depends on other packages, please install them in sequence according to the prompts.
+Replace {machine} and {target} with the real names from the supported list in the previous section. For example, to compile a typical Linux system image and run it on TH1520-A EVB development board, the compilation command is as follows:
+
+```
+MACHINE=light-a-val bitbake thead-image-linux
+```
 
-# 7 Other
+# Other
 
 ***light_deploy_images repository:***