diff --git a/.gitea/workflows/flash-aminpa-V1.5.yml b/.gitea/workflows/flash-aminpa-V1.5.yml index 5fc2343..9bb6aaf 100644 --- a/.gitea/workflows/flash-aminpa-V1.5.yml +++ b/.gitea/workflows/flash-aminpa-V1.5.yml @@ -1,5 +1,5 @@ -name: flash-aminpa-V1.5 -# Production flash for Amin Pardaz Asia device v1.5 +name: flash-aminpa-V1.5.yml +# Production hardware flashing for Amin Pardaz Asia device v1.5 on: push: @@ -12,7 +12,7 @@ concurrency: jobs: flash-aminpa: - name: Production flash - Amin Pardaz Asia v1.5 + name: Hardware flashing - Amin Pardaz Asia v1.5 runs-on: serial-runner steps: @@ -66,3 +66,6 @@ jobs: - name: Configure and verify bootcmd for detected flash run: /usr/bin/python3 scripts/serial_command.py set-bootcmd + + - name: Reboot hardware after successful flashing + run: /usr/bin/python3 scripts/serial_command.py reboot diff --git a/scripts/serial_command.py b/scripts/serial_command.py index 8a72515..8757f05 100644 --- a/scripts/serial_command.py +++ b/scripts/serial_command.py @@ -213,7 +213,7 @@ def boot_config(cli, confirmed=False): def main(): parser = argparse.ArgumentParser() - parser.add_argument("mode", choices=("check", "configure", "transfer", "transfer-dtb", "transfer-kernel", "transfer-rootfs", "erase", "boot-config", "preflight", "set-bootcmd"), default="check", nargs="?") + parser.add_argument("mode", choices=("check", "configure", "transfer", "transfer-dtb", "transfer-kernel", "transfer-rootfs", "erase", "boot-config", "preflight", "set-bootcmd", "reboot"), default="check", nargs="?") parser.add_argument("--port", default="/dev/ttyUSB0") parser.add_argument("--firmware", type=Path, default=None) parser.add_argument("--rootfs-size", type=lambda value: int(value, 0), help="Actual RootFS partition size in bytes (decimal or 0x-prefixed hex)") @@ -232,6 +232,12 @@ def main(): cli.detect() if args.mode == "check": return + if args.mode == "reboot": + print("\n>>> reset", flush=True) + port.write(b"reset\r") + port.flush() + print("Reset command sent; reboot completion has not been verified.", flush=True) + return if args.mode == "preflight": capacity = detect_flash(cli) files = {"uboot": "u-boot-sunxi-with-spl.bin", "dtb": "sun8i-v3s-licheepi-zero-dock.dtb",