Logo Ohos Dev Distributed Device Image Flashing

Ohos Dev Distributed Device Image Flashing

Tổ chức
openharmonyinsight
ohos-dev-distributed-device-image-flashing

Use when the user wants to download OpenHarmony daily build images or flash them to a real device (DAYU200/RK3568 or others). Triggers on daily build, DAYU200, RK3568, flashing, burning, hdc reboot, upgrading firmware.

Tổng quan

Nhà phát hànhopenharmonyinsight
Kho mãopenharmony-skills
Tên kỹ năngohos-dev-distributed-device-image-flashing
Sao
36
Bản fork
7
Tệp đi kèm
4
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 4 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được openharmonyinsight công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Ohos Dev Distributed Device Image Flashing trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/openharmonyinsight/openharmony-skills/tree/main/skills/ohos-dev-distributed-device-image-flashing
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/openharmonyinsight/openharmony-skills.git /tmp/openharmony-skills
mkdir -p .claude/skills
cp -r /tmp/openharmony-skills/skills/ohos-dev-distributed-device-image-flashing .claude/skills/ohos-dev-distributed-device-image-flashing
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Ohos Dev Distributed Device Image Flashing trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Ohos Dev Distributed Device Image Flashing ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Ohos Dev Distributed Device Image Flashing không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Flash OpenHarmony Device with Daily Build

Download daily build and flash via hdc updater mode. Scripts are generic — not hardcoded to any specific repo or device.

Scripts

ScriptPurpose
download_daily.pyQuery DCP API, download + extract device image
flash_device.pyParse parameter.txt for partitions, flash via hdc updater mode

Use the actual installed skill directory when running the helper scripts.

Required Workflow

Follow these steps in order. Do not skip connectivity checks.

Step 1: Verify Device Connectivity

Before any download or flash operation, confirm the device is reachable.

Direct USB:

bash
hdc list targets
# Must show at least one device serial. If empty, check USB cable and hdc server.

Via SSH tunnel:

bash
ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "echo connected && hdc list targets"
# Both SSH and hdc must succeed. If SSH fails, confirm port and that SSH service is running.

Record the current firmware version for post-flash comparison:

bash
hdc shell param get const.product.software.version

Step 2: Download Image

bash
SKILL_DIR=<installed-skill-dir>
python3 "$SKILL_DIR/download_daily.py" --component dayu200

After download completes, the script verifies archive integrity. Check the output for errors before proceeding.

Step 3: Flash Device

Pre-flash checklist:

  • Device is reachable (Step 1 passed)
  • Image downloaded and extracted (Step 2 passed, system.img exists in output dir)
  • User has explicitly approved the destructive flash operation

Only pass --yes after the user has explicitly approved destructive device flashing. Otherwise let flash_device.py prompt for FLASH.

bash
python3 "$SKILL_DIR/flash_device.py" --img-dir daily_build --yes

WARNING: Do not interrupt the flash process. If hdc disconnects or power is lost during dd writes, the device may become unbootable. See Recovery section below.

Step 4: Verify Success

Wait ~60 seconds after reboot, then:

bash
hdc shell param get const.product.software.version

Compare with the version recorded in Step 1. If the version changed to the expected build, flash succeeded.

If the device does not appear in hdc list targets after 120 seconds, see Recovery below.

Step 5: Push Custom Libraries (Optional)

After flashing the base image, push locally-compiled libraries:

bash
hdc shell mount -o rw,remount /
for lib in lib1.z.so lib2.z.so; do
    hdc file send $lib /system/lib/$lib
done
hdc shell reboot

For SSH tunnel scenarios, upload via scp first, then send to device:

bash
ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "hdc shell mount -o rw,remount /"
for lib in lib1.z.so lib2.z.so; do
    scp -P $SSH_PORT $lib $SSH_USER@$SSH_HOST:push_tmp/$lib
    ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "hdc file send push_tmp/$lib /system/lib/$lib"
done
ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "hdc shell reboot"

SSH Tunnel Usage

The scripts run on the target machine that has USB to the board. Upload via SSH then execute remotely.

bash
SKILL_DIR=<installed-skill-dir>
SSH_PORT=<ssh-port>
SSH_USER=<ssh-user>
SSH_HOST=<ssh-host>

