Skip to content

Commit

Permalink
optional service to log info log on chassis poweron
Browse files Browse the repository at this point in the history
This commit introduces a new service that will log an informational log
on every chassis power on.

This new informational error is being created for a couple of reasons:
- An easy eye catcher when reviewing logs to easily distinguish between
  major boots of the system (ones including a chassis power cycle)
- A mechanism for other OpenBMC software which utilizes the log to
  report back to the user when errors from the current boot need
  attention

This service needs to run before any of the power/vrm services run to
ensure any logs from those services can be correlated to running after
the current power on has started.

By default this service will not be installed but can be brought in via
a bbappend if desired.

Tested:
- Built new service into a flash image and confirmed
  - Info log was logged as expected during power on (prior to any vrm,
    power, or fan functions)
  - Info log was not logged when rebooting the BMC from a host running
    state

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: If78c076d86efabed6b0093e9f4116502a4d9da93
  • Loading branch information
geissonator committed May 1, 2023
1 parent 8aca050 commit afe12d6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service_files/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ unit_files = [
'phosphor-set-host-transition-to-off@.service',
'phosphor-set-host-transition-to-running@.service',
'phosphor-chassis-check-power-status@.service',
'phosphor-bmc-security-check.service'
'phosphor-bmc-security-check.service',
'phosphor-create-chassis-poweron-log@.service'
]

foreach u : unit_files
Expand Down
20 changes: 20 additions & 0 deletions service_files/phosphor-create-chassis-poweron-log@.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[Unit]
Description=Create info log indicating chassis%i poweron has started
Wants=obmc-power-start-pre@%i.target
Before=obmc-power-start-pre@%i.target
Before=phosphor-regulators-config.service
Conflicts=obmc-chassis-poweroff@%i.target
ConditionPathExists=!/run/openbmc/chassis@%i-on

[Service]
Restart=no
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c \
"busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging \
xyz.openbmc_project.Logging.Create Create ssa{ss} \
xyz.openbmc_project.State.Info.ChassisPowerOnStarted \
xyz.openbmc_project.Logging.Entry.Level.Informational 1 CHASSIS_ID %i"

[Install]
WantedBy=obmc-chassis-poweron@%i.target

0 comments on commit afe12d6

Please sign in to comment.