Skip to content

Commit 5b5942b

Browse files
committed
* [maixcam2] optimize gen_os.sh
1 parent 4a791dd commit 5b5942b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

tools/os/maixcam2/gen_os.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,7 @@ set -x
115115

116116
# 设置输出的镜像名字 maixcam2-2025-04-16-maixpy-v4.11.0
117117
date_now=$(date +"%Y-%m-%d")
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
118+
maixpy_version=$(echo "$whl_path" | sed -E 's/.*-([0-9]+\.[0-9]+\.[0-9]+)-.*/\1/')
123119
os_version_str=${board_name}-${date_now}-maixpy-v${maixpy_version}
124120

125121

tools/os/maixcam2/update_img.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,15 @@ if [ ! -f "$delete_first_files" ]; then
5757
exit 1
5858
fi
5959

60-
60+
echo "Umounting raw rootfs"
61+
umount tmp2/rootfs
62+
if [ $? -ne 0 ]; then
63+
echo "Failed to unmount tmp2/rootfs"
64+
exit 2
65+
fi
6166
rm -rf tmp2/*
6267
mkdir -p tmp2
68+
chmod 777 tmp2
6369

6470
# if builtin_files is a xz or tar.xz file, unzip it to tmp2/builtin_files
6571
if [[ "$builtin_files" == *.tar.xz ]]; then

0 commit comments

Comments
 (0)