Skip to content

Commit f057894

Browse files
committed
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.
1 parent 8fee341 commit f057894

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/mcuboot/imgtool/boot_record.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
# limitations under the License.
1515

1616
from enum import Enum
17-
import cbor
17+
try:
18+
import cbor2 as cbor
19+
except:
20+
import cbor
1821

1922

2023
class SwComponent(int, Enum):

0 commit comments

Comments
 (0)