Skip to content

Commit 4a791dd

Browse files
committed
* optimize gen_os.sh
1 parent 421a5b8 commit 4a791dd

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tools/os/maixcam2/gen_os.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ function usage() {
2121
echo "delete_first_files before copy new builtin files, delete some files, one line one item, format same with command rm,"
2222
echo "you can also create a delete_first.txt in builtin_files_dir and leave this arg empty"
2323
echo ""
24+
echo "Example:"
25+
echo " ./gen_os.sh AX630C_emmc_arm64_k419_sipeed_maixcam2_ubuntu_rootfs_V3.0.0_20250319114413_20251009154249_glibc.axp \
26+
build/maixpy-4.12.1-cp313-cp313-manylinux2014_aarch64.whl \
27+
maixcam2_builtin_files \
28+
1 \
29+
maixcam2 \
30+
1"
2431
}
2532

2633
function check_axp2img_command() {
@@ -108,7 +115,11 @@ set -x
108115

109116
# 设置输出的镜像名字 maixcam2-2025-04-16-maixpy-v4.11.0
110117
date_now=$(date +"%Y-%m-%d")
111-
maixpy_version=$(echo "$whl_path" | grep -oP '(?<=MaixPy-)[^-]+')
118+
if [[ "$whl_path" == *MaixPy* ]]; then
119+
maixpy_version=$(echo "$whl_path" | grep -oP '(?<=MaixPy)[^ ]+')
120+
else
121+
maixpy_version=$(echo "$whl_path" | grep -oP '(?<=maixpy)[^ ]+')
122+
fi
112123
os_version_str=${board_name}-${date_now}-maixpy-v${maixpy_version}
113124

114125

0 commit comments

Comments
 (0)