Skip to content

Commit f4febd0

Browse files
prettier: re-format
Prettier is enabled in openbmc-build-scripts on Markdown, JSON, and YAML files to have consistent formatting for these file types. Re-run the formatter on the whole repository. Change-Id: I35ec9c19ae581e4dd00b515c1bba3a9c1862eeb1 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
1 parent 3f84e95 commit f4febd0

File tree

117 files changed

+9107
-8266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+9107
-8266
lines changed

CONTRIBUTING.md

+153-164
Large diffs are not rendered by default.

IPMITOOL-cheatsheet.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ $ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user di
8585
$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user enable <userid>
8686
```
8787

88-
## Field-replaceable Unit (FRU)
88+
## Field-replaceable Unit (FRU)
8989

9090
#### 1. View FRU information
9191

@@ -181,6 +181,7 @@ $ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" channel
181181
## Chassis
182182

183183
#### 1. Display information about the high-level status of the system rack and
184+
184185
#### power subsystem.
185186

186187
```
@@ -247,28 +248,33 @@ Currently supported devices:
247248

248249
##
249250

250-
If you want to make your override persistent over reboots use the `persistent` option:
251+
If you want to make your override persistent over reboots use the `persistent`
252+
option:
253+
251254
```
252255
$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device> options=persistent
253256
```
254257

255258
##
256259

257260
If the main host machine is based on the x86 CPU you need also pay attention to
258-
the legacy/EFI mode selector. By default IPMI overrides boot source with the legacy
259-
mode enabled. To set EFI mode use `efiboot` option:
261+
the legacy/EFI mode selector. By default IPMI overrides boot source with the
262+
legacy mode enabled. To set EFI mode use `efiboot` option:
263+
260264
```
261265
$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device> options=efiboot
262266
```
263267

264268
You can combine options with a help of `,`:
269+
265270
```
266271
$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device> options=persistent,efiboot
267272
```
268273

269274
##
270275

271276
To read current boot source override setting:
277+
272278
```
273279
$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootparam get 5
274280
```
@@ -341,6 +347,7 @@ $ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" session
341347
## Serial Over Lan (SOL)
342348

343349
#### 1. Retrieve Serial-Over-LAN configuration information for the specified
350+
344351
#### channel.
345352

