Home
last modified time | relevance | path

Searched hist:f78215fd (Results 1 – 2 of 2) sorted by relevance

/openbmc/estoraged/src/
H A Dutil.cppf78215fd Tue Jun 07 15:39:22 CDT 2022 John Wedig <johnwedig@google.com> Fix code to search for MMC device

The findDevice() function is broken currently because it's looking for a
device in sysfs with the name of mmcblk*. The problem is that the boot
partitions are also showing up in sysfs (mmcblk0boot0 and mmcblk0boot1),
and the findDevice() function is getting confused.

Instead of relying on the name of the device to find the MMC device, we
now look at the following entry in sysfs, to make sure we found an MMC
device:

/sys/block/<dev_name>/device/type

The contents of that file should be MMC.

Tested:
Ran eStoraged on a machine to confirm that it created a D-Bus object
with the mmcblk0 device, instead of mmcblk0boot0.
$ busctl tree xyz.openbmc_project.eStoraged
`-/xyz
`-/xyz/openbmc_project
`-/xyz/openbmc_project/inventory
`-/xyz/openbmc_project/inventory/storage
`-/xyz/openbmc_project/inventory/storage/mmcblk0

Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I786934fcdc950b55c62bc7e3784e29d5ba73099f
/openbmc/estoraged/src/test/
H A Dutil_test.cppf78215fd Tue Jun 07 15:39:22 CDT 2022 John Wedig <johnwedig@google.com> Fix code to search for MMC device

The findDevice() function is broken currently because it's looking for a
device in sysfs with the name of mmcblk*. The problem is that the boot
partitions are also showing up in sysfs (mmcblk0boot0 and mmcblk0boot1),
and the findDevice() function is getting confused.

Instead of relying on the name of the device to find the MMC device, we
now look at the following entry in sysfs, to make sure we found an MMC
device:

/sys/block/<dev_name>/device/type

The contents of that file should be MMC.

Tested:
Ran eStoraged on a machine to confirm that it created a D-Bus object
with the mmcblk0 device, instead of mmcblk0boot0.
$ busctl tree xyz.openbmc_project.eStoraged
`-/xyz
`-/xyz/openbmc_project
`-/xyz/openbmc_project/inventory
`-/xyz/openbmc_project/inventory/storage
`-/xyz/openbmc_project/inventory/storage/mmcblk0

Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I786934fcdc950b55c62bc7e3784e29d5ba73099f