From effa9361ac86b4d9b6e4caed375c2855bc80007c Mon Sep 17 00:00:00 2001 From: bowei Date: Wed, 19 Aug 2026 12:56:36 +0800 Subject: [PATCH] =?UTF-8?q?sync:=20SHANGHAI-U9=202026-08-19=20=E7=A1=AC?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E5=AE=A1=E8=AE=A1=EF=BC=9Aimx6=5Fapp=20REPO?= =?UTF-8?q?=20/=20fpga=5Fru=20--host=20=E6=94=B9=E8=AF=BB=20skills=5Fenv.m?= =?UTF-8?q?d=EF=BC=88=E6=96=B0=E5=A2=9E=20SMOD=5FREPO=5FROOT=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fpga_update/scripts/fpga_ru.py | 21 ++++++++++++++++++++- smod_atsc_dev/scripts/imx6_app.py | 5 ++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/fpga_update/scripts/fpga_ru.py b/fpga_update/scripts/fpga_ru.py index 4f0eec3..8d37f5c 100644 --- a/fpga_update/scripts/fpga_ru.py +++ b/fpga_update/scripts/fpga_ru.py @@ -30,6 +30,25 @@ import socket import sys import time +def _env_lookup(key, default=None): + """Machine-relative value: real env var first, then ~/skills_env.md.""" + v = os.environ.get(key) + if v: + return v + path = os.path.join(os.path.expanduser("~"), "skills_env.md") + try: + with open(path, encoding="utf-8") as f: + for line in f: + m = re.match(rf"\s*{key}\s*=\s*(\S+)", line) + if m: + return m.group(1) + except OSError: + pass + if default is None: + sys.exit(f"missing {key}: add it to ~/skills_env.md or set it as an env var") + return default + + # ------------------------------------------------------------------ protocol constants HEAD, TAIL = 0xAA, 0xBB @@ -246,7 +265,7 @@ def do_finish(dev, timeout): def main(): ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) ap.add_argument("--mcs", required=True, help="path to the quickboot _update.mcs") - ap.add_argument("--host", default="192.168.1.143") + ap.add_argument("--host", default=_env_lookup("SMOD_BOARD_IP", "192.168.1.143")) ap.add_argument("--port", type=int, default=1234) ap.add_argument("--yes", action="store_true", help="skip the confirmation prompt") ap.add_argument("--dry-run", action="store_true", help="validate and frame the mcs, contact nothing") diff --git a/smod_atsc_dev/scripts/imx6_app.py b/smod_atsc_dev/scripts/imx6_app.py index ef9191e..390f545 100644 --- a/smod_atsc_dev/scripts/imx6_app.py +++ b/smod_atsc_dev/scripts/imx6_app.py @@ -52,7 +52,10 @@ def _env_lookup(key, default=None): return default -REPO = r"E:\Xilinx_design\smod\SMOD_ATSC\my_exciter" +# Machine-relative: the exciter checkout lives wherever this box keeps it. +# Recorded as SMOD_REPO_ROOT in ~/skills_env.md; the literal stays as the +# fallback so existing boxes keep working without touching that file. +REPO = _env_lookup("SMOD_REPO_ROOT", r"E:\Xilinx_design\smod\SMOD_ATSC\my_exciter") APP_SUBDIR = "imx6/src/atsc_app" # No default: the VM's IP moves with the VMware segment, so a stale fallback would