346353
```

README.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Baseboard Management Controllers (BMCs). This repository contains documentation
66
for OpenBMC as a whole. There may be component-specific documentation in the
77
repository for each component.
88

9-
The [features](features.md) document lists the project's major features
10-
with links to more information.
9+
The [features](features.md) document lists the project's major features with
10+
links to more information.
1111

1212
## Contact
1313

@@ -19,34 +19,34 @@ with links to more information.
1919

2020
These documents contain details on developing OpenBMC code itself
2121

22-
- [cheatsheet.md](cheatsheet.md): Quick reference for some common
23-
development tasks
22+
- [cheatsheet.md](cheatsheet.md): Quick reference for some common development
23+
tasks
2424

25-
- [CONTRIBUTING.md](CONTRIBUTING.md): Guidelines for contributing to
26-
OpenBMC
25+
- [CONTRIBUTING.md](CONTRIBUTING.md): Guidelines for contributing to OpenBMC
2726

28-
- [development tutorials](development/README.md): Tutorials for getting up to
29-
speed on OpenBMC development
27+
- [development tutorials](development/README.md): Tutorials for getting up to
28+
speed on OpenBMC development
3029

31-
- [kernel-development.md](kernel-development.md): Reference for common
32-
kernel development tasks
30+
- [kernel-development.md](kernel-development.md): Reference for common kernel
31+
development tasks
3332

3433
## OpenBMC Usage
3534

3635
These documents describe how to use OpenBMC, including using the programmatic
3736
interfaces to an OpenBMC system.
3837

39-
- [code-update](architecture/code-update): Updating OpenBMC and host platform firmware
38+
- [code-update](architecture/code-update): Updating OpenBMC and host platform
39+
firmware
4040

41-
- [console.md](console.md): Using the host console
41+
- [console.md](console.md): Using the host console
4242

43-
- [host-management.md](host-management.md): Performing host management tasks
44-
with OpenBMC
43+
- [host-management.md](host-management.md): Performing host management tasks
44+
with OpenBMC
4545

46-
- [rest-api.md](rest-api.md): Introduction to using the OpenBMC REST API
46+
- [rest-api.md](rest-api.md): Introduction to using the OpenBMC REST API
4747

48-
- [REDFISH-cheatsheet.md](REDFISH-cheatsheet.md): Quick reference for some
49-
common OpenBMC Redfish commands
48+
- [REDFISH-cheatsheet.md](REDFISH-cheatsheet.md): Quick reference for some
49+
common OpenBMC Redfish commands
5050

51-
- [REST-cheatsheet.md](REST-cheatsheet.md): Quick reference for some common
52-
OpenBMC REST API commands
51+
- [REST-cheatsheet.md](REST-cheatsheet.md): Quick reference for some common
52+
OpenBMC REST API commands

REDFISH-cheatsheet.md

+46-14
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Redfish cheat sheet
2+
23
This document is intended to provide a set of example [Redfish][1] client
3-
commands for OpenBMC usage. This document uses cURL.
4-
This document assumes several ids, such as ManagerId, "bmc", and
5-
ComputerSystemId, "system". Assuming an id is not correct and any software
6-
written to use the Redfish API should not. From the Redfish Specification,
7-
DSP0266, "Clients shall not make assumptions about the URIs for the members of a
8-
resource collection."
4+
commands for OpenBMC usage. This document uses cURL. This document assumes
5+
several ids, such as ManagerId, "bmc", and ComputerSystemId, "system". Assuming
6+
an id is not correct and any software written to use the Redfish API should not.
7+
From the Redfish Specification, DSP0266, "Clients shall not make assumptions
8+
about the URIs for the members of a resource collection."
99

1010
## Query Redfish Service Root
11+
1112
```
1213
export bmc=xx.xx.xx.xx
1314
curl -k https://${bmc}/redfish/v1
@@ -16,29 +17,35 @@ curl -k https://${bmc}/redfish/v1
1617
---
1718

1819
## Establish Redfish connection session
20+
1921
##### Method 1
22+
2023
```
2124
export bmc=xx.xx.xx.xx
2225
curl --insecure -H "Content-Type: application/json" -X POST -D headers.txt https://${bmc}/redfish/v1/SessionService/Sessions -d '{"UserName":"root", "Password":"0penBmc"}'
2326
```
24-
A file, headers.txt, will be created. Find the `"X-Auth-Token"`
25-
in that file. Save it away in an env variable like so:
27+
28+
A file, headers.txt, will be created. Find the `"X-Auth-Token"` in that file.
29+
Save it away in an env variable like so:
2630

2731
```
2832
export bmc_token=<token>
2933
```
3034

31-
##### Method 2
35+
##### Method 2
36+
3237
```
3338
export bmc=xx.xx.xx.xx
3439
export token=`curl -k -H "Content-Type: application/json" -X POST https://${bmc}/login -d '{"username" : "root", "password" : "0penBmc"}' | grep token | awk '{print $2;}' | tr -d '"'`
3540
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/...
3641
```
42+
3743
Note: Method 2 is used in this document.
3844

3945
---
4046

4147
## View Redfish Objects
48+
4249
```
4350
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis
4451
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Managers
@@ -48,64 +55,77 @@ curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems
4855
---
4956

5057
## View sessions
58+
5159
```
5260
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/SessionService/Sessions
5361
```
5462

5563
---
5664

5765
## Host power
66+
5867
Host soft power off:
68+
5969
```
6070
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X POST https://${bmc}/redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "GracefulShutdown"}'
6171
```
6272

6373
Host hard power off:
74+
6475
```
6576
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X POST https://${bmc}/redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "ForceOff"}'
6677
```
6778

6879
Host power on:
80+
6981
```
7082
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X POST https://${bmc}/redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "On"}'
7183
```
7284

7385
Reboot Host:
86+
7487
```
7588
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X POST https://${bmc}/redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "GracefulRestart"}'
7689
```
7790

7891
---
7992

8093
## BMC reboot
94+
8195
```
8296
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X POST https://${bmc}/redfish/v1/Managers/bmc/Actions/Manager.Reset -d '{"ResetType": "GracefulRestart"}'
8397
```
8498

