Initial integration with Entity Manager

This commit changes eStoraged so that it doesn't take a specific device
as an argument. Instead, it looks for a config object from Entity
Manager and creates a D-Bus object corresponding to the config object.

The config objects need to expose the following interface:
  "xyz.openbmc_project.Configuration.EmmcDevice"

To support more types of storage devices in the future, we can introduce
a new interface for each one.

In addition, eStoraged currently only supports 1 eMMC device. If we want
to support more than one in the future, we will need to add more
information to the Entity Manager config, to distinguish between them.

Assuming the eMMC is located on a FRU-detectable board, an "Exposes"
entry can be added to that board's Entity Manager config, for example:
{
    "Name": "example_emmc",
    "Type": "EmmcDevice"
}

Doing so will tell Entity Manager to create a config object with the
EmmcDevice interface mentioned above. Then, eStoraged will find the
config object with that interface and create its own D-Bus object that
can be used to manage the eMMC.

Tested:
Updated the Entity Manager config (as described above), started
eStoraged, then tested most of its methods and properties using busctl.
$ busctl call xyz.openbmc_project.eStoraged \
  /xyz/openbmc_project/inventory/storage/mmcblk0 \
  xyz.openbmc_project.Inventory.Item.Volume FormatLuks ays 3 1 2 3 \
  xyz.openbmc_project.Inventory.Item.Volume.FilesystemType.ext4 \
  --timeout=60
$ busctl call xyz.openbmc_project.eStoraged \
  /xyz/openbmc_project/inventory/storage/mmcblk0 \
  xyz.openbmc_project.Inventory.Item.Volume Lock
$ busctl call xyz.openbmc_project.eStoraged \
  /xyz/openbmc_project/inventory/storage/mmcblk0 \
  xyz.openbmc_project.Inventory.Item.Volume Unlock ay 3 1 2 3
$ busctl get-property xyz.openbmc_project.eStoraged \
  /xyz/openbmc_project/inventory/storage/mmcblk0 \
  xyz.openbmc_project.Inventory.Item.Volume Locked
$ busctl get-property xyz.openbmc_project.eStoraged \
  /xyz/openbmc_project/inventory/storage/mmcblk0 \
  xyz.openbmc_project.Inventory.Item.Drive Capacity
$ busctl call xyz.openbmc_project.eStoraged \
  /xyz/openbmc_project/inventory/storage/mmcblk0 \
  xyz.openbmc_project.Inventory.Item.Volume Erase s \
  xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.VerifyGeometry
$ busctl call xyz.openbmc_project.eStoraged \
  /xyz/openbmc_project/inventory/storage/mmcblk0 \
  xyz.openbmc_project.Inventory.Item.Volume Erase s \
  xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.LogicalOverWrite \
  --timeout=1200
$ busctl call xyz.openbmc_project.eStoraged \
  /xyz/openbmc_project/inventory/storage/mmcblk0 \
  xyz.openbmc_project.Inventory.Item.Volume Erase s \
  xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.LogicalVerify \
  --timeout=1200

Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: If137d02e185c366f4a1437076512b4883ba6d595
7 files changed
tree: cd8ca808e2e81732f0a35da451dc6042b02749aa
  1. include/
  2. src/
  3. subprojects/
  4. .clang-format
  5. .clang-tidy
  6. .gitignore
  7. LICENSE
  8. MAINTAINERS
  9. meson.build
  10. meson_options.txt
  11. OWNERS
  12. README.md
README.md

eStoraged

This daemon serves as an abstraction for an encrypted storage device, encapsulating the security functionality and providing a D-Bus interface to manage the encrypted filesystem on the device. Using the D-Bus interface, other software components can interact with eStoraged to do things like create a new encrypted filesystem, wipe its contents, lock/unlock the device, or change the password.