Skip to content

Commit 713ed77

Browse files
committed
README: Add score comparison instructions
Signed-off-by: Pawel Langowski <[email protected]>
1 parent 9c210f4 commit 713ed77

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ but also many more coreboot distributions like heads.
2424
## Usage
2525

2626
```bash
27-
usage: openness_score.py [-o OUTPUT] [-v] [-V] [file]
27+
usage: openness_score.py [-c proprietary_file] [-p PLATFORM] [-o OUTPUT] [-v] [-m [-V] [file]
2828

2929
Calculate Dasharo Openness Score for firmware images
3030

3131
positional arguments:
3232
file Firmware binary file to be parsed
3333

3434
options:
35+
-c proprietary_file, --compare proprietary_file
36+
Compare Dasharo and proprietary firmware scores and store result in a Markdown table. file should be the Dasharo binary and proprietary_file should be the proprietary firmware binary.
37+
-p PLATFORM, --platform PLATFORM
38+
Platform model to provide to the table when --compare is set.
3539
-o OUTPUT, --output OUTPUT
3640
Specifies the directory where to store the results
3741
-v, --verbose Print verbose information during the image parsing
@@ -57,6 +61,33 @@ The utility will produce 3 files:
5761
precise numbers and detailed classification of firmware image components
5862
to closed-source, open-source, data and empty categories
5963
64+
Example with `--compare` flag:
65+
66+
```bash
67+
./openness_score/openness_score.py msi_ms7d25_v1.1.4_ddr4.rom -c E7D25IMS.1M1 -p "MS-7D25"
68+
```
69+
70+
Aside from the 3 files mentioned above, this will also produce `compare.md` - A
71+
Markdown table containing the score comparison between the two binaries. If the
72+
file already exists, the result will be appended as a single row.
73+
74+
The table contains the following metrics:
75+
76+
- `closed-source diff`
77+
- `data size diff`
78+
- `empty space diff`
79+
80+
Each metric is calculated using the formula:
81+
82+
```txt
83+
(Dasharo <type> size - Proprietary <type> size) * 100 / Proprietary <type> size
84+
```
85+
86+
`<type>` is replaced by `closed-source`, `data` or `empty space` accordingly.
87+
88+
You can use `scripts/compare.sh` to generate a comparison table for common
89+
Dasharo platforms. For more information, see the script's help.
90+
6091
**The utility currently supports coreboot and pure UEFI images only.**
6192

6293
### Examples

0 commit comments

Comments
 (0)