bare-metal: hostlogger: restrict hostlogger to guestOS only

This will delay starting the hostlogger in baremetal mode. It will
start/stop with the gbmc-bare-metal-active.target.

Tested:
# In a simulation of BM mode:
echo anything > /dev/tty0
root@dddgj26-nfd01:~# wget -qO - http://localhost/redfish/v1/Systems/system/LogServices/HostLogger/Entries
{
  "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries",
  "@odata.type": "#LogEntryCollection.LogEntryCollection",
  "Description": "Collection of HostLogger Entries",
  "Members": [],
  "Members@odata.count": 0,
  "Name": "HostLogger Entries"
root@dddgj26-nfd01:~# systemctl start gbmc-bare-metal-active.target
root@dddgj26:~# echo hello > /dev/tty0
root@dddgj26-nfd01:~# wget -qO - http://localhost/redfish/v1/Systems/system/LogServices/HostLogger/Entries
{
  "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries",
  "@odata.type": "#LogEntryCollection.LogEntryCollection",
  "Description": "Collection of HostLogger Entries",
  "Members": [
    {
      "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries/0",
      "@odata.type": "#LogEntry.v1_9_0.LogEntry",
      "EntryType": "Oem",
      "Id": "0",
      "Message": "hello",
      "Name": "Host Logger Entry",
      "OemRecordFormat": "Host Logger Entry",
      "Severity": "OK"
    },
    {
      "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries/1",
      "@odata.type": "#LogEntry.v1_9_0.LogEntry",
      "EntryType": "Oem",
      "Id": "1",
      "Message": "\n",
      "Name": "Host Logger Entry",
      "OemRecordFormat": "Host Logger Entry",
      "Severity": "OK"
    }
  ],
  "Members@odata.count": 2,
  "Name": "HostLogger Entries"
root@dddgj26-nfd01:~# systemctl stop gbmc-bare-metal-active.targets
dddgj26:~# echo hello2 > /dev/tty0
root@dddgj26-nfd01:~# wget -qO - http://localhost/redfish/v1/Systems/system/LogServices/HostLogger/Entries
{
  "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries",
  "@odata.type": "#LogEntryCollection.LogEntryCollection",
  "Description": "Collection of HostLogger Entries",
  "Members": [
    {
      "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries/0",
      "@odata.type": "#LogEntry.v1_9_0.LogEntry",
      "EntryType": "Oem",
      "Id": "0",
      "Message": "hello",
      "Name": "Host Logger Entry",
      "OemRecordFormat": "Host Logger Entry",
      "Severity": "OK"
    },
    {
      "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries/1",
      "@odata.type": "#LogEntry.v1_9_0.LogEntry",
      "EntryType": "Oem",
      "Id": "1",
      "Message": "\n",
      "Name": "Host Logger Entry",
      "OemRecordFormat": "Host Logger Entry",
      "Severity": "OK"
    }
  ],
  "Members@odata.count": 2,
  "Name": "HostLogger Entries"
root@dddgj26-nfd01:~# systemctl restart gbmc-bare-metal-active.target
dddgj26:~# echo hello_restart > /dev/tty0
root@dddgj26-nfd01:~# wget -qO - http://localhost/redfish/v1/Systems/system/LogServices/HostLogger/Entries
{
  "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries",
  "@odata.type": "#LogEntryCollection.LogEntryCollection",
  "Description": "Collection of HostLogger Entries",
  "Members": [
    {
      "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries/0",
      "@odata.type": "#LogEntry.v1_9_0.LogEntry",
      "EntryType": "Oem",
      "Id": "0",
      "Message": "hello",
      "Name": "Host Logger Entry",
      "OemRecordFormat": "Host Logger Entry",
      "Severity": "OK"
    },
    {
      "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries/1",
      "@odata.type": "#LogEntry.v1_9_0.LogEntry",
      "EntryType": "Oem",
      "Id": "1",
      "Message": "\n",
      "Name": "Host Logger Entry",
      "OemRecordFormat": "Host Logger Entry",
      "Severity": "OK"
    },
    {
      "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries/2",
      "@odata.type": "#LogEntry.v1_9_0.LogEntry",
      "EntryType": "Oem",
      "Id": "2",
      "Message": "hello_restart",
      "Name": "Host Logger Entry",
      "OemRecordFormat": "Host Logger Entry",
      "Severity": "OK"
    },
    {
      "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries/3",
      "@odata.type": "#LogEntry.v1_9_0.LogEntry",
      "EntryType": "Oem",
      "Id": "3",
      "Message": "\n",
      "Name": "Host Logger Entry",
      "OemRecordFormat": "Host Logger Entry",
      "Severity": "OK"
    }
  ],
  "Members@odata.count": 4,
  "Name": "HostLogger Entries"

https://fusion2.corp.google.com/ci/guitar/projects/UNSPECIFIED/activity/227979c0-0603-4884-b477-4e7de5cce600/overview

Note: above fution link is from cherry pick. For release branch there is an ongoing issue that blocks all presubmits. We manually verified that nightly result looks good and all tests in presubmit passed.

Google-Bug-Id: 316190388
Change-Id: Ie5c3632345d5ebad88fc419caff94679c2df0fa2
Signed-off-by: Yuxiao Zhang <yuxiaozhang@google.com>
(cherry picked from commit ff64d40ba246b5861557b18eeb706eab27eb2c2d)
1 file changed
tree: fd4d27bc8a6c15be7f20e06032f6de9dedf7f018
  1. conf/
  2. dynamic-layers/
  3. recipes-bsp/
  4. recipes-connectivity/
  5. recipes-core/
  6. recipes-devtools/
  7. recipes-extended/
  8. recipes-google/
  9. recipes-kernel/
  10. recipes-phosphor/
  11. LICENSE
  12. README.md
README.md

meta-gbmc-staging

This repository contains additions to the openbmc/meta-google layer that are not yet ready for OpenBMC inclusion.

How to use this layer

  1. Clone openbmc/openbmc from GitHub.
  2. Clone this layer from GitHub into a subdirectory of openbmc.