From f324f4d283690ad6a5c7fe73139862c2fedf211d Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Wed, 4 Oct 2017 12:53:04 +0200 Subject: [PATCH] Allow to specify from-version for tclcheck_allota.py. Updated README. --- README.md | 18 +++++++----------- tclcheck.py | 0 tclcheck_all.py | 0 tclcheck_allfull.py | 0 tclcheck_allota.py | 16 +++++++++++----- tclcheck_new.py | 0 6 files changed, 18 insertions(+), 16 deletions(-) mode change 100644 => 100755 tclcheck.py mode change 100644 => 100755 tclcheck_all.py mode change 100644 => 100755 tclcheck_allfull.py mode change 100644 => 100755 tclcheck_allota.py mode change 100644 => 100755 tclcheck_new.py diff --git a/README.md b/README.md index 9101015..ead87c9 100644 --- a/README.md +++ b/README.md @@ -20,21 +20,16 @@ and abort the update. How to find available OTA updates --------------------------------- -After downloading or cloning the repository, edit the `tclcheck_all.py` and change the `fc.fv` -variable to your current firmware version. Let's assume you have a UK BBB100-2, so your PRD would -be `PRD-63117-003` and as of September 2017, your firmware version would be `AAM481`. So change the -line with `fc.fv` to: +After downloading or cloning the repository, make all tclcheck*.py scripts executable if needed. +Let's assume you have a UK BBB100-2, so your PRD would be `PRD-63117-003` and as of September +2017, your firmware version would be `AAM481`. Just run the following script: - fc.fv = "AAM481" + ./tclcheck_allota.py AAM481 -Also change the `fc.mode` line to: - - fc.mode = fc.MODE_OTA - -Now run the script. You'll get an output like this: +You'll get an output like this: ``` -List of latest OTA (from AAM481) firmware by PRD: +List of latest OTA firmware from AAM481 by PRD: ... PRD-63117-003 failed. (No update available.) PRD-63117-011: AAM481 ⇨ AAN358 d819919187b46793abeaeff60dd6deee17baac4b (QWERTZ BBB100-2 (Germany)) @@ -60,3 +55,4 @@ As you can see, our `PRD-63117-003` variant doesn't have the update yet, but oth You can use this info, to [install the update for a different variant](http://wiki.mbirth.de/know-how/hardware/blackberry-keyone/bb-keyone-ota-updates-for-different-variants.html). Just make sure to use a variant that has the same model number (`63117` = BBB100-2). + diff --git a/tclcheck.py b/tclcheck.py old mode 100644 new mode 100755 diff --git a/tclcheck_all.py b/tclcheck_all.py old mode 100644 new mode 100755 diff --git a/tclcheck_allfull.py b/tclcheck_allfull.py old mode 100644 new mode 100755 diff --git a/tclcheck_allota.py b/tclcheck_allota.py old mode 100644 new mode 100755 index b1da8bf..9ebf978 --- a/tclcheck_allota.py +++ b/tclcheck_allota.py @@ -3,6 +3,7 @@ # pylint: disable=C0111,C0326 +import sys import tcllib from requests.exceptions import RequestException, Timeout @@ -14,7 +15,13 @@ fc.serid = "3531510" fc.mode = fc.MODE_OTA fc.cltp = 10 -print("List of latest OTA firmware by PRD:".format(fc.fv)) +force_ver = False +force_ver_text = "" +if len(sys.argv) > 1: + force_ver = sys.argv[1] + force_ver_text = " from {}".format(force_ver) + +print("List of latest OTA firmware{} by PRD:".format(force_ver_text)) with open("prds.txt", "r") as afile: prdx = afile.read() @@ -22,16 +29,15 @@ with open("prds.txt", "r") as afile: while len(prds) > 0: prd, lastver, model = prds[0].split(" ", 2) + if force_ver != False: + lastver = force_ver try: fc.reset_session() fc.curef = prd fc.fv = lastver check_xml = fc.do_check() curef, fv, tv, fw_id, fileid, fn, fsize, fhash = fc.parse_check(check_xml) - txt_tv = tv - if fc.mode == fc.MODE_OTA: - txt_tv = "{} ⇨ {}".format(fv, tv) - print("{}: {} {} ({})".format(prd, txt_tv, fhash, model)) + print("{}: {} ⇨ {} {} ({})".format(prd, fv, tv, fhash, model)) prds.pop(0) except Timeout as e: print("{} failed. (Connection timed out.)".format(prd)) diff --git a/tclcheck_new.py b/tclcheck_new.py old mode 100644 new mode 100755