Skip to content

feat: add --cn flag to install from Gitee mirror (China) - #97

Merged
cavonlee merged 1 commit into
1.3.xfrom
feat/cn-mirror-install
Aug 7, 2026
Merged

feat: add --cn flag to install from Gitee mirror (China)#97
cavonlee merged 1 commit into
1.3.xfrom
feat/cn-mirror-install

Conversation

@cavonlee

@cavonlee cavonlee commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a --cn flag that forces all downloads to the Gitee mirror, for users in mainland China where raw.githubusercontent.com is often unreachable.

Previously the installer framework had a GitHub-availability check with Gitee fallback, but it was unreliable: several URLs in install.sh were hardcoded to GitHub and bypassed the fallback entirely, and the framework itself is downloaded from GitHub before any check runs.

Changes

  • Pre-scan args for --cn before downloading the installer framework (the framework URL itself must use the correct source)
  • Switch INSTALLER_URL to Gitee when --cn is set
  • Parameterize GIT_REPO / GIT_RAW_BASE / GIT_RAW_SEP / PIPOWER5_DTBO_URL (Gitee raw URL format requires a /raw/ segment)
  • Replace all hardcoded GitHub URLs in install.sh with the new variables
  • Fix install report label to show Gitee (--cn) when the flag is used

How to test

# Syntax check
bash -n install.sh

# Normal mode (GitHub) — unchanged behavior
curl -sSL https://raw.githubusercontent.com/sunfounder/pironman5/1.3.x/install.sh | sudo bash

# China mirror mode (Gitee)
curl -sSL https://gitee.com/sunfounder/pironman5/raw/1.3.x/install.sh | sudo bash -s -- --cn

# With variant
curl -sSL https://gitee.com/sunfounder/pironman5/raw/1.3.x/install.sh | sudo bash -s -- --cn --variant base

# Verify the install report shows "Source: Gitee (--cn)"
# Verify all downloads come from gitee.com (no raw.githubusercontent.com requests)

Verified: all 7 derived Gitee URLs (version.py fetches, installer framework, dtbo, HDMI EDID plugin) return 200; all 5 repos (pironman5, pipower5, pm_auto, pm_dashboard, sf_rpi_status) are cloneable from Gitee.

Add a --cn flag that forces all downloads to the Gitee mirror for
users in mainland China where raw.githubusercontent.com is unreliable.

Changes:
- Pre-scan args for --cn before downloading the installer framework
  (framework URL itself must use the correct source)
- Switch INSTALLER_URL to Gitee when --cn is set
- Parameterize GIT_REPO / GIT_RAW_BASE / GIT_RAW_SEP / PIPOWER5_DTBO_URL
  (Gitee raw URL format needs a /raw/ segment)
- Replace all hardcoded GitHub URLs in install.sh with the variables
- Fix install report label to show Gitee (--cn)

Usage:
  curl -sSL https://gitee.com/sunfounder/pironman5/raw/1.3.x/install.sh | sudo bash -s -- --cn
@cavonlee
cavonlee merged commit 6311f18 into 1.3.x Aug 7, 2026
4 checks passed
@cavonlee
cavonlee deleted the feat/cn-mirror-install branch August 7, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant