代码拉取完成,页面将自动刷新
同步操作将从 endless/open_ipc 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
set -e
BASE_PATH=$(dirname $(readlink -f $0))
BUILD_PATH="$BASE_PATH/build"
function usage() {
echo "usage: ./build.sh [command] [platform] [mode]"
echo "example: ./build.sh build m64x86 debug"
echo "commands:"
echo " build - Build the project"
echo " test - Build and run tests"
echo " copy - Copy files to QEMU image"
echo " run - Run QEMU emulator"
echo " monitor - Enter QEMU monitor mode"
echo " plug - Plug USB device into QEMU"
echo " unplug - Unplug USB device from QEMU"
echo " quit - Quit QEMU emulator"
echo ""
echo "platform: m64x86, aarch64, 3516cv610 (default: aarch64)"
echo "mode: debug, release, test (default: release)"
}
function build_platform() {
PLATFORM=$1
MODE=${2:-debug}
TEST=${3:-OFF}
rm -rf "$BUILD_PATH/$PLATFORM"
rm -rf "$BASE_PATH/package/bin/web"
mkdir -pv "$BUILD_PATH/$PLATFORM"
cd "$BUILD_PATH"/"$PLATFORM"
cmake $BASE_PATH -B$BUILD_PATH/$PLATFORM -DPLATFORM=$PLATFORM -DCMAKE_BUILD_TYPE=$MODE -DBUILD_TESTS=$TEST
make -j8
}
function main() {
COMMAND=$1
PLATFORM=${2:-aarch64} # 使用$2获取平台参数
MODE=${3:-release} # 使用$3获取模式参数
case $COMMAND in
build)
build_platform "$PLATFORM" "$MODE" "OFF"
;;
test)
build_platform "$PLATFORM" "$MODE" "ON"
;;
copy)
source qemu/qemu.sh
copy_to_image "$PLATFORM"
;;
run)
source qemu/qemu.sh
run_qemu "$PLATFORM"
;;
monitor)
source qemu/qemu.sh
run_qemu_monitor
;;
plug)
source qemu/qemu.sh
plug_usb
;;
unplug)
source qemu/qemu.sh
unplug_usb
;;
quit)
source qemu/qemu.sh
quit_qemu
;;
*)
usage
exit 1
;;
esac
}
main "$@"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。