8599
---
86100

87101
## BMC factory reset
102+
88103
Proceed with caution:
104+
89105
```
90106
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X POST https://${bmc}/redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults -d '{"ResetToDefaultsType": "ResetAll"}'
91107
```
92108

93109
---
94110

95111
## Log entry
112+
96113
Display logging entries:
114+
97115
```
98116
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems/system/LogServices/EventLog/Entries
99117
```
100118

101119
Delete logging entries:
120+
102121
```
103122
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X POST https://${bmc}/redfish/v1/Systems/system/LogServices/EventLog/Actions/LogService.Reset
104123
```
105124

106125
---
107126

108127
## Firmware ApplyTime:
128+
109129
```
110130
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH -d '{"HttpPushUriOptions":{"HttpPushUriApplyTime":{"ApplyTime":"Immediate"}}}' https://${bmc}/redfish/v1/UpdateService
111131
```
@@ -119,71 +139,83 @@ curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH -
119139
---
120140

121141
## Firmware update
122-
Firmware update:
123-
Note the `<image file path>` must be a tarball.
142+
143+
Firmware update: Note the `<image file path>` must be a tarball.
124144

125145
```
126146
uri=$(curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService | jq -r ' .HttpPushUri')
127147
128148
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/octet-stream" -X POST -T <image file path> https://${bmc}${uri}
129149
```
130150

131-
TFTP Firmware update using TransferProtocol:
132-
Note: The `<image file path>` contains the address of the TFTP service: `xx.xx.xx.xx/obmc-phosphor-xxxxx-xxxxxxxxx.static.mtd.tar`
151+
TFTP Firmware update using TransferProtocol: Note: The `<image file path>`
152+
contains the address of the TFTP service:
153+
`xx.xx.xx.xx/obmc-phosphor-xxxxx-xxxxxxxxx.static.mtd.tar`
133154

134155
```
135156
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X POST https://${bmc}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate -d '{"TransferProtocol":"TFTP","ImageURI":"<image file path>"}'
136157
```
158+
137159
TFTP Firmware update with protocol in ImageURI:
160+
138161
```
139162
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X POST https://${bmc}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate -d '{"ImageURI":"tftp://<image file path>"}'
140163
```
141164

142165
---
143166

144167
## Update "root" password
168+
145169
Change password to "0penBmc1":
170+
146171
```
147172
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH -d '{"Password": "0penBmc1"}' https://${bmc}/redfish/v1/AccountService/Accounts/root
148173
```
149174

150175
---
151176

152177
## BIOS firmware boot control
178+
153179
Enter into BIOS setup on boot
180+
154181
```
155182
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH https://${bmc}/redfish/v1/Systems/system -d '{"Boot":{"BootSourceOverrideEnabled": "Continuous","BootSourceOverrideTarget": "BiosSetup"}}'
156183
```
157184

158185
Fully boot
186+
159187
```
160188
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH https://${bmc}/redfish/v1/Systems/system -d '{"Boot":{"BootSourceOverrideEnabled": "Disabled","BootSourceOverrideTarget": "None"}}'
161189
```
162190

163191
Change Legacy/EFI selector (valid only if host is based on the x86 CPU)
192+
164193
```
165194
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH https://${bmc}/redfish/v1/Systems/system -d '{"Boot":{"BootSourceOverrideEnabled": "Once","BootSourceOverrideTarget": "None","BootSourceOverrideMode": "UEFI"}}'
166195
```
167196

168197
---
169198

170199
## Enable NTP
200+
171201
Add a NTP Server
202+
172203
```
173204
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol -d '{"NTP":{"NTPServers":["time.nist.gov"]}}'
174205
```
175206

176207
Now enable NTP
208+
177209
```
178210
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol -d '{"NTP":{"ProtocolEnabled": true}}'
179211
```
180212

181213
---
182214

183215
## Disable IPMI
216+
184217
```
185218
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol -d '{"IPMI":{"ProtocolEnabled": false}}'
186219
```
187220

188-
189221
[1]: https://www.dmtf.org/standards/redfish

0 commit comments

Comments
 (0)