!5 修复:使用命令行传递构建框架内核配置;统一传入参数

From: @chainsx 
Reviewed-by: @jianminw 
Signed-off-by: @jianminw
This commit is contained in:
openeuler-ci-bot 2024-12-05 10:31:38 +00:00 committed by Gitee
commit 6cfff5e556
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 127 additions and 24636 deletions

View File

@ -62,7 +62,7 @@
构建镜像需执行命令: 构建镜像需执行命令:
`sudo bash build.sh -n NAME -k KERNEL_URL -b KERNEL_BRANCH -c BOARD_CONFIG -r REPO_INFO -d DTB_NAME -s SPEC` `sudo bash build.sh -n NAME -k KERNEL_URL -b KERNEL_BRANCH -u UBOOT_DEFCONFIG -c KERNEL_DEFCONFIG -r REPO_INFO -d DTB_NAME -p PLATFORM -s SPEC --cores N`
**说明: 基于 build.sh 提供的默认参数,执行 sudo bash build.sh 可构建 Firefly-RK3399 的 openEuler-20.03-LTS 镜像。** **说明: 基于 build.sh 提供的默认参数,执行 sudo bash build.sh 可构建 Firefly-RK3399 的 openEuler-20.03-LTS 镜像。**
@ -97,11 +97,15 @@
- -k https://gitee.com/openeuler/kernel.git - -k https://gitee.com/openeuler/kernel.git
- openEuler-21.09 - openEuler-21.09
4. -c, --config BOARD_CONFIG 4. -u, --ubootconfig UBOOT_DEFCONFIG
开发板对应的 defconfig 的文件名称,对应 [u-boot/configs](https://github.com/u-boot/u-boot/tree/master/configs) 下 `BOARD_CONFIG` 文件,默认为 `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可以将此项设置为 `none`
5. -r, --repo REPO_INFO 5. -c, --config KERNEL_DEFCONFIG
内核编译使用的配置文件名称或路径,默认为 `openeuler-raspi_defconfig`。如果该参数为配置文件名称,请确保该文件在内核源码的目录 arch/arm64/configs 下。
6. -r, --repo REPO_INFO
开发源 repo 文件的 URL 或者路径,也可以是开发源中资源库的 baseurl 列表。注意,如果该参数为资源库的 baseurl 列表,该参数需要使用双引号,各个 baseurl 之间以空格隔开。 开发源 repo 文件的 URL 或者路径,也可以是开发源中资源库的 baseurl 列表。注意,如果该参数为资源库的 baseurl 列表,该参数需要使用双引号,各个 baseurl 之间以空格隔开。
下面分别举例: 下面分别举例:
@ -113,15 +117,15 @@
- 资源库的 baseurl 列表,如 `http://repo.openeuler.org/openEuler-20.03-LTS/OS/aarch64/ http://repo.openeuler.org/openEuler-20.03-LTS/EPOL/aarch64/` - 资源库的 baseurl 列表,如 `http://repo.openeuler.org/openEuler-20.03-LTS/OS/aarch64/ http://repo.openeuler.org/openEuler-20.03-LTS/EPOL/aarch64/`
6. -d, --device-tree DTB_NAME 7. -d, --device-tree DTB_NAME
内核设备树中的设备名称,和开发板名称有一点区别,对应 [kernel/arch/arm64/boot/dts/rockchip](https://gitee.com/openeuler/kernel/tree/master/arch/arm64/boot/dts/rockchip) 下的 `DTB_NAME.dts` 文件,默认为 `rk3399-firefly` 内核设备树中的设备名称,和开发板名称有一点区别,对应 [kernel/arch/arm64/boot/dts/rockchip](https://gitee.com/openeuler/kernel/tree/master/arch/arm64/boot/dts/rockchip) 下的 `DTB_NAME.dts` 文件,默认为 `rk3399-firefly`
7. -p, --platform PLATFORM 8. -p, --platform PLATFORM
开发板所使用的平台目前支持的平台有rockchip、phytium默认为 `rockchip` 开发板所使用的平台目前支持的平台有rockchip、phytium默认为 `rockchip`
8. -s, --spec SPEC 9. -s, --spec SPEC
构建的镜像版本: 构建的镜像版本:
- `headless`,无图形界面版的镜像。 - `headless`,无图形界面版的镜像。
@ -132,7 +136,11 @@
默认使用 `headless` 选项。 默认使用 `headless` 选项。
9. -h, --help 10. --cores N
并行编译的数量,根据运行脚本的宿主机 CPU 实际数目设定,默认为可用的 CPU 总数。
11. -h, --help
显示帮助信息。 显示帮助信息。
@ -146,11 +154,11 @@
- openEuler-20.03-LTS构建命令如下: - openEuler-20.03-LTS构建命令如下:
`sudo bash build.sh -n openEuler-20.03-LTS-Firefly-RK3399-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-20.03-LTS -c firefly-rk3399_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS/generic.repo -d rk3399-firefly -p rockchip -s headless` `sudo bash build.sh -n openEuler-20.03-LTS-Firefly-RK3399-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-20.03-LTS -u firefly-rk3399_defconfig -c openeuler_rockchip_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS/generic.repo -d rk3399-firefly -p rockchip -s headless`
- openEuler-22.03-LTS-SP3构建命令如下 - openEuler-22.03-LTS-SP3构建命令如下
`sudo bash build.sh -n openEuler-22.03-LTS-SP3-Firefly-RK3399-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-SP3 -c firefly-rk3399_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS-SP3/generic.repo -d rk3399-firefly -p rockchip -s headless` `sudo bash build.sh -n openEuler-22.03-LTS-SP3-Firefly-RK3399-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-SP3 -u firefly-rk3399_defconfig -c openeuler_rockchip_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS-SP3/generic.repo -d rk3399-firefly -p rockchip -s headless`
2. RockPi-4A 2. RockPi-4A
@ -158,11 +166,11 @@
- openEuler-20.03-LTS构建命令如下: - openEuler-20.03-LTS构建命令如下:
`sudo bash build.sh -n openEuler-20.03-LTS-RockPi-4A-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-20.03-LTS -c rock-pi-4-rk3399_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS/generic.repo -d rk3399-rock-pi-4a -p rockchip -s headless` `sudo bash build.sh -n openEuler-20.03-LTS-RockPi-4A-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-20.03-LTS -u rock-pi-4-rk3399_defconfig -c openeuler_rockchip_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-20.03-LTS/generic.repo -d rk3399-rock-pi-4a -p rockchip -s headless`
- openEuler-22.03-LTS构建命令如下 - openEuler-22.03-LTS构建命令如下
`sudo bash build.sh -n openEuler-22.03-LTS-RockPi-4A-aarch64-alpha1 -k https://gitee.com/openeuler/kernel.git -b openEuler-22.03-LTS -c rock-pi-4-rk3399_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS/generic.repo -d rk3399-rock-pi-4a -p rockchip -s headless` `sudo bash build.sh -n openEuler-22.03-LTS-RockPi-4A-aarch64-alpha1 -k https://gitee.com/openeuler/kernel.git -b openEuler-22.03-LTS -u rock-pi-4-rk3399_defconfig -c openeuler_rockchip_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS/generic.repo -d rk3399-rock-pi-4a -p rockchip -s headless`
适用的 RK3588 开发板: 适用的 RK3588 开发板:
@ -174,23 +182,23 @@
- openEuler-22.03-LTS构建命令如下: - openEuler-22.03-LTS构建命令如下:
`sudo bash build.sh -n openEuler-22.03-RK3588-Firefly-ITX-3588J-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-RK3588 -c none -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS/generic.repo -d rk3588-firefly-itx-3588j -p rockchip -s headless` `sudo bash build.sh -n openEuler-22.03-RK3588-Firefly-ITX-3588J-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-RK3588 -u none -c openeuler_rk3588_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS/generic.repo -d rk3588-firefly-itx-3588j -p rockchip -s headless`
2. Firefly ROC-RK3588S-PC 2. Firefly ROC-RK3588S-PC
已测试的版本如下: 已测试的版本如下:
- openEuler-22.03-LTS构建命令如下: - openEuler-22.03-LTS-SP3,构建命令如下:
`sudo bash build.sh -n openEuler-22.03-LTS-Station-M3-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-RK3588 -c none -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS/generic.repo -d rk3588s-roc-pc -p rockchip -s headless` `sudo bash build.sh -n openEuler-22.03-LTS-SP3-Station-M3-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-SP3 -u none -c openeuler_rockchip_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS-SP3/generic.repo -d rk3588s-roc-pc -p rockchip -s headless`
3. Radxa Rock-5B 3. Radxa Rock-5B
已测试的版本如下: 已测试的版本如下:
- openEuler-22.03-LTS构建命令如下: - openEuler-22.03-LTS-SP3,构建命令如下:
`sudo bash build.sh -n openEuler-22.03-LTS-Rock5B-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-RK3588 -c none -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS/generic.repo -d rk3588-rock-5b -p rockchip -s headless` `sudo bash build.sh -n openEuler-22.03-LTS-SP3-Rock5B-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-SP3 -u none -c openeuler_rockchip_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS-SP3/generic.repo -d rk3588-rock-5b -p rockchip -s headless`
适用的 RK356X 开发板: 适用的 RK356X 开发板:
@ -202,15 +210,15 @@
- openEuler-22.03-LTS-SP2构建命令如下: - openEuler-22.03-LTS-SP2构建命令如下:
`sudo bash build.sh -n openEuler-22.03-LTS-SP2-Station-M2-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-SP2 -c none -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS-SP2/generic.repo -d rk3566-roc-pc -p rockchip -s headless` `sudo bash build.sh -n openEuler-22.03-LTS-SP2-Station-M2-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-SP2 -u none -c openeuler_rockchip_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS-SP2/generic.repo -d rk3566-roc-pc -p rockchip -s headless`
- openEuler-22.03-LTS-SP3构建命令如下: - openEuler-22.03-LTS-SP3构建命令如下:
`sudo bash build.sh -n openEuler-22.03-LTS-SP3-Station-M2-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-SP3 -c none -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS-SP3/generic.repo -d rk3566-roc-pc -p rockchip -s headless` `sudo bash build.sh -n openEuler-22.03-LTS-SP3-Station-M2-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-SP3 -u none -c openeuler_rockchip_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS-SP3/generic.repo -d rk3566-roc-pc -p rockchip -s headless`
- openEuler-24.03-LTS构建命令如下: - openEuler-24.03-LTS构建命令如下:
`sudo bash build.sh -n openEuler-24.03-LTS-Station-M2-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-24.03-LTS -c none -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-24.03-LTS/generic.repo -d rk3566-roc-pc -p rockchip -s headless` `sudo bash build.sh -n openEuler-24.03-LTS-Station-M2-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-24.03-LTS -u none -c openeuler_rockchip_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-24.03-LTS/generic.repo -d rk3566-roc-pc -p rockchip -s headless`
2. Firefly ROC-RK3568-PC-SE 2. Firefly ROC-RK3568-PC-SE
@ -218,11 +226,11 @@
- openEuler-22.03-LTS-SP2构建命令如下: - openEuler-22.03-LTS-SP2构建命令如下:
`sudo bash build.sh -n openEuler-22.03-LTS-SP2-ROC-RK3568-PC-SE-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-SP2 -c none -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS-SP2/generic.repo -d rk3568-roc-pc-se -p rockchip -s headless` `sudo bash build.sh -n openEuler-22.03-LTS-SP2-ROC-RK3568-PC-SE-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-SP2 -u none -c openeuler_rockchip_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS-SP2/generic.repo -d rk3568-roc-pc-se -p rockchip -s headless`
- openEuler-22.03-LTS-SP3构建命令如下: - openEuler-22.03-LTS-SP3构建命令如下:
`sudo bash build.sh -n openEuler-22.03-LTS-SP3-ROC-RK3568-PC-SE-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-SP3 -c none -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS-SP3/generic.repo -d rk3568-roc-pc-se -p rockchip -s headless` `sudo bash build.sh -n openEuler-22.03-LTS-SP3-ROC-RK3568-PC-SE-aarch64-alpha1 -k https://gitee.com/openeuler/rockchip-kernel.git -b openEuler-22.03-LTS-SP3 -u none -c openeuler_rockchip_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS-SP3/generic.repo -d rk3568-roc-pc-se -p rockchip -s headless`
适用的 Phytium 开发板: 适用的 Phytium 开发板:
@ -234,11 +242,11 @@
- openEuler-22.03-LTS-SP3构建命令如下: - openEuler-22.03-LTS-SP3构建命令如下:
`sudo bash build.sh -n openEuler-22.03-LTS-PhytiumPi-4GB-aarch64-alpha1 -k https://gitee.com/openeuler/phytium-kernel.git -b openEuler-22.03-LTS-Phytium -c none -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS/generic.repo -d phytiumpi_firefly -p phytium -s headless` `sudo bash build.sh -n openEuler-22.03-LTS-PhytiumPi-4GB-aarch64-alpha1 -k https://gitee.com/openeuler/phytium-kernel.git -b openEuler-22.03-LTS-Phytium -u none -c phytium_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-22.03-LTS/generic.repo -d phytiumpi_firefly -p phytium -s headless`
- openEuler-24.03-LTS构建命令如下: - openEuler-24.03-LTS构建命令如下:
`sudo bash build.sh -n openEuler-24.03-LTS-PhytiumPi-4GB-aarch64-alpha1 -k https://gitee.com/openeuler/phytium-kernel.git -b openEuler-24.03-LTS-Phytium -c none -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-24.03-LTS/generic.repo -d phytiumpi_firefly -p phytium -s headless` `sudo bash build.sh -n openEuler-24.03-LTS-PhytiumPi-4GB-aarch64-alpha1 -k https://gitee.com/openeuler/phytium-kernel.git -b openEuler-24.03-LTS-Phytium -u none -c phytium_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-24.03-LTS/generic.repo -d phytiumpi_firefly -p phytium -s headless`
### 顺序构建 ### 顺序构建

View File

@ -9,11 +9,13 @@ Options:
-n, --name IMAGE_NAME The Rockchip image name to be built. -n, --name IMAGE_NAME The Rockchip 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 BOARD_CONFIG Required! The name of target board which should be a space separated list, which defaults to firefly-rk3399_defconfig. -c, --config KERNEL_DEFCONFIG The name/path of defconfig file when compiling kernel, which defaults to openeuler_rockchip_defconfig.
-u, --ubootconfig UBOOT_DEFCONFIG Required! The name of defconfig file when compiling u-boot, which defaults to firefly-rk3399_defconfig.
-p, --platform PLATFORM Required! The platform of target board, which defaults to rockchip. -p, --platform PLATFORM Required! The platform of target board, which defaults to rockchip.
-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.
-d, --device-tree DTB_NAME Required! The device tree name of target board, which defaults to rk3399-firefly. -d, --device-tree DTB_NAME Required! The device tree name of target board, which defaults to rk3399-firefly.
-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 or the file path of rpmlist. The default is headless.
--cores N The number of cpu cores to be used during making.
-h, --help Show command help. -h, --help Show command help.
" "
@ -26,7 +28,7 @@ help()
used_param() { used_param() {
echo "" echo ""
echo "Default args" echo "Default args"
echo "CONFIG_NAME : $config" echo "KERNEL_DEFCONFIG : $default_defconfig"
echo "" echo ""
echo "DTB_NAME : $dtb_name" echo "DTB_NAME : $dtb_name"
echo "" echo ""
@ -37,7 +39,8 @@ used_param() {
} }
default_param() { default_param() {
config=firefly-rk3399_defconfig default_defconfig=openeuler_rockchip_defconfig
ubootconfig=firefly-rk3399_defconfig
dtb_name=rk3399-firefly dtb_name=rk3399-firefly
platform=rockchip platform=rockchip
branch=openEuler-20.03-LTS branch=openEuler-20.03-LTS
@ -46,6 +49,7 @@ default_param() {
workdir=$(pwd)/build workdir=$(pwd)/build
board_type=rk3399 board_type=rk3399
name=${branch}-${dtb_name}-aarch64-alpha1 name=${branch}-${dtb_name}-aarch64-alpha1
make_cores=$(nproc)
} }
save_param() { save_param() {
@ -55,7 +59,8 @@ save_param() {
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 "config=$config echo "default_defconfig=$default_defconfig
ubootconfig=$ubootconfig
dtb_name=$dtb_name dtb_name=$dtb_name
platform=$platform platform=$platform
branch=$branch branch=$branch
@ -98,7 +103,11 @@ parseargs()
shift shift
shift shift
elif [ "x$1" == "x-c" -o "x$1" == "x--config" ]; then elif [ "x$1" == "x-c" -o "x$1" == "x--config" ]; then
config=`echo $2` default_defconfig=`echo $2`
shift
shift
elif [ "x$1" == "x-u" -o "x$1" == "x--ubootconfig" ]; then
ubootconfig=`echo $2`
shift shift
shift shift
elif [ "x$1" == "x-r" -o "x$1" == "x--repo" ]; then elif [ "x$1" == "x-r" -o "x$1" == "x--repo" ]; then
@ -113,6 +122,10 @@ parseargs()
spec_param=`echo $2` spec_param=`echo $2`
shift shift
shift shift
elif [ "x$1" == "x--cores" ]; then
make_cores=`echo $2`
shift
shift
else else
echo `date` - ERROR, UNKNOWN params "$@" echo `date` - ERROR, UNKNOWN params "$@"
return 2 return 2

View File

@ -8,8 +8,10 @@ The target boot.img will be generated in the build folder of the directory where
Options: Options:
-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.
-k, --kernel KERNEL_URL Required! The URL of kernel source's repository. -k, --kernel KERNEL_URL Required! The URL of kernel source's repository.
-c, --config KERNEL_DEFCONFIG The name/path of defconfig file when compiling kernel, which defaults to openeuler_rockchip_defconfig.
-d, --device-tree DTB_NAME Required! The device tree name of target board, which defaults to rk3399-firefly. -d, --device-tree DTB_NAME Required! The device tree name of target board, which defaults to rk3399-firefly.
-p, --platform PLATFORM Required! The platform of target board, which defaults to rockchip. -p, --platform PLATFORM Required! The platform of target board, which defaults to rockchip.
--cores N The number of cpu cores to be used during making.
-h, --help Show command help. -h, --help Show command help.
" "
@ -22,11 +24,13 @@ help()
default_param() { default_param() {
workdir=$(pwd)/build workdir=$(pwd)/build
branch=openEuler-20.03-LTS branch=openEuler-20.03-LTS
default_defconfig=openeuler_rockchip_defconfig
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)
} }
local_param(){ local_param(){
@ -34,6 +38,9 @@ local_param(){
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=${branch:18}
dtb_name=$(cat $workdir/.param | grep dtb_name) dtb_name=$(cat $workdir/.param | grep dtb_name)
dtb_name=${dtb_name:9} dtb_name=${dtb_name:9}
@ -61,6 +68,10 @@ parseargs()
branch=`echo $2` branch=`echo $2`
shift shift
shift shift
elif [ "x$1" == "x-c" -o "x$1" == "x--config" ]; then
default_defconfig=`echo $2`
shift
shift
elif [ "x$1" == "x-d" -o "x$1" == "x--device-tree" ]; then elif [ "x$1" == "x-d" -o "x$1" == "x--device-tree" ]; then
dtb_name=`echo $2` dtb_name=`echo $2`
shift shift
@ -73,6 +84,10 @@ parseargs()
platform=`echo $2` platform=`echo $2`
shift shift
shift shift
elif [ "x$1" == "x--cores" ]; then
make_cores=`echo $2`
shift
shift
else else
echo `date` - ERROR, UNKNOWN params "$@" echo `date` - ERROR, UNKNOWN params "$@"
return 2 return 2
@ -111,6 +126,9 @@ clone_and_check_kernel_source() {
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=${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}
@ -127,6 +145,7 @@ clone_and_check_kernel_source() {
cd $workdir cd $workdir
if [[ ${last_branch} != ${branch} || \ if [[ ${last_branch} != ${branch} || \
${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
@ -143,49 +162,23 @@ clone_and_check_kernel_source() {
fi fi
} }
build_rockchip-6.6-kernel() { make_kernel(){
cp $workdir/../configs/rockchip64-6.6_defconfig kernel/arch/arm64/configs LOG "make kernel(${default_defconfig}) begin..."
cd $workdir/kernel kernel_dir_tmp=$1
make ARCH=arm64 rockchip64-6.6_defconfig cd "${kernel_dir_tmp}"
LOG "make kernel begin..." if [ "x${kernel_defconfig:0:1}" != "x/" ]; then
make ARCH=arm64 -j$(nproc) if [ ! -f arch/arm64/configs/${kernel_defconfig} ]; then
} ERROR "config file ${kernel_defconfig} can not be found in kernel source".
exit 2
build_rockchip-5.10-kernel() { fi
cp $workdir/../configs/rockchip64-5.10_defconfig kernel/arch/arm64/configs kernel_defconfig=arch/arm64/configs/${kernel_defconfig}
cd $workdir/kernel fi
make ARCH=arm64 rockchip64-5.10_defconfig make distclean
LOG "make kernel begin..." cp ${kernel_defconfig} .config
make ARCH=arm64 -j$(nproc) make ARCH=arm64 olddefconfig
} kernel_defconfig=${kernel_defconfig##*/}
make ARCH=arm64 -j${make_cores}
build_rockchip-4.19-kernel() { LOG "make kernel(${default_defconfig}) end."
cp $workdir/../configs/rockchip64-4.19_defconfig kernel/arch/arm64/configs
cd $workdir/kernel
make ARCH=arm64 rockchip64_4.19_defconfig
LOG "make kernel begin..."
make ARCH=arm64 -j$(nproc)
}
build_phytium-5.10-kernel() {
cd $workdir/kernel
make ARCH=arm64 phytium_defconfig
LOG "make kernel begin..."
make ARCH=arm64 -j$(nproc)
}
build_phytium-6.6-kernel() {
cd $workdir/kernel
make ARCH=arm64 phytium_defconfig
LOG "make kernel begin..."
make ARCH=arm64 -j$(nproc)
}
build_rk3588-kernel() {
cd $workdir/kernel
make ARCH=arm64 openeuler_rk3588_defconfig
LOG "make kernel begin..."
make ARCH=arm64 -j$(nproc)
} }
install_kernel() { install_kernel() {
@ -204,6 +197,7 @@ install_kernel() {
make ARCH=arm64 modules_install INSTALL_MOD_PATH=$workdir/kernel/kernel-modules make ARCH=arm64 modules_install INSTALL_MOD_PATH=$workdir/kernel/kernel-modules
LOG "device tree name is ${dtb_name}.dtb" LOG "device tree name is ${dtb_name}.dtb"
cp arch/arm64/boot/dts/${platform}/${dtb_name}.dtb ${boot_dir} cp arch/arm64/boot/dts/${platform}/${dtb_name}.dtb ${boot_dir}
cp arch/arm64/boot/Image ${boot_dir}
LOG "prepare kernel done." LOG "prepare kernel done."
} }
@ -215,7 +209,6 @@ mk_boot() {
dracut --no-kernel ${boot_dir}/initrd.img dracut --no-kernel ${boot_dir}/initrd.img
LOG "gen initrd done." LOG "gen initrd done."
kernel_name=$(ls $boot_dir | grep vmlinuz)
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
@ -227,7 +220,7 @@ mk_boot() {
exit 2 exit 2
fi fi
echo "label openEuler echo "label openEuler
kernel /${kernel_name} kernel /Image
initrd /initrd.img initrd /initrd.img
fdt /${dtb_name} fdt /${dtb_name}
append ${bootargs}" \ append ${bootargs}" \
@ -263,6 +256,19 @@ 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"
kernel_defconfig="openeuler_rockchip_defconfig"
default_defconfig=""
if [ "x$default_defconfig" == "x" ] ; then
default_defconfig=$kernel_defconfig
elif [ -f $default_defconfig ]; then
cp $default_defconfig ${workdir}/
kernel_defconfig=${workdir}/${default_defconfig##*/}
else
echo `date` - ERROR, config file $default_defconfig can not be found.
exit 2
fi
if [ ! -d $workdir ]; then if [ ! -d $workdir ]; then
mkdir $workdir mkdir $workdir
fi fi
@ -277,30 +283,7 @@ 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
if [ "${platform}" == "rockchip" ];then make_kernel $workdir/kernel
if [ "${branch:0:19}" == "openEuler-20.03-LTS" ];then # include: openEuler-20.03-LTS*
build_rockchip-4.19-kernel
elif [ "${branch}" == "openEuler-22.03-LTS-RK3588" ]; then
build_rk3588-kernel
elif [ "${branch:0:19}" == "openEuler-22.03-LTS" ]; then # include: openEuler-22.03-LTS*
build_rockchip-5.10-kernel
elif [ "${branch:0:19}" == "openEuler-24.03-LTS" ]; then # include: openEuler-24.03-LTS*
build_rockchip-6.6-kernel
else
echo "Unsupported version."
fi
elif [ "${platform}" == "phytium" ];then
if [ "${branch:0:19}" == "openEuler-22.03-LTS" ]; then # include: openEuler-22.03-LTS*
build_phytium-5.10-kernel
elif [ "${branch:0:19}" == "openEuler-24.03-LTS" ]; then # include: openEuler-24.03-LTS*
build_phytium-6.6-kernel
else
echo "Unsupported version."
fi
else
echo "Unsupported platform"
exit 2
fi
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"

View File

@ -6,7 +6,8 @@ Build Rockchip u-boot image.
The target files idbloader.img and u-boot.itb will be generated in the build/u-boot folder of the directory where the build_u-boot.sh script is located. The target files idbloader.img and u-boot.itb will be generated in the build/u-boot folder of the directory where the build_u-boot.sh script is located.
Options: Options:
-c, --config BOARD_CONFIG Required! The name of target board which should be a space separated list, which defaults to firefly-rk3399_defconfig, set none to use prebuild u-boot image. -u, --ubootconfig UBOOT_DEFCONFIG Required! The name of defconfig file when compiling u-boot, which defaults to firefly-rk3399_defconfig, set none to use prebuild u-boot image.
--cores N The number of cpu cores to be used during making.
-h, --help Show command help. -h, --help Show command help.
" "
@ -17,18 +18,19 @@ help()
} }
default_param() { default_param() {
config="firefly-rk3399_defconfig" ubootconfig="firefly-rk3399_defconfig"
workdir=$(pwd)/build workdir=$(pwd)/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=${workdir}/../bin
make_cores=$(nproc)
} }
local_param(){ local_param(){
if [ -f $workdir/.param ]; then if [ -f $workdir/.param ]; then
config=$(cat $workdir/.param | grep config) ubootconfig=$(cat $workdir/.param | grep ubootconfig)
config=${config:7} ubootconfig=${ubootconfig:12}
fi fi
} }
@ -44,8 +46,12 @@ parseargs()
return 1 return 1
elif [ "x$1" == "x" ]; then elif [ "x$1" == "x" ]; then
shift shift
elif [ "x$1" == "x-c" -o "x$1" == "x--config" ]; then elif [ "x$1" == "x-u" -o "x$1" == "x--ubootconfig" ]; then
config=`echo $2` ubootconfig=`echo $2`
shift
shift
elif [ "x$1" == "x--cores" ]; then
make_cores=`echo $2`
shift shift
shift shift
else else
@ -97,9 +103,9 @@ build_u-boot() {
ERROR "arm-trusted-firmware(bl31.elf) can not be found!" ERROR "arm-trusted-firmware(bl31.elf) can not be found!"
exit 2 exit 2
fi fi
make ARCH=arm $config make ARCH=arm $ubootconfig
make ARCH=arm -j$(nproc) make ARCH=arm -j${make_cores}
make ARCH=arm u-boot.itb -j$(nproc) make ARCH=arm u-boot.itb -j${make_cores}
LOG "make u-boot done." LOG "make u-boot done."
fi fi
if [ ! -f u-boot.itb ]; then if [ ! -f u-boot.itb ]; then
@ -152,7 +158,7 @@ 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$config" == "xnone" ]; then if [ "x$ubootconfig" == "xnone" ]; then
use_prebuild_u-boot use_prebuild_u-boot
else else
build_u-boot build_u-boot

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