# Upload scripts
scp -P $SSH_PORT "$SKILL_DIR/download_daily.py" $SSH_USER@$SSH_HOST:download_daily.py
scp -P $SSH_PORT "$SKILL_DIR/flash_device.py" $SSH_USER@$SSH_HOST:flash_device.py

# Download on remote
ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "python download_daily.py --component dayu200"

# Flash from remote
ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "python flash_device.py --yes"

WARNING: SSH disconnect during flash is dangerous. If the SSH session drops while dd is writing a partition, the device may be left in a partially-written state. Mitigations:

  • Use nohup or tmux/screen on the remote machine to keep the process alive if SSH drops.
  • Ensure the remote machine has a stable power supply.
  • If SSH drops mid-flash, do NOT power cycle the device. Reconnect SSH and check if the process is still running (ps aux | grep flash_device).

Device Recovery

If a flash fails (power loss, hdc disconnect, corrupted image), the device may not boot normally.

DAYU200 / RK3568 Recovery

  1. Try updater mode: Hold the device's Vol+/recovery button while powering on. The device should enter updater/recovery mode. Then retry flashing.

  2. If hdc is unreachable in updater mode: Use the RKDevTool (Windows) or upgrade_tool (Linux) from Rockchip to flash via USB in maskrom/loader mode:

    • Power off the device
    • Hold the maskrom button while connecting USB
    • Use RKDevTool to write the full image
  3. If maskrom is not accessible: The hardware recovery button location varies by board revision. Consult the DAYU200 hardware documentation.

General Checklist

SymptomRecovery
Device reboots to updater loopRe-flash all partitions from updater mode
hdc list targets shows nothingTry maskrom mode or check USB cable
Boot hangs on logosystem.img may be corrupt — re-download and flash
Services crash after custom .so pushIDL interface mismatch — do a full flash instead of partial push

Key Design Decisions

Partition table from parameter.txt: flash_device.py parses CMDLINE:mtdparts=... from the image's parameter.txt to discover partitions. The built-in RK3568 fallback partition list is used only when --allow-fallback-partitions is explicitly passed after verifying the image layout.

SSH port fallback: Scripts default to port 2222. If connection fails, prompt the user for the correct port rather than failing silently.

DCP API: Response path is data.builds.dataList[].component. Auto-searches last 7 days if today's build is missing.

Archive safety: download_daily.py rejects archive entries that would extract outside the output directory. After download, the archive is verified by opening it before extraction.

Destructive action confirmation: flash_device.py requires interactive FLASH confirmation unless --yes is passed by an already-approved workflow.

Command failure handling: flash_device.py stops immediately when an hdc command exits non-zero.

Userdata write path: userdata.img is flashed last. The helper unmounts /data, uploads the image to updater ramdisk temporary storage, writes it with dd, runs sync on the userdata block device, and removes the temporary file. Do not write userdata.img with a direct hdc file send to /dev/block/by-name/userdata.

Why Updater Mode

Normal mode mounts system/vendor read-only — dd silently fails. Updater mode keeps partitions unmounted. Userdata is flashed last because it's used as temp storage during the process.

Common Mistakes

MistakeFix
DCP 返回空日期格式 YYYYMMDDHHMMSS;脚本自动搜索 7 天
dd 无输出必须 updater 模式
userdata 失败先 umount /data
推包后 mmi_service 不启动IDL 接口变了需全量刷机,不能只推部分 .so
SSH 连不上先启动目标机器的 SSH 或端口转发服务,确认端口
SSH 断开导致烧录中断用 nohup/tmux 运行脚本;不要立即断电
下载的镜像包损坏删除 tar.gz 重新下载;检查网络连通性

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Ohos Dev Distributed Device Image Flashing làm được gì?

Use when the user wants to download OpenHarmony daily build images or flash them to a real device (DAYU200/RK3568 or others). Triggers on daily build, DAYU200, RK3568, flashing, burning, hdc reboot, upgrading firmware.

Vì sao nên dùng Ohos Dev Distributed Device Image Flashing trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Ohos Dev Distributed Device Image Flashing là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Ohos Dev Distributed Device Image Flashing trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/openharmonyinsight/openharmony-skills/tree/main/skills/ohos-dev-distributed-device-image-flashing. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Ohos Dev Distributed Device Image Flashing?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Ohos Dev Distributed Device Image Flashing với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Ohos Dev Distributed Device Image Flashing với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Ohos Dev Distributed Device Image Flashing có miễn phí không?

Kỹ năng này được openharmonyinsight phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