Parcourir la source

update: air302py打包固件时,如果存在PLAT_ROOT目录,应该按PLAT_ROOT目录的git指纹做tag
update: air302py下载固件时,如果存在PLAT_ROOT目录,且air302bin存在,应该使用之

Wendal Chen il y a 5 ans
Parent
commit
7a44acffa8
2 fichiers modifiés avec 8 ajouts et 2 suppressions
  1. 1 0
      .gitignore
  2. 7 2
      bsp/air302/air302.py

+ 1 - 0
.gitignore

@@ -57,3 +57,4 @@ Mkfile.old
 dkms.conf
 
 bsp/air302/FlashToolCLI/
+bsp/air302/tmp/

+ 7 - 2
bsp/air302/air302.py

@@ -46,7 +46,10 @@ COM_PORT = config["air302"]["COM_PORT"]
 '''
 def get_git_revision_short_hash():
     try :
-        return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).strip()
+        if os.path.exists(PLAT_ROOT):
+            return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'], cwd=PLAT_ROOT).strip()
+        else:
+            return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).strip()
     except:
         return ""
 
@@ -192,7 +195,9 @@ def _dl(tp, _path=None):
         f.write(FTC_CNF_TMPL)
     cmd = [FTC_PATH + "FlashToolCLI.exe", "-p", COM_PORT, "burnbatch", "--imglist"]
     if tp == "rom" or tp == "full":
-        if EC_PATH.endswith(".ec") :
+        if os.path.exists(PLAT_ROOT + "out/ec616_0h00/air302/air302.bin") :
+            shutil.copy(PLAT_ROOT + "out/ec616_0h00/air302/air302.bin", FTC_PATH + "system.bin")
+        elif EC_PATH.endswith(".ec") :
             import zipfile
             with zipfile.ZipFile(EC_PATH) as zip :
                 with open(FTC_PATH + "system.bin", "wb") as f: