Add dbus match rule to detect motherboard object creation

In some rare cases, it is observed that the smbios table is
received by smbiosmdr daemon way before Entity Manager creates
the motherboard object path. When that happens, smbios daemon
creates dbus objects for the cpus but fails to associate them with
the chassis. This causes missing "Processors" and "Memory" sections
under "Links" in the chassis response.

The issue can be easily reproduced by rebooting just the BMC without
rebooting the host node.

The fix is to setup a dbus matcher when the motherboard path
is not found. The matcher shall look for the event when
xyz.openbmc_project.Inventory.Item.System interface is added
to the dbus object.

Tested:

Tried rebooting the bmc multiple times and verified
that post reboot, the "Processors" and "Memory" sections
are visible under "Links" section in the Chassis response

```
{
  "@odata.id": "/redfish/v1/Chassis/<Chassis Name>",
  "@odata.type": "#Chassis.v1_17_0.Chassis",
  "Actions": {
    "#Chassis.Reset": {
      "@Redfish.ActionInfo": "/redfish/v1/Chassis/<Chassis Name>/ResetActionInfo",
      "target": "/redfish/v1/Chassis/<Chassis Name>/Actions/Chassis.Reset"
    }
  },
  "Assembly": {
    "@odata.id": "/redfish/v1/Chassis/<Chassis Name>/Assembly"
  },
  "ChassisType": ".....",
  "Id": "<Chassis Name>",
  "Links": {
    "Cables": [
      {
         ....
      }
    ],
    "Cables@odata.count": ..,
    "ComputerSystems": [
      {
        "@odata.id": "/redfish/v1/Systems/system"
      }
    ],
    "Contains": [
      .......
    ],
    "Contains@odata.count": ..,
    "ManagedBy": [
      {
        "@odata.id": "/redfish/v1/Managers/bmc"
      }
    ],
    "Processors": [ <<==== Processor section is present
      {
        "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0"
      },
      {
        "@odata.id": "/redfish/v1/Systems/system/Processors/cpu1"
      },
      {
        "@odata.id": "/redfish/v1/Systems/system/Processors/cpu2"
      },
      .....
    ],
    "Processors@odata.count": ..
  },
  "LogServices": {
    "@odata.id": "/redfish/v1/Chassis/<Chassis Name>/LogServices"
  },
  "Manufacturer": ".....",
  "Memory": { <<==== Memory section is present
    "@odata.id": "/redfish/v1/Systems/system/Memory"
  },
  "Model": ".....",
  "Name": "<Chassis Name>",
  "PCIeDevices": {
    "@odata.id": "/redfish/v1/Systems/system/PCIeDevices"
  },
  "PartNumber": ".....",
  "Power": {
    "@odata.id": "/redfish/v1/Chassis/<Chassis Name>/Power"
  },
  "PowerState": "On",
  "PowerSubsystem": {
    "@odata.id": "/redfish/v1/Chassis/<Chassis Name>/PowerSubsystem"
  },
  "Sensors": {
    "@odata.id": "/redfish/v1/Chassis/<Chassis Name>/Sensors"
  },
  "SerialNumber": ".....",
  "Status": {
    "Health": "OK",
    "HealthRollup": "OK",
    "State": "Enabled"
  },
  "Thermal": {
    "@odata.id": "/redfish/v1/Chassis/<Chassis Name>/Thermal"
  },
  "ThermalSubsystem": {
    "@odata.id": "/redfish/v1/Chassis/<Chassis Name>/ThermalSubsystem"
  }
}
```

Change-Id: I58b514c9e845d64770fa6f946493222a011a2018
Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
diff --git a/src/mdrv2.cpp b/src/mdrv2.cpp
index f8e2654..173b34f 100644
--- a/src/mdrv2.cpp
+++ b/src/mdrv2.cpp
@@ -400,6 +400,7 @@
     method.append(systemInterfacePath);
     method.append(0);
     method.append(std::vector<std::string>({systemInterface}));
+
     try
     {
         std::vector<std::string> paths;
@@ -408,7 +409,32 @@
         if (paths.size() < 1)
         {
             phosphor::logging::log<phosphor::logging::level::ERR>(
-                "Failed to get system motherboard dbus path.");
+                "Failed to get system motherboard dbus path. Setting up a "
+                "match rule");
+            // Add match rule if motherboard dbus path is not yet created
+            static std::unique_ptr<sdbusplus::bus::match_t>
+                motherboardConfigMatch =
+                    std::make_unique<sdbusplus::bus::match_t>(
+                        bus,
+                        sdbusplus::bus::match::rules::interfacesAdded() +
+                            sdbusplus::bus::match::rules::argNpath(
+                                0,
+                                "/xyz/openbmc_project/inventory/system/board/"),
+                        [this,
+                         systemInterface](sdbusplus::message::message& msg) {
+                            sdbusplus::message::object_path objectName;
+                            boost::container::flat_map<
+                                std::string,
+                                boost::container::flat_map<
+                                    std::string,
+                                    std::variant<std::string, uint64_t>>>
+                                msgData;
+                            msg.read(objectName, msgData);
+                            if (msgData.contains(systemInterface))
+                            {
+                                this->systemInfoUpdate();
+                            }
+                        });
         }
         else
         {