Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trezor-core-tools python package #4078

Merged
merged 4 commits into from
Aug 28, 2024
Merged

trezor-core-tools python package #4078

merged 4 commits into from
Aug 28, 2024

Conversation

matejcik
Copy link
Contributor

@matejcik matejcik commented Aug 1, 2024

this, essentially, replaces ./core/tools/headertool.py with just headertool

also improves combine_firmware so that it (a) accepts model name as an argument, instead of path to the header file, (b) accepts lowercase section names, (c) is friendlier when you mess up a section name

@matejcik matejcik marked this pull request as ready for review August 1, 2024 21:19
@matejcik
Copy link
Contributor Author

matejcik commented Aug 1, 2024

tagging @TychoVrahe for combine_firmware changes, @obrusvit for Python layout

@matejcik matejcik self-assigned this Aug 6, 2024
Copy link
Contributor

@obrusvit obrusvit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to use new tools layout_parser and headertool after invoking poetry install from this branch.

Apart from these minor issues, seems to be OK.

core/tools/trezor_core_tools/layout_parser.py Outdated Show resolved Hide resolved
core/tools/trezor_core_tools/layout_parser.py Outdated Show resolved Hide resolved
core/tools/README.md Outdated Show resolved Hide resolved
STORAGE_1_SECTOR_END = $(shell python ./tools/layout_parser.py ${LAYOUT_FILE} STORAGE_1_SECTOR_END)
STORAGE_2_SECTOR_START = $(shell python ./tools/layout_parser.py ${LAYOUT_FILE} STORAGE_2_SECTOR_START)
STORAGE_2_SECTOR_END = $(shell python ./tools/layout_parser.py ${LAYOUT_FILE} STORAGE_2_SECTOR_END)
FLASH_START = $(shell layout_parser ${TREZOR_MODEL} FLASH_START)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FLASH_START seems to be unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd keep it around in case something like make flash would use it? wdyt @TychoVrahe

FIRMWARE_P1_MAXSIZE = $(shell layout_parser ${TREZOR_MODEL} FIRMWARE_P1_IMAGE_MAXSIZE)
FIRMWARE_P2_MAXSIZE = $(shell layout_parser ${TREZOR_MODEL} FIRMWARE_P2_IMAGE_MAXSIZE)
BOARDLOADER_SECTOR_START = $(shell layout_parser ${TREZOR_MODEL} BOARDLOADER_SECTOR_START)
BOARDLOADER_SECTOR_END = $(shell layout_parser ${TREZOR_MODEL} BOARDLOADER_SECTOR_END)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BOARDLOADER_SECTOR_START and BOARDLOADER_SECTOR_END seem to be unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtto

@matejcik matejcik merged commit 6ae9686 into main Aug 28, 2024
33 of 35 checks passed
@matejcik matejcik deleted the matejcik/trezor-core-tools branch August 28, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Approved
Development

Successfully merging this pull request may close these issues.

3 participants