build Raspberry Pi image, refine the documentation

This commit is contained in:
Yafen 2025-08-29 10:58:38 +08:00
parent 709348c40a
commit f869dc13c0
50 changed files with 5857 additions and 597 deletions

View File

@ -70,17 +70,13 @@ You can get introduction of openEuler SBC SIG from [sig-SBC](https://gitee.com/o
- [openEuler Adaptation Guide](documents/rockchip/openEuler适配指南.md) - [openEuler Adaptation Guide](documents/rockchip/openEuler适配指南.md)
- [Using RKNPU on openEuler](documents/rockchip/在openEuler上使用RKNPU.md) - [Using RKNPU on openEuler](documents/rockchip/在openEuler上使用RKNPU.md)
- [Run RKLLM on openEuler](documents/rockchip/在openEuler上运行RKLLM.md) - [Run RKLLM on openEuler](documents/rockchip/在openEuler上运行RKLLM.md)
- [scripts](./scripts/): - [scripts](./scripts/): Script for building openEuler image
- [Raspberry Pi](./scripts/raspberrypi): Script for building openEuler image for Raspberry Pi - [Build a unified system image](scripts/build.sh)
- [Quickly Build (without kernel compilation)](scripts/raspberrypi/build-image.sh) - [Build a unified system image using Docker](./scripts/build-image-docker.sh)
- [Build on host (with kernel compilation)](scripts/raspberrypi/build-image-common.sh) - [Build a boot Image](scripts/build_boot.sh)
- [Build in a Docker container (with kernel compilation)](scripts/raspberrypi/build-image-docker.sh) - [Build a rootfs Image](scripts/build_rootfs.sh)
- [Rockchip and other SoCs](./scripts/rockchip): Used to build openEuler images for Rockchip and other SoCs - [Compile u-boot](scripts/build_u-boot.sh)
- [One-time build images](scripts/rockchip/build.sh) - [Generate a bootable image](scripts/gen_image.sh)
- [Build a boot Image](scripts/rockchip/build_boot.sh)
- [Build a rootfs Image](scripts/rockchip/build_rootfs.sh)
- [Compile u-boot](scripts/rockchip/build_u-boot.sh)
- [Generate a bootable image](scripts/rockchip/gen_image.sh)
## How to download latest image ## How to download latest image
@ -306,38 +302,6 @@ To build openEuler AArch64 image for Raspberry Pi, Rockchip or other SoCs, the r
For other architecture hardware, you can use [QEMU](https://www.qemu.org/) to build AArch64 system emulation. For other architecture hardware, you can use [QEMU](https://www.qemu.org/) to build AArch64 system emulation.
### Run the scripts to build image ### Run the scripts to build image
You can use the unified build scripts [build.sh](./scripts/build.sh) or [build-image-docker.sh](./scripts/build-image-docker.sh) to build images for Raspberry Pi, Rockchip, and other development boards, either directly on the host machine or by launching a Docker container. For details, please refer to the documentation below:
You can use the respective scripts of Raspberry Pi, Rockchip or other SoCs to build images. Refer to the specific documentation:
- [Build Raspberry Pi images](./documents/树莓派.md#构建镜像) - [Build Raspberry Pi images](./documents/树莓派.md#构建镜像)
- [Build images for Rochchip and other SoCs](./documents/瑞芯微等开发板.md#镜像构建) - [Build images for Rochchip and other SoCs](./documents/瑞芯微等开发板.md#镜像构建)
Alternatively, you can use the unified entry point [build.sh](./scripts/build.sh) to build images for Raspberry Pi, Rockchip or other SoCs by executing the following command:
`sudo bash scripts/build.sh --board BOARD_TYPE --in-docker [other_args...]`
Parameter Definitions & Meaning:
1. `--in-docker`
Build the image using a Docker container. Refer to the links below:
- [Build Raspberry Pi images in Docker](./documents/树莓派.md#docker-容器内构建)
- [Build images for Rockchip or other SoCs in Docker](./documents/瑞芯微等开发板.md#docker-容器内构建)
2. `--board BOARD_TYPE`
Specifies the development board type. Currently supported parameters include:
- `rpi`: Build a Raspberry Pi image without compiling the kernel. For other parameters, refer to [Quick build for Raspberry Pi (no kernel compilation)](./documents/树莓派.md#快速构建无需编译内核推荐).
- `rpi-custom`: Build a Raspberry Pi image with kernel compilation. For other parameters, refer to [Build a Raspberry Pi image using a custom-compiled kernel](./documents/树莓派.md#完全构建包括编译内核).
- `firefly-itx-3588j`: Build a Firefly ITX-3588J image. For other parameters, refer to [Build an image for Rockchip or other SoCs](./documents/瑞芯微等开发板.md#一次构建).
- `firefly-rk3399`: Build a Firefly RK3399 image. For other parameters, refer to [Build an image for Rockchip or other SoCs](./documents/瑞芯微等开发板.md#一次构建).
- `firefly-roc-rk3566-pc`: Build a Firefly ROC-RK3566-PC image. For other parameters, refer to [Build an image for Rockchip or other SoCs](./documents/瑞芯微等开发板.md#一次构建).
- `firefly-roc-rk3568-pc`: Build a Firefly ROC-RK3568-PC image. For other parameters, refer to [Build an image for Rockchip or other SoCs](./documents/瑞芯微等开发板.md#一次构建).
- `firefly-roc-rk3568-pc-se`: Build a Firefly ROC-RK3568-PC-SE image. For other parameters, refer to [Build an image for Rockchip or other SoCs](./documents/瑞芯微等开发板.md#一次构建).
- `firefly-roc-rk3588s-pc`: Build a Firefly ROC-RK3588S-PC image. For other parameters, refer to [Build an image for Rockchip or other SoCs](./documents/瑞芯微等开发板.md#一次构建).
- `phytiumpi-4gb`: Build a Phytium Pi 4GB image. For other parameters, refer to [Build an image for Rockchip or other SoCs](./documents/瑞芯微等开发板.md#一次构建).
- `radxa-rock5b`: Build a Radxa Rock-5B image. For other parameters, refer to [Build an image for Rockchip or other SoCs](./documents/瑞芯微等开发板.md#一次构建).
- `radxa-rockpi-4a`: Build a Radxa RockPi-4A image. For other parameters, refer to [Build an image for Rockchip or other SoCs](./documents/瑞芯微等开发板.md#一次构建).
- `orangepi-zero2`: Build a Orange Pi Zero2 image. For other parameters, refer to [Build an image for Rockchip or other SoCs](./documents/瑞芯微等开发板.md#一次构建).
- `longanpi-3h`: Build a Sipeed Longan Pi 3H image. For other parameters, refer to [Build an image for Rockchip or other SoCs](./documents/瑞芯微等开发板.md#一次构建).
3. `-h`, `--help`
Display help information.

View File

@ -69,17 +69,13 @@ SIG 组基本信息位于 [sig-SBC](https://gitee.com/openeuler/community/tree/m
- [openEuler 适配指南](documents/rockchip/openEuler适配指南.md) - [openEuler 适配指南](documents/rockchip/openEuler适配指南.md)
- [在openEuler上使用RKNPU](documents/rockchip/在openEuler上使用RKNPU.md) - [在openEuler上使用RKNPU](documents/rockchip/在openEuler上使用RKNPU.md)
- [在openEuler上运行RKLLM](documents/rockchip/在openEuler上运行RKLLM.md) - [在openEuler上运行RKLLM](documents/rockchip/在openEuler上运行RKLLM.md)
- [scripts](./scripts/): 镜像构建脚本 - [scripts](./scripts/): openEuler 镜像构建脚本
- [树莓派](./scripts/raspberrypi): 构建 openEuler 树莓派镜像的脚本 - [构建完整镜像](scripts/build.sh)
- [快速构建(不编译内核)](scripts/raspberrypi/build-image.sh) - [使用 Docker 构建完整镜像](./scripts/build-image-docker.sh)
- [主机上构建(编译内核)](scripts/raspberrypi/build-image-common.sh) - [构建 boot 镜像](scripts/build_boot.sh)
- [Docker 容器中构建(编译内核)](scripts/raspberrypi/build-image-docker.sh) - [构建 rootfs 镜像](scripts/build_rootfs.sh)
- [瑞芯微等开发板](./scripts/rockchip): 构建 openEuler RK3399 等开发板镜像的脚本 - [编译 u-boot](scripts/build_u-boot.sh)
- [一次构建脚本](scripts/rockchip/build.sh) - [将 u-boot、boot、rootfs 合并成一个完整镜像](scripts/gen_image.sh)
- [boot 镜像构建脚本](scripts/build_boot.sh)
- [rootfs 镜像构建脚本](scripts/build_rootfs.sh)
- [u-boot 编译脚本](scripts/rockchip/build_u-boot.sh)
- [可启动镜像生成脚本](scripts/rockchip/gen_image.sh)
## 最新镜像 ## 最新镜像
@ -305,37 +301,6 @@ SIG 组基本信息位于 [sig-SBC](https://gitee.com/openeuler/community/tree/m
其他架构可以使用 [QEMU](https://www.qemu.org/) 模拟器搭建 AArch64 运行环境。 其他架构可以使用 [QEMU](https://www.qemu.org/) 模拟器搭建 AArch64 运行环境。
### 构建镜像 ### 构建镜像
镜像构建使用统一入口 [build.sh](./scripts/build.sh) 或 [build-image-docker.sh](./scripts/build-image-docker.sh) 在宿主机或者启动 Docker 容器构建树莓派或瑞芯微等开发板镜像。具体参考以下文档:
可以使用树莓派或瑞芯微等开发板各自的脚本构建镜像,具体文档参考:
- [树莓派镜像构建](./documents/树莓派.md#构建镜像) - [树莓派镜像构建](./documents/树莓派.md#构建镜像)
- [瑞芯微等开发板镜像构建](./documents/瑞芯微等开发板.md#镜像构建) - [瑞芯微等开发板镜像构建](./documents/瑞芯微等开发板.md#镜像构建)
也可以使用统一入口 [build.sh](./scripts/build.sh) 构建树莓派或瑞芯微等开发板镜像,执行命令:
`sudo bash scripts/build.sh --board BOARD_TYPE --in-docker [other_args...]`
各个参数含义:
1. --in-docker
使用 Docker 容器构建镜像,参考链接:
- [使用 Docker 容器构建树莓派镜像](./documents/树莓派.md#docker-容器内构建)
- [使用 Docker 容器构建瑞芯微等开发板镜像](./documents/瑞芯微等开发板.md#docker-容器内构建)
2. --board BOARD_TYPE
开发板类型和构建方式。当前支持的参数有:
- rpi无需编译内核直接构建树莓派镜像其他参数请参考 [无需编译内核快速构建树莓派镜像](./documents/树莓派.md#快速构建无需编译内核推荐)。
- rpi-custom编译内核并构建树莓派镜像其他参数请参考 [编译内核构建树莓派镜像](./documents/树莓派.md#完全构建包括编译内核)。
- firefly-itx-3588j构建 Firefly ITX-3588J 开发板镜像,其他参数请参考 [构建瑞芯微等开发板镜像](./documents/瑞芯微等开发板.md#一次构建)。
- firefly-rk3399构建 Firefly RK3399 开发板镜像,其他参数请参考 [构建瑞芯微等开发板镜像](./documents/瑞芯微等开发板.md#一次构建)。
- firefly-roc-rk3566-pc构建 Firefly ROC-RK3566-PC 开发板镜像,其他参数请参考 [构建瑞芯微等开发板镜像](./documents/瑞芯微等开发板.md#一次构建)。
- firefly-roc-rk3568-pc构建 Firefly ROC-RK3568-PC 开发板镜像,其他参数请参考 [构建瑞芯微等开发板镜像](./documents/瑞芯微等开发板.md#一次构建)。
- firefly-roc-rk3568-pc-se构建 Firefly ROC-RK3568-PC-SE 开发板镜像,其他参数请参考 [构建瑞芯微等开发板镜像](./documents/瑞芯微等开发板.md#一次构建)。
- firefly-roc-rk3588s-pc构建 Firefly ROC-RK3588S-PC 开发板镜像,其他参数请参考 [构建瑞芯微等开发板镜像](./documents/瑞芯微等开发板.md#一次构建)。
- phytiumpi-4gb构建 Phytium Pi 4GB 开发板镜像,其他参数请参考 [构建瑞芯微等开发板镜像](./documents/瑞芯微等开发板.md#一次构建)。
- radxa-rock5b构建 Radxa Rock-5B 开发板镜像,其他参数请参考 [构建瑞芯微等开发板镜像](./documents/瑞芯微等开发板.md#一次构建)。
- radxa-rockpi-4a构建 Radxa RockPi-4A 开发板镜像,其他参数请参考 [构建瑞芯微等开发板镜像](./documents/瑞芯微等开发板.md#一次构建)。
- orangepi-zero2构建 Orange Pi Zero2 开发板镜像,其他参数请参考 [构建瑞芯微等开发板镜像](./documents/瑞芯微等开发板.md#一次构建)。
- longanpi-3h构建 Sipeed Longan Pi 3H 开发板镜像,其他参数请参考 [构建瑞芯微等开发板镜像](./documents/瑞芯微等开发板.md#一次构建)。
3. -h, --help
显示帮助信息。

View File

@ -36,7 +36,7 @@
### 使用 BSP 内核 ### 使用 BSP 内核
如果想使用 BSP 内核进行测试,可以在构建指令中指定 BSP 内核的仓库地址及对应分支,参考[一次构建](../瑞芯微等开发板.md#一次构建)。 如果想使用 BSP 内核进行测试,可以在构建指令中指定 BSP 内核的仓库地址及对应分支,参考 [构建完整镜像](../瑞芯微等开发板.md#构建完整镜像)。
## 准备 u-boot ## 准备 u-boot
@ -46,17 +46,17 @@
- RK35xx - RK35xx
需要将编译好的 u-boot 二进制文件放到 [u-boot 目录](../../scripts/rockchip/bin/u-boot/)下,并在版型文件中增加文件路径。 需要将编译好的 u-boot 二进制文件放到 [u-boot 目录](../../scripts/bin/u-boot/)下,并在版型文件中增加文件路径。
## 准备 firmware 文件 ## 准备 firmware 文件
这里提到的 firmware 是开发板的板载蓝牙和 WiFi 的驱动固件,可参考[本框架储存的的 firmware 文件](../../scripts/rockchip/bin/linux-firmware/)。 这里提到的 firmware 是开发板的板载蓝牙和 WiFi 的驱动固件,可参考[本框架储存的的 firmware 文件](../../scripts/bin/linux-firmware/)。
请确定开发板所使用的 firmware并提交至仓库的相应目录下。 请确定开发板所使用的 firmware并提交至仓库的相应目录下。
## 编写版型文件 ## 编写版型文件
适用的开发板的版型配置文件在 [boards](../../scripts/rockchip/boards/) 文件夹中,版型文件示例如下: 适用的开发板的版型配置文件在 [boards](../../scripts/boards/) 文件夹中,版型文件示例如下:
``` ```
ubootconfig=firefly-rk3399_defconfig #Required! The name of defconfig file when compiling u-boot, which defaults to firefly-rk3399_defconfig. ubootconfig=firefly-rk3399_defconfig #Required! The name of defconfig file when compiling u-boot, which defaults to firefly-rk3399_defconfig.
@ -77,13 +77,13 @@ POST_BOARD_OVERLAY() {
1. ubootconfig=UBOOT_DEFCONFIG 1. ubootconfig=UBOOT_DEFCONFIG
开发板对应的 defconfig 的文件名称,对应 [u-boot/configs](https://github.com/u-boot/u-boot/tree/master/configs) 下 `UBOOT_DEFCONFIG` 文件,默认为 `firefly-rk3399_defconfig`;如需在 RK3568/RK3588 开发板上使用预编译的 u-boot可以将此项设置为 `none`。 开发板对应的 defconfig 的文件名称,对应 [u-boot/configs](https://github.com/u-boot/u-boot/tree/master/configs) 下 `UBOOT_DEFCONFIG` 文件,默认为 `firefly-rk3399_defconfig`;如需在 RK3568/RK3588 开发板上使用预编译的 u-boot可以将此项设置为空:`ubootconfig=`。
如果设置为 `none`,则还需添加以下附属配置参数: 如果设置为 ``,则还需添加以下附属配置参数:
- local_uboot_dir - local_uboot_dir
开发板 u-boot 配置设置为 `none` 时,本地预编译的 u-boot 二进制文件的位置。 开发板 u-boot 配置设置为时,本地预编译的 u-boot 二进制文件的位置。
2. dtb_name=DTB_NAME 2. dtb_name=DTB_NAME
@ -114,11 +114,11 @@ POST_BOARD_OVERLAY() {
6. POST_BOARD_OVERLAY() 6. POST_BOARD_OVERLAY()
`POST_BOARD_OVERLAY()` 是执行复制 firmware 文件到根目录以及对目标开发板根目录执行特定操作的函数,其使用的变量与 [build_rootfs.sh](../../scripts/rockchip/build_rootfs.sh) 相同,通常包含以下两个变量: `POST_BOARD_OVERLAY()` 是执行复制 firmware 文件到根目录以及对目标开发板根目录执行特定操作的函数,其使用的变量与 [build_rootfs.sh](../../scripts/build_rootfs.sh) 相同,通常包含以下两个变量:
- nonfree_bin_dir - nonfree_bin_dir
该参数为储存 firmware 的文件夹,默认为 [${workdir}/../bin](../../scripts/rockchip/bin/)。 该参数为储存 firmware 的文件夹,默认为 [../../scripts/bin/](../../scripts/bin/)。
- rootfs_dir - rootfs_dir
@ -126,4 +126,4 @@ POST_BOARD_OVERLAY() {
## 运行测试 ## 运行测试
通过运行脚本[一次构建](../瑞芯微等开发板.md#一次构建),将 `--board` 参数设置为新增开发板的版型文件来运行测试。 通过运行脚本 [构建完整镜像](../瑞芯微等开发板.md#构建完整镜像),将 `--board` 参数设置为新增开发板的版型文件来运行测试。

View File

@ -441,7 +441,7 @@ dnf --installroot=$WORKDIR/rootfs/ install -y alsa-utils wpa_supplicant vim net-
``` ```
3. 拷贝 wifi 配置文件,蓝牙启动文件 3. 拷贝 wifi 配置文件,蓝牙启动文件
1. 下载 [无线配置目录](../../scripts/rockchip/bin/wireless) 到 $WORKDIR 1. 下载 [无线配置目录](../../scripts/bin/wireless) 到 $WORKDIR
2. 拷贝文件 : 2. 拷贝文件 :
``` ```

View File

@ -47,8 +47,8 @@
1. 生成的刷写文件压缩包为 build 下或项目主页发布的的压缩后的 RAW 原始镜像需要解压openEuler-VERSION-BOARD-RELEASE.img.xz。 1. 生成的刷写文件压缩包为 build 下或项目主页发布的的压缩后的 RAW 原始镜像需要解压openEuler-VERSION-BOARD-RELEASE.img.xz。
2. 项目主页 scripts/bin 目录下提供的: 2. 项目主页 scripts/bin 目录下提供的:
- 如果是 RK3399使用 [rk3399_loader.bin](../../scripts/rockchip/bin/rk3399_loader.bin) - 如果是 RK3399使用 [rk3399_loader.bin](../../scripts/bin/rk3399_loader.bin)
- 如果是 RK3588使用 [rk3588_loader.bin](../../scripts/rockchip/bin/rk3588_loader.bin) - 如果是 RK3588使用 [rk3588_loader.bin](../../scripts/bin/rk3588_loader.bin)
3. 下载版本不小于 2.92 的 [RKDevTool 工具](https://dl.radxa.com/tools/windows/windows_RKDevTool_Release_v2.92.zip)。 3. 下载版本不小于 2.92 的 [RKDevTool 工具](https://dl.radxa.com/tools/windows/windows_RKDevTool_Release_v2.92.zip)。

View File

@ -1,4 +1,4 @@
# 一次构建命令列举 # 构建完整镜像命令列举
- [描述](#描述) - [描述](#描述)
- [适用的 RK3399 开发板](#适用的-rk3399-开发板) - [适用的 RK3399 开发板](#适用的-rk3399-开发板)
@ -10,7 +10,7 @@
## 描述 ## 描述
本文档介绍了支持的开发板以及对应的一次构建命令。 本文档介绍了支持的开发板以及构建对应开发板完整镜像的命令。
### 适用的 RK3399 开发板: ### 适用的 RK3399 开发板:

View File

@ -23,7 +23,7 @@
1. --board BOARD_CONFIG 1. --board BOARD_CONFIG
适用的开发板的版型配置文件在 [boards](../scripts/rockchip/boards) 文件夹中,示例文件 [sample.conf](../scripts/rockchip/boards/sample.conf),默认为 `firefly-rk3399`。其包括的配置参数意义见[版型文件](./openEuler适配指南.md#编写版型文件)。 适用的开发板的版型配置文件在 [boards](../scripts/boards) 文件夹中,示例文件 [sample.conf](../scripts/boards/sample.conf),默认为 `firefly-rk3399`。其包括的配置参数意义见[版型文件](./openEuler适配指南.md#编写版型文件)。
2. -h, --help 2. -h, --help
@ -42,7 +42,7 @@
1. --board BOARD_CONFIG 1. --board BOARD_CONFIG
适用的开发板的版型配置文件在 [boards](../scripts/rockchip/boards) 文件夹中,示例文件 [sample.conf](../scripts/rockchip/boards/sample.conf),默认为 `firefly-rk3399`。其包括的配置参数意义见[版型文件](./openEuler适配指南.md#编写版型文件)。 适用的开发板的版型配置文件在 [boards](../scripts/boards) 文件夹中,示例文件 [sample.conf](../scripts/boards/sample.conf),默认为 `firefly-rk3399`。其包括的配置参数意义见[版型文件](./openEuler适配指南.md#编写版型文件)。
2. -k, --kernel KERNEL_URL 2. -k, --kernel KERNEL_URL
@ -78,15 +78,15 @@
1. --board BOARD_CONFIG 1. --board BOARD_CONFIG
适用的开发板的版型配置文件在 [boards](../scripts/rockchip/boards) 文件夹中,示例文件 [sample.conf](../scripts/rockchip/boards/sample.conf),默认为 `firefly-rk3399`。其包括的配置参数意义见[版型文件](./openEuler适配指南.md#编写版型文件)。 适用的开发板的版型配置文件在 [boards](../scripts/boards) 文件夹中,示例文件 [sample.conf](../scripts/boards/sample.conf),默认为 `firefly-rk3399`。其包括的配置参数意义见[版型文件](./openEuler适配指南.md#编写版型文件)。
2. -r, --repo REPO_INFO 2. -r, --repo REPO_INFO
开发源 repo 文件的 URL 或者路径,也可以是开发源中资源库的 baseurl 列表。注意,如果该参数为资源库的 baseurl 列表,该参数需要使用双引号,各个 baseurl 之间以空格隔开。 软件源 repo 文件的 URL 或者路径,也可以是软件源中资源库的 baseurl 列表。注意,如果该参数为资源库的 baseurl 列表,该参数需要使用双引号,各个 baseurl 之间以空格隔开。
下面分别举例: 下面分别举例:
- 开发源 repo 文件的 URL`https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS-SP2/generic.repo` - 软件源 repo 文件的 URL`https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS-SP2/generic.repo`
- 开发源的 repo 文件路径: - 软件源的 repo 文件路径:
`./openEuler-20.03-LTS.repo`:生成 openEuler 20.03 LTS 版本的镜像,该文件内容参考 <https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.03-LTS/generic.repo> `./openEuler-20.03-LTS.repo`:生成 openEuler 20.03 LTS 版本的镜像,该文件内容参考 <https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.03-LTS/generic.repo>
@ -109,7 +109,7 @@
- `xfce`,带 Xfce 桌面以及中文字体、输入法等全部配套软件。 - `xfce`,带 Xfce 桌面以及中文字体、输入法等全部配套软件。
- `ukui`,带 UKUI 桌面及必要的配套软件(不包括中文字体以及输入法)。 - `ukui`,带 UKUI 桌面及必要的配套软件(不包括中文字体以及输入法)。
- `dde`,带 DDE 桌面及必要的配套软件(不包括中文字体以及输入法)。 - `dde`,带 DDE 桌面及必要的配套软件(不包括中文字体以及输入法)。
- rpmlist 文件路径,其中包含镜像中要安装的软件列表,内容参考 [rpmlist](../../scripts/rockchip/configs/rpmlist)。 - rpmlist 文件路径,其中包含镜像中要安装的软件列表,内容参考 [rpmlist](../../scripts/configs/rpmlist)。
默认使用 `headless` 选项。 默认使用 `headless` 选项。
@ -132,7 +132,7 @@
1. --board BOARD_CONFIG 1. --board BOARD_CONFIG
适用的开发板的版型配置文件在 [boards](../scripts/rockchip/boards) 文件夹中,示例文件 [sample.conf](../scripts/rockchip/boards/sample.conf),默认为 `firefly-rk3399`。其包括的配置参数意义见[版型文件](./openEuler适配指南.md#编写版型文件)。 适用的开发板的版型配置文件在 [boards](../scripts/boards) 文件夹中,示例文件 [sample.conf](../scripts/boards/sample.conf),默认为 `firefly-rk3399`。其包括的配置参数意义见[版型文件](./openEuler适配指南.md#编写版型文件)。
2. -n, --name IMAGE_NAME 2. -n, --name IMAGE_NAME

View File

@ -11,8 +11,8 @@
- [镜像构建](#镜像构建) - [镜像构建](#镜像构建)
- [准备环境](#准备环境) - [准备环境](#准备环境)
- [构建镜像](#构建镜像) - [构建镜像](#构建镜像)
- [快速构建(无需编译内核,推荐)](#快速构建无需编译内核推荐) - [无需编译内核构建镜像](#无需编译内核构建镜像)
- [完全构建(包括编译内核)](#完全构建包括编译内核) - [使用自定义内核构建镜像](#使用自定义内核构建镜像)
- [Docker 容器内构建](#docker-容器内构建) - [Docker 容器内构建](#docker-容器内构建)
<!-- /TOC --> <!-- /TOC -->
@ -38,10 +38,12 @@
- [openEuler 21.09 内测版DDE 桌面、中文输入法)更新日志](raspberrypi/changelog/changelog-21.09-DDE.md) - [openEuler 21.09 内测版DDE 桌面、中文输入法)更新日志](raspberrypi/changelog/changelog-21.09-DDE.md)
- [openEuler 21.09 内测版Xfce 桌面、中文输入法)更新日志](raspberrypi/changelog/changelog-21.09-Xfce.md) - [openEuler 21.09 内测版Xfce 桌面、中文输入法)更新日志](raspberrypi/changelog/changelog-21.09-Xfce.md)
- [openEuler 21.09 内测版LXDE 桌面、中文输入法)更新日志](raspberrypi/changelog/changelog-21.09-LXDE.md) - [openEuler 21.09 内测版LXDE 桌面、中文输入法)更新日志](raspberrypi/changelog/changelog-21.09-LXDE.md)
- [scripts](../scripts/raspberrypi): 构建 openEuler 树莓派镜像的脚本 - [scripts](../scripts): 构建 openEuler 树莓派镜像的脚本
- [快速构建(不编译内核)](../scripts/raspberrypi/build-image.sh) - [构建完整镜像](scripts/build.sh)
- [完全构建(编译内核)](../scripts/raspberrypi/build-image-common.sh) - [使用 Docker 构建完整镜像](./scripts/build-image-docker.sh)
- [Docker 容器中构建](../scripts/raspberrypi/build-image-docker.sh) - [构建 boot 镜像](scripts/build_boot.sh)
- [构建 rootfs 镜像](scripts/build_rootfs.sh)
- [将 u-boot、boot、rootfs 合并成一个完整镜像](scripts/gen_image.sh)
## 最新镜像 ## 最新镜像
@ -75,12 +77,97 @@
详细过程参见 [openEuler 镜像的构建](raspberrypi/openEuler镜像的构建.md)。 详细过程参见 [openEuler 镜像的构建](raspberrypi/openEuler镜像的构建.md)。
构建脚本见 [scripts/raspberrypi](../scripts/raspberrypi)。 构建脚本见 [scripts](../scripts)。
构建镜像需执行命令:
`sudo bash build.sh --board BOARD_CONFIG -n NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO_INFO -s SPEC --cores N`
脚本运行结束后,会提示镜像的存储位置,镜像默认保存在脚本运行所在目录的 `build/YYYY-MM-DD/` 下。
各个参数意义:
1. --board BOARD_CONFIG
适用的开发板的版型配置文件在 [boards](../scripts/boards) 文件夹中,示例文件 [sample.conf](../scripts/boards/sample.conf)。构建树莓派镜像需要设置为 `raspberrypi`,对应文件 [raspberrypi.conf](../scripts/boards/raspberrypi.conf)。
其包括的配置参数意义如下:
- platform=PLATFORM
开发板所使用的平台目前支持的平台有broadcom、rockchip、phytium。构建树莓派镜像需要设置为 `broadcom`
- device-tree=DTB_NAME
内核设备树中的设备名称,和开发板名称有一点区别,对应 [kernel/arch/arm64/boot/dts/broadcom](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-6.6/arch/arm64/boot/dts/broadcom) 下的 `DTB_NAME.dts` 文件。构建树莓派镜像时,默认编译出所有树莓派平台的设备树文件,因此该参数可以为空或者根据需要设置为 `bcm2711-rpi-4-b``bcm2712-rpi-5-b`
- ubootconfig=UBOOT_DEFCONFIG
开发板对应的 defconfig 的文件名称,对应 [u-boot/configs](https://github.com/u-boot/u-boot/tree/master/configs) 下 `UBOOT_DEFCONFIG` 文件,默认为 `firefly-rk3399_defconfig`。构建树莓派镜像无需这部分内容,默认为空:`ubootconfig=`
2. -n, --name IMAGE_NAME
构建的镜像名称,例如:`openEuler-24.03-LTS-raspi-aarch64-alpha1`
3. -k, --kernel KERNEL_URL
内核源码仓库的项目地址,如 `https://gitee.com/openeuler/raspberrypi-kernel.git`。可根据需要设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``git@gitee.com:openeuler/kernel.git`
注意,如果本参数为空,则不会编译内核源码,默认使用软件源中的内核包。
4. -b, --branch KERNEL_BRANCH
内核源码的对应分支例如OLK-6.6。根据 -k 参数有以下选择:
- -k https://gitee.com/openeuler/rockchip-kernel.git
- openEuler-20.03-LTS
- -k https://gitee.com/openeuler/kernel.git
- openEuler-21.09
5. -c, --config KERNEL_DEFCONFIG
内核编译使用的配置文件名称或路径,如 `bcm2711_defconfig``bcm2712_defconfig`。如果该参数为配置文件名称,请确保该文件在内核源码的目录 arch/arm64/configs 下。
注意,如果 `--branch` 参数为 `OLK-6.6` 且本参数 `--config` 为空,则默认编译出同时支持树莓派 5 和树莓派 4B 的内核映像。
6. -r, --repo REPO_INFO
软件源 repo 文件的 URL 或者路径,也可以是软件源中资源库的 baseurl 列表。注意,如果该参数为资源库的 baseurl 列表,该参数需要使用双引号,各个 baseurl 之间以空格隔开。
下面分别举例:
- 软件源 repo 文件的 URL`https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS-SP1/generic.repo`
- 软件源的 repo 文件路径:
- `./openEuler-20.03-LTS-SP1.repo`:生成 openEuler 20.03 LTS SP1 版本的镜像,该文件内容参考 <https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.03-LTS-SP1/generic.repo>
- 资源库的 baseurl 列表,如 `"http://repo.openeuler.org/openEuler-20.03-LTS-SP1/OS/aarch64/ http://repo.openeuler.org/openEuler-20.03-LTS-SP1/EPOL/aarch64/"`
7. -s, --spec SPEC
构建的镜像版本:
- `headless`,无图形界面版的镜像。
- `xfce`,带 Xfce 桌面以及中文字体、输入法等全部配套软件。
- `ukui`,带 UKUI 桌面以及中文字体、输入法等全部配套软件。
- `dde`,带 DDE 桌面以及中文字体、输入法等全部配套软件。
- `gnome`,带 GNOME 桌面以及中文字体、输入法等全部配套软件。
- `devstation`,带 GNOME 桌面、中文字体、输入法、大量开发工具和 IDE 等配套软件。
- rpmlist 文件路径,该文件包含镜像中要安装的软件列表,内容参考 [rpmlist](../scripts/configs-rpi/rpmlist)。
默认使用 `headless` 选项。
8. --cores N
并行编译的数量,根据运行脚本的宿主机 CPU 实际数目设定,默认为可用的 CPU 总数。
9. -h, --help
显示帮助信息。
#### 无需编译内核构建镜像
例如,使用软件源中的内核包构建 openEuler 24.03 LTS SP2 版本 openEuler 树莓派镜像,执行命令:`sudo bash build.sh --board raspberrypi --kernel "" --branch "" --config "" --repo https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-24.03-LTS-SP2/generic.repo --name openEuler-24.03-LTS-raspi-aarch64-alpha1`
#### 快速构建(无需编译内核,推荐)
>![](public_sys-resources/icon-notice.gif) **须知:** >![](public_sys-resources/icon-notice.gif) **须知:**
>当前支持多个 openEuler 版本,即 20.09、20.03 LTS SP1、21.03、20.03 LTS SP2、21.09、20.03 LTS SP3、22.03 LTS、22.09、22.03 LTS SP1、23.03、22.03 LTS SP2、22.03 LTS SP3、24.03 LTS、22.03 LTS SP4、24.09、24.03 LTS SP1、25.03、24.03 LTS SP2 版本。 >无需编译内核,使用软件源中的内核包,当前支持版本有 20.09、20.03 LTS SP1、21.03、20.03 LTS SP2、21.09、20.03 LTS SP3、22.03 LTS、22.09、22.03 LTS SP1、23.03、22.03 LTS SP2、22.03 LTS SP3、24.03 LTS、22.03 LTS SP4、24.09、24.03 LTS SP1、25.03、24.03 LTS SP2。
>如果构建包含 Xfce/UKUI/DDE/GNOME 桌面环境或者 DevStation 开发者工作站的镜像,需要注意五点: >如果构建包含 Xfce/UKUI/DDE/GNOME 桌面环境或者 DevStation 开发者工作站的镜像,需要注意五点:
>1. 构建包含 Xfce 桌面环境的镜像,当前只支持 openEuler 21.03/20.03 LTS SP2/21.09/20.03 LTS SP3/22.03 LTS/22.09/22.03 LTS SP1/23.03/22.03 LTS SP2/22.03 LTS SP3/24.03 LTS/22.03 LTS SP4/24.09 版本。自 openEuler 24.03 LTS SP1 起,不再支持 Xfce 桌面环境。 >1. 构建包含 Xfce 桌面环境的镜像,当前只支持 openEuler 21.03/20.03 LTS SP2/21.09/20.03 LTS SP3/22.03 LTS/22.09/22.03 LTS SP1/23.03/22.03 LTS SP2/22.03 LTS SP3/24.03 LTS/22.03 LTS SP4/24.09 版本。自 openEuler 24.03 LTS SP1 起,不再支持 Xfce 桌面环境。
>2. 构建包含 DDE 桌面环境的镜像,当前只支持 openEuler 20.03 LTS SP1/21.03/20.03 LTS SP2/21.09/20.03 LTS SP3/22.03 LTS/22.09/22.03 LTS SP1/23.03/22.03 LTS SP2/22.03 LTS SP3/24.03 LTS/22.03 LTS SP4/24.09/24.03 LTS SP1/25.03/24.03 LTS SP2 版本。 >2. 构建包含 DDE 桌面环境的镜像,当前只支持 openEuler 20.03 LTS SP1/21.03/20.03 LTS SP2/21.09/20.03 LTS SP3/22.03 LTS/22.09/22.03 LTS SP1/23.03/22.03 LTS SP2/22.03 LTS SP3/24.03 LTS/22.03 LTS SP4/24.09/24.03 LTS SP1/25.03/24.03 LTS SP2 版本。
@ -88,168 +175,68 @@
>4. 构建 DevStation 开发者工作站的镜像,当前只支持 openEuler 24.03 LTS SP1/25.03/24.03 LTS SP2 版本。 >4. 构建 DevStation 开发者工作站的镜像,当前只支持 openEuler 24.03 LTS SP1/25.03/24.03 LTS SP2 版本。
>5. 根据需要设置 -s/--spec其具体意义见该参数的介绍部分。 >5. 根据需要设置 -s/--spec其具体意义见该参数的介绍部分。
使用已有的树莓派内核、固件、蓝牙等 RPM 包构建镜像。
构建镜像需执行命令: #### 使用自定义内核构建镜像
例如,使用软件源中的内核包构建 openEuler 24.03 LTS SP2 版本 openEuler 树莓派镜像,执行命令:`sudo bash build.sh --board raspberrypi --kernel "https://gitee.com/openeuler/raspberrypi-kernel.git" --branch "OLK-6.6" --config "" --repo https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-24.03-LTS-SP2/generic.repo --name openEuler-24.03-LTS-raspi-aarch64-alpha1`
`sudo bash build-image.sh -d DIR -r REPO -n IMAGE_NAME -s SPEC`
各个参数意义:
1. -d, --dir DIR
构建镜像和临时文件的输出目录,默认为脚本所在目录。如果 `DIR` 不存在则会自动创建。
脚本运行结束后,会提示镜像的存储位置,默认保存在 `DIR/raspi_output/img/` 下。
2. -r, --repo REPO_INFO
开发源 repo 文件的 URL 或者路径,也可以是开发源中资源库的 baseurl 列表。注意,如果该参数为资源库的 baseurl 列表,该参数需要使用双引号,各个 baseurl 之间以空格隔开。
下面分别举例:
- 开发源 repo 文件的 URL`https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-21.03/generic.repo`
- 开发源的 repo 文件路径:
- `./openEuler-21.03.repo`:生成 openEuler 21.03 版本的镜像,该文件内容参考 <https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-21.03/generic.repo>
- 资源库的 baseurl 列表,如 `"http://repo.openeuler.org/openEuler-21.03/OS/aarch64/ http://repo.openeuler.org/openEuler-21.03/EPOL/aarch64/"`
3. -n, --name IMAGE_NAME
构建的镜像名称。
例如,`openEuler-21.03.img`。默认为`openEuler-raspi-aarch64.img`,或者根据 `-n, --name IMAGE_NAME` 参数自动生成。
4. -s, --spec SPEC
构建的镜像版本:
- `headless`,无图形界面版的镜像。
- `xfce`,带 Xfce 桌面以及中文字体、输入法等全部配套软件。
- `ukui`,带 UKUI 桌面以及中文字体、输入法等全部配套软件。
- `dde`,带 DDE 桌面以及中文字体、输入法等全部配套软件。
- `gnome`,带 GNOME 桌面以及中文字体、输入法等全部配套软件。
- `devstation`,带 GNOME 桌面、中文字体、输入法、大量开发工具和 IDE 等配套软件。
- rpmlist 文件路径,其中包含镜像中要安装的软件列表,内容参考 [rpmlist](../scripts/raspberrypi/config/rpmlist)。
默认使用 `headless` 选项。
5. -h, --help
显示帮助信息。
#### 完全构建(包括编译内核)
包含编译内核、下载树莓派相关固件等过程,速度相对较慢。
>![](public_sys-resources/icon-notice.gif) **须知:** >![](public_sys-resources/icon-notice.gif) **须知:**
>当前支持三个 openEuler 版本,即 20.03 LTS、20.09、20.03 LTS SP1、21.03、20.03 LTS SP2、21.09、20.03 LTS SP3、22.03 LTS、22.09、22.03 LTS SP1、23.03、22.03 LTS SP2、22.03 LTS SP3、24.03 LTS、22.03 LTS SP4、24.09、24.03 LTS SP1、25.03、24.03 LTS SP2 版本 >使用自定义内核,当前支持版本有 20.03 LTS、20.09、20.03 LTS SP1、21.03、20.03 LTS SP2、21.09、20.03 LTS SP3、22.03 LTS、22.09、22.03 LTS SP1、23.03、22.03 LTS SP2、22.03 LTS SP3、24.03 LTS、22.03 LTS SP4、24.09、24.03 LTS SP1、25.03、24.03 LTS SP2。
>如果构建包含 Xfce/UKUI/DDE 桌面环境或者 DevStation 开发者工作站的镜像,需要注意六点: >如果构建包含 Xfce/UKUI/DDE 桌面环境或者 DevStation 开发者工作站的镜像,需要注意六点:
>1. 构建包含 Xfce 桌面环境的镜像,当前只支持 openEuler 21.03/20.03 LTS SP2/21.09/20.03 LTS SP3/22.03 LTS/22.09/22.03 LTS SP1/23.03/22.03 LTS SP2/22.03 LTS SP3/24.03 LTS/22.03 LTS SP4/24.09 版本,需要选择对应内核源码和分支。自 openEuler 24.03 LTS SP1 起,不再支持 Xfce 桌面环境。 >1. 构建包含 Xfce 桌面环境的镜像,当前只支持 openEuler 21.03/20.03 LTS SP2/21.09/20.03 LTS SP3/22.03 LTS/22.09/22.03 LTS SP1/23.03/22.03 LTS SP2/22.03 LTS SP3/24.03 LTS/22.03 LTS SP4/24.09 版本,需要选择对应内核源码和分支。自 openEuler 24.03 LTS SP1 起,不再支持 Xfce 桌面环境。
> - openEuler 21.03:需要选择 [openEuler 内核](https://gitee.com/openeuler/kernel) 的 [openEuler-21.03](https://gitee.com/openeuler/kernel/tree/openEuler-21.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/kernel.git`-b/--branch` 设置为 `openEuler-21.03`。 > - openEuler 21.03:需要选择 [openEuler 内核](https://gitee.com/openeuler/kernel) 的 [openEuler-21.03](https://gitee.com/openeuler/kernel/tree/openEuler-21.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/kernel.git``-b/--branch` 设置为 `openEuler-21.03``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 20.03 LTS SP2/20.03 LTS SP3需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-20.03-LTS](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-20.03-LTS/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-20.03-LTS` > - openEuler 20.03 LTS SP2/20.03 LTS SP3需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-20.03-LTS](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-20.03-LTS/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-20.03-LTS``-c/--config` 设置为 `openeuler-raspi_defconfig`
> - openEuler 21.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-21.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-21.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-21.09` > - openEuler 21.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-21.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-21.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-21.09``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.03 LTS需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS` > - openEuler 22.03 LTS需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.09` > - openEuler 22.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.09``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.03 LTS SP1需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS-SP1](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS-SP1/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS-SP1` > - openEuler 22.03 LTS SP1需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS-SP1](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS-SP1/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS-SP1``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 23.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-23.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-23.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-23.03` > - openEuler 23.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-23.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-23.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-23.03``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS-SP2](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS-SP2/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS-SP2` > - openEuler 22.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS-SP2](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS-SP2/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS-SP2``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.03 LTS SP3/22.03 LTS SP4需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-5.10](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-5.10/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-5.10` > - openEuler 22.03 LTS SP3/22.03 LTS SP4需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-5.10](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-5.10/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-5.10``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 24.03 LTS/24.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-6.6](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-6.6/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-6.6` > - openEuler 24.03 LTS/24.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-6.6](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-6.6/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-6.6``-c/--config` 设置为空 `""`
>2. 构建包含 UKUI 桌面环境的镜像,当前只支持 openEuler 20.09/20.03 LTS SP1/21.03/20.03 LTS SP2/21.09/20.03 LTS SP3/22.03 LTS/22.09/22.03 LTS SP1/23.03/22.03 LTS SP2/22.03 LTS SP3/24.03 LTS/22.03 LTS SP4/24.09/24.03 LTS SP1/25.03/24.03 LTS SP2 版本,需要选择对应内核源码和分支。 >2. 构建包含 UKUI 桌面环境的镜像,当前只支持 openEuler 20.09/20.03 LTS SP1/21.03/20.03 LTS SP2/21.09/20.03 LTS SP3/22.03 LTS/22.09/22.03 LTS SP1/23.03/22.03 LTS SP2/22.03 LTS SP3/24.03 LTS/22.03 LTS SP4/24.09/24.03 LTS SP1/25.03/24.03 LTS SP2 版本,需要选择对应内核源码和分支。
> - openEuler 20.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-20.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-20.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-20.09` > - openEuler 20.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-20.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-20.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-20.09``-c/--config` 设置为 `openeuler-raspi_defconfig`
> - openEuler 20.03 LTS SP1/20.03 LTS SP2/20.03 LTS SP3需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-20.03-LTS](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-20.03-LTS/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-20.03-LTS` > - openEuler 20.03 LTS SP1/20.03 LTS SP2/20.03 LTS SP3需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-20.03-LTS](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-20.03-LTS/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-20.03-LTS``-c/--config` 设置为 `openeuler-raspi_defconfig`
> - openEuler 21.03:需要选择 [openEuler 内核](https://gitee.com/openeuler/kernel) 的 [openEuler-21.03](https://gitee.com/openeuler/kernel/tree/openEuler-21.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/kernel.git`-b/--branch` 设置为 `openEuler-21.03`。 > - openEuler 21.03:需要选择 [openEuler 内核](https://gitee.com/openeuler/kernel) 的 [openEuler-21.03](https://gitee.com/openeuler/kernel/tree/openEuler-21.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/kernel.git`-b/--branch` 设置为 `openEuler-21.03``-c/--config` 设置为 `bcm2711_defconfig`。
> - openEuler 21.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-21.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-21.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-21.09` > - openEuler 21.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-21.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-21.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-21.09``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.03 LTS需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS` > - openEuler 22.03 LTS需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.09` > - openEuler 22.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.09``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.03 LTS SP1需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS-SP1](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS-SP1/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS-SP1` > - openEuler 22.03 LTS SP1需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS-SP1](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS-SP1/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS-SP1``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 23.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-23.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-23.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-23.03` > - openEuler 23.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-23.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-23.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-23.03``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS-SP2](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS-SP2/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS-SP2` > - openEuler 22.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS-SP2](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS-SP2/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS-SP2``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.03 LTS SP3/22.03 LTS SP4需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-5.10](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-5.10/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-5.10` > - openEuler 22.03 LTS SP3/22.03 LTS SP4需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-5.10](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-5.10/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-5.10``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 24.03 LTS/24.09/24.03 LTS SP1/24.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-6.6](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-6.6/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-6.6` > - openEuler 24.03 LTS/24.09/24.03 LTS SP1/24.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-6.6](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-6.6/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-6.6``-c/--config` 设置为空 `""`
> - openEuler 25.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-25.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-25.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-25.03` > - openEuler 25.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-25.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-25.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-25.03``-c/--config` 设置为空 `""`
>3. 构建包含 DDE 桌面环境的镜像,当前只支持 openEuler 20.03 LTS SP1/21.03/20.03 LTS SP2/21.09/20.03 LTS SP3/22.03 LTS/22.09/22.03 LTS SP1/23.03/22.03 LTS SP2/22.03 LTS SP3/24.03 LTS/22.03 LTS SP4/24.09/24.03 LTS SP1/25.03/24.03 LTS SP2 版本。 >3. 构建包含 DDE 桌面环境的镜像,当前只支持 openEuler 20.03 LTS SP1/21.03/20.03 LTS SP2/21.09/20.03 LTS SP3/22.03 LTS/22.09/22.03 LTS SP1/23.03/22.03 LTS SP2/22.03 LTS SP3/24.03 LTS/22.03 LTS SP4/24.09/24.03 LTS SP1/25.03/24.03 LTS SP2 版本。
> - openEuler 20.03 LTS SP1/20.03 LTS SP2/20.03 LTS SP3需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-20.03-LTS](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-20.03-LTS/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-20.03-LTS` > - openEuler 20.03 LTS SP1/20.03 LTS SP2/20.03 LTS SP3需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-20.03-LTS](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-20.03-LTS/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-20.03-LTS``-c/--config` 设置为 `openeuler-raspi_defconfig`
> - openEuler 21.03:需要选择 [openEuler 内核](https://gitee.com/openeuler/kernel) 的 [openEuler-21.03](https://gitee.com/openeuler/kernel/tree/openEuler-21.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/kernel.git`-b/--branch` 设置为 `openEuler-21.03`。 > - openEuler 21.03:需要选择 [openEuler 内核](https://gitee.com/openeuler/kernel) 的 [openEuler-21.03](https://gitee.com/openeuler/kernel/tree/openEuler-21.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/kernel.git`-b/--branch` 设置为 `openEuler-21.03``-c/--config` 设置为 `bcm2711_defconfig`。
> - openEuler 21.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-21.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-21.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-21.09` > - openEuler 21.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-21.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-21.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-21.09``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.03 LTS需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS` > - openEuler 22.03 LTS需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.09` > - openEuler 22.09:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.09](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.09/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.09``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.03 LTS SP1需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS-SP1](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS-SP1/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS-SP1` > - openEuler 22.03 LTS SP1需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS-SP1](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS-SP1/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS-SP1``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 23.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-23.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-23.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-23.03` > - openEuler 23.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-23.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-23.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-23.03``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS-SP2](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS-SP2/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS-SP2` > - openEuler 22.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-22.03-LTS-SP2](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-22.03-LTS-SP2/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-22.03-LTS-SP2``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 22.03 LTS SP3/22.03 LTS SP4需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-5.10](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-5.10/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-5.10` > - openEuler 22.03 LTS SP3/22.03 LTS SP4需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-5.10](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-5.10/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-5.10``-c/--config` 设置为 `bcm2711_defconfig`
> - openEuler 24.03 LTS/24.09/24.03 LTS SP1/24.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-6.6](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-6.6/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-6.6` > - openEuler 24.03 LTS/24.09/24.03 LTS SP1/24.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-6.6](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-6.6/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-6.6``-c/--config` 设置为空 `""`
> - openEuler 25.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-25.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-25.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-25.03` > - openEuler 25.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-25.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-25.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-25.03``-c/--config` 设置为空 `""`
>4. 构建包含 GNOME 桌面环境的镜像,当前只支持 openEuler 24.03 LTS/22.03 LTS SP4/24.09/24.03 LTS SP1/25.03/24.03 LTS SP2 版本。 >4. 构建包含 GNOME 桌面环境的镜像,当前只支持 openEuler 24.03 LTS/22.03 LTS SP4/24.09/24.03 LTS SP1/25.03/24.03 LTS SP2 版本。
> - openEuler 24.03 LTS/24.09/24.03 LTS SP1/24.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-6.6](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-6.6/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-6.6` > - openEuler 24.03 LTS/24.09/24.03 LTS SP1/24.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-6.6](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-6.6/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-6.6``-c/--config` 设置为空 `""`
> - openEuler 25.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-25.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-25.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-25.03` > - openEuler 25.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-25.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-25.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-25.03``-c/--config` 设置为空 `""`
>5. 构建 DevStation 开发者工作站的镜像,当前只支持 openEuler 24.03 LTS SP1/25.03/24.03 LTS SP2 版本。 >5. 构建 DevStation 开发者工作站的镜像,当前只支持 openEuler 24.03 LTS SP1/25.03/24.03 LTS SP2 版本。
> - openEuler 24.03 LTS SP1/24.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-6.6](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-6.6/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-6.6` > - openEuler 24.03 LTS SP1/24.03 LTS SP2需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [OLK-6.6](https://gitee.com/openeuler/raspberrypi-kernel/tree/OLK-6.6/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `OLK-6.6``-c/--config` 设置为空 `""`
> - openEuler 25.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-25.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-25.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-25.03` > - openEuler 25.03:需要选择 [openEuler-RaspberryPi 内核](https://gitee.com/openeuler/raspberrypi-kernel) 的 [openEuler-25.03](https://gitee.com/openeuler/raspberrypi-kernel/tree/openEuler-25.03/) 分支,即将参数 `-k/--kernel` 设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``-b/--branch` 设置为 `openEuler-25.03``-c/--config` 设置为空 `""`
>6. 根据需要设置 -s/--spec其具体意义见该参数的介绍部分。 >6. 根据需要设置 -s/--spec其具体意义见该参数的介绍部分。
构建镜像需执行命令:
`sudo bash build-image-common.sh -n IMAGE_NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO -s SPEC --cores N`
脚本运行结束后,会提示镜像的存储位置,镜像默认保存在脚本运行所在目录的 `raspi_output/img/` 下。
各个参数意义:
1. -n, --name IMAGE_NAME
构建的镜像名称。
例如,`openEuler-20.03-LTS-SP1.img`。默认为`openEuler-raspi-aarch64.img`,或者根据 `-n, --name IMAGE_NAME` 参数自动生成。
2. -k, --kernel KERNEL_URL
内核源码仓库的项目地址,默认为 `https://gitee.com/openeuler/raspberrypi-kernel.git`。可根据需要设置为 `git@gitee.com:openeuler/raspberrypi-kernel.git``git@gitee.com:openeuler/kernel.git`
3. -b, --branch KERNEL_BRANCH
内核源码的对应分支,默认为 `openEuler-20.03-LTS`,推荐使用分支 `openEuler-21.09``openEuler-20.03-LTS``openEuler-20.09`
4. -c, --config KERNEL_DEFCONFIG
内核编译使用的配置文件名称或路径,默认为 `openeuler-raspi_defconfig`。如果该参数为配置文件名称,请确保该文件在内核源码的目录 arch/arm64/configs 下。
5. -r, --repo REPO_INFO
开发源 repo 文件的 URL 或者路径,也可以是开发源中资源库的 baseurl 列表。注意,如果该参数为资源库的 baseurl 列表,该参数需要使用双引号,各个 baseurl 之间以空格隔开。
下面分别举例:
- 开发源 repo 文件的 URL`https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS-SP1/generic.repo`
- 开发源的 repo 文件路径:
- `./openEuler-20.03-LTS-SP1.repo`:生成 openEuler 20.03 LTS SP1 版本的镜像,该文件内容参考 <https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.03-LTS-SP1/generic.repo>
- 资源库的 baseurl 列表,如 `"http://repo.openeuler.org/openEuler-20.03-LTS-SP1/OS/aarch64/ http://repo.openeuler.org/openEuler-20.03-LTS-SP1/EPOL/aarch64/"`
6. -s, --spec SPEC
构建的镜像版本:
- `headless`,无图形界面版的镜像。
- `xfce`,带 Xfce 桌面以及中文字体、输入法等全部配套软件。
- `ukui`,带 UKUI 桌面以及中文字体、输入法等全部配套软件。
- `dde`,带 DDE 桌面以及中文字体、输入法等全部配套软件。
- `gnome`,带 GNOME 桌面以及中文字体、输入法等全部配套软件。
- `devstation`,带 GNOME 桌面、中文字体、输入法、大量开发工具和 IDE 等配套软件。
- rpmlist 文件路径,该文件包含镜像中要安装的软件列表,内容参考 [rpmlist](../scripts/raspberrypi/config-common/rpmlist)。
默认使用 `headless` 选项。
7. --cores N
并行编译的数量,根据运行脚本的宿主机 CPU 实际数目设定,默认为可用的 CPU 总数。
#### Docker 容器内构建 #### Docker 容器内构建
构建镜像需执行命令: 构建镜像需执行命令:
`sudo bash build-image-docker.sh -d DOCKER_FILE -n IMAGE_NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO --cores N` `sudo bash build-image-docker.sh -d DOCKER_FILE --board BOARD_CONFIG -n NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO_INFO -s SPEC --cores N`
脚本运行结束后,镜像默认保存在脚本运行所在目录的 `raspi_output/img/` 下。 脚本运行结束后,会提示镜像的存储位置,镜像默认保存在脚本运行所在目录的 `build/YYYY-MM-DD/` 下。
注意!!!运行该脚本前,需安装 Docker 运行环境。该脚本会自动将 `-d DOCKER_FILE` 参数对应的 Docker 镜像导入本机系统中。 注意!!!运行该脚本前,需安装 Docker 运行环境。该脚本会自动将 `-d DOCKER_FILE` 参数对应的 Docker 镜像导入本机系统中。
除参数 `-d DOCKER_FILE` 外,剩余参数与 [快速构建(无需编译内核,推荐)](#快速构建无需编译内核推荐) 或 [完全构建(包括编译内核)](#完全构建包括编译内核) 中对应参数一致: 除参数 `-d DOCKER_FILE` 外,其余参数与 [构建镜像章节](#构建镜像) 中 [build.sh](../scripts/build.sh) 对应参数一致:
1. -d, --docker DOCKER_FILE 1. -d, --docker DOCKER_FILE

View File

@ -9,8 +9,10 @@
- [最新镜像](#最新镜像) - [最新镜像](#最新镜像)
- [镜像构建](#镜像构建) - [镜像构建](#镜像构建)
- [准备环境](#准备环境) - [准备环境](#准备环境)
- [一次构建](#一次构建) - [构建完整镜像](#构建完整镜像)
- [Docker 容器内构建](#docker-容器内构建) - [Docker 容器内构建](#docker-容器内构建)
- [使用脚本构建镜像需执行命令:](#使用脚本构建镜像需执行命令)
- [使用 Docker 分步构建](#使用-docker-分步构建)
- [顺序构建](#顺序构建) - [顺序构建](#顺序构建)
- [刷写镜像](#刷写镜像) - [刷写镜像](#刷写镜像)
- [刷写到 SD 卡](#刷写到-sd-卡) - [刷写到 SD 卡](#刷写到-sd-卡)
@ -25,7 +27,7 @@
- [openEuler镜像的构建](rockchip/openEuler镜像的构建.md) - [openEuler镜像的构建](rockchip/openEuler镜像的构建.md)
- [刷写EMMC镜像](rockchip/刷写EMMC镜像.md) - [刷写EMMC镜像](rockchip/刷写EMMC镜像.md)
- [顺序构建](rockchip/顺序构建.md) - [顺序构建](rockchip/顺序构建.md)
- [一次构建命令列举](rockchip/一次构建命令列举.md) - [构建完整镜像命令列举](rockchip/构建完整镜像命令列举.md)
- [基于Firefly-SDK编译Firefly-RK3399的内核镜像](rockchip/基于Firefly-SDK编译Firefly-RK3399的内核镜像.md) - [基于Firefly-SDK编译Firefly-RK3399的内核镜像](rockchip/基于Firefly-SDK编译Firefly-RK3399的内核镜像.md)
- [打包 ITX-RK3588J 一体化烧写镜像](rockchip/打包ITX-RK3588J一体化烧写镜像.md) - [打包 ITX-RK3588J 一体化烧写镜像](rockchip/打包ITX-RK3588J一体化烧写镜像.md)
- [设置 SELinux](rockchip/设置SELinux.md) - [设置 SELinux](rockchip/设置SELinux.md)
@ -33,12 +35,12 @@
- [openEuler 适配指南](rockchip/openEuler适配指南.md) - [openEuler 适配指南](rockchip/openEuler适配指南.md)
- [在openEuler上使用RKNPU](rockchip/在openEuler上使用RKNPU.md) - [在openEuler上使用RKNPU](rockchip/在openEuler上使用RKNPU.md)
- [在openEuler上运行RKLLM](rockchip/在openEuler上运行RKLLM.md) - [在openEuler上运行RKLLM](rockchip/在openEuler上运行RKLLM.md)
- [scripts](../scripts/rockchip): 构建 openEuler RK3399 等开发板镜像的脚本 - [scripts](../scripts): 构建 openEuler 树莓派、RK3399 等开发板镜像的脚本
- [一次构建脚本](../scripts/rockchip/build.sh) - [构建完整镜像](scripts/build.sh)
- [boot 镜像构建脚本](../scripts/rockchip/build_boot.sh) - [使用 Docker 构建完整镜像](./scripts/build-image-docker.sh)
- [rootfs 镜像构建脚本](../scripts/rockchip/build_rootfs.sh) - [构建 boot 镜像](scripts/build_boot.sh)
- [u-boot 编译脚本](../scripts/rockchip/build_u-boot.sh) - [构建 rootfs 镜像](scripts/build_rootfs.sh)
- [可启动镜像生成脚本](../scripts/rockchip/gen_image.sh) - [将 u-boot、boot、rootfs 合并成一个完整镜像](scripts/gen_image.sh)
## 最新镜像 ## 最新镜像
@ -65,9 +67,9 @@
详细过程参见 [openEuler 镜像的构建](rockchip/openEuler镜像的构建.md)。 详细过程参见 [openEuler 镜像的构建](rockchip/openEuler镜像的构建.md)。
构建脚本见 [scripts/rockchip](../scripts/rockchip)。 构建脚本见 [scripts](../scripts)。
### 一次构建 ### 构建完整镜像
构建镜像需执行命令: 构建镜像需执行命令:
@ -91,13 +93,13 @@
1. --board BOARD_CONFIG 1. --board BOARD_CONFIG
适用的开发板的版型配置文件在 [boards](../scripts/rockchip/boards) 文件夹中,示例文件 [sample.conf](../scripts/rockchip/boards/sample.conf),默认为 `firefly-rk3399` 适用的开发板的版型配置文件在 [boards](../scripts/boards) 文件夹中,示例文件 [sample.conf](../scripts/boards/sample.conf),默认为 `firefly-rk3399`
其包括的配置参数意义如下: 其包括的配置参数意义如下:
- platform=PLATFORM - platform=PLATFORM
开发板所使用的平台目前支持的平台有rockchip、phytium默认为 `rockchip` 开发板所使用的平台,目前支持的平台有:broadcom、rockchip、phytium默认为 `rockchip`
- device-tree=DTB_NAME - device-tree=DTB_NAME
@ -105,7 +107,7 @@
- ubootconfig=UBOOT_DEFCONFIG - ubootconfig=UBOOT_DEFCONFIG
开发板对应的 defconfig 的文件名称,对应 [u-boot/configs](https://github.com/u-boot/u-boot/tree/master/configs) 下 `UBOOT_DEFCONFIG` 文件,默认为 `firefly-rk3399_defconfig`;如需在 RK3588 开发板上使用预编译的 u-boot可以将此项设置为 `none`。 开发板对应的 defconfig 的文件名称,对应 [u-boot/configs](https://github.com/u-boot/u-boot/tree/master/configs) 下 `UBOOT_DEFCONFIG` 文件,默认为 `firefly-rk3399_defconfig`;如需在 RK3588 开发板上使用预编译的 u-boot可以将此项设置为空:`ubootconfig=`。
2. -n, --name IMAGE_NAME 2. -n, --name IMAGE_NAME
@ -130,11 +132,11 @@
6. -r, --repo REPO_INFO 6. -r, --repo REPO_INFO
开发源 repo 文件的 URL 或者路径,也可以是开发源中资源库的 baseurl 列表。注意,如果该参数为资源库的 baseurl 列表,该参数需要使用双引号,各个 baseurl 之间以空格隔开。 软件源 repo 文件的 URL 或者路径,也可以是软件源中资源库的 baseurl 列表。注意,如果该参数为资源库的 baseurl 列表,该参数需要使用双引号,各个 baseurl 之间以空格隔开。
下面分别举例: 下面分别举例:
- 开发源 repo 文件的 URL`https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS/generic.repo` - 软件源 repo 文件的 URL`https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS/generic.repo`
- 开发源的 repo 文件路径: - 软件源的 repo 文件路径:
`./openEuler-20.03-LTS.repo`:生成 openEuler 20.03 LTS 版本的镜像,该文件内容参考 <https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.03-LTS/generic.repo> `./openEuler-20.03-LTS.repo`:生成 openEuler 20.03 LTS 版本的镜像,该文件内容参考 <https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.03-LTS/generic.repo>
@ -147,7 +149,7 @@
- `xfce`,带 Xfce 桌面以及中文字体、输入法等全部配套软件。 - `xfce`,带 Xfce 桌面以及中文字体、输入法等全部配套软件。
- `ukui`,带 UKUI 桌面及必要的配套软件(不包括中文字体以及输入法)。 - `ukui`,带 UKUI 桌面及必要的配套软件(不包括中文字体以及输入法)。
- `dde`,带 DDE 桌面及必要的配套软件(不包括中文字体以及输入法)。 - `dde`,带 DDE 桌面及必要的配套软件(不包括中文字体以及输入法)。
- rpmlist 文件路径,其中包含镜像中要安装的软件列表,内容参考 [rpmlist](../scripts/rockchip/configs/rpmlist)。 - rpmlist 文件路径,其中包含镜像中要安装的软件列表,内容参考 [rpmlist](../scripts/configs/rpmlist)。
默认使用 `headless` 选项。 默认使用 `headless` 选项。
@ -173,84 +175,84 @@
<td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.t-firefly.com/zh_CN/Firefly-RK3399/index.html">Firefly Wiki</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.t-firefly.com/zh_CN/Firefly-RK3399/index.html">Firefly Wiki</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3399</p></td> <td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3399</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 20.03 LTS, openEuler 22.03 LTS SP2, openEuler 22.03 LTS SP3, openEuler 24.03 LTS</p></td> <td class="cellrowborder" valign="top" width="10%"><p>openEuler 20.03 LTS, openEuler 22.03 LTS SP2, openEuler 22.03 LTS SP3, openEuler 24.03 LTS</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/一次构建命令列举.md#firefly-rk3399">一次构建命令</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#firefly-rk3399">构建完整镜像命令</a></td>
</tr> </tr>
<tbody><tr> <tbody><tr>
<td class="cellrowborder" valign="top" width="10%"><ul><li>Radxa Rock Pi 4A</li></ul></td> <td class="cellrowborder" valign="top" width="10%"><ul><li>Radxa Rock Pi 4A</li></ul></td>
<td class="cellrowborder" valign="top" width="10%"><a href="https://docs.radxa.com/rock4/rock4ab">Radxa Wiki</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="https://docs.radxa.com/rock4/rock4ab">Radxa Wiki</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3399</p></td> <td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3399</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 20.03 LTS, openEuler 22.03 LTS</p></td> <td class="cellrowborder" valign="top" width="10%"><p>openEuler 20.03 LTS, openEuler 22.03 LTS</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/一次构建命令列举.md#radxa-rockpi-4a">一次构建命令</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#radxa-rockpi-4a">构建完整镜像命令</a></td>
</tr> </tr>
<tbody><tr> <tbody><tr>
<td class="cellrowborder" valign="top" width="10%"><ul><li>Firefly ROC-RK3566-PC</li></ul></td> <td class="cellrowborder" valign="top" width="10%"><ul><li>Firefly ROC-RK3566-PC</li></ul></td>
<td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.t-firefly.com/zh_CN/ROC-RK3566-PC/">Firefly Wiki</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.t-firefly.com/zh_CN/ROC-RK3566-PC/">Firefly Wiki</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3566</p></td> <td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3566</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP2, openEuler 22.03 LTS SP3, openEuler 24.03 LTS</p></td> <td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP2, openEuler 22.03 LTS SP3, openEuler 24.03 LTS</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/一次构建命令列举.md#firefly-roc-rk3566-pc">一次构建命令</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#firefly-roc-rk3566-pc">构建完整镜像命令</a></td>
</tr> </tr>
<tbody><tr> <tbody><tr>
<td class="cellrowborder" valign="top" width="10%"><ul><li>Firefly ROC-RK3568-PC-SE</li></ul></td> <td class="cellrowborder" valign="top" width="10%"><ul><li>Firefly ROC-RK3568-PC-SE</li></ul></td>
<td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.t-firefly.com/zh_CN/ROC-RK3568-PC-SE/">Firefly Wiki</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.t-firefly.com/zh_CN/ROC-RK3568-PC-SE/">Firefly Wiki</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3568</p></td> <td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3568</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP2, openEuler 22.03 LTS SP3</p></td> <td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP2, openEuler 22.03 LTS SP3</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/一次构建命令列举.md#firefly-roc-rk3568-pc-se">一次构建命令</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#firefly-roc-rk3568-pc-se">构建完整镜像命令</a></td>
</tr> </tr>
<tbody><tr> <tbody><tr>
<td class="cellrowborder" valign="top" width="10%"><ul><li>Firefly ROC-RK3568-PC</li></ul></td> <td class="cellrowborder" valign="top" width="10%"><ul><li>Firefly ROC-RK3568-PC</li></ul></td>
<td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.t-firefly.com/zh_CN/ROC-RK3568-PC/">Firefly Wiki</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.t-firefly.com/zh_CN/ROC-RK3568-PC/">Firefly Wiki</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3568</p></td> <td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3568</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP2, openEuler 22.03 LTS SP3</p></td> <td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP2, openEuler 22.03 LTS SP3</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/一次构建命令列举.md#firefly-roc-rk3568-pc">一次构建命令</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#firefly-roc-rk3568-pc">构建完整镜像命令</a></td>
</tr> </tr>
<tbody><tr> <tbody><tr>
<td class="cellrowborder" valign="top" width="10%"><ul><li>BananaPi Armsom-Sige5</li></ul></td> <td class="cellrowborder" valign="top" width="10%"><ul><li>BananaPi Armsom-Sige5</li></ul></td>
<td class="cellrowborder" valign="top" width="10%"><a href="https://docs.armsom.org/armsom-sige5">Armsom Wiki</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="https://docs.armsom.org/armsom-sige5">Armsom Wiki</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3576</p></td> <td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3576</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP3</p></td> <td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP3</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/一次构建命令列举.md#bananapi-armsom-sige5">一次构建命令</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#bananapi-armsom-sige5">构建完整镜像命令</a></td>
</tr> </tr>
<tbody><tr> <tbody><tr>
<td class="cellrowborder" valign="top" width="10%"><ul><li>Firefly ITX-3588J</li></ul></td> <td class="cellrowborder" valign="top" width="10%"><ul><li>Firefly ITX-3588J</li></ul></td>
<td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.t-firefly.com/zh_CN/Core-3588J/index.html">Firefly Wiki</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.t-firefly.com/zh_CN/Core-3588J/index.html">Firefly Wiki</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3588</p></td> <td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3588</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP3</p></td> <td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP3</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/一次构建命令列举.md#firefly-itx-3588j">一次构建命令</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#firefly-itx-3588j">构建完整镜像命令</a></td>
</tr> </tr>
<tbody><tr> <tbody><tr>
<td class="cellrowborder" valign="top" width="10%"><ul><li>Firefly ROC-RK3588S-PC</li></ul></td> <td class="cellrowborder" valign="top" width="10%"><ul><li>Firefly ROC-RK3588S-PC</li></ul></td>
<td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.t-firefly.com/zh_CN/ROC-RK3588S-PC/index.html">Firefly Wiki</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.t-firefly.com/zh_CN/ROC-RK3588S-PC/index.html">Firefly Wiki</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3588</p></td> <td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3588</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP2, openEuler 22.03 LTS SP3</p></td> <td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP2, openEuler 22.03 LTS SP3</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/一次构建命令列举.md#firefly-roc-rk3588s-pc">一次构建命令</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#firefly-roc-rk3588s-pc">构建完整镜像命令</a></td>
</tr> </tr>
<tbody><tr> <tbody><tr>
<td class="cellrowborder" valign="top" width="10%"><ul><li>Radxa Rock-5B</li></ul></td> <td class="cellrowborder" valign="top" width="10%"><ul><li>Radxa Rock-5B</li></ul></td>
<td class="cellrowborder" valign="top" width="10%"><a href="https://docs.radxa.com/rock5/rock5b">Radxa Wiki</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="https://docs.radxa.com/rock5/rock5b">Radxa Wiki</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3588</p></td> <td class="cellrowborder" valign="top" width="10%"><p>Rockchip RK3588</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP2, openEuler 22.03 LTS SP3</p></td> <td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP2, openEuler 22.03 LTS SP3</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/一次构建命令列举.md#radxa-rock-5b">一次构建命令</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#radxa-rock-5b">构建完整镜像命令</a></td>
</tr> </tr>
<tbody><tr> <tbody><tr>
<td class="cellrowborder" valign="top" width="10%"><ul><li>Phytium Pi 4GB</li></ul></td> <td class="cellrowborder" valign="top" width="10%"><ul><li>Phytium Pi 4GB</li></ul></td>
<td class="cellrowborder" valign="top" width="10%"><a href="https://www.phytium.com.cn/homepage/phytium_pie/">Phytium Website</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="https://www.phytium.com.cn/homepage/phytium_pie/">Phytium Website</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Phytium</p></td> <td class="cellrowborder" valign="top" width="10%"><p>Phytium</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP3, openEuler 24.03 LTS</p></td> <td class="cellrowborder" valign="top" width="10%"><p>openEuler 22.03 LTS SP3, openEuler 24.03 LTS</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/一次构建命令列举.md#phytium-pi-4gb">一次构建命令</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#phytium-pi-4gb">构建完整镜像命令</a></td>
</tr> </tr>
<tbody><tr> <tbody><tr>
<td class="cellrowborder" valign="top" width="10%"><ul><li>Orange Pi Zero 2</li></ul></td> <td class="cellrowborder" valign="top" width="10%"><ul><li>Orange Pi Zero 2</li></ul></td>
<td class="cellrowborder" valign="top" width="10%"><a href="http://www.orangepi.cn/orangepiwiki/index.php/Orange_Pi_Zero_2">OrangePi Wiki</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="http://www.orangepi.cn/orangepiwiki/index.php/Orange_Pi_Zero_2">OrangePi Wiki</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Allwinner H616</p></td> <td class="cellrowborder" valign="top" width="10%"><p>Allwinner H616</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 20.03 LTS, openEuler 24.03 LTS</p></td> <td class="cellrowborder" valign="top" width="10%"><p>openEuler 20.03 LTS, openEuler 24.03 LTS</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/一次构建命令列举.md#orange-pi-zero-2">一次构建命令</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#orange-pi-zero-2">构建完整镜像命令</a></td>
</tr> </tr>
<tbody><tr> <tbody><tr>
<td class="cellrowborder" valign="top" width="10%"><ul><li>Longan Pi 3H</li></ul></td> <td class="cellrowborder" valign="top" width="10%"><ul><li>Longan Pi 3H</li></ul></td>
<td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.sipeed.com/hardware/zh/longan/h618/lpi3h/1_intro.html">Sipeed Wiki</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="https://wiki.sipeed.com/hardware/zh/longan/h618/lpi3h/1_intro.html">Sipeed Wiki</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Allwinner H618</p></td> <td class="cellrowborder" valign="top" width="10%"><p>Allwinner H618</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 24.03 LTS</p></td> <td class="cellrowborder" valign="top" width="10%"><p>openEuler 24.03 LTS</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/一次构建命令列举.md#longan-pi-3h">一次构建命令</a></td> <td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#longan-pi-3h">构建完整镜像命令</a></td>
</tr> </tr>
</tbody></table> </tbody></table>
@ -265,7 +267,7 @@
注意!!!运行该脚本前,需安装 Docker 运行环境。该脚本会自动将 DOCKER_FILE 参数对应的 Docker 镜像导入本机系统中。 注意!!!运行该脚本前,需安装 Docker 运行环境。该脚本会自动将 DOCKER_FILE 参数对应的 Docker 镜像导入本机系统中。
除参数 DOCKER_FILE 外,剩余参数与[一次构建](#一次构建)中对应参数一致: 除参数 DOCKER_FILE 外,剩余参数与[构建完整镜像](#构建完整镜像)中对应参数一致:
1. -d, --docker DOCKER_FILE 1. -d, --docker DOCKER_FILE

View File

@ -1,4 +1,4 @@
ubootconfig=none ubootconfig=
local_uboot_dir=${nonfree_bin_dir}/u-boot/armsom-sige5 local_uboot_dir=${nonfree_bin_dir}/u-boot/armsom-sige5
dtb_name=rk3576-armsom-sige5 dtb_name=rk3576-armsom-sige5
platform=rockchip platform=rockchip

View File

@ -1,4 +1,4 @@
ubootconfig=none ubootconfig=
local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3588 local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3588
dtb_name=rk3588-firefly-itx-3588j dtb_name=rk3588-firefly-itx-3588j
platform=rockchip platform=rockchip

View File

@ -1,4 +1,4 @@
ubootconfig=none ubootconfig=
local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3566 local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3566
dtb_name=rk3566-roc-pc dtb_name=rk3566-roc-pc
platform=rockchip platform=rockchip

View File

@ -1,4 +1,4 @@
ubootconfig=none ubootconfig=
local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3568 local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3568
dtb_name=rk3568-roc-pc-se dtb_name=rk3568-roc-pc-se
platform=rockchip platform=rockchip

View File

@ -1,4 +1,4 @@
ubootconfig=none ubootconfig=
local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3568 local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3568
dtb_name=rk3568-roc-pc dtb_name=rk3568-roc-pc
platform=rockchip platform=rockchip

View File

@ -1,4 +1,4 @@
ubootconfig=none ubootconfig=
local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3588 local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3588
dtb_name=rk3588s-roc-pc dtb_name=rk3588s-roc-pc
platform=rockchip platform=rockchip

View File

@ -1,4 +1,4 @@
ubootconfig=none ubootconfig=
local_uboot_dir=${nonfree_bin_dir}/u-boot/longanpi-3h local_uboot_dir=${nonfree_bin_dir}/u-boot/longanpi-3h
dtb_name=sun50i-h618-longanpi-3h dtb_name=sun50i-h618-longanpi-3h
platform=allwinner platform=allwinner

View File

@ -1,4 +1,4 @@
ubootconfig=none ubootconfig=
local_uboot_dir=${nonfree_bin_dir}/u-boot/orangepi-zero2 local_uboot_dir=${nonfree_bin_dir}/u-boot/orangepi-zero2
dtb_name=sun50i-h616-orangepi-zero2 dtb_name=sun50i-h616-orangepi-zero2
platform=allwinner platform=allwinner

View File

@ -1,4 +1,4 @@
ubootconfig=none ubootconfig=
local_uboot_dir=${nonfree_bin_dir}/u-boot/phytiumpi local_uboot_dir=${nonfree_bin_dir}/u-boot/phytiumpi
dtb_name=phytiumpi_firefly dtb_name=phytiumpi_firefly
platform=phytium platform=phytium

View File

@ -1,4 +1,4 @@
ubootconfig=none ubootconfig=
local_uboot_dir=${nonfree_bin_dir}/u-boot/radxa-rock5b local_uboot_dir=${nonfree_bin_dir}/u-boot/radxa-rock5b
dtb_name=rk3588-rock-5b dtb_name=rk3588-rock-5b
platform=rockchip platform=rockchip

View File

@ -0,0 +1,11 @@
ubootconfig=
dtb_name=bcm2711-rpi-4-b
platform=broadcom
soc_name=
arch=arm64
part_table=msdos
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."
echo "Nothing to do..."
}

View File

@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
set -e set -e
set -x
__usage=" __usage="
Usage: build-image-docker [OPTIONS] Usage: build-image-docker [OPTIONS]
Build board image. Build openEuler image.
Options: Options:
--board BOARD_CONFIG Required! The config of target board in the boards folder. --board BOARD_CONFIG Required! The config of target board in the boards folder.
@ -14,7 +14,7 @@ Options:
-b, --branch KERNEL_BRANCH The branch name of kernel source's repository, which defaults to openEuler-22.03-LTS-SP3. -b, --branch KERNEL_BRANCH The branch name of kernel source's repository, which defaults to openEuler-22.03-LTS-SP3.
-c, --config KERNEL_DEFCONFIG The name/path of defconfig file when compiling kernel, which defaults to openeuler_rockchip_defconfig. -c, --config KERNEL_DEFCONFIG The name/path of defconfig file when compiling kernel, which defaults to openeuler_rockchip_defconfig.
-r, --repo REPO_INFO Required! The URL/path of target repo file or list of repo's baseurls which should be a space separated list. -r, --repo REPO_INFO Required! The URL/path of target repo file or list of repo's baseurls which should be a space separated list.
-s, --spec SPEC The image's specification: headless, xfce, ukui, dde or the file path of rpmlist. The default is headless. -s, --spec SPEC The image's specification: headless, xfce, ukui, dde, gnome, devstation or the file path of rpmlist. The default is headless.
--cores N The number of cpu cores to be used during making. --cores N The number of cpu cores to be used during making.
-h, --help Show command help. -h, --help Show command help.
" "
@ -100,6 +100,11 @@ builddate=${buildid:0:8}
make_cores=$(nproc) make_cores=$(nproc)
log_dir=${workdir}/log log_dir=${workdir}/log
if [ ! -d ${log_dir} ];then mkdir -p ${log_dir}; fi if [ ! -d ${log_dir} ];then mkdir -p ${log_dir}; fi
if [ "x${board}" == "xraspberrypi" ]; then
config_dir=${cur_dir}/configs-rpi
else
config_dir=${cur_dir}/configs
fi
parseargs "$@" || help $? parseargs "$@" || help $?
@ -123,7 +128,7 @@ docker_img_name=${docker_img_name##*: }
LOG build board image with docker: ${docker_file}. LOG build board image with docker: ${docker_file}.
(echo "FROM $docker_img_name" && grep -v FROM ${cur_dir}/configs/Dockerfile) | \ (echo "FROM $docker_img_name" && grep -v FROM ${config_dir}/Dockerfile) | \
docker build -t ${docker_img_name}-${buildid} \ docker build -t ${docker_img_name}-${buildid} \
--build-arg board=${board} \ --build-arg board=${board} \
--build-arg docker_file=${docker_file} \ --build-arg docker_file=${docker_file} \
@ -134,7 +139,7 @@ LOG build board image with docker: ${docker_file}.
--build-arg repo_file=${repo_file} \ --build-arg repo_file=${repo_file} \
--build-arg spec_param=${spec_param} \ --build-arg spec_param=${spec_param} \
--build-arg make_cores=${make_cores} \ --build-arg make_cores=${make_cores} \
--no-cache -f- ${cur_dir}/configs --no-cache -f- ${config_dir}
echo docker run --rm --privileged=true \ echo docker run --rm --privileged=true \
-v ${cur_dir}:/work \ -v ${cur_dir}:/work \

View File

@ -1,18 +1,20 @@
#!/bin/bash #!/bin/bash
set -e
set -x
__usage=" __usage="
Usage: build [OPTIONS] Usage: build [OPTIONS]
Build Rockchip bootable images. Build openEuler bootable images.
The target bootable compressed images will be generated in the build/YYYY-MM-DD folder of the directory where the build script is located. The target bootable compressed images will be generated in the build/YYYY-MM-DD folder of the directory where the build script is located.
Options: Options:
--board BOARD_CONFIG Required! The config of target board in the boards folder, which defaults to firefly-rk3399. --board BOARD_CONFIG Required! The config of target board in the boards folder, which defaults to firefly-rk3399.
-n, --name IMAGE_NAME The Rockchip image name to be built. -n, --name IMAGE_NAME The openEuler image name to be built.
-k, --kernel KERNEL_URL The URL of kernel source's repository, which defaults to https://gitee.com/openeuler/rockchip-kernel.git. -k, --kernel KERNEL_URL The URL of kernel source's repository, which defaults to https://gitee.com/openeuler/rockchip-kernel.git.
-b, --branch KERNEL_BRANCH The branch name of kernel source's repository, which defaults to openEuler-20.03-LTS. -b, --branch KERNEL_BRANCH The branch name of kernel source's repository, which defaults to openEuler-20.03-LTS.
-c, --config KERNEL_DEFCONFIG The name/path of defconfig file when compiling kernel, which defaults to openeuler_rockchip_defconfig. -c, --config KERNEL_DEFCONFIG The name/path of defconfig file when compiling kernel, which defaults to openeuler_rockchip_defconfig.
-r, --repo REPO_INFO The URL/path of target repo file or list of repo's baseurls which should be a space separated list. -r, --repo REPO_INFO The URL/path of target repo file or list of repo's baseurls which should be a space separated list.
-s, --spec SPEC The image's specification: headless, xfce, ukui, dde or the file path of rpmlist. The default is headless. -s, --spec SPEC The image's specification: headless, xfce, ukui, dde, gnome, devstation or the file path of rpmlist. The default is headless.
--cores N The number of cpu cores to be used during making. --cores N The number of cpu cores to be used during making.
-h, --help Show command help. -h, --help Show command help.
" "
@ -43,17 +45,17 @@ default_param() {
branch=openEuler-20.03-LTS branch=openEuler-20.03-LTS
repo_file="https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS/generic.repo" repo_file="https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS/generic.repo"
kernel_url="https://gitee.com/openeuler/rockchip-kernel.git" kernel_url="https://gitee.com/openeuler/rockchip-kernel.git"
workdir=$cur_dir/build workdir=${cur_dir}/build
name=${branch}-${board}-aarch64-alpha1 name=${branch}-${board}-aarch64-alpha1
make_cores=$(nproc) make_cores=$(nproc)
} }
save_param() { save_param() {
if [ -f $workdir/.param_last ]; then if [ -f ${workdir}/.param_last ]; then
rm $workdir/.param_last rm ${workdir}/.param_last
fi fi
if [ -f $workdir/.param ]; then if [ -f ${workdir}/.param ]; then
mv $workdir/.param $workdir/.param_last mv ${workdir}/.param ${workdir}/.param_last
fi fi
echo "board=$board echo "board=$board
default_defconfig=$default_defconfig default_defconfig=$default_defconfig
@ -63,7 +65,7 @@ platform=$platform
branch=$branch branch=$branch
repo_file=$repo_file repo_file=$repo_file
kernel_url=$kernel_url kernel_url=$kernel_url
spec_param=$spec_param" > $workdir/.param spec_param=$spec_param" > ${workdir}/.param
} }
oe_deppkg_install() { oe_deppkg_install() {
@ -148,8 +150,8 @@ LOG "DeviceTree name: ${dtb_name}."
LOG "Target platform: ${platform}." LOG "Target platform: ${platform}."
used_param used_param
if [ ! -d $workdir ]; then if [ ! -d ${workdir} ]; then
mkdir $workdir mkdir ${workdir}
fi fi
# Firefly Toolchain Repo # Firefly Toolchain Repo
@ -160,15 +162,15 @@ host_arch=$(arch)
save_param save_param
log_dir=${workdir}/log log_dir=${workdir}/log
if [ ! -d ${log_dir} ];then mkdir -p ${log_dir}; fi if [ ! -d ${log_dir} ];then mkdir -p ${log_dir}; fi
if [ -f $workdir/.done ];then if [ -f ${workdir}/.done ];then
LOG "Checking the previous build." LOG "Checking the previous build."
if [[ $(cat $workdir/.done | grep u-boot) == "u-boot" && \ if [[ $(cat ${workdir}/.done | grep u-boot) == "u-boot" && \
$(cat $workdir/.done | grep bootimg) == "bootimg" && \ $(cat ${workdir}/.done | grep bootimg) == "bootimg" && \
$(cat $workdir/.done | grep rootfs) == "rootfs" && \ $(cat ${workdir}/.done | grep rootfs) == "rootfs" && \
$(cat $workdir/.done | grep image) == "image" ]];then $(cat ${workdir}/.done | grep image) == "image" ]];then
LOG "Found complete build, clean build flag." LOG "Found complete build, clean build flag."
rm $workdir/.done rm ${workdir}/.done
touch $workdir/.done touch ${workdir}/.done
fi fi
else else
oe_deppkg_install oe_deppkg_install
@ -179,18 +181,18 @@ else
else else
LOG "You are running this script on a ${host_arch} mechine, progress...." LOG "You are running this script on a ${host_arch} mechine, progress...."
fi fi
touch $workdir/.done touch ${workdir}/.done
fi fi
if [[ $(cat $workdir/.done | grep u-boot) != "u-boot" ]];then if [[ $(cat ${workdir}/.done | grep u-boot) != "u-boot" ]];then
bash ${cur_dir}/build_u-boot.sh bash ${cur_dir}/build_u-boot.sh
fi fi
if [[ $(cat $workdir/.done | grep bootimg) != "bootimg" ]];then if [[ $(cat ${workdir}/.done | grep bootimg) != "bootimg" ]];then
bash ${cur_dir}/build_boot.sh bash ${cur_dir}/build_boot.sh
fi fi
if [[ $(cat $workdir/.done | grep rootfs) != "rootfs" ]];then if [[ $(cat ${workdir}/.done | grep rootfs) != "rootfs" ]];then
if [[ "${host_arch}" == "x86_64" && "${arch}" == "arm64" ]];then if [[ "${host_arch}" == "x86_64" && "${arch}" == "arm64" ]];then
LOG "You are running this script on a ${host_arch} mechine, installing qemu-user-static...." LOG "You are running this script on a ${host_arch} mechine, installing qemu-user-static...."
sudo rpm -ivh ${cur_dir}/bin/qemu-user-static-aarch64-x86_64.rpm sudo rpm -ivh ${cur_dir}/bin/qemu-user-static-aarch64-x86_64.rpm

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
set -e
set -x
__usage=" __usage="
Usage: build_boot [OPTIONS] Usage: build_boot [OPTIONS]
@ -21,30 +23,30 @@ help()
} }
default_param() { default_param() {
workdir=$cur_dir/build workdir=${cur_dir}/build
branch=openEuler-20.03-LTS branch=openEuler-20.03-LTS
default_defconfig=openeuler_rockchip_defconfig default_defconfig=openeuler_rockchip_defconfig
board=firefly-rk3399 board=firefly-rk3399
dtb_name=rk3399-firefly dtb_name=rk3399-firefly
platform=rockchip platform=rockchip
kernel_url="https://gitee.com/openeuler/rockchip-kernel.git" kernel_url="https://gitee.com/openeuler/rockchip-kernel.git"
boot_dir=$workdir/boot boot_dir=${workdir}/boot
log_dir=$workdir/log log_dir=${workdir}/log
make_cores=$(nproc) make_cores=$(nproc)
} }
local_param(){ local_param(){
if [ -f $workdir/.param ]; then if [ -f ${workdir}/.param ]; then
branch=$(cat $workdir/.param | grep branch) branch=$(cat ${workdir}/.param | grep branch)
branch=${branch:7} branch=${branch:7}
default_defconfig=$(cat $workdir/.param | grep default_defconfig) default_defconfig=$(cat ${workdir}/.param | grep default_defconfig)
default_defconfig=${default_defconfig:18} default_defconfig=${default_defconfig:18}
board=$(cat $workdir/.param | grep board) board=$(cat ${workdir}/.param | grep board)
board=${board:6} board=${board:6}
kernel_url=$(cat $workdir/.param | grep kernel_url) kernel_url=$(cat ${workdir}/.param | grep kernel_url)
kernel_url=${kernel_url:11} kernel_url=${kernel_url:11}
fi fi
} }
@ -101,50 +103,50 @@ LOG(){
LOSETUP_D_IMG(){ LOSETUP_D_IMG(){
set +e set +e
if [ -d $workdir/boot_emmc ]; then if [ -d ${workdir}/boot_emmc ]; then
if grep -q "$workdir/boot_emmc " /proc/mounts ; then if grep -q "${workdir}/boot_emmc " /proc/mounts ; then
umount $workdir/boot_emmc umount ${workdir}/boot_emmc
fi fi
fi fi
if [ -d $workdir/boot_emmc ]; then if [ -d ${workdir}/boot_emmc ]; then
rm -rf $workdir/boot_emmc rm -rf ${workdir}/boot_emmc
fi fi
set -e set -e
} }
clone_and_check_kernel_source() { clone_and_check_kernel_source() {
cd $workdir pushd ${workdir}
if [ -d kernel ]; then if [ -d kernel ]; then
if [ -f $workdir/.param_last ]; then if [ -f ${workdir}/.param_last ]; then
last_branch=$(cat $workdir/.param_last | grep branch) last_branch=$(cat ${workdir}/.param_last | grep branch)
last_branch=${last_branch:7} last_branch=${last_branch:7}
last_default_defconfig=$(cat $workdir/.param_last | grep default_defconfig) last_default_defconfig=$(cat ${workdir}/.param_last | grep default_defconfig)
last_default_defconfig=${last_default_defconfig:18} last_default_defconfig=${last_default_defconfig:18}
last_dtb_name=$(cat $workdir/.param_last | grep dtb_name) last_dtb_name=$(cat ${workdir}/.param_last | grep dtb_name)
last_dtb_name=${last_dtb_name:9} last_dtb_name=${last_dtb_name:9}
last_platform_name=$(cat $workdir/.param_last | grep platform) last_platform_name=$(cat ${workdir}/.param_last | grep platform)
last_platform_name=${last_dtb_name:9} last_platform_name=${last_platform_name:9}
last_kernel_url=$(cat $workdir/.param_last | grep kernel_url) last_kernel_url=$(cat ${workdir}/.param_last | grep kernel_url)
last_kernel_url=${last_kernel_url:11} last_kernel_url=${last_kernel_url:11}
cd $workdir/kernel pushd ${workdir}/kernel
git remote -v update git remote -v update
lastest_kernel_version=$(git rev-parse @{u}) lastest_kernel_version=$(git rev-parse @{u})
local_kernel_version=$(git rev-parse @) local_kernel_version=$(git rev-parse @)
cd $workdir popd
if [[ ${last_branch} != ${branch} || \ if [[ ${last_branch} != ${branch} || \
${last_default_defconfig} != ${default_defconfig} || \ ${last_default_defconfig} != ${default_defconfig} || \
${last_dtb_name} != ${dtb_name} || \ ${last_dtb_name} != ${dtb_name} || \
${last_kernel_url} != ${kernel_url} || \ ${last_kernel_url} != ${kernel_url} || \
${lastest_kernel_version} != ${local_kernel_version} ]]; then ${lastest_kernel_version} != ${local_kernel_version} ]]; then
if [ -d $workdir/kernel ];then rm -rf $workdir/kernel; fi if [ -d ${workdir}/kernel ];then rm -rf ${workdir}/kernel; fi
if [ -d $workdir/boot ];then rm -rf $workdir/boot; fi if [ -d ${workdir}/boot ];then rm -rf ${workdir}/boot; fi
if [ -f $workdir/boot.img ];then rm $workdir/boot.img; fi if [ -f ${workdir}/boot.img ];then rm ${workdir}/boot.img; fi
git clone --depth=1 -b $branch $kernel_url kernel git clone --depth=1 -b $branch $kernel_url kernel
LOG "clone kernel source done." LOG "clone kernel source done."
fi fi
@ -153,94 +155,146 @@ clone_and_check_kernel_source() {
git clone --depth=1 -b $branch $kernel_url kernel git clone --depth=1 -b $branch $kernel_url kernel
LOG "clone kernel source done." LOG "clone kernel source done."
fi fi
popd
} }
make_kernel(){ make_kernel(){
LOG "make kernel(${default_defconfig}) begin..." LOG "make kernel(${default_defconfig}) begin..."
kernel_dir_tmp=$1 kernel_dir_tmp=$1
cd "${kernel_dir_tmp}" pushd "${kernel_dir_tmp}"
if [ "x${kernel_defconfig:0:1}" != "x/" ]; then if [ -n "${kernel_defconfig}" ]; then
if [ ! -f arch/arm64/configs/${kernel_defconfig} ]; then if [ "x${kernel_defconfig:0:1}" != "x/" ]; then
ERROR "config file ${kernel_defconfig} can not be found in kernel source". if [ ! -f arch/arm64/configs/${kernel_defconfig} ]; then
exit 2 ERROR "config file ${kernel_defconfig} can not be found in kernel source".
exit 2
fi
kernel_defconfig=arch/arm64/configs/${kernel_defconfig}
fi fi
kernel_defconfig=arch/arm64/configs/${kernel_defconfig}
fi fi
if [ ! -z "${cross_compile}" ]; then if [ ! -z "${cross_compile}" ]; then
export CROSS_COMPILE=${cross_compile} export CROSS_COMPILE=${cross_compile}
fi fi
make distclean make distclean
kernel_ver=""
if [ "x${board}" == "xraspberrypi" ]; then
kernel_ver=$(awk '/^VERSION = / {v=$3} /^PATCHLEVEL = / {p=$3} /^SUBLEVEL = / {s=$3} /^EXTRAVERSION = / {e=$3} END {print v"."p"."s (e ? "-" e : "") "+"}' Makefile)
if [ -z "${kernel_defconfig}" ]; then
if [ "x${branch}" == "xOLK-6.6" ]; then
make ARCH=arm64 -j${make_cores} O=output/v8 bcm2711_defconfig
make ARCH=arm64 -j${make_cores} O=output/v8 KERNELRELEASE=${kernel_ver}-v8
make ARCH=arm64 -j${make_cores} O=output/2712 bcm2712_defconfig
make ARCH=arm64 -j${make_cores} O=output/2712 KERNELRELEASE=${kernel_ver}-2712
cp output/2712/arch/arm64/boot/Image arch/arm64/boot/Image
cp output/2712/arch/arm64/boot/dts/${platform}/${dtb_name}.dtb arch/arm64/boot/dts/${platform}/${dtb_name}.dtb
LOG "make kernel(bcm2711_defconfig, bcm2712_defconfig) for Raspberry Pi end."
return
else
kernel_defconfig="arch/arm64/configs/bcm2711_defconfig"
fi
fi
fi
cp ${kernel_defconfig} .config cp ${kernel_defconfig} .config
make ARCH=arm64 olddefconfig make ARCH=arm64 olddefconfig
kernel_defconfig=${kernel_defconfig##*/} kernel_defconfig=${kernel_defconfig##*/}
make ARCH=arm64 -j${make_cores} make ARCH=arm64 -j${make_cores}
LOG "make kernel(${default_defconfig}) end." LOG "make kernel(${default_defconfig}) end."
popd
} }
install_kernel() { install_kernel() {
if [ ! -f $workdir/kernel/arch/arm64/boot/Image ]; then if [ ! -f ${workdir}/kernel/arch/arm64/boot/Image ]; then
ERROR "kernel Image can not be found!" ERROR "kernel Image can not be found!"
exit 2 exit 2
else else
LOG "make kernel done." LOG "make kernel done."
fi fi
if [ -d $workdir/kernel/kernel-modules ];then rm -rf $workdir/kernel/kernel-modules; fi if [ -d ${workdir}/kernel/kernel-modules ];then rm -rf ${workdir}/kernel/kernel-modules; fi
if [ -d ${boot_dir} ];then rm -rf ${boot_dir}; fi if [ -d ${boot_dir} ];then rm -rf ${boot_dir}; fi
mkdir -p ${boot_dir} mkdir -p ${boot_dir}
mkdir -p $workdir/kernel/kernel-modules mkdir -p ${workdir}/kernel/kernel-modules
cd $workdir/kernel pushd ${workdir}/kernel
if [ ! -z "${cross_compile}" ]; then if [ ! -z "${cross_compile}" ]; then
export CROSS_COMPILE=${cross_compile} export CROSS_COMPILE=${cross_compile}
fi fi
make ARCH=arm64 install INSTALL_PATH=${boot_dir} if [ "x${board}" == "xraspberrypi" ]; then
make ARCH=arm64 modules_install INSTALL_MOD_PATH=$workdir/kernel/kernel-modules mkdir -p ${boot_dir}/overlays
LOG "device tree name is ${dtb_name}.dtb" if [ -z "${kernel_defconfig}" ] && [ "x${branch}" == "xOLK-6.6" ]; then
cp arch/arm64/boot/dts/${platform}/${dtb_name}.dtb ${boot_dir} rpi_version=("v8" "2712")
cp arch/arm64/boot/Image ${boot_dir} for rpi in "${rpi_version[@]}"; do
pushd output/${rpi}
make ARCH=arm64 -j${make_cores} modules_install INSTALL_MOD_PATH=${workdir}/kernel/kernel-modules
cp arch/arm64/boot/Image ${boot_dir}/Image-${rpi}
cp .config ${boot_dir}/config-${rpi}
cp System.map ${boot_dir}/System.map-${rpi}
popd
done
mv ${boot_dir}/Image-v8 ${boot_dir}/kernel8.img
mv ${boot_dir}/Image-2712 ${boot_dir}/kernel_2712.img
cp output/2712/arch/arm64/boot/dts/${platform}/*.dtb ${boot_dir}
cp output/2712/arch/arm64/boot/dts/overlays/*.dtb* ${boot_dir}/overlays/
else
make ARCH=arm64 -j${make_cores} modules_install INSTALL_MOD_PATH=${workdir}/kernel/kernel-modules
cp arch/arm64/boot/Image ${boot_dir}/kernel8.img
cp .config ${boot_dir}/config
cp System.map ${boot_dir}/System.map
cp arch/arm64/boot/dts/${platform}/*.dtb ${boot_dir}
cp arch/arm64/boot/dts/overlays/*.dtb* ${boot_dir}/overlays/
fi
else
make ARCH=arm64 install INSTALL_PATH=${boot_dir}
make ARCH=arm64 -j${make_cores} modules_install INSTALL_MOD_PATH=${workdir}/kernel/kernel-modules
cp arch/arm64/boot/Image ${boot_dir}
cp arch/arm64/boot/dts/${platform}/*.dtb ${boot_dir}
fi
rm -rf ${workdir}/kernel/kernel-modules/lib/modules/*/source ${workdir}/kernel/kernel-modules/lib/modules/*/build
LOG "prepare kernel done." LOG "prepare kernel done."
popd
} }
mk_boot() { mk_boot() {
LOG "start make bootimg..." LOG "start make bootimg..."
mkdir -p ${boot_dir}/extlinux if [ "x${board}" != "xraspberrypi" ]; then
mkdir -p ${boot_dir}/extlinux
LOG "start gen initrd..." LOG "start gen initrd..."
dracut --no-kernel ${boot_dir}/initrd.img dracut --no-kernel ${boot_dir}/initrd.img
LOG "gen initrd done." LOG "gen initrd done."
dtb_name=$(ls $boot_dir | grep dtb) dtb_name=$(ls ${boot_dir} | grep dtb)
LOG "gen extlinux config for $dtb_name" LOG "gen extlinux config for $dtb_name"
if [ "${platform}" == "rockchip" ];then if [ "${platform}" == "rockchip" ];then
bootargs=${rockchip_bootargs} bootargs=${rockchip_bootargs}
elif [ "${platform}" == "phytium" ];then elif [ "${platform}" == "phytium" ];then
bootargs=${phytium_bootargs} bootargs=${phytium_bootargs}
elif [ "${platform}" == "allwinner" ];then elif [ "${platform}" == "allwinner" ];then
bootargs=${allwinner_bootargs} bootargs=${allwinner_bootargs}
else else
echo "Unsupported platform" echo "Unsupported platform"
exit 2 exit 2
fi
echo "label openEuler
kernel /Image
initrd /initrd.img
fdt /${dtb_name}
append ${bootargs}" \
> ${boot_dir}/extlinux/extlinux.conf
LOG "gen extlinux config done."
fi fi
echo "label openEuler dd if=/dev/zero of=${workdir}/boot.img bs=1M count=240 status=progress
kernel /Image mkfs.vfat -n boot ${workdir}/boot.img
initrd /initrd.img if [ -d ${workdir}/boot_emmc ];then rm -rf ${workdir}/boot_emmc; fi
fdt /${dtb_name} mkdir ${workdir}/boot_emmc
append ${bootargs}" \ mount ${workdir}/boot.img ${workdir}/boot_emmc/
> ${boot_dir}/extlinux/extlinux.conf cp -r ${boot_dir}/* ${workdir}/boot_emmc/
umount ${workdir}/boot.img
rmdir ${workdir}/boot_emmc
LOG "gen extlinux config done." if [ -f ${workdir}/boot.img ]; then
dd if=/dev/zero of=$workdir/boot.img bs=1M count=240 status=progress
mkfs.vfat -n boot $workdir/boot.img
if [ -d $workdir/boot_emmc ];then rm -rf $workdir/boot_emmc; fi
mkdir $workdir/boot_emmc
mount $workdir/boot.img $workdir/boot_emmc/
cp -r ${boot_dir}/* $workdir/boot_emmc/
umount $workdir/boot.img
rmdir $workdir/boot_emmc
if [ -f $workdir/boot.img ]; then
LOG "make boot image done." LOG "make boot image done."
else else
ERROR "make boot image failed!" ERROR "make boot image failed!"
@ -257,19 +311,23 @@ cur_dir=$(cd $(dirname $0);pwd)
default_param default_param
local_param local_param
parseargs "$@" || help $? parseargs "$@" || help $?
set -e
rockchip_bootargs="earlyprintk console=ttyS2,1500000 rw root=UUID=614e0000-0000-4b53-8000-1d28000054a9 rootfstype=ext4 init=/sbin/init rootwait" rockchip_bootargs="earlyprintk console=ttyS2,1500000 rw root=UUID=614e0000-0000-4b53-8000-1d28000054a9 rootfstype=ext4 init=/sbin/init rootwait"
phytium_bootargs="console=ttyAMA1,115200 earlycon=pl011,0x2800d000 rw root=UUID=614e0000-0000-4b53-8000-1d28000054a9 rootfstype=ext4 rootwait cma=256m" phytium_bootargs="console=ttyAMA1,115200 earlycon=pl011,0x2800d000 rw root=UUID=614e0000-0000-4b53-8000-1d28000054a9 rootfstype=ext4 rootwait cma=256m"
allwinner_bootargs="console=tty0 console=ttyS0,115200 rw root=UUID=614e0000-0000-4b53-8000-1d28000054a9 rootfstype=ext4 rootwait earlycon clk_gnore_unused" allwinner_bootargs="console=tty0 console=ttyS0,115200 rw root=UUID=614e0000-0000-4b53-8000-1d28000054a9 rootfstype=ext4 rootwait earlycon clk_gnore_unused"
if [ ! -f $default_defconfig ] ; then if [ -n "${default_defconfig}" ]; then
LOG "kernel defconfig is : ${default_defconfig}" if [ ! -f $default_defconfig ] ; then
kernel_defconfig=$default_defconfig LOG "kernel defconfig is : ${default_defconfig}"
elif [ -f $default_defconfig ]; then kernel_defconfig=$default_defconfig
LOG "use local kernel defconfig..." else
cp $default_defconfig ${workdir}/ LOG "use local kernel defconfig..."
kernel_defconfig=${workdir}/${default_defconfig##*/} cp $default_defconfig ${workdir}/
kernel_defconfig=${workdir}/${default_defconfig##*/}
fi
elif [ "x${board}" != "xraspberrypi" ]; then
LOG "default_defconfig is missing"
exit 1
fi fi
cross_compile="" cross_compile=""
@ -282,26 +340,37 @@ else
LOG "You are running this script on a ${host_arch} mechine, progress...." LOG "You are running this script on a ${host_arch} mechine, progress...."
fi fi
if [ ! -d $workdir ]; then if [ ! -d ${workdir} ]; then
mkdir $workdir mkdir ${workdir}
fi fi
source $cur_dir/boards/${board}.conf source ${cur_dir}/boards/${board}.conf
if [ ! -d ${log_dir} ];then mkdir -p ${log_dir}; fi if [ ! -d ${log_dir} ];then mkdir -p ${log_dir}; fi
if [ ! -f $workdir/.done ];then if [ ! -f ${workdir}/.done ];then
touch $workdir/.done touch ${workdir}/.done
fi fi
sed -i 's/bootimg//g' $workdir/.done sed -i 's/bootimg//g' ${workdir}/.done
LOG "build boot..." LOG "build boot..."
if [ "x${board}" == "xraspberrypi" ] && [ -z "${kernel_url}" ]; then
LOG "build an empty boot.img for Raspberry Pi."
rm -rf ${workdir}/kernel || LOG "remove kernel source."
dd if=/dev/zero of=${workdir}/boot.img bs=1M count=10 status=progress
mkfs.vfat -n boot ${workdir}/boot.img
LOG "The boot.img is generated in the ${workdir}."
echo "bootimg" >> ${workdir}/.done
exit 0
fi
clone_and_check_kernel_source clone_and_check_kernel_source
if [[ -f $workdir/kernel/arch/arm64/boot/dts/${platform}/${dtb_name}.dtb && -f $workdir/kernel/arch/arm64/boot/Image ]];then if [[ -f ${workdir}/kernel/arch/arm64/boot/dts/${platform}/${dtb_name}.dtb && -f ${workdir}/kernel/arch/arm64/boot/Image ]];then
LOG "kernel is the latest" LOG "kernel is the latest"
else else
make_kernel $workdir/kernel make_kernel ${workdir}/kernel
fi fi
if [[ -f $workdir/boot.img && $(cat $workdir/.done | grep bootimg) == "bootimg" ]];then if [[ -f ${workdir}/boot.img && $(cat ${workdir}/.done | grep bootimg) == "bootimg" ]]; then
LOG "boot is the latest" LOG "boot is the latest"
else else
trap 'LOSETUP_D_IMG' EXIT trap 'LOSETUP_D_IMG' EXIT
@ -310,4 +379,4 @@ else
mk_boot mk_boot
fi fi
LOG "The boot.img is generated in the ${workdir}." LOG "The boot.img is generated in the ${workdir}."
echo "bootimg" >> $workdir/.done echo "bootimg" >> ${workdir}/.done

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
set -e
set +x
__usage=" __usage="
Usage: build_rootfs [OPTIONS] Usage: build_rootfs [OPTIONS]
@ -10,7 +12,7 @@ Options:
--board, BOARD_CONFIG Required! The config of target board in the boards folder, which defaults to firefly-rk3399. --board, BOARD_CONFIG Required! The config of target board in the boards folder, which defaults to firefly-rk3399.
-r, --repo REPO_INFO The URL/path of target repo file or list of repo's baseurls which should be a space separated list. -r, --repo REPO_INFO The URL/path of target repo file or list of repo's baseurls which should be a space separated list.
-b, --branch KERNEL_BRANCH The branch name of kernel source's repository, which defaults to openEuler-20.03-LTS. -b, --branch KERNEL_BRANCH The branch name of kernel source's repository, which defaults to openEuler-20.03-LTS.
-s, --spec SPEC The image's specification: headless, xfce, ukui, dde or the file path of rpmlist. The default is headless. -s, --spec SPEC The image's specification: headless, xfce, ukui, dde, gnome, devstation or the file path of rpmlist. The default is headless.
-h, --help Show command help. -h, --help Show command help.
" "
@ -23,28 +25,33 @@ help()
default_param() { default_param() {
board=firefly-rk3399 board=firefly-rk3399
repo_file="https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS/generic.repo" repo_file="https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS/generic.repo"
workdir=${cur_dir}/build
tmp_dir=${workdir}/tmp tmp_dir=${workdir}/tmp
workdir=$cur_dir/build
branch=openEuler-20.03-LTS branch=openEuler-20.03-LTS
rootfs_arch=aarch64 rootfs_arch=aarch64
nonfree_bin_dir=${workdir}/../bin nonfree_bin_dir=${cur_dir}/bin
config_dir=${cur_dir}/configs
rootfs_dir=${workdir}/rootfs rootfs_dir=${workdir}/rootfs
log_dir=${workdir}/log log_dir=${workdir}/log
rootfs_mnt=${workdir}/rootfs_tmp
} }
local_param(){ local_param(){
if [ -f $workdir/.param ]; then if [ -f ${workdir}/.param ]; then
board=$(cat $workdir/.param | grep board) board=$(cat ${workdir}/.param | grep board)
board=${board:6} board=${board:6}
repo_file=$(cat $workdir/.param | grep repo_file) repo_file=$(cat ${workdir}/.param | grep repo_file)
repo_file=${repo_file:10} repo_file=${repo_file:10}
branch=$(cat $workdir/.param | grep branch) branch=$(cat ${workdir}/.param | grep branch)
branch=${branch:7} branch=${branch:7}
spec_param=$(cat $workdir/.param | grep spec_param) spec_param=$(cat ${workdir}/.param | grep spec_param)
spec_param=${spec_param:11} spec_param=${spec_param:11}
kernel_url=$(cat ${workdir}/.param | grep kernel_url)
kernel_url=${kernel_url:11}
fi fi
} }
@ -96,13 +103,13 @@ LOG(){
LOSETUP_D_IMG(){ LOSETUP_D_IMG(){
set +e set +e
if [ -d ${workdir}/rootfs_tmp ]; then if [ -d ${rootfs_mnt} ]; then
if grep -q "${workdir}/rootfs_tmp " /proc/mounts ; then if grep -q "${rootfs_mnt} " /proc/mounts ; then
umount ${workdir}/rootfs_tmp umount ${rootfs_mnt}
fi fi
fi fi
if [ -d ${workdir}/rootfs_tmp ]; then if [ -d ${rootfs_mnt} ]; then
rm -rf ${workdir}/rootfs_tmp rm -rf ${rootfs_mnt}
fi fi
set -e set -e
} }
@ -140,14 +147,17 @@ INSTALL_PACKAGES(){
ERROR can not install $item. ERROR can not install $item.
fi fi
done done
if [ "x${board}" == "xraspberrypi" ] && [ -z "${kernel_url}" ]; then
chroot ${rootfs_dir}/ dnf ${tmp_repo_info} --disablerepo="*" install -y raspberrypi-kernel --nogpgcheck
if [ $? == 0 ]; then
LOG install raspberrypi-kernel.
else
ERROR can not install raspberrypi-kernel.
fi
fi
} }
build_rootfs() { build_rootfs() {
trap 'UMOUNT_ALL' EXIT
cd $workdir
if [ -d rootfs ];then rm -rf rootfs; fi
mkdir rootfs
if [ ! -d ${tmp_dir} ]; then if [ ! -d ${tmp_dir} ]; then
mkdir -p ${tmp_dir} mkdir -p ${tmp_dir}
else else
@ -156,8 +166,8 @@ build_rootfs() {
if [ "x$spec_param" == "xheadless" ] || [ "x$spec_param" == "x" ]; then if [ "x$spec_param" == "xheadless" ] || [ "x$spec_param" == "x" ]; then
: :
elif [ "x$spec_param" == "xxfce" ] || [ "x$spec_param" == "xukui" ] || [ "x$spec_param" == "xdde" ]; then elif [ "x$spec_param" == "xxfce" ] || [ "x$spec_param" == "xukui" ] || [ "x$spec_param" == "xdde" ] || [ "x$spec_param" == "xgnome" ] || [ "x$spec_param" == "xdevstation" ]; then
CONFIG_RPM_LIST=$workdir/../configs/rpmlist-${spec_param} CONFIG_RPM_LIST=${config_dir}/rpmlist-${spec_param}
elif [ -f ${spec_param} ]; then elif [ -f ${spec_param} ]; then
cp ${spec_param} ${tmp_dir}/ cp ${spec_param} ${tmp_dir}/
spec_file_name=${spec_param##*/} spec_file_name=${spec_param##*/}
@ -166,16 +176,13 @@ build_rootfs() {
echo `date` - ERROR, please check your params in option -s or --spec. echo `date` - ERROR, please check your params in option -s or --spec.
exit 2 exit 2
fi fi
echo $(pwd)
mkdir -p ${rootfs_dir}/var/lib/rpm
rpm --root ${rootfs_dir}/ --initdb
if [ "x$repo_file" == "x" ] ; then if [ "x$repo_file" == "x" ] ; then
echo `date` - ERROR, \"-r REPO_INFO or --repo REPO_INFO\" missing. echo `date` - ERROR, \"-r REPO_INFO or --repo REPO_INFO\" missing.
help 2 help 2
elif [ "x${repo_file:0:4}" == "xhttp" ]; then elif [ "x${repo_file:0:4}" == "xhttp" ]; then
if [ "x${repo_file:0-5}" == "x.repo" ]; then if [ "x${repo_file:0-5}" == "x.repo" ]; then
repo_url=${repo_file}
wget ${repo_file} -P ${tmp_dir}/ wget ${repo_file} -P ${tmp_dir}/
repo_file_name=${repo_file##*/} repo_file_name=${repo_file##*/}
repo_file=${tmp_dir}/${repo_file_name} repo_file=${tmp_dir}/${repo_file_name}
@ -186,7 +193,7 @@ build_rootfs() {
for baseurl in ${repo_file// / } for baseurl in ${repo_file// / }
do do
echo [repo${index}] >> ${repo_file_tmp} echo [repo${index}] >> ${repo_file_tmp}
echo name=repo${index} to build rk3399 image >> ${repo_file_tmp} echo name=repo${index} to build ${board} image >> ${repo_file_tmp}
echo baseurl=${baseurl} >> ${repo_file_tmp} echo baseurl=${baseurl} >> ${repo_file_tmp}
echo enabled=1 >> ${repo_file_tmp} echo enabled=1 >> ${repo_file_tmp}
echo gpgcheck=0 >> ${repo_file_tmp} echo gpgcheck=0 >> ${repo_file_tmp}
@ -222,12 +229,12 @@ build_rootfs() {
done done
os_release_name="openEuler-release" os_release_name="openEuler-release"
dnf ${repo_info} --disablerepo="*" --downloaddir=${workdir}/ download ${os_release_name} --forcearch ${rootfs_arch} dnf ${repo_info} --disablerepo="*" --downloaddir=${tmp_dir}/ download ${os_release_name} --forcearch ${rootfs_arch}
if [ $? != 0 ]; then if [ $? != 0 ]; then
ERROR "Fail to download ${os_release_name}!" ERROR "Fail to download ${os_release_name}!"
exit 2 exit 2
fi fi
os_release_name=`ls -r ${workdir}/${os_release_name}*.rpm 2>/dev/null| head -n 1` os_release_name=`ls -r ${tmp_dir}/${os_release_name}*.rpm 2>/dev/null| head -n 1`
if [ -z "${os_release_name}" ]; then if [ -z "${os_release_name}" ]; then
ERROR "${os_release_name} can not be found!" ERROR "${os_release_name} can not be found!"
exit 2 exit 2
@ -235,6 +242,16 @@ build_rootfs() {
LOG "Success to download ${os_release_name}." LOG "Success to download ${os_release_name}."
fi fi
LOG "make rootfs for ${repo_file} begin..."
trap 'UMOUNT_ALL' EXIT
if [ -d ${rootfs_dir} ]; then
UMOUNT_ALL
rm -rf ${rootfs_dir}
fi
mkdir ${rootfs_dir}
mkdir -p ${rootfs_dir}/var/lib/rpm
rpm --root ${rootfs_dir}/ --initdb
rpm -ivh --nodeps --root ${rootfs_dir}/ ${os_release_name} --ignorearch rpm -ivh --nodeps --root ${rootfs_dir}/ ${os_release_name} --ignorearch
mkdir -p ${rootfs_dir}/etc/rpm mkdir -p ${rootfs_dir}/etc/rpm
@ -248,52 +265,41 @@ build_rootfs() {
mount --bind /dev ${rootfs_dir}/dev mount --bind /dev ${rootfs_dir}/dev
mount -t proc /proc ${rootfs_dir}/proc mount -t proc /proc ${rootfs_dir}/proc
mount -t sysfs /sys ${rootfs_dir}/sys mount -t sysfs /sys ${rootfs_dir}/sys
set +e
INSTALL_PACKAGES ${CONFIG_RPM_LIST} "${repo_info}" INSTALL_PACKAGES ${CONFIG_RPM_LIST} "${repo_info}"
cat ${rootfs_dir}/etc/systemd/timesyncd.conf | grep "^NTP=*"
if [ $? -ne 0 ]; then
sed -i -e '/^#NTP=/cNTP=0.cn.pool.ntp.org' ${rootfs_dir}/etc/systemd/timesyncd.conf
sed -i -e 's/#FallbackNTP=/FallbackNTP=1.asia.pool.ntp.org 2.asia.pool.ntp.org /g' ${rootfs_dir}/etc/systemd/timesyncd.conf
fi
set -e
rm -rf ${rootfs_dir}/*.core rm -rf ${rootfs_dir}/*.core
rm ${workdir}/*rpm
for dns in $default_dns cp -Lp ${config_dir}/resolv.conf ${rootfs_dir}/etc/resolv.conf
do
echo " nameserver ${dns}" >> "${rootfs_dir}/etc/resolv.conf"
done
if [ ! -d ${rootfs_dir}/etc/sysconfig/network-scripts ]; then mkdir "${rootfs_dir}/etc/sysconfig/network-scripts"; fi if [ ! -d ${rootfs_dir}/etc/sysconfig/network-scripts ]; then mkdir "${rootfs_dir}/etc/sysconfig/network-scripts"; fi
echo " TYPE=Ethernet cp -Lp ${config_dir}/ifcfg-eth0 ${rootfs_dir}/etc/sysconfig/network-scripts/ifcfg-eth0
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
UUID=851a6f36-e65c-3a43-8f4a-78fd0fc09dc9
ONBOOT=yes
AUTOCONNECT_PRIORITY=-999
DEVICE=eth0" > "${rootfs_dir}/etc/sysconfig/network-scripts/ifup-eth0"
LOG "Configure network done." LOG "Configure network done."
cp $nonfree_bin_dir/../bin/extend-root.sh ${rootfs_dir}/etc/rc.d/init.d/extend-root.sh if [ "x${board}" == "xraspberrypi" ]; then
mkdir -p ${rootfs_dir}/lib/udev/rules.d
if [ ! -d ${rootfs_dir}/usr/share/licenses/raspi ]; then mkdir -p ${rootfs_dir}/usr/share/licenses/raspi; fi
cp ${config_dir}/hosts ${rootfs_dir}/etc/hosts
cp ${config_dir}/*.rules ${rootfs_dir}/lib/udev/rules.d/
cp ${config_dir}/LICENCE.* ${rootfs_dir}/usr/share/licenses/raspi/
fi
if [ ! -d ${rootfs_dir}/etc/rc.d/init.d ]; then mkdir -p ${rootfs_dir}/etc/rc.d/init.d; fi
cp -Lp ${config_dir}/extend-root.sh ${rootfs_dir}/etc/rc.d/init.d/extend-root.sh
chmod +x ${rootfs_dir}/etc/rc.d/init.d/extend-root.sh chmod +x ${rootfs_dir}/etc/rc.d/init.d/extend-root.sh
echo net.ipv4.conf.wlan0.rp_filter=0 >> ${rootfs_dir}/etc/sysctl.conf
set +e cp -Lp ${config_dir}/chroot.sh ${rootfs_dir}/chroot.sh
sed -i -e '/^#NTP=/cNTP=0.cn.pool.ntp.org' ${rootfs_dir}/etc/systemd/timesyncd.conf chmod +x ${rootfs_dir}/chroot.sh
sed -i -e 's/#FallbackNTP=/FallbackNTP=1.asia.pool.ntp.org 2.asia.pool.ntp.org /g' ${rootfs_dir}/etc/systemd/timesyncd.conf
set -e
cat << EOF | chroot ${rootfs_dir} /bin/bash chroot ${rootfs_dir} /bin/bash -c "echo 'Y' | /chroot.sh ${spec_param}"
echo 'openeuler' | passwd --stdin root
echo openEuler > /etc/hostname
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
chkconfig --add extend-root.sh
chkconfig extend-root.sh on
EOF
LOG "Set NTP and auto expand rootfs done." LOG "Set NTP and auto expand rootfs done."
@ -304,11 +310,13 @@ EOF
POST_BOARD_OVERLAY POST_BOARD_OVERLAY
UMOUNT_ALL UMOUNT_ALL
rm ${rootfs_dir}/chroot.sh
LOG "make rootfs for ${repo_file} end."
} }
mk_rootfsimg() { mk_rootfsimg() {
trap 'LOSETUP_D_IMG' EXIT trap 'LOSETUP_D_IMG' EXIT
cd $workdir
rootfs_size=`du -sh --block-size=1MiB ${rootfs_dir} | cut -f 1 | xargs` rootfs_size=`du -sh --block-size=1MiB ${rootfs_dir} | cut -f 1 | xargs`
mod_size=`du -sh --block-size=1MiB ${workdir}/kernel/kernel-modules/lib/modules | cut -f 1 | xargs` mod_size=`du -sh --block-size=1MiB ${workdir}/kernel/kernel-modules/lib/modules | cut -f 1 | xargs`
size=$(($rootfs_size+$mod_size+100)) size=$(($rootfs_size+$mod_size+100))
@ -316,17 +324,17 @@ mk_rootfsimg() {
dd if=/dev/zero of=${rootfs_img} bs=1MiB count=$size status=progress && sync dd if=/dev/zero of=${rootfs_img} bs=1MiB count=$size status=progress && sync
mkfs.ext4 -L rootfs ${workdir}/rootfs.img mkfs.ext4 -L rootfs ${workdir}/rootfs.img
if [ -d ${workdir}/rootfs_tmp ];then rm -rf ${workdir}/rootfs_tmp; fi if [ -d ${rootfs_mnt} ];then rm -rf ${rootfs_mnt}; fi
mkdir ${workdir}/rootfs_tmp mkdir ${rootfs_mnt}
mount ${workdir}/rootfs.img ${workdir}/rootfs_tmp mount ${workdir}/rootfs.img ${rootfs_mnt}
rsync -avHAXq ${rootfs_dir}/* ${workdir}/rootfs_tmp rsync -avHAXq ${rootfs_dir}/* ${rootfs_mnt}
sync sync
sleep 10 sleep 10
LOSETUP_D_IMG LOSETUP_D_IMG
if [ -f $workdir/rootfs.img ]; then if [ -f ${workdir}/rootfs.img ]; then
LOG "make rootfs image done." LOG "make rootfs image done."
else else
ERROR "make rootfs image failed!" ERROR "make rootfs image failed!"
@ -343,7 +351,10 @@ default_param
local_param local_param
parseargs "$@" || help $? parseargs "$@" || help $?
CONFIG_RPM_LIST=$workdir/../configs/rpmlist if [ "x${board}" == "xraspberrypi" ]; then
config_dir=${cur_dir}/configs-rpi
fi
CONFIG_RPM_LIST=${config_dir}/rpmlist
POST_BOARD_OVERLAY() { POST_BOARD_OVERLAY() {
echo "Initial POST_BOARD_OVERLAY function" # It will be overwritten by board.conf. echo "Initial POST_BOARD_OVERLAY function" # It will be overwritten by board.conf.
@ -353,44 +364,39 @@ if [[ "x$arch" == "arm64" ]]; then
rootfs_arch="aarch64" rootfs_arch="aarch64"
fi fi
default_dns="8.8.8.8 8.8.4.4 114.114.114.114" if [ ! -d ${workdir} ]; then
mkdir ${workdir}
if [ ! -d $workdir ]; then
mkdir $workdir
fi fi
source $cur_dir/boards/${board}.conf source ${cur_dir}/boards/${board}.conf
if [ ! -d ${log_dir} ];then mkdir -p ${log_dir}; fi if [ ! -d ${log_dir} ];then mkdir -p ${log_dir}; fi
if [ ! -f $workdir/.done ];then if [ ! -f ${workdir}/.done ];then
touch $workdir/.done touch ${workdir}/.done
fi fi
cd $workdir sed -i 's/rootfs//g' ${workdir}/.done
sed -i 's/rootfs//g' $workdir/.done
LOG "build rootfs..." LOG "build rootfs..."
if [ -d rootfs ]; then if [ -d ${rootfs_dir} ]; then
if [[ -f $workdir/rootfs.img && $(cat $workdir/.done | grep rootfs) == "rootfs" ]];then if [[ -f ${workdir}/rootfs.img && $(cat ${workdir}/.done | grep rootfs) == "rootfs" ]];then
if [ -f $workdir/.param_last ];then if [ -f ${workdir}/.param_last ];then
last_branch=$(cat $workdir/.param_last | grep branch) last_branch=$(cat ${workdir}/.param_last | grep branch)
last_branch=${last_branch:7} last_branch=${last_branch:7}
last_board=$(cat $workdir/.param_last | grep board) last_board=$(cat ${workdir}/.param_last | grep board)
last_board=${last_board:6} last_board=${last_board:6}
last_repo_file=$(cat $workdir/.param_last | grep repo_file) last_repo_file=$(cat ${workdir}/.param_last | grep repo_file)
last_repo_file=${last_repo_file:10} last_repo_file=${last_repo_file:10}
last_spec_param=$(cat $workdir/.param_last | grep spec_param) last_spec_param=$(cat ${workdir}/.param_last | grep spec_param)
last_spec_param=${last_spec_param:11} last_spec_param=${last_spec_param:11}
if [[ ${last_branch} != ${branch} || ${last_board} != ${board} || ${last_repo_file} != ${repo_file} || ${last_spec_param} != ${spec_param} ]]; then if [[ ${last_branch} != ${branch} || ${last_board} != ${board} || ${last_repo_file} != ${repo_file} || ${last_spec_param} != ${spec_param} ]]; then
rm -rf rootfs
build_rootfs build_rootfs
mk_rootfsimg mk_rootfsimg
fi fi
fi fi
else else
rm -rf rootfs
build_rootfs build_rootfs
mk_rootfsimg mk_rootfsimg
fi fi
@ -399,4 +405,4 @@ else
mk_rootfsimg mk_rootfsimg
fi fi
LOG "The rootfs.img is generated in the ${workdir}." LOG "The rootfs.img is generated in the ${workdir}."
echo "rootfs" >> $workdir/.done echo "rootfs" >> ${workdir}/.done

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
set -e
set -x
__usage=" __usage="
Usage: build_u-boot [OPTIONS] Usage: build_u-boot [OPTIONS]
@ -19,17 +21,17 @@ help()
default_param() { default_param() {
board=firefly-rk3399 board=firefly-rk3399
workdir=$cur_dir/build workdir=${cur_dir}/build
u_boot_url="https://gitlab.arm.com/systemready/firmware-build/u-boot.git" u_boot_url="https://gitlab.arm.com/systemready/firmware-build/u-boot.git"
rk3399_bl31_url="https://github.com/rockchip-linux/rkbin/raw/master/bin/rk33/rk3399_bl31_v1.36.elf" rk3399_bl31_url="https://github.com/rockchip-linux/rkbin/raw/master/bin/rk33/rk3399_bl31_v1.36.elf"
log_dir=$workdir/log log_dir=${workdir}/log
nonfree_bin_dir=${workdir}/../bin nonfree_bin_dir=${cur_dir}/bin
make_cores=$(nproc) make_cores=$(nproc)
} }
local_param(){ local_param(){
if [ -f $workdir/.param ]; then if [ -f ${workdir}/.param ]; then
board=$(cat $workdir/.param | grep board) board=$(cat ${workdir}/.param | grep board)
board=${board:6} board=${board:6}
fi fi
} }
@ -73,14 +75,14 @@ LOG(){
} }
build_u-boot() { build_u-boot() {
cd $workdir pushd ${workdir}
if [ -d u-boot ];then if [ -d ${workdir}/u-boot ];then
cd u-boot pushd ${workdir}/u-boot
remote_url_exist=`git remote -v | grep "origin"` remote_url_exist=`git remote -v | grep "origin"`
remote_url=`git ls-remote --get-url origin` remote_url=`git ls-remote --get-url origin`
popd
if [[ ${remote_url_exist} = "" || ${remote_url} != ${u_boot_url} ]]; then if [[ ${remote_url_exist} = "" || ${remote_url} != ${u_boot_url} ]]; then
cd ../ rm -rf ${workdir}/u-boot
rm -rf $workdir/u-boot
git clone --depth=1 -b ${u_boot_ver} ${u_boot_url} git clone --depth=1 -b ${u_boot_ver} ${u_boot_url}
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
LOG "clone u-boot done." LOG "clone u-boot done."
@ -93,8 +95,9 @@ build_u-boot() {
git clone --depth=1 -b ${u_boot_ver} ${u_boot_url} git clone --depth=1 -b ${u_boot_ver} ${u_boot_url}
LOG "clone u-boot done." LOG "clone u-boot done."
fi fi
cd $workdir/u-boot popd
if [[ -f $workdir/u-boot/u-boot.itb && -f $workdir/u-boot/idbloader.img ]];then pushd ${workdir}/u-boot
if [[ -f ${workdir}/u-boot/u-boot.itb && -f ${workdir}/u-boot/idbloader.img ]];then
LOG "u-boot is the latest" LOG "u-boot is the latest"
else else
if [ -f bl31.elf ];then rm bl31.elf; fi if [ -f bl31.elf ];then rm bl31.elf; fi
@ -116,23 +119,24 @@ build_u-boot() {
ERROR "make u-boot failed!" ERROR "make u-boot failed!"
exit 2 exit 2
fi fi
popd
} }
use_prebuild_u-boot() { use_prebuild_u-boot() {
if [ -d $workdir/u-boot ]; then if [ -d ${workdir}/u-boot ]; then
rm -rf $workdir/u-boot rm -rf ${workdir}/u-boot
fi fi
mkdir $workdir/u-boot mkdir ${workdir}/u-boot
if [[ "x${platform}" == "xrockchip" ]]; then if [[ "x${platform}" == "xrockchip" ]]; then
cp ${local_uboot_dir}/* $workdir/u-boot cp ${local_uboot_dir}/* ${workdir}/u-boot
elif [[ "x${platform}" == "xphytium" ]]; then elif [[ "x${platform}" == "xphytium" ]]; then
cp ${local_uboot_dir}/fip-all-sd-boot.bin $workdir/u-boot cp ${local_uboot_dir}/fip-all-sd-boot.bin ${workdir}/u-boot
mkenvimage -s 0x1000 -o $workdir/u-boot/env.bin ${local_uboot_dir}/env.txt mkenvimage -s 0x1000 -o ${workdir}/u-boot/env.bin ${local_uboot_dir}/env.txt
dd if=$workdir/u-boot/env.bin of=$workdir/u-boot/fip-all-sd-boot.bin bs=1k seek=1472 conv=notrunc dd if=${workdir}/u-boot/env.bin of=${workdir}/u-boot/fip-all-sd-boot.bin bs=1k seek=1472 conv=notrunc
elif [[ "x${platform}" == "xallwinner" ]]; then elif [[ "x${platform}" == "xallwinner" ]]; then
cp ${local_uboot_dir}/* $workdir/u-boot cp ${local_uboot_dir}/* ${workdir}/u-boot
else else
echo "target u-boot can not found!" echo "target u-boot can not found!"
exit 2 exit 2
@ -156,24 +160,28 @@ else
LOG "You are running this script on a ${host_arch} mechine, progress...." LOG "You are running this script on a ${host_arch} mechine, progress...."
fi fi
if [ ! -d $workdir ]; then if [ ! -d ${workdir} ]; then
mkdir $workdir mkdir ${workdir}
fi fi
source $cur_dir/boards/${board}.conf source ${cur_dir}/boards/${board}.conf
if [ ! -d ${log_dir} ];then mkdir -p ${log_dir}; fi if [ ! -d ${log_dir} ];then mkdir -p ${log_dir}; fi
if [ ! -f $workdir/.done ];then if [ ! -f ${workdir}/.done ];then
touch $workdir/.done touch ${workdir}/.done
fi fi
sed -i 's/u-boot//g' $workdir/.done sed -i 's/u-boot//g' ${workdir}/.done
LOG "build u-boot..." LOG "build u-boot..."
if [ "x$ubootconfig" == "xnone" ]; then if [ "x${board}" == "xraspberrypi" ]; then
use_prebuild_u-boot LOG "Skip build u-boot for Raspberry Pi."
else else
build_u-boot if [ "x$ubootconfig" == "x" ]; then
use_prebuild_u-boot
else
build_u-boot
fi
LOG "The bootloader files are generated in the ${workdir}/u-boot."
fi fi
LOG "The bootloader files are generated in the ${workdir}/u-boot." echo "u-boot" >> ${workdir}/.done
echo "u-boot" >> $workdir/.done

View File

@ -0,0 +1,61 @@
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="rpivid-*", GROUP="video", MODE="0660"
KERNEL=="vcsm-cma", GROUP="video", MODE="0660"
SUBSYSTEM=="dma_heap", GROUP="video", MODE="0660"
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"
SUBSYSTEM=="pwm*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/pwm && chmod -R 770 /sys/class/pwm;\
chown -R root:gpio /sys/devices/platform/soc/*.pwm/pwm/pwmchip* && chmod -R 770 /sys/devices/platform/soc/*.pwm/pwm/pwmchip*\
'"
KERNEL=="ttyAMA0", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $$ALIASES/uart0 $$ALIASES/serial0; then \
echo 0;\
elif cmp -s $$ALIASES/uart0 $$ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi\
'", SYMLINK+="serial%c"
KERNEL=="ttyAMA1", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if [ -e /dev/ttyAMA0 ]; then \
exit 1; \
elif cmp -s $$ALIASES/uart0 $$ALIASES/serial0; then \
echo 0;\
elif cmp -s $$ALIASES/uart0 $$ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi\
'", SYMLINK+="serial%c"
KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $$ALIASES/uart1 $$ALIASES/serial0; then \
echo 0; \
elif cmp -s $$ALIASES/uart1 $$ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi \
'", SYMLINK+="serial%c"
ACTION=="add", SUBSYSTEM=="vtconsole", KERNEL=="vtcon1", RUN+="/bin/sh -c '\
if echo RPi-Sense FB | cmp -s /sys/class/graphics/fb0/name; then \
echo 0 > /sys$devpath/bind; \
fi; \
'"

View File

@ -0,0 +1 @@
../configs/Dockerfile

View File

@ -0,0 +1,13 @@
FROM openeuler-20.03-lts-sp1:latest
RUN dnf clean expire-cache
RUN dnf -y install cmake gdb gcc gcc-c++ libstdc++-static ncurses ncurses-devel make python bash coreutils && \
dnf -y clean all
RUN dnf -y install module-init-tools git openssl-devel bc bison flex dnf-plugins-core dosfstools parted wget device-mapper-multipath grep xz kpartx
RUN dnf -y install rsync passwd diffutils
ENV SHELL=/bin/bash
ENTRYPOINT ["/bin/bash", "/work/build-image.sh"]

View File

@ -0,0 +1,32 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: raspberrypi-sys-mods
Source: https://github.com/RPi-Distro/raspberrypi-sys-mods
Files: *
Copyright: 2015 Raspberry Pi Foundation
License: BSD-3-Clause
License: BSD-3-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HOLDERS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

53
scripts/configs-rpi/chroot.sh Executable file
View File

@ -0,0 +1,53 @@
#!/bin/bash
systemctl enable sshd
systemctl enable systemd-timesyncd
systemctl enable hciuart
systemctl enable haveged
echo openEuler > /etc/hostname
echo "openeuler" | passwd --stdin root
useradd -m -G "wheel" -s "/bin/bash" pi
echo "raspberry" | passwd --stdin pi
if [ -f /usr/share/zoneinfo/Asia/Shanghai ]; then
if [ -f /etc/localtime ]; then
rm -f /etc/localtime
fi
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
fi
if [ -f /etc/rc.d/rc.local ]; then
chmod +x /etc/rc.d/rc.local
fi
if [ "x$1" == "xxfce" ]; then
echo "user-session=xfce" >> /etc/lightdm/lightdm.conf.d/60-lightdm-gtk-greeter.conf
sed -i -e 's/^background=/#background=/' /etc/lightdm/lightdm-gtk-greeter.conf
sed -i -e '/^#background=/cbackground=/usr/share/backgrounds/xfce/xfce-blue.jpg' /etc/lightdm/lightdm-gtk-greeter.conf
elif [ "x$1" == "xdde" ]; then
if id openeuler; then
userdel -r openeuler
fi
fi
cd /etc/rc.d/init.d
chmod +x extend-root.sh
chkconfig --add extend-root.sh
chkconfig extend-root.sh on
cd -
ln -s /lib/firmware /etc/firmware
if [ -f /etc/locale.conf ]; then
sed -i -e "s/^LANG/#LANG/" /etc/locale.conf
fi
if [ "x$1" == "xxfce" ] || [ "x$1" == "xukui" ] || [ "x$1" == "xdde" ] || [ "x$1" == "xgnome" ] || [ "x$1" == "xdevstation" ]; then
echo 'LANG="zh_CN.UTF-8"' >> /etc/locale.conf
cat << EOF > /etc/X11/xorg.conf.d/99-vc4.conf
Section "OutputClass"
Identifier "vc4"
MatchDriver "vc4"
Driver "modesetting"
Option "PrimaryGPU" "true"
EndSection
EOF
systemctl set-default graphical.target
else
echo 'LANG="en_US.utf8"' >> /etc/locale.conf
fi
if [ "x$1" == "xgnome" ] || [ "x$1" == "xdevstation" ]; then
systemctl enable gdm
fi

View File

@ -0,0 +1,51 @@
# For more options and information see
# http://rptl.io/configtxt
# Some settings may impact device functionality. See link above for details
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
# Additional overlays and parameters are documented
# /boot/firmware/overlays/README
# Automatically load overlays for detected cameras
camera_auto_detect=1
# Automatically load overlays for detected DSI displays
display_auto_detect=1
# Automatically load initramfs files, if found
auto_initramfs=1
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2
# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1
# Run in 64-bit mode
arm_64bit=1
# Disable compensation for displays with overscan
disable_overscan=1
# Run as fast as firmware / board allows
arm_boost=1
[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1
[cm5]
dtoverlay=dwc2,dr_mode=host
[all]

View File

@ -0,0 +1,49 @@
#!/bin/bash
# chkconfig: - 99 10
# description: extend root
set -e
extend_root(){
ROOT_PART="$(findmnt / -o source -n)" # /dev/mmcblk0p3
ROOT_DEV="/dev/$(lsblk -no pkname "$ROOT_PART")" # /dev/mmcblk0
PART_NUM="$(echo "$ROOT_PART" | grep -o "[[:digit:]]*$")" # 3
PART_INFO=$(parted "$ROOT_DEV" -ms unit s p)
# BYT;
# /dev/mmcblk0:31116288s:sd/mmc:512:512:msdos:SD SC16G:;
# 1:8192s:593919s:585728s:fat16::boot, lba;
# 2:593920s:1593343s:999424s:linux-swap(v1)::;
# 3:1593344s:31116287s:29522944s:ext4::;
LAST_PART_NUM=$(echo "$PART_INFO" | tail -n 1 | cut -f 1 -d:) # 3
PART_START=$(echo "$PART_INFO" | grep "^${PART_NUM}" | cut -f 2 -d: | sed 's/[^0-9]//g') # 1593344
PART_END=$(echo "$PART_INFO" | grep "^${PART_NUM}" | cut -f 3 -d: | sed 's/[^0-9]//g') # XXXX < 31116288
ROOT_END=$(echo "$PART_INFO" | grep "^/dev"| cut -f 2 -d: | sed 's/[^0-9]//g') # 31116288
((ROOT_END--)) # 31116287
if [ $PART_END -lt $ROOT_END ]; then
fdisk "$ROOT_DEV" <<EOF
p
d
$PART_NUM
n
p
$PART_NUM
$PART_START
p
w
EOF
resize2fs $ROOT_PART
echo "Extend $ROOT_PART finished." >> /var/log/extend-root.log
else
echo "Already the largest! Do not need extend any more!" >> /var/log/extend-root.log
fi
return 0
}
if extend_root; then
rm -f /etc/rc.d/init.d/extend-root.sh
else
echo "Fail to root!" >> /var/log/extend-root.log
fi

View File

@ -0,0 +1,2 @@
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

View File

@ -0,0 +1 @@
../configs/ifcfg-eth0

View File

@ -0,0 +1 @@
../configs/resolv.conf

View File

@ -0,0 +1,27 @@
dnf
alsa-utils
haveged
wpa_supplicant
vim
net-tools
iproute
iputils
NetworkManager
NetworkManager-wifi
NetworkManager-wwan
NetworkManager-bluetooth
NetworkManager-ovs
NetworkManager-ppp
openssh-server
openssh-clients
passwd
hostname
bluez
pulseaudio-module-bluetooth
parted
raspberrypi-firmware
raspberrypi-bluetooth
sudo
bc
systemd-timesyncd
openEuler-repos

View File

@ -0,0 +1,30 @@
dnf
alsa-utils
haveged
wpa_supplicant
vim
net-tools
iproute
iputils
NetworkManager
NetworkManager-wifi
NetworkManager-wwan
NetworkManager-bluetooth
NetworkManager-ovs
NetworkManager-ppp
openssh-server
openssh-clients
passwd
hostname
bluez
pulseaudio-module-bluetooth
parted
raspberrypi-firmware
raspberrypi-bluetooth
sudo
dde
ibus-libpinyin
firefox
bc
systemd-timesyncd
openEuler-repos

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,194 @@
dnf
alsa-utils
haveged
wpa_supplicant
vim
net-tools
iproute
iputils
NetworkManager
NetworkManager-wifi
NetworkManager-wwan
NetworkManager-bluetooth
NetworkManager-ovs
NetworkManager-ppp
openssh-server
openssh-clients
passwd
hostname
bluez
pulseaudio-module-bluetooth
parted
raspberrypi-firmware
raspberrypi-bluetooth
sudo
firefox
bc
systemd-timesyncd
dejavu-fonts
liberation-fonts
gnu-*-fonts
google-*-fonts
xorg-x11-apps
xorg-x11-drivers
xorg-x11-drv-ati
xorg-x11-drv-dummy
xorg-x11-drv-evdev
xorg-x11-drv-fbdev
xorg-x11-drv-intel
xorg-x11-drv-libinput
xorg-x11-drv-nouveau
xorg-x11-drv-qxl
xorg-x11-drv-synaptics-legacy
xorg-x11-drv-v4l
xorg-x11-drv-vesa
xorg-x11-drv-vmware
xorg-x11-drv-wacom
xorg-x11-fonts
xorg-x11-fonts-others
xorg-x11-font-utils
xorg-x11-server
xorg-x11-server-utils
xorg-x11-server-Xephyr
xorg-x11-server-Xspice
xorg-x11-util-macros
xorg-x11-utils
xorg-x11-xauth
xorg-x11-xbitmaps
xorg-x11-xinit
xorg-x11-xkb-utils
adwaita-icon-theme
atk
atkmm
at-spi2-atk
at-spi2-core
baobab
abattis-cantarell-fonts
cheese
clutter
clutter-gst3
clutter-gtk
cogl
dconf
dconf-editor
devhelp
eog
epiphany
evince
evolution-data-server
file-roller
folks
gcab
gcr
gdk-pixbuf2
gdm
gedit
geocode-glib
gfbgraph
gjs
glib2
glibmm24
glib-networking
gmime30
gnome-autoar
gnome-backgrounds
gnome-bluetooth
gnome-boxes
gnome-builder
gnome-calculator
gnome-calendar
gnome-characters
gnome-clocks
gnome-color-manager
gnome-contacts
gnome-control-center
gnome-desktop3
gnome-disk-utility
gnome-font-viewer
gnome-getting-started-docs
gnome-initial-setup
gnome-keyring
gnome-logs
gnome-menus
gnome-music
gnome-online-accounts
gnome-online-miners
gnome-photos
gnome-remote-desktop
gnome-screenshot
gnome-session
gnome-settings-daemon
gnome-shell
gnome-shell-extensions
gnome-software
gnome-system-monitor
gnome-terminal
gnome-tour
gnome-user-docs
gnome-user-share
gnome-video-effects
gnome-weather
gobject-introspection
gom
grilo
grilo-plugins
gsettings-desktop-schemas
gsound
gspell
gssdp
gtk3
gtk4
gtk-doc
gtkmm30
gtksourceview4
gtk-vnc2
gupnp
gupnp-av
gupnp-dlna
gvfs
json-glib
libchamplain
libdazzle
libgdata
libgee
libgnomekbd
libgsf
libgtop2
libgweather
libgxps
libhandy
libmediaart
libnma
libnotify
libpeas
librsvg2
libsecret
libsigc++20
libsoup
mm-common
mutter
nautilus
orca
pango
pangomm
libphodav
python3-pyatspi
python3-gobject
rest
rygel
simple-scan
sushi
sysprof
tepl
totem
totem-pl-parser
tracker3
tracker3-miners
vala
vte291
yelp
yelp-tools
yelp-xsl
zenity
ibus-libpinyin
openEuler-repos

View File

@ -0,0 +1,29 @@
dnf
alsa-utils
haveged
wpa_supplicant
vim
net-tools
iproute
iputils
NetworkManager
NetworkManager-wifi
NetworkManager-wwan
NetworkManager-bluetooth
NetworkManager-ovs
NetworkManager-ppp
openssh-server
openssh-clients
passwd
hostname
bluez
pulseaudio-module-bluetooth
parted
raspberrypi-firmware
raspberrypi-bluetooth
sudo
ukui
firefox
bc
systemd-timesyncd
openEuler-repos

View File

@ -0,0 +1,46 @@
dnf
alsa-utils
haveged
wpa_supplicant
vim
net-tools
iproute
iputils
NetworkManager
NetworkManager-wifi
NetworkManager-wwan
NetworkManager-bluetooth
NetworkManager-ovs
NetworkManager-ppp
openssh-server
openssh-clients
passwd
hostname
bluez
pulseaudio-module-bluetooth
parted
raspberrypi-firmware
raspberrypi-bluetooth
sudo
dejavu-fonts
liberation-fonts
gnu-*-fonts
google-*-fonts
xorg-*
xfwm4
xfdesktop
xfce4-*
xfce4-*-plugin
network-manager-applet
*fonts
fcitx
fcitx-qt5
fcitx-cloudpinyin
fcitx-sunpinyin
fcitx-configtool
lightdm
lightdm-gtk
firefox
bc
systemd-timesyncd
openEuler-repos

View File

@ -0,0 +1,7 @@
#!/bin/bash
echo 'openeuler' | passwd --stdin root
echo openEuler > /etc/hostname
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
chkconfig --add extend-root.sh
chkconfig extend-root.sh on

View File

View File

@ -0,0 +1,16 @@
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
UUID=851a6f36-e65c-3a43-8f4a-78fd0fc09dc9
ONBOOT=yes
AUTOCONNECT_PRIORITY=-999
DEVICE=eth0

View File

@ -0,0 +1,3 @@
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 114.114.114.114

6
scripts/gen_image-x86_64.sh Normal file → Executable file
View File

@ -1,8 +1,10 @@
#!/bin/bash #!/bin/bash
set -e
set -x
__usage=" __usage="
Usage: gen_image [OPTIONS] Usage: gen_image [OPTIONS]
Generate Rockchip bootable image. Generate openEuler bootable image.
The target compressed bootable images will be generated in the build/YYYY-MM-DD folder of the directory where the gen_image.sh script is located. The target compressed bootable images will be generated in the build/YYYY-MM-DD folder of the directory where the gen_image.sh script is located.
Options: Options:
@ -79,4 +81,4 @@ default_param
prepare_bin prepare_bin
prepare_img prepare_img
make_img make_img
echo "image" >> $workdir/.done echo "image" >> ${workdir}/.done

View File

@ -1,12 +1,14 @@
#!/bin/bash #!/bin/bash
set -e
set -x
__usage=" __usage="
Usage: gen_image [OPTIONS] Usage: gen_image [OPTIONS]
Generate Rockchip bootable image. Generate openEuler bootable image.
The target compressed bootable images will be generated in the build/YYYY-MM-DD folder of the directory where the gen_image.sh script is located. The target compressed bootable images will be generated in the build/YYYY-MM-DD folder of the directory where the gen_image.sh script is located.
Options: Options:
-n, --name IMAGE_NAME The Rockchip image name to be built. -n, --name IMAGE_NAME The openEuler image name to be built.
--board BOARD_CONFIG Required! The config of target board in the boards folder, which defaults to firefly-rk3399. --board BOARD_CONFIG Required! The config of target board in the boards folder, which defaults to firefly-rk3399.
-h, --help Show command help. -h, --help Show command help.
" "
@ -24,6 +26,8 @@ default_param() {
board=firefly-rk3399 board=firefly-rk3399
soc_name=rk3399 soc_name=rk3399
platform=rockchip platform=rockchip
nonfree_bin_dir=${cur_dir}/bin
config_dir=${cur_dir}/configs
rootfs_dir=${workdir}/rootfs rootfs_dir=${workdir}/rootfs
boot_dir=${workdir}/boot boot_dir=${workdir}/boot
uboot_dir=${workdir}/u-boot uboot_dir=${workdir}/u-boot
@ -47,6 +51,9 @@ parseargs()
shift shift
elif [ "x$1" == "x-n" -o "x$1" == "x--name" ]; then elif [ "x$1" == "x-n" -o "x$1" == "x--name" ]; then
name=`echo $2` name=`echo $2`
if [ "x${name:0-4}" == "x.img" ]; then
name=${name::-4}
fi
shift shift
shift shift
elif [ "x$1" == "x--board" ]; then elif [ "x$1" == "x--board" ]; then
@ -122,15 +129,13 @@ LOG(){
} }
make_img(){ make_img(){
cd $workdir if [[ -f ${workdir}/boot.img && $(cat ${workdir}/.done | grep bootimg) == "bootimg" ]];then
if [[ -f $workdir/boot.img && $(cat $workdir/.done | grep bootimg) == "bootimg" ]];then
LOG "boot.img check done." LOG "boot.img check done."
else else
ERROR "boot.img check failed, please re-run build_boot.sh." ERROR "boot.img check failed, please re-run build_boot.sh."
exit 2 exit 2
fi fi
if [[ -f $workdir/rootfs.img && $(cat $workdir/.done | grep rootfs) == "rootfs" ]];then if [[ -f ${workdir}/rootfs.img && $(cat ${workdir}/.done | grep rootfs) == "rootfs" ]];then
LOG "rootfs.img check done." LOG "rootfs.img check done."
else else
ERROR "rootfs.img check failed, please re-run build_rootfs.sh." ERROR "rootfs.img check failed, please re-run build_rootfs.sh."
@ -143,16 +148,25 @@ make_img(){
size=$(($size+1100)) size=$(($size+1100))
losetup -D losetup -D
img_file=${workdir}/${name}.img img_file=${workdir}/${name}.img
LOG create ${img_file} size of ${size}MiB
dd if=/dev/zero of=${img_file} bs=1MiB count=$size status=progress && sync dd if=/dev/zero of=${img_file} bs=1MiB count=$size status=progress && sync
LOG "create ${part_table} partition table." LOG "create ${part_table} partition table."
parted ${img_file} mklabel ${part_table} mkpart primary fat32 32768s 524287s if [ "x${board}" == "xraspberrypi" ]; then
section1_start=16384
section1_end=1064959
else
section1_start=32768
section1_end=524287
fi
parted ${img_file} mklabel ${part_table} mkpart primary fat32 ${section1_start}s ${section1_end}s
parted ${img_file} -s set 1 boot on parted ${img_file} -s set 1 boot on
parted ${img_file} mkpart primary ext4 524288s 100% parted ${img_file} mkpart primary ext4 $(($section1_end+1))s 100%
device=`losetup -f --show -P ${img_file}` device=`losetup -f --show -P ${img_file}`
LOG "after losetup: ${device}"
trap 'LOSETUP_D_IMG' EXIT trap 'LOSETUP_D_IMG' EXIT
LOG "image ${img_file} created and mounted as ${device}"
kpartx -va ${device} kpartx -va ${device}
loopX=${device##*\/} loopX=${device##*\/}
partprobe ${device} partprobe ${device}
@ -170,25 +184,40 @@ make_img(){
if [ -d ${rootfs_dir} ];then rm -rf ${rootfs_dir}; fi if [ -d ${rootfs_dir} ];then rm -rf ${rootfs_dir}; fi
mkdir ${rootfs_dir} mkdir ${rootfs_dir}
mount $workdir/rootfs.img ${rootfs_dir} mount ${workdir}/rootfs.img ${rootfs_dir}
if [ -d ${boot_dir} ];then rm -rf ${boot_dir}; fi if [ -d ${boot_dir} ];then rm -rf ${boot_dir}; fi
mkdir ${boot_dir} mkdir ${boot_dir}
mount $workdir/boot.img ${boot_dir} mount ${workdir}/boot.img ${boot_dir}
cp -rfp ${boot_dir}/* ${boot_mnt} || LOG "${boot_dir} is empty."
cp -rfp ${boot_dir}/* ${boot_mnt}
line=$(blkid | grep $rootp) line=$(blkid | grep $rootp)
uuid=${line#*UUID=\"} if [ "x${board}" == "xraspberrypi" ]; then
uuid=${uuid%%\"*} if [ -d ${rootfs_dir}/boot/grub2 ]; then
sed -i "s|UUID=614e0000-0000-4b53-8000-1d28000054a9|UUID=${uuid}|g" ${boot_mnt}/extlinux/extlinux.conf rm -rf ${rootfs_dir}/boot/grub2
fi
cp -rfp ${rootfs_dir}/boot/* ${boot_mnt}/ || LOG "no file in ${rootfs_dir}/boot/"
cp ${config_dir}/config.txt ${boot_mnt}/
partuuid=${line#*PARTUUID=\"}
partuuid=${partuuid%%\"*}
echo "console=serial0,115200 console=tty1 root=PARTUUID=${partuuid} rootfstype=ext4 elevator=deadline rootwait net.ifnames=0" > ${boot_mnt}/cmdline.txt
else
uuid=${line#*UUID=\"}
uuid=${uuid%%\"*}
sed -i "s|UUID=614e0000-0000-4b53-8000-1d28000054a9|UUID=${uuid}|g" ${boot_mnt}/extlinux/extlinux.conf
fi
rsync -avHAXq ${rootfs_dir}/* ${root_mnt} rsync -avHAXq ${rootfs_dir}/* ${root_mnt}
sync sync
sleep 10 sleep 10
LOG "copy openEuler-root done." LOG "copy openEuler-root done."
if [ -d ${root_mnt}/lib/modules ];then rm -rf ${root_mnt}/lib/modules; fi if [ -d ${workdir}/kernel/kernel-modules/lib/modules ]; then
cp -rfp $workdir/kernel/kernel-modules/lib/modules ${root_mnt}/lib if [ -d ${root_mnt}/lib/modules ];then rm -rf ${root_mnt}/lib/modules; fi
LOG "install kernel modules done." cp -rfp ${workdir}/kernel/kernel-modules/lib/modules ${root_mnt}/lib
LOG "install kernel modules done."
fi
umount $rootp umount $rootp
umount $bootp umount $bootp
@ -230,7 +259,7 @@ make_img(){
ERROR "allwinner u-boot file can not be found!" ERROR "allwinner u-boot file can not be found!"
exit 2 exit 2
fi fi
else elif [ "${platform}" != "broadcom" ];then
echo "Unsupported platform" echo "Unsupported platform"
fi fi
@ -241,18 +270,12 @@ make_img(){
} }
outputd(){ outputd(){
cd $workdir if [ -d ${outputdir} ];then
find ${outputdir} -name "${name}.img" -o -name "${name}.tar.gz" -o -name "${name}.img.xz" -delete
if [ -f $outputdir ];then
img_name_check=$(ls $outputdir | grep $name)
if [ "x$img_name_check" != "x" ]; then
rm ${name}.img*
rm ${name}.tar.gz*
fi
else else
mkdir -p $outputdir mkdir -p $outputdir
fi fi
mv ${name}.img ${outputdir} mv ${workdir}/${name}.img ${outputdir}
LOG "xz openEuler image begin..." LOG "xz openEuler image begin..."
xz ${outputdir}/${name}.img xz ${outputdir}/${name}.img
if [ ! -f ${outputdir}/${name}.img.xz ]; then if [ ! -f ${outputdir}/${name}.img.xz ]; then
@ -264,11 +287,11 @@ outputd(){
if [[ "x$soc_name" == "xrk3399" && "x$platform" == "xrockchip" ]]; then if [[ "x$soc_name" == "xrk3399" && "x$platform" == "xrockchip" ]]; then
LOG "tar openEuler image begin..." LOG "tar openEuler image begin..."
cp $workdir/../bin/rk3399_loader.bin $workdir cp ${nonfree_bin_dir}/rk3399_loader.bin ${workdir}
cp $workdir/../bin/rk3399_parameter.gpt $workdir cp ${nonfree_bin_dir}/rk3399_parameter.gpt ${workdir}
cp $workdir/u-boot/idbloader.img $workdir cp ${workdir}/u-boot/idbloader.img ${workdir}
cp $workdir/u-boot/u-boot.itb $workdir cp ${workdir}/u-boot/u-boot.itb ${workdir}
cd $workdir pushd ${workdir}
tar -zcvf ${outputdir}/${name}.tar.gz \ tar -zcvf ${outputdir}/${name}.tar.gz \
rk3399_loader.bin \ rk3399_loader.bin \
rk3399_parameter.gpt \ rk3399_parameter.gpt \
@ -276,24 +299,27 @@ outputd(){
u-boot.itb \ u-boot.itb \
boot.img \ boot.img \
rootfs.img rootfs.img
popd
if [ ! -f ${outputdir}/${name}.tar.gz ]; then if [ ! -f ${outputdir}/${name}.tar.gz ]; then
ERROR "tar openEuler image failed!" ERROR "tar openEuler image failed!"
exit 2 exit 2
else else
LOG "tar openEuler image success." LOG "tar openEuler image success."
fi fi
rm $workdir/rk3399_loader.bin rm ${workdir}/rk3399_loader.bin
rm $workdir/rk3399_parameter.gpt rm ${workdir}/rk3399_parameter.gpt
rm $workdir/idbloader.img rm ${workdir}/idbloader.img
rm $workdir/u-boot.itb rm ${workdir}/u-boot.itb
cd $outputdir pushd $outputdir
sha256sum ${name}.tar.gz >> ${name}.tar.gz.sha256sum sha256sum ${name}.tar.gz >> ${name}.tar.gz.sha256sum
popd
fi fi
cd $outputdir pushd $outputdir
sha256sum ${name}.img.xz >> ${name}.img.xz.sha256sum sha256sum ${name}.img.xz >> ${name}.img.xz.sha256sum
popd
LOG "The target images are generated in the ${outputdir}." LOG "The target images: ${outputdir}/${name}.img.xz."
} }
set -e set -e
@ -301,18 +327,22 @@ cur_dir=$(cd $(dirname $0);pwd)
default_param default_param
parseargs "$@" || help $? parseargs "$@" || help $?
if [ ! -d $workdir ]; then if [ "x${board}" == "xraspberrypi" ]; then
mkdir $workdir config_dir=${cur_dir}/configs-rpi
fi fi
source $cur_dir/boards/${board}.conf if [ ! -d ${workdir} ]; then
mkdir ${workdir}
fi
source ${cur_dir}/boards/${board}.conf
if [ ! -d ${log_dir} ];then mkdir -p ${log_dir}; fi if [ ! -d ${log_dir} ];then mkdir -p ${log_dir}; fi
if [ ! -f $workdir/.done ];then if [ ! -f ${workdir}/.done ];then
touch $workdir/.done touch ${workdir}/.done
fi fi
sed -i 's/image//g' $workdir/.done sed -i 's/image//g' ${workdir}/.done
LOG "gen image..." LOG "gen image..."
make_img make_img
outputd outputd
echo "image" >> $workdir/.done echo "image" >> ${workdir}/.done