Skip to content

Commit 697fc9f

Browse files
author
zhengchenxiao
committed
add:"ci" and refine "sd.image" script
1 parent a92c434 commit 697fc9f

File tree

3 files changed

+35
-9
lines changed

3 files changed

+35
-9
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,13 @@ jobs:
3131
cd models
3232
xmake -vyD
3333
'
34-
shell: bash
34+
shell: bash
35+
36+
- name: Upload Build Artifacts
37+
uses: actions/upload-artifact@v3
38+
with:
39+
name: build-artifacts
40+
path: |
41+
models/rtthread.bin
42+
models/build/ext4.img
43+
retention-days: 7

repo/packages/r/rt-thread/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ do
5656
return config_key
5757
end
5858

59-
local vendor = get_config_values(config_file, "CONFIG_VENDOR_", "CONFIG_CHIP_MODEL_", "CONFIG_BOARD_", "CONFIG_KERNEL_SOURCE_")
59+
local vendor = get_config_values(config_file, "CONFIG_VENDOR_")
6060
local model = get_config_values(config_file, "CONFIG_CHIP_MODEL_")
6161
local board = get_config_values(config_file, "CONFIG_BOARD_")
6262
local company = get_config_values(config_file, "CONFIG_COMPANY_")

tools/scripts/tasks/sdk-image/on_run.lua

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ local function get_other_files_from_curdir()
106106
return files
107107
end
108108

109-
function main()
110-
109+
-- rk3500的sd.image打包函数
110+
local function packages_rk3500()
111111
-- 获取文件路径
112112
local rtthread_bin = get_kernel_from_curdir() -- 获取内核文件
113113
local rootfs_img = get_rootfs_from_curdir() -- 获取根文件系统
@@ -117,10 +117,7 @@ function main()
117117
local uboot_img = other_files.uboot
118118
local fdt = other_files.fdt
119119
local idbloader_img = other_files.idbloader
120-
121-
-- 删除现有镜像文件
122-
os.iorun("rm sd.img -f")
123-
120+
124121
-- 确保文件存在
125122
check_required_param(rtthread_bin, "kernel")
126123
check_required_param(uboot_img, "uboot")
@@ -131,7 +128,7 @@ function main()
131128
-- 镜像文件名
132129
local imgname = "sd.img"
133130
local pwd = os.getenv("PWD")
134-
131+
135132
-- 创建空白的 sd.img 文件并初始化
136133
os.execv("dd", {"if=/dev/zero", "of="..pwd .. "/" .. imgname, "bs=1M", "count=1000"})
137134
os.execv("ls -al")
@@ -161,3 +158,23 @@ function main()
161158
-- 清理临时的 boot.img 文件
162159
os.iorun("rm boot.img")
163160
end
161+
162+
function main()
163+
-- 删除现有镜像文件
164+
os.iorun("rm sd.img -f")
165+
166+
local config_file = ".config"
167+
local file = io.open(config_file, "r")
168+
local content = file:read("*all")
169+
file:close()
170+
local vendor = content:match("CONFIG_VENDOR_" .. "([^%s=]*)=y")
171+
local model = content:match("CONFIG_CHIP_MODEL_" .. "([^%s=]*)=y")
172+
print("sdk_vendor:",vendor)
173+
if vendor == "QEMU" then
174+
end
175+
if vendor == "ROCKCHIP" then
176+
if model == "RK3568" then
177+
packages_rk3500()
178+
end
179+
end
180+
end

0 commit comments

Comments
 (0)