اصلاح ورک فلو های استقرار
This commit is contained in:
@@ -22,7 +22,7 @@ jobs:
|
|||||||
CONFIRM_SQUASHFS_MTDBLOCK3: ${{ inputs.confirm_squashfs_mtdblock3 }}
|
CONFIRM_SQUASHFS_MTDBLOCK3: ${{ inputs.confirm_squashfs_mtdblock3 }}
|
||||||
run: |
|
run: |
|
||||||
if [ "$CONFIRM_SQUASHFS_MTDBLOCK3" = "true" ]; then
|
if [ "$CONFIRM_SQUASHFS_MTDBLOCK3" = "true" ]; then
|
||||||
/usr/bin/python3 scripts/serial_command.py boot-config --confirm-squashfs-mtdblock3
|
/usr/bin/python3 deployment/serial/serial_command.py boot-config --confirm-squashfs-mtdblock3
|
||||||
else
|
else
|
||||||
/usr/bin/python3 scripts/serial_command.py boot-config
|
/usr/bin/python3 deployment/serial/serial_command.py boot-config
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Detect flash, set bootcmd and verify
|
- name: Detect flash, set bootcmd and verify
|
||||||
run: /usr/bin/python3 scripts/serial_command.py set-bootcmd
|
run: /usr/bin/python3 deployment/serial/serial_command.py set-bootcmd
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ jobs:
|
|||||||
|
|
||||||
- name: Transfer DTB, write SPI flash and verify read-back
|
- name: Transfer DTB, write SPI flash and verify read-back
|
||||||
run: |
|
run: |
|
||||||
/usr/bin/python3 scripts/serial_command.py transfer-dtb
|
/usr/bin/python3 deployment/serial/serial_command.py transfer-dtb
|
||||||
|
|||||||
@@ -38,41 +38,41 @@ jobs:
|
|||||||
PY
|
PY
|
||||||
|
|
||||||
- name: Check current U-Boot CLI
|
- name: Check current U-Boot CLI
|
||||||
run: /usr/bin/python3 scripts/serial_command.py check
|
run: /usr/bin/python3 deployment/serial/serial_command.py check
|
||||||
|
|
||||||
- name: Configure and verify network
|
- name: Configure and verify network
|
||||||
env:
|
env:
|
||||||
UBOOT_DEVICE_IP: ${{ vars.UBOOT_DEVICE_IP || '192.168.75.100' }}
|
UBOOT_DEVICE_IP: ${{ vars.UBOOT_DEVICE_IP || '192.168.75.100' }}
|
||||||
TFTP_SERVER_IP: ${{ vars.TFTP_SERVER_IP || '192.168.75.247' }}
|
TFTP_SERVER_IP: ${{ vars.TFTP_SERVER_IP || '192.168.75.247' }}
|
||||||
run: |
|
run: |
|
||||||
/usr/bin/python3 scripts/serial_command.py configure --device-ip "$UBOOT_DEVICE_IP" --tftp-server-ip "$TFTP_SERVER_IP"
|
/usr/bin/python3 deployment/serial/serial_command.py configure --device-ip "$UBOOT_DEVICE_IP" --tftp-server-ip "$TFTP_SERVER_IP"
|
||||||
|
|
||||||
- name: Check all firmware sizes against detected flash layout
|
- name: Check all firmware sizes against detected flash layout
|
||||||
run: /usr/bin/python3 scripts/serial_command.py preflight
|
run: /usr/bin/python3 deployment/serial/serial_command.py preflight
|
||||||
|
|
||||||
- name: Erase detected SPI flash and verify sample
|
- name: Erase detected SPI flash and verify sample
|
||||||
run: /usr/bin/python3 scripts/serial_command.py erase
|
run: /usr/bin/python3 deployment/serial/serial_command.py erase
|
||||||
|
|
||||||
- name: Transfer, write and verify U-Boot
|
- name: Transfer, write and verify U-Boot
|
||||||
run: /usr/bin/python3 scripts/serial_command.py transfer
|
run: /usr/bin/python3 deployment/serial/serial_command.py transfer
|
||||||
|
|
||||||
- name: Transfer, write and verify DTB
|
- name: Transfer, write and verify DTB
|
||||||
run: /usr/bin/python3 scripts/serial_command.py transfer-dtb
|
run: /usr/bin/python3 deployment/serial/serial_command.py transfer-dtb
|
||||||
|
|
||||||
- name: Transfer, write and verify Kernel
|
- name: Transfer, write and verify Kernel
|
||||||
run: /usr/bin/python3 scripts/serial_command.py transfer-kernel
|
run: /usr/bin/python3 deployment/serial/serial_command.py transfer-kernel
|
||||||
|
|
||||||
- name: Transfer, write and verify RootFS
|
- name: Transfer, write and verify RootFS
|
||||||
run: /usr/bin/python3 scripts/serial_command.py transfer-rootfs
|
run: /usr/bin/python3 deployment/serial/serial_command.py transfer-rootfs
|
||||||
|
|
||||||
- name: Inspect boot configuration
|
- name: Inspect boot configuration
|
||||||
run: /usr/bin/python3 scripts/serial_command.py boot-config
|
run: /usr/bin/python3 deployment/serial/serial_command.py boot-config
|
||||||
|
|
||||||
- name: Configure and verify bootcmd for detected flash
|
- name: Configure and verify bootcmd for detected flash
|
||||||
run: /usr/bin/python3 scripts/serial_command.py set-bootcmd
|
run: /usr/bin/python3 deployment/serial/serial_command.py set-bootcmd
|
||||||
|
|
||||||
- name: Save U-Boot environment before reboot
|
- name: Save U-Boot environment before reboot
|
||||||
run: /usr/bin/python3 scripts/serial_command.py saveenv
|
run: /usr/bin/python3 deployment/serial/serial_command.py saveenv
|
||||||
|
|
||||||
- name: Reboot hardware after successful flashing
|
- name: Reboot hardware after successful flashing
|
||||||
run: /usr/bin/python3 scripts/serial_command.py reboot
|
run: /usr/bin/python3 deployment/serial/serial_command.py reboot
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ jobs:
|
|||||||
|
|
||||||
- name: Erase entire flash and verify first 256 bytes
|
- name: Erase entire flash and verify first 256 bytes
|
||||||
run: |
|
run: |
|
||||||
/usr/bin/python3 scripts/serial_command.py erase
|
/usr/bin/python3 deployment/serial/serial_command.py erase
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ jobs:
|
|||||||
|
|
||||||
- name: Transfer Kernel, write SPI flash and verify read-back
|
- name: Transfer Kernel, write SPI flash and verify read-back
|
||||||
run: |
|
run: |
|
||||||
/usr/bin/python3 scripts/serial_command.py transfer-kernel
|
/usr/bin/python3 deployment/serial/serial_command.py transfer-kernel
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ jobs:
|
|||||||
|
|
||||||
- name: Detect flash, transfer RootFS and verify read-back
|
- name: Detect flash, transfer RootFS and verify read-back
|
||||||
run: |
|
run: |
|
||||||
/usr/bin/python3 scripts/serial_command.py transfer-rootfs
|
/usr/bin/python3 deployment/serial/serial_command.py transfer-rootfs
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ jobs:
|
|||||||
|
|
||||||
- name: Check current U-Boot CLI prompt
|
- name: Check current U-Boot CLI prompt
|
||||||
run: |
|
run: |
|
||||||
/usr/bin/python3 scripts/serial_command.py check
|
/usr/bin/python3 deployment/serial/serial_command.py check
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ jobs:
|
|||||||
TEST_HOST_IP: ${{ vars.TEST_HOST_IP || '192.168.75.15' }}
|
TEST_HOST_IP: ${{ vars.TEST_HOST_IP || '192.168.75.15' }}
|
||||||
TEST_DEVICE_IP: ${{ vars.TEST_DEVICE_IP }}
|
TEST_DEVICE_IP: ${{ vars.TEST_DEVICE_IP }}
|
||||||
run: |
|
run: |
|
||||||
/usr/bin/python3 scripts/software_test.py --interface "$TEST_INTERFACE" --host-ip "$TEST_HOST_IP" --device-ip "$TEST_DEVICE_IP"
|
/usr/bin/python3 deployment/serial/software_test.py --interface "$TEST_INTERFACE" --host-ip "$TEST_HOST_IP" --device-ip "$TEST_DEVICE_IP"
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ jobs:
|
|||||||
UBOOT_DEVICE_IP: ${{ vars.UBOOT_DEVICE_IP || '192.168.75.100' }}
|
UBOOT_DEVICE_IP: ${{ vars.UBOOT_DEVICE_IP || '192.168.75.100' }}
|
||||||
TFTP_SERVER_IP: ${{ vars.TFTP_SERVER_IP || '192.168.75.247' }}
|
TFTP_SERVER_IP: ${{ vars.TFTP_SERVER_IP || '192.168.75.247' }}
|
||||||
run: |
|
run: |
|
||||||
/usr/bin/python3 scripts/serial_command.py configure --device-ip "$UBOOT_DEVICE_IP" --tftp-server-ip "$TFTP_SERVER_IP"
|
/usr/bin/python3 deployment/serial/serial_command.py configure --device-ip "$UBOOT_DEVICE_IP" --tftp-server-ip "$TFTP_SERVER_IP"
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ jobs:
|
|||||||
|
|
||||||
- name: Transfer firmware, write SPI flash and verify read-back
|
- name: Transfer firmware, write SPI flash and verify read-back
|
||||||
run: |
|
run: |
|
||||||
/usr/bin/python3 scripts/serial_command.py transfer
|
/usr/bin/python3 deployment/serial/serial_command.py transfer
|
||||||
|
|||||||
+13
-2
@@ -21,7 +21,7 @@ workflow تنظیم شبکه و workflow اصلی فلش از آنها است
|
|||||||
نمونهٔ اجرای مستقیم:
|
نمونهٔ اجرای مستقیم:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
/usr/bin/python3 scripts/serial_command.py configure \
|
/usr/bin/python3 deployment/serial/serial_command.py configure \
|
||||||
--device-ip 192.168.75.100 \
|
--device-ip 192.168.75.100 \
|
||||||
--tftp-server-ip 192.168.75.247
|
--tftp-server-ip 192.168.75.247
|
||||||
```
|
```
|
||||||
@@ -53,10 +53,21 @@ IP میزبان باید از قبل روی کارت شبکهٔ انتخاب
|
|||||||
نمونهٔ اجرای دستی روی runner با جایگزینکردن IP واقعی دستگاه:
|
نمونهٔ اجرای دستی روی runner با جایگزینکردن IP واقعی دستگاه:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
/usr/bin/python3 scripts/software_test.py \
|
/usr/bin/python3 deployment/serial/software_test.py \
|
||||||
--interface eno1 \
|
--interface eno1 \
|
||||||
--host-ip 192.168.75.15 \
|
--host-ip 192.168.75.15 \
|
||||||
--device-ip <DEVICE_IP>
|
--device-ip <DEVICE_IP>
|
||||||
```
|
```
|
||||||
|
|
||||||
برای محل فایلهای firmware و نقشهٔ فلش، [راهنمای firmware](firmware/README.md) را ببینید.
|
برای محل فایلهای firmware و نقشهٔ فلش، [راهنمای firmware](firmware/README.md) را ببینید.
|
||||||
|
|
||||||
|
## ساختار استقرار
|
||||||
|
|
||||||
|
اسکریپتهای اجرایی در `deployment/serial/` قرار دارند:
|
||||||
|
|
||||||
|
- `serial_command.py`: کنترل U-Boot، فلش و راهاندازی برد از طریق سریال.
|
||||||
|
- `software_test.py`: بررسی پاسخ ping دستگاه پس از بوت.
|
||||||
|
|
||||||
|
workflowهای اصلی امینپرداز و ورودیهای workflowهای کمکی در
|
||||||
|
`.gitea/workflows/` باقی میمانند و اسکریپتها را از مسیر جدید اجرا میکنند.
|
||||||
|
فایلهای باینری همچنان در پوشهٔ `firmware/` ریشهٔ مخزن قرار میگیرند.
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ def main():
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
if args.firmware is None:
|
if args.firmware is None:
|
||||||
filename = "rootfs.squashfs" if args.mode == "transfer-rootfs" else "zImage" if args.mode == "transfer-kernel" else ("sun8i-v3s-licheepi-zero-dock.dtb" if args.mode == "transfer-dtb" else "u-boot-sunxi-with-spl.bin")
|
filename = "rootfs.squashfs" if args.mode == "transfer-rootfs" else "zImage" if args.mode == "transfer-kernel" else ("sun8i-v3s-licheepi-zero-dock.dtb" if args.mode == "transfer-dtb" else "u-boot-sunxi-with-spl.bin")
|
||||||
args.firmware = Path(__file__).resolve().parent.parent / "firmware" / filename
|
args.firmware = Path(__file__).resolve().parents[2] / "firmware" / filename
|
||||||
if args.mode in ("transfer", "transfer-dtb", "transfer-kernel", "transfer-rootfs") and not args.firmware.is_file():
|
if args.mode in ("transfer", "transfer-dtb", "transfer-kernel", "transfer-rootfs") and not args.firmware.is_file():
|
||||||
raise RuntimeError("Firmware file not found: " + str(args.firmware))
|
raise RuntimeError("Firmware file not found: " + str(args.firmware))
|
||||||
# Shared by both workflows: fail rather than interleave serial commands.
|
# Shared by both workflows: fail rather than interleave serial commands.
|
||||||
@@ -250,7 +250,7 @@ def main():
|
|||||||
files = {"uboot": "u-boot-sunxi-with-spl.bin", "dtb": "sun8i-v3s-licheepi-zero-dock.dtb",
|
files = {"uboot": "u-boot-sunxi-with-spl.bin", "dtb": "sun8i-v3s-licheepi-zero-dock.dtb",
|
||||||
"kernel": "zImage", "rootfs": "rootfs.squashfs"}
|
"kernel": "zImage", "rootfs": "rootfs.squashfs"}
|
||||||
for part, filename in files.items():
|
for part, filename in files.items():
|
||||||
path = Path(__file__).resolve().parent.parent / "firmware" / filename
|
path = Path(__file__).resolve().parents[2] / "firmware" / filename
|
||||||
minimum = 64 if part in ("kernel", "rootfs") else 32
|
minimum = 64 if part in ("kernel", "rootfs") else 32
|
||||||
limit = LAYOUTS[capacity][part][1]
|
limit = LAYOUTS[capacity][part][1]
|
||||||
if not path.is_file() or not minimum <= path.stat().st_size <= limit:
|
if not path.is_file() or not minimum <= path.stat().st_size <= limit:
|
||||||
مرجع در شماره جدید
مسدود کردن کاربر