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

Punchboot-tool merge #30

Merged
merged 13 commits into from Dec 4, 2023
Merged

Punchboot-tool merge #30

merged 13 commits into from Dec 4, 2023

Conversation

jonasblixt
Copy link
Owner

No description provided.

Copy link

codecov bot commented Nov 28, 2023

Codecov Report

Attention: 68 lines in your changes are missing coverage. Please review.

Comparison is base (a71fb52) 66.54% compared to head (e7508b0) 66.16%.

Files Patch % Lines
src/boot/linux.c 9.52% 19 Missing ⚠️
include/libc/ctype.h 0.00% 14 Missing ⚠️
src/arch/armv7a/arm32_aeabi_divmod.c 37.50% 10 Missing ⚠️
src/boot/ab_state.c 42.85% 8 Missing ⚠️
src/boot/boot.c 50.00% 8 Missing ⚠️
src/boot/image_helpers.c 66.66% 6 Missing ⚠️
src/arch/armv7a/arch.c 0.00% 2 Missing ⚠️
src/bio.c 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #30      +/-   ##
==========================================
- Coverage   66.54%   66.16%   -0.39%     
==========================================
  Files          54       54              
  Lines        2828     2787      -41     
==========================================
- Hits         1882     1844      -38     
+ Misses        946      943       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This is a major re-write of the tooling. Firstly the tools repo
(punchboot-tools) has been merged back into the main punchboot
repository to reduce the maintanence burden.

Historically the tools were devided into a C shared library, the CLI
written in C and a thin Python wrapper.

With this commit both the shared library and the C CLI is replaced with
a more rich python layer and CLI. Most of the low-level stuff is still
left in the C code, so it's still possible to create bindings for other
languages.

But going forward Python will be the main language for the tooling.

With this commit the C wrapper mainly deals with byte arrays and most of
the string handling, UUID conversion, checksum generation are moved to
the python top layer.

Minor changes have been introduced to the Python API:

--- New functionallity ---
Session.authenticate_dsa_token - New, exposes the underlying DSA token
                                 authentication mechanism
Session.part_erase             - Erase a partition

--- Breaking changes ---
part_get_partitions - New, Replaces 'part_list_partitions' which only
                        exposed UUID's and description fiellds of partitions.
                        This new function returns all information about partitions.

--- Updated functions that does not break API compability ---
__init__     - Implemented optional UUID selection parameter, with this
                it's now possible to initialize sessions to different puchboot
                devices attached to the same host.

part_verify  - Can now accept either a pathlib Path, a byte array or
a BufferedReader, and part argument can be either a string version of
an uuid or an UUID object

part_write   - Can now accept either a pathlib Path or a BufferedReader
                    and part argument can be either a string version of
                    an uuid or an UUID object

part_table_install - Can now accept string or UUID object for part parameter

board_run_command - Can now accept both command ID's and string
    version of the command, Support for passing an optinal byte array as
    argument has also been added The underlying API has changed slightly to
    support returning byte arrays, and the python does the same thing now.

--- Deprecations ---
    part_resize - This has not been supported for a while in the bootloader, and
                    now it has been removed from punchboot tools as well
With off_t defined this file can't be used to build the python library
in a normal linux environment.
To make it clear that thease functions can only be used to load and run
bpak files.
And drop the "OTP" part. It _may_ be OTP on some platforms/boards but
the wire format / API should not dictate that.

This function has never been implemented in the CM parser so it's safe
to adjust it.

This still needs an implementation / abstraction in CM before it can be
useful.
When we detect overlapping memory segments.
This commit includes fixes to enable builds on:
 - Native windows builds without using msys2/cygwin
 - Macos x86_64 and arm64
 - Linux

Historically the only binary release was on windows with an installer to
simplify driver installation and such. With this commit we instead build
binary python wheels for Python 3.8 -> Python 3.12 on Windows, Linux and
MacOS (x86_64 and arm64) and distribute them through PyPi.

It's now as easy as: pip install punchboot.
@jonasblixt jonasblixt merged commit 519b308 into master Dec 4, 2023
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant