mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-08 18:26:48 +00:00
# 概述 把dadk版本升级到0.2.0 dadk 0.2.0能够提升编译速度,并且支持使用dadk对内核进行profiling。 新版dadk的文档: https://docs.dragonos.org.cn/p/dadk/ # 注意 这是一个breaking change,升级后,将无法使用dadk 0.2.0去编译旧的项目。如有需要,请手动降级到dadk 0.1.11: ```shell cargo install --git https://git.mirrors.dragonos.org.cn/DragonOS-Community/DADK --tag v0.1.11 ``` # 更改列表 * chore: 把管理用户程序编译的dadk配置文件改为新格式的 * feat: 使用新版dadk来创建\挂载\卸载磁盘镜像 * chore: bump dadk min version to 0.2.0 * chore: fix ci * chore: 更新github ci镜像到1.7 * doc: 添加文档 --------- Co-Authored-by: xuzihao <xuzihao@dragonos.org> Signed-off-by: longjin <longjin@DragonOS.org>
41 lines
950 B
Bash
41 lines
950 B
Bash
#!/bin/bash
|
|
|
|
BASE_PATH=$(pwd)
|
|
# 定义错误信息
|
|
ARCH_MISMATCH_ERROR="Error: ARCH in env.mk does not match arch in dadk-manifest.toml"
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
echo "Error: ARCH environment variable is not set." >&2
|
|
exit 1
|
|
fi
|
|
|
|
|
|
# Check if ROOT_PATH is set
|
|
if [ -n "$ROOT_PATH" ]; then
|
|
CHECK_PATH="$ROOT_PATH"
|
|
else
|
|
# Check if the current directory name is "tools"
|
|
if [ "$(basename "$BASE_PATH")" = "tools" ]; then
|
|
# Try the parent directory's dadk-manifest
|
|
CHECK_PATH=$(dirname "$BASE_PATH")/
|
|
else
|
|
# Otherwise, check the current directory
|
|
CHECK_PATH="$BASE_PATH"
|
|
fi
|
|
fi
|
|
|
|
echo "Checking $CHECK_PATH"
|
|
|
|
|
|
# 读取dadk-manifest.toml文件中的arch字段
|
|
DADK_ARCH=$(grep -oP '(?<=arch = ")[^"]+' $CHECK_PATH/dadk-manifest.toml)
|
|
|
|
# 检查arch字段是否为x86_64
|
|
if [ "$ARCH" != $DADK_ARCH ]; then
|
|
echo "$ARCH_MISMATCH_ERROR" >&2
|
|
exit 1
|
|
else
|
|
echo "Arch check passed."
|
|
exit 0
|
|
fi
|