build: 启用显式 RKMPP 构建

This commit is contained in:
mofeng-git
2026-10-12 22:53:12 +08:00
parent 66a13d3d8c
commit 92f4203bc2
11 changed files with 52 additions and 45 deletions

View File

@@ -18,6 +18,10 @@ ARCH_MAP=(
# Build for specific architecture using cross
build_arch() {
local rust_target="$1"
local feature_args=()
case "$rust_target" in
aarch64-*|armv7-*) feature_args=(--features rkmpp) ;;
esac
case "${CHINAMIRRO:-}" in
1|true|TRUE|yes|YES|on|ON)
@@ -40,13 +44,13 @@ build_arch() {
CARGO_NET_GIT_FETCH_WITH_CLI=true \
RUSTUP_DIST_SERVER="$rust_dist" \
RUSTUP_UPDATE_ROOT="$rust_root" \
cross build --release --target "$rust_target"
cross build --release --target "$rust_target" "${feature_args[@]}"
return
;;
esac
echo "=== Building: $rust_target (via cross with custom Dockerfile) ==="
cross build --release --target "$rust_target"
cross build --release --target "$rust_target" "${feature_args[@]}"
}
# Main

View File

@@ -268,14 +268,18 @@ build_for_platform() {
if [ "$BUILD_BINARY" = true ]; then
echo_info "Building binary with cross..."
cd "$PROJECT_ROOT"
cross build --release --target "$target"
local feature_args=()
case "$target" in
aarch64-*|armv7-*) feature_args=(--features rkmpp) ;;
esac
cross build --release --target "$target" "${feature_args[@]}"
fi
# Check binary exists
local binary="$PROJECT_ROOT/target/$target/release/one-kvm"
if [ ! -f "$binary" ]; then
echo_error "Binary not found: $binary"
echo_error "Build it first: cross build --release --target $target"
echo_error "Build it first: ./build/build-images.sh"
exit 1
fi