اضافه شدن ورک فلو برد تستی
flash-aminpa-V1.5 / Production flash - Amin Pardaz Asia v1.5 (push) Successful in 7m15s
flash-aminpa-V1.5 / Production flash - Amin Pardaz Asia v1.5 (push) Successful in 7m15s
This commit is contained in:
@@ -199,7 +199,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"), default="check", nargs="?")
|
||||
parser.add_argument("mode", choices=("check", "configure", "transfer", "transfer-dtb", "transfer-kernel", "transfer-rootfs", "erase", "boot-config", "preflight"), 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)")
|
||||
@@ -218,6 +218,18 @@ def main():
|
||||
cli.detect()
|
||||
if args.mode == "check":
|
||||
return
|
||||
if args.mode == "preflight":
|
||||
capacity = detect_flash(cli)
|
||||
files = {"uboot": "u-boot-sunxi-with-spl.bin", "dtb": "sun8i-v3s-licheepi-zero-dock.dtb",
|
||||
"kernel": "zImage", "rootfs": "rootfs.squashfs"}
|
||||
for part, filename in files.items():
|
||||
path = Path(__file__).resolve().parent.parent / "firmware" / filename
|
||||
minimum = 64 if part in ("kernel", "rootfs") else 32
|
||||
limit = LAYOUTS[capacity][part][1]
|
||||
if not path.is_file() or not minimum <= path.stat().st_size <= limit:
|
||||
raise RuntimeError(f"Firmware missing or outside selected partition size: {path} (maximum {limit:#x})")
|
||||
print("All firmware sizes fit the detected flash layout.")
|
||||
return
|
||||
if args.mode == "erase":
|
||||
erase_flash(cli)
|
||||
return
|
||||
|
||||
مرجع در شماره جدید
مسدود کردن کاربر