Files
lnxgit/scripts/wsl_create_builder_user.sh
LnxGit b0bf9653d7 补充 Android 构建脚本与踩坑记录;新增分片上传与源码清理工具
- scripts/: 一键式 WSL 构建流程(bootstrap / setup / host pyside / 用户 / 预热 / 构建 / 裁剪)
- android/BUILD.md: 完整构建说明与已知问题对照表
- buildozer.spec: p4a.source_dir 固定目录,避免每次直连 GitHub
- tools/upload_chunked.py: 大文件分片并发上传(绕过单请求超时)
- tools/clean_sources.py: 清理 BOM/CRLF(BOM 会导致打包工具 ast 解析失败)
2026-09-22 14:15:45 +08:00

25 lines
773 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# 创建普通构建用户并把构建环境交给他(buildozer 拒绝以 root 运行)。
set -euo pipefail
USER_NAME="${USER_NAME:-builder}"
WORK="${WORK:-/root/lnxgit-android}"
if ! id "$USER_NAME" >/dev/null 2>&1; then
echo "==> 创建用户 $USER_NAME"
useradd -m -s /bin/bash "$USER_NAME"
else
echo "==> 用户 $USER_NAME 已存在"
fi
echo "==> 交接构建目录所有权: $WORK"
chown -R "$USER_NAME:$USER_NAME" "$WORK"
echo "==> 给源码挂载点写权限(产物需要写回 Windows 侧)"
TARGET_PARENT="/mnt/c/Users/Administrator/Documents/WEB/pygit-mobile"
mkdir -p "$TARGET_PARENT/dist"
chmod -R a+rwX "$TARGET_PARENT/dist" || true
echo "==> 验证:"
su - "$USER_NAME" -c "python3 --version; whoami; ls -d $WORK"