History log of /openbmc/estoraged/src/erase/ (Results 1 – 21 of 21)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
9c2e836201-Feb-2025 Patrick Williams <patrick@stwcx.xyz>

meson: reformat with meson formatter

Apply the `meson format` results.

Change-Id: I4cc78e59d8341dd5ea54ee2793afdab179b259e8
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

15b63e1216-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: I07372e75f12f406bd0555dd27e249bc7dd0958d4
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

d4554f2a17-Jun-2024 Manojkiran Eda <manojkiran.eda@gmail.com>

Fix spelling mistakes using codespell

This commit corrects various spelling mistakes throughout the
repository. The corrections were made automatically using `codespell`[1]
tool.

[1]: https://githu

Fix spelling mistakes using codespell

This commit corrects various spelling mistakes throughout the
repository. The corrections were made automatically using `codespell`[1]
tool.

[1]: https://github.com/codespell-project/codespell

Change-Id: I153217f4ae8454e3546a59da9fcfe3f83fd04b39
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>

show more ...

620d1a5129-Mar-2024 Konstantin Aladyshev <aladyshev22@gmail.com>

build: Fix boost dependency

Currently local build fails with a message:
"""
src/meson.build:16:14: ERROR: Include dir subprojects/boost_1_78_0/
does not exist
"""
The error is happening because the

build: Fix boost dependency

Currently local build fails with a message:
"""
src/meson.build:16:14: ERROR: Include dir subprojects/boost_1_78_0/
does not exist
"""
The error is happening because the correct path for the includes should
not be "subprojects/boost_1_79_0/" but "../subprojects/boost_1_79_0/".
But such relative links are deprecated, therefore rewrite boost
dependency with its own packagefile.
Also boost library is required for the project build, therefore drop
"required: false" statement for the dependency.
And since boost is required for the libeStoragedErase, add boost_dep to
its dependencies.

Tested:
"meson setup build && cd build && meson compile" now works without any
issues.

Change-Id: Id0afda7563c944f3afc88cd1f59099794611525e
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>

show more ...

043af59f23-Nov-2023 Tom Tung <shes050117@gmail.com>

Get eraseMaxGeometry and eraseMinGeometry from dbus

Also, make findDevice return output parameters based on RVO.

With the change like in EntityManager JSON:
```
{
"Name": "example_emmc",
"T

Get eraseMaxGeometry and eraseMinGeometry from dbus

Also, make findDevice return output parameters based on RVO.

With the change like in EntityManager JSON:
```
{
"Name": "example_emmc",
"Type": "EmmcDevice",
"LocationCode": "location"
"EraseMaxGeometry": 10000000000,
"EraseMinGeometry": 5000000000,
}
```
and geometry values will be set to estoraged.

Tested:
- unit test pass:
```
5/7 util_test OK 0.05s
```

Change-Id: Ia8499af2168c7e740558978273fc80456eb29282
Signed-off-by: Tom Tung <shes050117@gmail.com>

show more ...

04c28fad10-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: Ia968a74764d3bda33160a8a9890629ed3cc94d0e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

61cf426017-Mar-2023 John Wedig <johnwedig@google.com>

Fix build warnings

This commit fixes some build warnings in CI caused by unused variables
and an invalid move assignment operator, since a member variable is of
reference type.

Signed-off-by: John

Fix build warnings

This commit fixes some build warnings in CI caused by unused variables
and an invalid move assignment operator, since a member variable is of
reference type.

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

show more ...

b2c86be315-Apr-2022 John Edward Broadbent <jebr@google.com>

Change ownership of handle to eStorageD object

Clients used to create both the CryptHandle and the eStorageD objects
using the same information. Then the client would pass the CryptHandle
into eStor

Change ownership of handle to eStorageD object

Clients used to create both the CryptHandle and the eStorageD objects
using the same information. Then the client would pass the CryptHandle
into eStorageD methods in order to perform crypto methods. This change
creates the CryptHandle closer to where it is used. This makes the code
simpler and easier to understand.

Tested:
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

Change-Id: I276e97146f4498191eb19512bc244a1e8d9cd2cb
Signed-off-by: John Edward Broadbent <jebr@google.com>

show more ...

2b5454d314-Apr-2022 John Edward Broadbent <jebr@google.com>

fix error handling for CryptHandle.get

The old code calls CryptHandle once to make sure it is valid, then
calls it again to use it.

Tested:
busctl call xyz.openbmc_project.eStoraged.mmcblk0 \
> /

fix error handling for CryptHandle.get

The old code calls CryptHandle once to make sure it is valid, then
calls it again to use it.

Tested:
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

Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: I21c02315c365e74ead3d0b5b2578c62503376756

show more ...

d6071fc231-Mar-2022 John Edward Broadbent <jebr@google.com>

Fix Short read/write issue

It was possible for "short" reads and writes to cause the pattern and
zero steps to not work correctly. This change adds logic to deal with
the short reads.

Tested: unit

Fix Short read/write issue

It was possible for "short" reads and writes to cause the pattern and
zero steps to not work correctly. This change adds logic to deal with
the short reads.

Tested: unit test and machine test
root@bmc# 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.ZeroOverWrite \
> --timeout=1200
real 6m0.815s
user 0m0.010s
sys 0m0.010s

Change-Id: If8df9bdba159a3bcfa77104a4c17b8d352794db2
Signed-off-by: John Edward Broadbent <jebr@google.com>

show more ...

605085a605-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 ...

a6e3b99d17-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 ...

82897c3521-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 ...

0c2808f025-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 ...

d3bfa7bb13-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 ...

59dffa6313-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 ...

6978676121-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 ...

4bc8a10c30-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 ...

7f2ab64311-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 ...

972c3faa29-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 ...

e6ffe70414-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 ...