aboutsummaryrefslogtreecommitdiffstats
path: root/tools/mcuboot/imgtool
diff options
context:
space:
mode:
authorReinhold Gschweicher <pyro4hell@gmail.com>2023-05-01 20:38:17 +0200
committerNeroBurner <pyro4hell@gmail.com>2023-06-04 19:46:37 +0200
commitf057894d2670712c316f69bd9aa3a66275a8b3e5 (patch)
treef3df038a4db06452a8bf4e1dcc54293a0533cfce /tools/mcuboot/imgtool
parent8fee341b865449efbc7d8d3b6446ede3cb9a23a3 (diff)
Allow mcuboot tool to use cbor2 additional to cbor
The mcuboot imgtool uses the python module `cbor`. An equivalent and updated package `cbor2` requires Python 3.7 or newer. The arch packages provide a package `python-cbor2`, but no package for `cbor`. This patch makes it possible to use the system package by adding support for the `cbor2` package additionally to the `cbor` package.
Diffstat (limited to 'tools/mcuboot/imgtool')
-rw-r--r--tools/mcuboot/imgtool/boot_record.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/mcuboot/imgtool/boot_record.py b/tools/mcuboot/imgtool/boot_record.py
index 4112b225..28797c3c 100644
--- a/tools/mcuboot/imgtool/boot_record.py
+++ b/tools/mcuboot/imgtool/boot_record.py
@@ -14,7 +14,10 @@
# limitations under the License.
from enum import Enum
-import cbor
+try:
+ import cbor2 as cbor
+except:
+ import cbor
class SwComponent(int, Enum):