تغییر ایپی tftp سرور به متغیر
flash-aminpa-V1.5.yml / Hardware flashing - Amin Pardaz Asia v1.5 (push) Successful in 7m25s

This commit is contained in:
2026-11-10 12:30:21 +03:30
والد b38dd9baf8
کامیت 9b5bff8002
4فایلهای تغییر یافته به همراه40 افزوده شده و 7 حذف شده
+8 -5
مشاهده پرونده
@@ -1,5 +1,6 @@
"""Check an existing U-Boot prompt or configure its volatile environment."""
import argparse
import ipaddress
import fcntl
import re
import sys
@@ -218,6 +219,8 @@ def main():
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)")
parser.add_argument("--confirm-squashfs-mtdblock3", action="store_true", help="Confirm actual RootFS is SquashFS on mtdblock3 and set bootargs")
parser.add_argument("--device-ip", type=ipaddress.IPv4Address, default="192.168.75.100")
parser.add_argument("--tftp-server-ip", type=ipaddress.IPv4Address, default="192.168.75.247")
args = parser.parse_args()
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")
@@ -271,11 +274,11 @@ def main():
"printenv ipaddr serverip ethaddr bootcmd bootargs",
allow_missing=("ipaddr", "serverip", "ethaddr", "bootcmd", "bootargs"),
)
cli.command("setenv ipaddr 192.168.75.100")
cli.command("printenv ipaddr", r"^ipaddr=192\.168\.75\.100$")
cli.command("setenv serverip 192.168.75.247")
cli.command("printenv serverip", r"^serverip=192\.168\.75\.247$")
cli.command("ping 192.168.75.247", r"^host 192\.168\.75\.247 is alive$", timeout=30)
cli.command(f"setenv ipaddr {args.device_ip}")
cli.command("printenv ipaddr", r"^ipaddr=" + re.escape(str(args.device_ip)) + r"$")
cli.command(f"setenv serverip {args.tftp_server_ip}")
cli.command("printenv serverip", r"^serverip=" + re.escape(str(args.tftp_server_ip)) + r"$")
cli.command(f"ping {args.tftp_server_ip}", r"^host " + re.escape(str(args.tftp_server_ip)) + r" is alive$", timeout=30)
cli.command("sf probe 0:0", r"^SF: Detected .+", timeout=20)
print("\nAll commands verified; environment changes were not saved to flash.")