67a47446 | 05-Apr-2022 |
John Wedig <johnwedig@google.com> |
Switch eStoraged to asio interface
Switching the D-Bus interface to asio makes it easier to integrate with EntityManager. In addition, this switch to asio makes sense since some of the erase operati
Switch eStoraged to asio interface
Switching the D-Bus interface to asio makes it easier to integrate with EntityManager. In addition, this switch to asio makes sense since some of the erase operations take a long time, about 6 minutes.
This commit also removes one of the clang-tidy checks because clang was flagging an error in one of the boost asio files, inside the constructor for sdbusplus::asio::connection.
Tested: Tested most of the methods and properties using busctl. $ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \ /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.mmcblk0 \ /xyz/openbmc_project/inventory/storage/mmcblk0 \ xyz.openbmc_project.Inventory.Item.Volume Lock $ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \ /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.mmcblk0 \ /xyz/openbmc_project/inventory/storage/mmcblk0 \ xyz.openbmc_project.Inventory.Item.Volume Locked $ busctl get-property xyz.openbmc_project.eStoraged.mmcblk0 \ /xyz/openbmc_project/inventory/storage/mmcblk0 \ xyz.openbmc_project.Inventory.Item.Drive Capacity $ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \ /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.mmcblk0 \ /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.mmcblk0 \ /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: I99cb371871bfa68eb0193f614f899221afd9013a
show more ...
|
605085a6 | 05-Nov-2021 |
John Edward Broadbent <jebr@google.com> |
Add erase sanitize
Sanitize uses the eMMC firmware to erase all blocks.
Tested: $ cat /dev/urandom > /dev/mmcblk0
$ time busctl call xyz.openbmc_project.eStoraged.mmcblk0 \ /xyz/openbmc_project/in
Add erase sanitize
Sanitize uses the eMMC firmware to erase all blocks.
Tested: $ cat /dev/urandom > /dev/mmcblk0
$ time busctl call xyz.openbmc_project.eStoraged.mmcblk0 \ /xyz/openbmc_project/inventory/storage/mmcblk0 \ xyz.openbmc_project.Inventory.Item.Volume Erase s \ xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.VendorSanitize \ --timeout=1200
real 0m1.793s user 0m0.021s sys 0m0.009s
root@ytbaz20-nfd01:/# cat /dev/mmcblk0 | hexdump
0000000 0000 0000 0000 0000 0000 0000 0000 0000 *
Signed-off-by: John Edward Broadbent <jebr@google.com> Change-Id: I31bc21c0b6d31cbba0db752d94a93eb004dbbde6
show more ...
|
e35e7361 | 22-Mar-2022 |
John Edward Broadbent <jebr@google.com> |
Add implementation capacity for drive interface
This will set the capacity property when the eStoraged object is created. This change does not expect the drive size to change.
Change-Id: I72cd68c50
Add implementation capacity for drive interface
This will set the capacity property when the eStoraged object is created. This change does not expect the drive size to change.
Change-Id: I72cd68c5045e9ef49939f4655a223a02234c7434 Signed-off-by: John Edward Broadbent <jebr@google.com>
show more ...
|
a6e3b99d | 17-Mar-2022 |
John Edward Broadbent <jebr@google.com> |
Refactor findsize into util away from erase
At first the size was only needed for erase, now it is needed for the drives interface. The code needed to be refactored to make drive interface implement
Refactor findsize into util away from erase
At first the size was only needed for erase, now it is needed for the drives interface. The code needed to be refactored to make drive interface implementation possible.
Signed-off-by: John Edward Broadbent <jebr@google.com> Change-Id: I0a23ee23a0de3fd89a9e776b4854e8da9a8ff2e4
show more ...
|
86dfb244 | 14-Mar-2022 |
John Edward Broadbent <jebr@google.com> |
Add the Drives Interface to eStorageD
This new interface will be able to send machine health information from eStorageD to clients on dbus using phosphor dbus interfaces.
$ busctl call -j xyz.openb
Add the Drives Interface to eStorageD
This new interface will be able to send machine health information from eStorageD to clients on dbus using phosphor dbus interfaces.
$ busctl call -j xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper GetSubTree sias "/xyz/openbmc_project/inventory" 0 1 "xyz.openbmc_project.Inventory.Item.Drive"
$ curl -u root:0penBmc -X GET "http://localbmc/redfish/v1/Systems/system/Storage/1/Drives/mmcblk0"
Signed-off-by: John Edward Broadbent <jebr@google.com> Change-Id: I91facaf6d1ac0d52258fc97ba93e6f2138619073
show more ...
|
a1e0eb03 | 15-Mar-2022 |
John Edward Broadbent <jebr@google.com> |
Change DBus path from storage to inventory
bmcweb only searches for drive in the inventory. If we want bmcweb to find and treat the eMMC like drive, we must change this path.
It would be possible t
Change DBus path from storage to inventory
bmcweb only searches for drive in the inventory. If we want bmcweb to find and treat the eMMC like drive, we must change this path.
It would be possible to change how bmcweb find drives. See below: https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/storage.hpp#L561
Tested: Ran on real machine and verified the path was correct. Change-Id: Ibba9d144f4d141fdad358da1e43db6d871d6d013 Signed-off-by: John Edward Broadbent <jebr@google.com>
show more ...
|
82897c35 | 21-Feb-2022 |
Ed Tanous <edtanous@google.com> |
Check in a clang-tidy
This should've been done when we first created the repo, but better late than never.
Signed-off-by: Ed Tanous <edtanous@google.com> Signed-off-by: John Edward Broadbent <jebr@
Check in a clang-tidy
This should've been done when we first created the repo, but better late than never.
Signed-off-by: Ed Tanous <edtanous@google.com> Signed-off-by: John Edward Broadbent <jebr@google.com> Change-Id: I68da1d13167ec94f9d008dea307c9f23a991d42c
show more ...
|
0c2808f0 | 25-Feb-2022 |
Patrick Williams <patrick@stwcx.xyz> |
build: enable subproject-based build
* Move existing phosphor-logging.wrap to the subprojects directory. * Add wrap files for all openbmc dependencies. * Fix up meson.build files to utilize subproje
build: enable subproject-based build
* Move existing phosphor-logging.wrap to the subprojects directory. * Add wrap files for all openbmc dependencies. * Fix up meson.build files to utilize subproject dependencies and follow Meson conventions for dependency naming. * Ensure wrap files are not ignored by .gitignore.
Tested: Built on a typical Linux development system and 'ninja test' passed.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I167911f045ee1f27cc69bcba7be185762844a030
show more ...
|
f59b7291 | 15-Feb-2022 |
John Edward Broadbent <jebr@google.com> |
Add Locking
This uses the estoraged version of locking for erase use. It will unmount the file system, and make the encrypted block disappear. Ideally we will add hardware locking support at a later
Add Locking
This uses the estoraged version of locking for erase use. It will unmount the file system, and make the encrypted block disappear. Ideally we will add hardware locking support at a later time.
Signed-off-by: John Edward Broadbent <jebr@google.com> Change-Id: I0cfb0637fc8d3dd6f8d23c9dd60d1f66fd424a4e
show more ...
|
d3bfa7bb | 13-Jan-2022 |
John Edward Broadbent <jebr@google.com> |
Add namespaces to erase methods
Some erase objects did not have the required namespace. This change adds the estoraged and estoraged_testing namespace where it is needed.
Testing: Not tested Change
Add namespaces to erase methods
Some erase objects did not have the required namespace. This change adds the estoraged and estoraged_testing namespace where it is needed.
Testing: Not tested Change-Id: I63757ea4d3672659f21108e5e65fd09aa1c03406 Signed-off-by: John Edward Broadbent <jebr@google.com>
show more ...
|
59dffa63 | 13-Jan-2022 |
John Edward Broadbent <jebr@google.com> |
Add crypto Erase to eStorageD.
The goal is to erase the keys that are used to decrypt the drive. After the keys are erased it will not be possible to decrypt the drive, even if the password can be r
Add crypto Erase to eStorageD.
The goal is to erase the keys that are used to decrypt the drive. After the keys are erased it will not be possible to decrypt the drive, even if the password can be recalled. The data is forever inaccessible.
Testing:
$ systemctl stop emmc.service
$ /eStoraged -b /dev/mmcblk0 &
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 /xyz/openbmc_project/storage/mmcblk0 xyz.openbmc_project.Inventory.Item.Volume FormatLuks ays 3 1 2 3 xyz.openbmc_project.Inventory.Item.Volume.FilesystemType.ext4
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 /xyz/openbmc_project/storage/mmcblk0 xyz.openbmc_project.Inventory.Item.Volume Lock
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 /xyz/openbmc_project/storage/mmcblk0 xyz.openbmc_project.Inventory.Item.Volume Erase s xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.CryptoErase
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 /xyz/openbmc_project/storage/mmcblk0 xyz.openbmc_project.Inventory.Item.Volume Unlock ay 3 1 2 3 Call failed: The operation failed internally.
Signed-off-by: John Edward Broadbent <jebr@google.com> Change-Id: I3221e82a92c1b555e2379b19c9e1d5b6e4b02f9b
show more ...
|
69786761 | 21-Jan-2022 |
John Edward Broadbent <jebr@google.com> |
Not passing fd in the zero and pattern erase
The original erase zero, and erase pattern methods took fd that were opened by the client code. This changes make zero and pattern open the files interna
Not passing fd in the zero and pattern erase
The original erase zero, and erase pattern methods took fd that were opened by the client code. This changes make zero and pattern open the files internally, which is safe and a more standard practice.
Tested: This change has not been tested
Change-Id: Iae848429b304aa39d510d1f090ace416db88ac7e Signed-off-by: John Edward Broadbent <jebr@google.com>
show more ...
|
4bc8a10c | 30-Dec-2021 |
John Edward Broadbent <jebr@google.com> |
Add zero write and verify
This code implements the zero verify and zero write dbus interface. The goal is to fill the whole block device with zeros, then check to make sure the operation worked corr
Add zero write and verify
This code implements the zero verify and zero write dbus interface. The goal is to fill the whole block device with zeros, then check to make sure the operation worked correctly.
Tested: $ systemctl stop emmc.service $ ./eStoraged -b /dev/mmcblk0 & $ time busctl call xyz.openbmc_project.eStoraged.mmcblk0 /xyz/openbmc_project/storage/mmcblk0 xyz.openbmc_project.Inventory.Item.Volume Erase s xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.ZeroOverWrite --timeout=1200 Erasing encrypted eMMC <6> Starting erase
real 5m59.695s user 0m0.000s sys 0m0.030s
root@ytbaz20-nfd01:~/jebr# hexdump /dev/mmcblk0 0000000 0000 0000 0000 0000 0000 0000 0000 0000 * $ time busctl call xyz.openbmc_project.eStoraged.mmcblk0 /xyz/openbmc_project/storage/mmcblk0 xyz.openbmc_project.Inventory.Item.Volume Erase s xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.ZeroVerify --timeout=1200 Erasing encrypted eMMC <6> Starting erase
real 5m46.920s user 0m0.010s sys 0m0.010s $ echo "not zero" > /dev/mmcblk0 $ time busctl call xyz.openbmc_project.eStoraged.mmcblk0 /xyz/openbmc_project/storage/mmcblk0 xyz.openbmc_project.Inventory.Item.Volume Erase s xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.ZeroVerify --timeout=1200 Erasing encrypted eMMC <6> Starting erase <3> Estoraged erase zeros block is not zero Call failed: The operation failed internally.
real 0m0.022s user 0m0.000s sys 0m0.020s
Change-Id: Ie78ad427de1aa75472fc7ddd72d094866fe14b66 Signed-off-by: John Edward Broadbent <jebr@google.com>
show more ...
|
b17f8251 | 12-Jan-2022 |
John Wedig <johnwedig@google.com> |
Check if mount point already exists
Typically, we create the mount point directory when we mount the filesystem, and then we remove the directory when we unmount. Currently, we aren't accounting for
Check if mount point already exists
Typically, we create the mount point directory when we mount the filesystem, and then we remove the directory when we unmount. Currently, we aren't accounting for the case where the directory already exists, e.g. if the BMC reboots while the filesystem is mounted.
This commit adds a check to see if the directory is already present. If so, it won't try to create the directory again.
Tested: 1. Formatted an eMMC using the FormatLuks method, which also creates the mount point and mounts the filesystem. 2. Rebooted the BMC 3. Ran the Unlock method to unlock the LUKS device and mount the filesystem.
Signed-off-by: John Wedig <johnwedig@google.com> Change-Id: I3e279c653b21f570b97e4d530a19e5ae30bf8719
show more ...
|
7f2ab643 | 11-Nov-2021 |
John Edward Broadbent <jebr@google.com> |
Add pattern write and verify to erase
The goals are to write a non-compressible and verifiable pattern to the drive as a means to validate that the drive is working, and ensure all blocks have been
Add pattern write and verify to erase
The goals are to write a non-compressible and verifiable pattern to the drive as a means to validate that the drive is working, and ensure all blocks have been overwritten.
Tested: $ systemctl stop emmc.service $ ./eStoraged -b /dev/mmcblk0& $busctl call xyz.openbmc_project.eStoraged.mmcblk0 /xyz/openbmc_project/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.mmcblk0 /xyz/openbmc_project/storage/mmcblk0 xyz.openbmc_project.Inventory.Item.Volume Erase s xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.LogicalVerify --timeout=1200
$echo "jebr" > /dev/mmcblk0
$busctl call xyz.openbmc_project.eStoraged.mmcblk0 /xyz/openbmc_project/storage/mmcblk0 xyz.openbmc_project.Inventory.Item.Volume Erase s xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.LogicalVerify --timeout=1200 Call failed: The operation failed internally.
Change-Id: Ibc1254279b1f46246eb37056ea6e4e1a57159bb9 Signed-off-by: John Edward Broadbent <jebr@google.com>
show more ...
|
972c3faa | 29-Dec-2021 |
John Wedig <johnwedig@google.com> |
Switch to new D-Bus interface
Now that the eStoraged interface is in phosphor-dbus-interfaces, we can remove the yaml files from this repo and switch to the new interface in phosphor-dbus-interfaces
Switch to new D-Bus interface
Now that the eStoraged interface is in phosphor-dbus-interfaces, we can remove the yaml files from this repo and switch to the new interface in phosphor-dbus-interfaces. Note that the new interface is slightly different. Some functions have different arguments, and the eStoraged-specific errors were removed.
Also, the new interface allows for the caller to specify the filesystem type, but for now, only ext4 is supported.
Tested: $ /usr/bin/eStoraged -b /dev/mmcblk0 & $ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \ /xyz/openbmc_project/storage/mmcblk0 \ xyz.openbmc_project.Inventory.Item.Volume FormatLuks ays 3 1 2 3 \ xyz.openbmc_project.Inventory.Item.Volume.FilesystemType.ext4 $ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \ /xyz/openbmc_project/storage/mmcblk0 \ xyz.openbmc_project.Inventory.Item.Volume Lock $ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \ /xyz/openbmc_project/storage/mmcblk0 \ xyz.openbmc_project.Inventory.Item.Volume Unlock ay 3 1 2 3 $ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \ /xyz/openbmc_project/storage/mmcblk0 \ xyz.openbmc_project.Inventory.Item.Volume Erase s \ xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.VerifyGeometry
Signed-off-by: John Wedig <johnwedig@google.com> Change-Id: I5477b313ac5342409e2cf53ca70259c17da6269c
show more ...
|
6218dc5d | 03-Dec-2021 |
John Wedig <johnwedig@google.com> |
Add get() function to CryptHandle class
This commit modifies the CryptHandle class so that the crypt_device struct is managed internally. This way, the caller does not need to provide it's own crypt
Add get() function to CryptHandle class
This commit modifies the CryptHandle class so that the crypt_device struct is managed internally. This way, the caller does not need to provide it's own crypt_device pointer. The caller can use the new get() function when it needs access to the crypt_device struct.
Signed-off-by: John Wedig <johnwedig@google.com> Change-Id: I82c2f96d74cc2714de5a656432cbaa2f6ee1244a
show more ...
|
e6ffe704 | 14-Oct-2021 |
John Edward Broadbent <jebr@google.com> |
Add Erase verifyGeometry
This confirms specified amount of the drive is accessible. The min and max expected drive size are set as a build configuration, and compared against the drive size (found b
Add Erase verifyGeometry
This confirms specified amount of the drive is accessible. The min and max expected drive size are set as a build configuration, and compared against the drive size (found by using the linux ioctl). Also adds testing build files, testing options, and verifyGeometry test.
Tested: Ran eStoraged on a machine with an eMMC, using the following $ ./eStoraged -b /dev/mmcblk0 & $ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \ /xyz/openbmc_project/storage/mmcblk0 \ xyz.openbmc_project.eStoraged Erase ays 1 1 \ xyz.openbmc_project.eStoraged.EraseMethod.VerifyGeometry
Signed-off-by: John Edward Broadbent <jebr@google.com> Change-Id: Ie47f8666996a6085a115d1b86f2643bc278638c5
show more ...
|
b810c926 | 17-Nov-2021 |
John Wedig <johnwedig@google.com> |
Format LUKS encrypted device
This commit adds the functionality to format a new LUKS device, create a filesystem, and mount it. Unit tests are included.
Currently, the D-Bus interface to format the
Format LUKS encrypted device
This commit adds the functionality to format a new LUKS device, create a filesystem, and mount it. Unit tests are included.
Currently, the D-Bus interface to format the LUKS device is synchronous, but it may need to become asynchronous, since it can take some time. The format operation took about 20 seconds when testing it.
Tested: Ran eStoraged on a machine with an eMMC, using the following commands: $ /usr/bin/eStoraged -b /dev/mmcblk0 & $ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \ /xyz/openbmc_project/storage/mmcblk0 xyz.openbmc_project.eStoraged \ Format ay 3 1 2 3 $ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \ /xyz/openbmc_project/storage/mmcblk0 xyz.openbmc_project.eStoraged \ Lock ay 3 1 2 3 $ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \ /xyz/openbmc_project/storage/mmcblk0 xyz.openbmc_project.eStoraged \ Unlock ay 3 1 2 3
Signed-off-by: John Wedig <johnwedig@google.com> Change-Id: Ib5d0b8bb201b43a60238bfd4f13a29a6519a9f7d
show more ...
|
4e13b0a1 | 15-Nov-2021 |
John Edward Broadbent <jebr@google.com> |
Add phosphor-logging
This commit adds phosphor-logging (lg2) to eStorageD. It also adds several logging statements.
Signed-off-by: John Edward Broadbent <jebr@google.com> Change-Id: Ideb4f6033b94dd
Add phosphor-logging
This commit adds phosphor-logging (lg2) to eStorageD. It also adds several logging statements.
Signed-off-by: John Edward Broadbent <jebr@google.com> Change-Id: Ideb4f6033b94dd8b1384c79cd3a26ce89e7b2c4c
show more ...
|
2098dabe | 14-Sep-2021 |
John Wedig <johnwedig@google.com> |
Initial D-Bus interface
This sets up an initial D-Bus interface without any real functionality. It doesn't interact with any storage hardware yet.
The yaml files are included temporarily until the
Initial D-Bus interface
This sets up an initial D-Bus interface without any real functionality. It doesn't interact with any storage hardware yet.
The yaml files are included temporarily until the phosphor-dbus-interfaces review is complete: https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/48636
The .clang-tidy file has been removed because clang-tidy can't filter out the generated files. It should be re-enabled when we no longer need to generate the D-Bus sources in this repo.
Signed-off-by: John Edward Broadbent <jebr@google.com> Change-Id: If704e69ef7225257efc7c865424df4421999f62d Signed-off-by: John Wedig <johnwedig@google.com>
show more ...
|
bf8d6ac7 | 01-Nov-2021 |
John Wedig <johnwedig@google.com> |
Add initial set of files
Includes LICENSE, OWNERS, MAINTAINERS, README.md, .gitignore, .clang-tidy, and .clang-format.
Signed-off-by: John Wedig <johnwedig@google.com> Change-Id: I0410a9001543b1148
Add initial set of files
Includes LICENSE, OWNERS, MAINTAINERS, README.md, .gitignore, .clang-tidy, and .clang-format.
Signed-off-by: John Wedig <johnwedig@google.com> Change-Id: I0410a9001543b11484b8e17328f84aa3d3a29e42
show more ...
|
0a3cc384 | 28-Oct-2021 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
Initial empty repository
|