Skip to content

Commit 7a9c309

Browse files
committed
feat: add flashprog support to flash module
Extend flash module to support both flashrom and flashprog tools, allowing users to choose their preferred flash utility via configuration. Signed-off-by: llogen <christoph.lange@blindspot.software>
1 parent 3f39f64 commit 7a9c309

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Key features include:
3535
For detailed information on the system architecture, see the [Documentation](./docs/README.md).
3636

3737
| Supported Client OS | Recommended DUT Agent Hardware |
38-
|---------------------|--------------------------------|
38+
| ------------------- | ------------------------------ |
3939
| Linux | RaspberryPi 4 |
4040

4141
## Getting Started
@@ -85,14 +85,13 @@ DUT agent on it. Below you can find the currently supported modules with example
8585
[here](./docs/dutagent-config.md), to learn how you can adapt the agent's configuration to your needs
8686

8787
| Modules | Status |
88-
|--------------------------------------------------------------------|--------------------------|
88+
| ------------------------------------------------------------------ | ------------------------ |
8989
| [GPIO Button](./pkg/module/gpio/README.md) | :white_check_mark: |
9090
| [GPIO Switch](./pkg/module/gpio/README.md) | :white_check_mark: |
9191
| [IPMI Power Control](./pkg/module/gpio/README.md) | :white_check_mark: |
9292
| [Power Distribution Unit (Intellinet)](./pkg/module/pdu/README.md) | :white_check_mark: |
9393
| Power Distribution Unit (Delock) | :hourglass_flowing_sand: |
94-
| [SPI Flasher (flashrom)](./pkg/module/flash/README.md) | :white_check_mark: |
95-
| SPI Flasher (flashprog) | :hourglass_flowing_sand: |
94+
| [SPI Flasher](./pkg/module/flash/README.md) | :white_check_mark: |
9695
| [Serial Console](./pkg/module/serial/README.md) | :white_check_mark: |
9796
| [Shell Execution](./pkg/module/shell/README.md) | :white_check_mark: |
9897
| [Secure Shell (SSH)](./pkg/module/ssh/README.md) | :white_check_mark: |
@@ -118,6 +117,6 @@ Commons Fund. The NGI0 Commons Fund is made possible with financial support from
118117
[Next Generation Internet](https://ngi.eu/) program.
119118

120119
| | | |
121-
|------------------------------|------------------------------------|----------------------------|
120+
| ---------------------------- | ---------------------------------- | -------------------------- |
122121
| ![nlnet](./assets/nlnet.png) | ![European Union](./assets/EU.png) | ![NGI0](./assets/NGI0.png) |
123122

pkg/module/flash/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The _shell_ package provides a single module:
1+
The _flash_ package provides a single module:
22

33
# Flash
44

@@ -8,19 +8,20 @@ Read or write the SPI flash on the DUT.
88
ARGUMENTS:
99
[read | write] <image>
1010
11-
For read operation, <image> sets the filepath the read image is saved at the client.
11+
For read operation, <image> sets the filepath the read image is saved at the client.
1212
For write operation, <image> is the local filepath to the image at the client.
1313
1414
```
1515

16-
This module is a wrapper around flash-software on the _dutagent_. At the moment only _flashrom_ is supported.
17-
Other software will be configurable in this module later. The flasher software must be installed on the _dutagent_, and
18-
suitable flasher hardware must be hooked up to the DUT. Functionality is tested with DediProg programmers.
16+
This module is a wrapper around a flasher tool on the _dutagent_. Supported tools: _flashrom_, _flashprog_.
17+
The flasher tool must be installed on the _dutagent_, and suitable flasher hardware must be hooked up to the DUT.
18+
Functionality is tested with DediProg programmers.
1919

20-
See [flash-example-cfg.yml](./flash-example-cfg.yml) for examples.
20+
See [flash-example-cfg.yml](./flash-example-cfg.yml) for examples.
2121

2222
## Configuration Options
2323

2424
| Option | Value | Description |
2525
|------------|--------|---------------------------------------------------------------------------------------------------|
2626
| programmer | string | Name of the flasher hardware, that is used by the _dutagent_ and attached to the DUT's SPI flash. |
27+
| tool | string | Path to the flasher tool binary on the _dutagent_. Defaults to `/bin/flashrom` if not specified. Supported: flashrom, flashprog. |

pkg/module/flash/flash-example-cfg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ devices:
1111
- module: flash
1212
main: true
1313
options:
14-
tool: "/usr/sbin/flashrom"
14+
tool: "/usr/sbin/flashprog"
1515
programmer: "dediprog"

pkg/module/flash/flash.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func init() {
2727
ID: "flash",
2828
New: func() module.Module {
2929
return &Flash{
30-
supportedTools: []string{"flashrom"},
30+
supportedTools: []string{"flashrom", "flashprog"},
3131
}
3232
},
3333
})
@@ -52,8 +52,8 @@ const (
5252
type Flash struct {
5353
// Programmer is the name of the flasher hardware.
5454
Programmer string
55-
// Tool is th path to the underlying flash-tool on the dutagent. If unset, [DefaultFlashTool] is used.
56-
// Currently only fashrom is supported.
55+
// Tool is the path to the underlying flash-tool on the dutagent. If unset, [DefaultFlashTool] is used.
56+
// Supported tools: flashrom, flashprog.
5757
Tool string
5858

5959
op op // op holds the current flash operation
@@ -78,8 +78,8 @@ const description = `
7878
For read operation, <image> sets the filepath the read image is saved at the client.
7979
For write operation, <image> is the local filepath to the image at the client.
8080
81-
This module is a wrapper around a flash software on the dutagent. The flasher software
82-
must be installed on the dutagent and a suitable flasher hardware must be hooked up to
81+
This module is a wrapper around a flasher tool on the dutagent. The flasher tool
82+
must be installed on the dutagent and a suitable flasher hardware must be hooked up to
8383
the DUT.
8484
8585
`

0 commit comments

Comments
 (0)