https://github.com/open-power/guard
https://github.com/open-power/guard
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/open-power/guard
- Owner: open-power
- License: apache-2.0
- Created: 2021-05-27T16:05:17.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-11T09:03:56.000Z (over 1 year ago)
- Last Synced: 2024-05-09T08:23:34.611Z (about 1 year ago)
- Language: C++
- Size: 104 KB
- Stars: 0
- Watchers: 7
- Forks: 12
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GUARD
Guarding the system against failures by permanently isolating faulty units.
guard records contains the permanently isolated components details. GUARD
repository provides the libraries and tools to create/list/delete guard records## Building
Need `meson` and `ninja`. Alternatively, source an OpenBMC ARM/x86 SDK.
```
meson build && ninja -C build
```To use power system device for guard FRU's.
```
meson build -Ddevtree=enabled && ninja -C build
```To build libguard with verbose level to get required trace.\
Supported verbose level:\
`0` - Emergency, `1` - Alert, `2` - Critical, `3` - Error, `4` - Warning, `5` -
Notice, `6` - Info, `7` - Debug\
By default verbose level is Error.```
meson build -Dverbose=7 && ninja -C build
```## To run unit tests
Tests can be run in the CI docker container, or with an OpenBMC x86 sdk(see
below for x86 steps).```
meson -Doe-sdk=enabled -Dtests=enabled build
ninja -C build test
```## Usage of GUARD tool
```
guard --help
GUARD Tool
Usage: guard [OPTIONS]Options:
-h,--help Guard CLI tool options
-c,--create TEXT Create Guard record, expects physical path as input
-i,--invalidate FLOAT Invalidate a single Guard record, expects record id
as input
-I,--invalidate-all Invalidates all the Guard records
-l,--list List all the GUARD'ed resources
-r,--reset Erase all the Guard records
-v,--version Version of GUARD tool```
**Note:** Physical path can be fetched from device tree, using
ATTR_PHYS_DEV_PATH attribute of the corresponding target. Physical path formats
supported by guard tool:-- physical:sys-0/node-0/proc-0/mc-0/mi-0/mcc-0
- /sys-0/node-0/proc-0/mc-0/mi-0/mcc-0
- sys-0/node-0/proc-0/mc-0/mi-0/mcc-0### Examples
- To create a guard record.
```
guard -c sys-0/node-0/proc-0/mc-0/mi-0/mcc-0
Success
```- To list the guard records present in a system.
```
guard -l
ID | ERROR | Type | Path
00000001 | 00000000 | manual | physical:sys-0/node-0/proc-0/mc-0/mi-0/mcc-0
```- To erase all the guard records
```
guard -r
```- To invalidate a single guard record
```
guard -i 1
```- To invalidate all the guard records
```
guard -I
```