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

manifest: add improved cbor manifest support with cbor-diag #50

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ certs/slot*/bundle*
certs/slot*/immutable.sha
manifest.cbor
manifest/manifest.out.cbor
manifest/responder_manifest.cbor
manifest/*.pretty

170 changes: 26 additions & 144 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ path = "src/main.rs"

[build-dependencies]
bindgen = "0.63"
which = "6.0.0"

[dependencies]
log = "0.4"
Expand All @@ -34,10 +35,7 @@ memmap2 = { version = "0.5", optional = true}
once_cell = { version = "1.16", optional = true}
sha2 = { version = "0.10", optional = true}
env_logger = { version = "0.10", optional = true}
colored = "2.1.0"
which = "6.0.0"

libmctp = { git = "https://github.com/westerndigitalcorporation/libmctp.git" }

[dependencies.pyo3]
version = "0.20.2"
features = ["auto-initialize", "abi3-py312"]

29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,37 @@ You will also need a few host dependencies
sudo dnf install cmake clang-libs clang-devel pciutils-devel openssl openssl-devel python3-devel
```

## Python
## Ruby

spdm-utils requires the [cbor2](https://pypi.org/project/cbor2/) python module for manifest encoding and decoding. It can be installed with:
`spdm-utils` uses the [cbor-diag](https://github.com/cabo/cbor-diag) ruby gem for
manifest encoding and decoding. Similar to the implementation of this [CBOR parsing](https://cbor.me/)
online tool.

You will first need to have `gem` installed, this is a the package manager for ruby.
For example, for Fedora you can install it with:

```shell
$ sudo dnf install gem
```

After which, you can install `cbor-diag`

```shell
$ gem install cbor-diag
```
$ pip install cbor2

The default binary path *should* be, `$HOME/bin/`, which you may need to add to
your `PATH`. You can test that the scripts are usable with

```shell
$ which cbor2diag.rb
home/<user>/bin/cbor2diag.rb
```

When building `spdm-utils` it will generate a `manifest.out.cbor` which contains
the serialised cbor manifest, and also a `manifest.pretty` which is the *pretty* format
of the manifest (user friendly).

# Building

Initialise all sub-modules
Expand Down
Loading