New issue
Advanced search Search tips

Issue 808303 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 20
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: ----

Blocking:
issue 702724
issue 788719
issue 797141



Sign in to add a comment

Refactoring mount-encrypted to C++

Project Member Reported by sarthakkukreti@chromium.org, Feb 2 2018

Issue description

Mount-encrypted handles the setup and creation of the encrypted stateful partition. Refactoring it into C++ and breaking it into multiple segments would yield the following benefits:

- The separation of key management and mount-related functions would be easier to manage and add features to (eg. crbug:788719, crbug:797141).
- Reuse existing functions from cryptohome eg. fs utils, cryptolib, ext4 dircrypto, instead of reimplementing the same in C.
 
Blockedon: -797141 -788719
Blocking: 797141 788719
Components: Security
Cc: apronin@chromium.org
To make sure we are not duplicating effort: there is a set of WIP CLs that perform gradual mount-encrypted refactoring, starting with https://crrev.com/c/870774
Project Member

Comment 5 by bugdroid1@chromium.org, Feb 22 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/4a95b9b7aed292e2c0a02b2bf81b7244ab3b6549

commit 4a95b9b7aed292e2c0a02b2bf81b7244ab3b6549
Author: Mattias Nissler <mnissler@chromium.org>
Date: Thu Feb 22 12:13:59 2018

tpm: Add extern "C" declaration for C++ compatibility.

The mount-encrypted utility, which includes tlcl.h is in the process
of being converted to C++. To simplify inclusion in C++ code, add the
standard extern "C" linkage specifiers.

BRANCH=none
BUG= chromium:808303 
TEST=compiles

Change-Id: I8a99a0e5cfcce64b27cad10735b08ba40434b222
Reviewed-on: https://chromium-review.googlesource.com/915345
Commit-Ready: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>

[modify] https://crrev.com/4a95b9b7aed292e2c0a02b2bf81b7244ab3b6549/firmware/include/tlcl.h

Project Member

Comment 6 by bugdroid1@chromium.org, Mar 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/8a257cdf96c9eb29b6e3e035316451223503aaf1

commit 8a257cdf96c9eb29b6e3e035316451223503aaf1
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Mar 01 07:54:19 2018

cryptohome: Minimally refactor mount-encrypted to cpp

Minimally refactor mount-encrypted and mount-helpers to cpp
and fix compilation issues.

This involves:
- Adding scope to const definitions that would be bypassed
  by goto: "error: jump bypasses initialization"
- Converting implicit pointer casts that were not caught earlier.

CQ-DEPEND=CL:915345
BUG= chromium:808303 
TEST=test_that platform_EncryptedStateful

Change-Id: I72ee455e5103fd168ccc44ce624a9f1032c7c4e6
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/898084

[rename] https://crrev.com/8a257cdf96c9eb29b6e3e035316451223503aaf1/cryptohome/mount_encrypted.cc
[rename] https://crrev.com/8a257cdf96c9eb29b6e3e035316451223503aaf1/cryptohome/mount_encrypted.h
[modify] https://crrev.com/8a257cdf96c9eb29b6e3e035316451223503aaf1/cryptohome/cryptohome.gyp
[rename] https://crrev.com/8a257cdf96c9eb29b6e3e035316451223503aaf1/cryptohome/mount_helpers.cc
[rename] https://crrev.com/8a257cdf96c9eb29b6e3e035316451223503aaf1/cryptohome/mount_helpers.h

Project Member

Comment 7 by bugdroid1@chromium.org, Mar 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/49196b4d3da40e339632184a8f65a867e6cb63da

commit 49196b4d3da40e339632184a8f65a867e6cb63da
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Mar 01 07:54:17 2018

cryptohome: clang-format mount-encrypted

$ clang-format -style=file mount-encrypted* mount-helpers*

BUG= chromium:808303 
TEST=test_that platform_EncryptedStateful

Change-Id: I8c74c3f8757c4b99c106f55ebf56c4f68c388247
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/909923
Reviewed-by: Mattias Nissler <mnissler@chromium.org>

[modify] https://crrev.com/49196b4d3da40e339632184a8f65a867e6cb63da/cryptohome/mount-helpers.h
[modify] https://crrev.com/49196b4d3da40e339632184a8f65a867e6cb63da/cryptohome/mount-helpers.c
[modify] https://crrev.com/49196b4d3da40e339632184a8f65a867e6cb63da/cryptohome/mount-encrypted.h
[modify] https://crrev.com/49196b4d3da40e339632184a8f65a867e6cb63da/cryptohome/mount-encrypted.c

Blocking: 702724
Quick question: Do we have an expected timeline for this?

I'm doing a quick round fixing various smaller things, and there's a P1 issue 702724 in mount-encrypted, which in turn makes the consequences of P0 b/73351086 more serious than they would otherwise be. 

Deciding now if I should wait until this work is done: would be great to start with a nicer cleaner codebase. Or, if I should go ahead and fix issue 702724 first, and then this set of refactoring CLs will merge.
For now: added 702724 to the list of blocked bugs.
Project Member

Comment 9 by bugdroid1@chromium.org, Mar 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/9d26a10c573d8ff550e099b36772a2a468629111

commit 9d26a10c573d8ff550e099b36772a2a468629111
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Wed Mar 07 09:00:45 2018

cryptohome: decouple cryptohome and tpm metrics

cryptohome_metrics now only uses static values from tpm_metrics.h
and allows decoupling of compilation targets for libcrostpm.

BUG= chromium:808303 
TEST=compilation

Change-Id: I463eacb2752d76586f82539fb1d43b82d6260d7b
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/942314
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/9d26a10c573d8ff550e099b36772a2a468629111/cryptohome/cryptohome_metrics.cc
[modify] https://crrev.com/9d26a10c573d8ff550e099b36772a2a468629111/cryptohome/cryptohome_metrics.h
[modify] https://crrev.com/9d26a10c573d8ff550e099b36772a2a468629111/cryptohome/tpm_impl.cc

Project Member

Comment 10 by bugdroid1@chromium.org, Mar 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/c6778798c2d1783e654923da12e3ccd5280609c9

commit c6778798c2d1783e654923da12e3ccd5280609c9
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Wed Mar 07 09:00:46 2018

cryptohome: split platform from libcrostpm

Create a minimal separate target for platform and friends that can
be used without bringing in everything from libcrostpm. libcrostpm
now directly depends on this target (libcrosplatform).

BUG= chromium:808303 
TEST=compilation

Change-Id: I0a7e70be6e19077b0bd3e9466d0914318e72a005
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/942315
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/c6778798c2d1783e654923da12e3ccd5280609c9/cryptohome/cryptohome.gyp

Project Member

Comment 11 by bugdroid1@chromium.org, May 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/ae044606c19d94daa7c7bfdefad7e08d0cafe926

commit ae044606c19d94daa7c7bfdefad7e08d0cafe926
Author: Mattias Nissler <mnissler@chromium.org>
Date: Wed May 16 00:46:36 2018

cryptohome: Run mount_encrypted_unittests

BUG= chromium:788719 ,  chromium:808303 
TEST=FEATURES=test emerge-$BOARD -v1 cryptohome

Change-Id: If9025f20e337abdfc7e5d6d02f6b2c3fc9d7e4d0
Reviewed-on: https://chromium-review.googlesource.com/1012031
Commit-Ready: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/ae044606c19d94daa7c7bfdefad7e08d0cafe926/chromeos-base/cryptohome/cryptohome-9999.ebuild

Project Member

Comment 12 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/61e684246971b314ef8fe62fbc7a96d9a8b8d765

commit 61e684246971b314ef8fe62fbc7a96d9a8b8d765
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:28 2018

libbrillo: Add dependency on lvm2.

Add lvm2 to COMMON_DEPEND to build blkdevutils::DeviceMapper.

BUG= chromium:808303 
CQ-DEPEND=CL:1187155
TEST="equery depends lvm2" shows libbrillo

Change-Id: I08969b3a17276b67567ed8753f75d380546c0bda
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1222791
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/61e684246971b314ef8fe62fbc7a96d9a8b8d765/chromeos-base/libbrillo/libbrillo-9999.ebuild

Project Member

Comment 13 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/e5b6195a3ccaaacd299fe006f0c3df1b3595a34e

commit e5b6195a3ccaaacd299fe006f0c3df1b3595a34e
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:24 2018

cryptohome: decouple encrypted fs setup from mount-encrypted

In preparation for refactoring mount-encrypted, separate
out fs setup functions into a separate file. Additionally,
split and cleanup includes to a minimal set.

BUG= chromium:808303 
CQ-DEPEND=CL:1184322
TEST=compilation.

Change-Id: If28c3482b9296116ed3a2477ca1325b295019414
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116290
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[add] https://crrev.com/e5b6195a3ccaaacd299fe006f0c3df1b3595a34e/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/e5b6195a3ccaaacd299fe006f0c3df1b3595a34e/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/e5b6195a3ccaaacd299fe006f0c3df1b3595a34e/cryptohome/cryptohome.gyp
[add] https://crrev.com/e5b6195a3ccaaacd299fe006f0c3df1b3595a34e/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 14 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/d775a9d36e42c097cf40f23e76b37dce2f351e72

commit d775a9d36e42c097cf40f23e76b37dce2f351e72
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:25 2018

cryptohome: Remove code to migrate to mount-encrypted

Since there are no legacy devices with unencrypted stateful
partitions, remove all code to do migration.

BUG= chromium:808303 
TEST=compiles

Change-Id: I6c8eccb1a09437b89100a955ed575014a00e94d0
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116291
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>

[modify] https://crrev.com/d775a9d36e42c097cf40f23e76b37dce2f351e72/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/d775a9d36e42c097cf40f23e76b37dce2f351e72/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/d775a9d36e42c097cf40f23e76b37dce2f351e72/cryptohome/mount_encrypted/encrypted_fs.h
[modify] https://crrev.com/d775a9d36e42c097cf40f23e76b37dce2f351e72/cryptohome/mount_helpers.h
[modify] https://crrev.com/d775a9d36e42c097cf40f23e76b37dce2f351e72/cryptohome/mount_helpers.cc

Project Member

Comment 15 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/f2a30aa5e9c262634818f5c78236425fcf65d0cc

commit f2a30aa5e9c262634818f5c78236425fcf65d0cc
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:25 2018

cryptohome: Cleanup mount-encrypted hex <--> blob conversions

Remove hand-rolled functions and reuse existing
functions for hex to blob conversions and back.
Also, remove unused variables related to key
handling.

BUG= chromium:808303 
TEST=compiles

Change-Id: I00f5a3199bcd5b99a1594dc499eb1db5e5cc8253
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116292
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>

[modify] https://crrev.com/f2a30aa5e9c262634818f5c78236425fcf65d0cc/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/f2a30aa5e9c262634818f5c78236425fcf65d0cc/cryptohome/mount_helpers.cc
[modify] https://crrev.com/f2a30aa5e9c262634818f5c78236425fcf65d0cc/cryptohome/mount_helpers.h

Project Member

Comment 16 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/757c0a767147117ed95bc9163f15c17422b44455

commit 757c0a767147117ed95bc9163f15c17422b44455
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:26 2018

cryptohome: Create EncryptedFs for mount-encrypted

Minimal changes to encapsulate the filesystem setup in
mount-encrypted. This is in preparation to introduce
a new type of encrypted file system.

Move local functions in an anonymous namespace.

BUG= chromium:808303 
TEST=compiles

Change-Id: I93a28e2026b7d8920077be8c4d93c4d6a6b3a17e
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116293
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/757c0a767147117ed95bc9163f15c17422b44455/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/757c0a767147117ed95bc9163f15c17422b44455/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/757c0a767147117ed95bc9163f15c17422b44455/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 17 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/bcec5f516deffbc15ff23da2e057750c03044e31

commit bcec5f516deffbc15ff23da2e057750c03044e31
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:26 2018

cryptohome: Modernize mount-encrypted encrypted_fs

- Move to FilePaths and std::string instead of gchar*/char*
- Adhere to style guide in naming struct, enum and class types.
- Simplify handling of bind_mounts.
- Add comments for EncryptedFs and member functions.
- Remove key_path

BUG= chromium:808303 
TEST=compiles

Change-Id: I2a785c0cb9c9e872d1d0284f1b83097180302e0f
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116294
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/bcec5f516deffbc15ff23da2e057750c03044e31/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/bcec5f516deffbc15ff23da2e057750c03044e31/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/bcec5f516deffbc15ff23da2e057750c03044e31/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 18 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/adb61cb753318045946dd738957b62cdfd1f1d71

commit adb61cb753318045946dd738957b62cdfd1f1d71
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:27 2018

cryptohome: Fix logging and comments

Update mount-encrypted to cpp-style logging and comments.

BUG= chromium:808303 
TEST=compiles

Change-Id: I2917425175cdfc135c8e3de1ae3267b403ddb7e7
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116295
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>

[modify] https://crrev.com/adb61cb753318045946dd738957b62cdfd1f1d71/cryptohome/mount_encrypted/encryption_key.cc
[modify] https://crrev.com/adb61cb753318045946dd738957b62cdfd1f1d71/cryptohome/mount_encrypted.h
[modify] https://crrev.com/adb61cb753318045946dd738957b62cdfd1f1d71/cryptohome/mount_encrypted/encrypted_fs.cc

Project Member

Comment 19 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/4f08ef4cbbe696bbc8c872f1cd3a2d62ba377d21

commit 4f08ef4cbbe696bbc8c872f1cd3a2d62ba377d21
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:28 2018

cryptohome: Rename private members of EncryptedFs

Follow C++-style guide in renaming private members
of EncryptedFs.

(While this is a pretty small patch, there are a ton
of such minor changes in refactoring mount-encrypted
and it might be easier to review if such mechanical
changes were grouped functionally).

BUG= chromium:808303 
TEST=compiles

Change-Id: Ifb6a289e931c5d1ec10ebe8a57885fd95a0bf632
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116296
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>

[modify] https://crrev.com/4f08ef4cbbe696bbc8c872f1cd3a2d62ba377d21/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/4f08ef4cbbe696bbc8c872f1cd3a2d62ba377d21/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 20 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/87cfccb83005480767e83036867c25bac069dd58

commit 87cfccb83005480767e83036867c25bac069dd58
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:29 2018

cryptohome: Remove duplicate teardown code

- The failure condition for Setup() tries a variation of the
  Teardown() function. Instead, refactor to a single version of
  mount teardown in stages. This helps in breaking down Setup()
  into smaller chunks.
- Update how dirty_expire_centisecs and lodev are created so that
  we don't have to manually free them at the end of setup. This
  also removes the final goto and allows us to put variables
  closer to where they are actually used (without initializations
  crossing goto boundaries).
- The current dirty_expire_centisecs --> commit_interval mapping is
  not smooth:
  dirty_expire_centisecs : commit interval
  0 [set to 0 / read failure] : 600s
  1-99                        : 5s (ext4 default)
  100-199                     : 1s
  200-299                     : 2s
  ...
  Instead, default to 5s for all dirty_expire_centisecs < 600. Only
  use 600s for read failures.

BUG= chromium:808303 
TEST=compiles

Change-Id: Ied21e64dbb6349cba6d77bd182da43113b58aaa0
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116297
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/87cfccb83005480767e83036867c25bac069dd58/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/87cfccb83005480767e83036867c25bac069dd58/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 21 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/94836b718b6c9766e238ec66f33e19ea067ca856

commit 94836b718b6c9766e238ec66f33e19ea067ca856
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:29 2018

cryptohome: breakout fs creation from EncryptedFs::Setup

Decouple the calculation of parameters, sparse file creation
and deletion from the actual setup for better readability
in EncryptedFs::Setup.

BUG= chromium:808303 
TEST=compiles

Change-Id: I49b637b577e2dc4a76a1d3857cc3243e6713cec6
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116338
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/94836b718b6c9766e238ec66f33e19ea067ca856/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/94836b718b6c9766e238ec66f33e19ea067ca856/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 22 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/039f739bfe95ff5cc490e0c603e3256e0f85eca4

commit 039f739bfe95ff5cc490e0c603e3256e0f85eca4
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:30 2018

cryptohome: Modify Platform::Mount to use mount flags.

Currently, Platform::Mount uses a base set of mount flags.
Instead of creating a new function for mounting with flags,
we modify the signature of Mount since there are not many
direct users of the mount function. This is in preparation
of using Mount() with flags in mount-encrypted.

- Rename kDefaultMountOptions to kDefaultMountFlags to
  disambiguate between the arguments for flags and options.

BUG= chromium:808303 
TEST=compiles

Change-Id: I69af6dbf765dfa311f45b8e98909dec446450d83
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116339
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/039f739bfe95ff5cc490e0c603e3256e0f85eca4/cryptohome/mount_unittest.cc
[modify] https://crrev.com/039f739bfe95ff5cc490e0c603e3256e0f85eca4/cryptohome/platform.h
[modify] https://crrev.com/039f739bfe95ff5cc490e0c603e3256e0f85eca4/cryptohome/mount.cc
[modify] https://crrev.com/039f739bfe95ff5cc490e0c603e3256e0f85eca4/cryptohome/platform.cc
[modify] https://crrev.com/039f739bfe95ff5cc490e0c603e3256e0f85eca4/cryptohome/mock_platform.h

Project Member

Comment 23 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/8e5278a2337c3b93f8c2ef363fcd36753e9c0dcd

commit 8e5278a2337c3b93f8c2ef363fcd36753e9c0dcd
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:31 2018

cryptohome: add Platform to EncryptedFs

- Add platform to EncryptedFs: this allows us to abstract
  away a lot of file-related operations into a mockable
  interface that will (eventuall) be useful for unit-testing.

- Add functions for Access(), SameVFS() and GetBlkSize().

BUG= chromium:808303 
TEST=compiles

Change-Id: I240934c752f110516165b69ec27f44e6b564b0e0
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116340
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/8e5278a2337c3b93f8c2ef363fcd36753e9c0dcd/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/8e5278a2337c3b93f8c2ef363fcd36753e9c0dcd/cryptohome/mount_helpers.h
[modify] https://crrev.com/8e5278a2337c3b93f8c2ef363fcd36753e9c0dcd/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/8e5278a2337c3b93f8c2ef363fcd36753e9c0dcd/cryptohome/mount_encrypted/encrypted_fs.h
[modify] https://crrev.com/8e5278a2337c3b93f8c2ef363fcd36753e9c0dcd/cryptohome/mock_platform.h
[modify] https://crrev.com/8e5278a2337c3b93f8c2ef363fcd36753e9c0dcd/cryptohome/platform.cc
[modify] https://crrev.com/8e5278a2337c3b93f8c2ef363fcd36753e9c0dcd/cryptohome/mount_helpers.cc
[modify] https://crrev.com/8e5278a2337c3b93f8c2ef363fcd36753e9c0dcd/cryptohome/platform.h

Project Member

Comment 24 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/22f519a8172eea9f9635332c58675bec9a49412c

commit 22f519a8172eea9f9635332c58675bec9a49412c
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:31 2018

cryptohome: Refactor fs utils into platform

- Add SetCloseUnusedFileDescriptors for fs functions:
  this closes all unused file descriptors in the child process.
- Refactor FormatExt4 to take options and number of blocks.
- Add Fsck and Resize.
- Refactor mount-encrypted to reuse fs utils from platform.
- Remove equivalent functions from mount_helpers.

BUG= chromium:808303 
TEST=compiles.

Change-Id: Id8bb7dcbcf127aff11a6440979b732188d599a75
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116341
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/22f519a8172eea9f9635332c58675bec9a49412c/cryptohome/mount.cc
[modify] https://crrev.com/22f519a8172eea9f9635332c58675bec9a49412c/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/22f519a8172eea9f9635332c58675bec9a49412c/cryptohome/mount_helpers.h
[modify] https://crrev.com/22f519a8172eea9f9635332c58675bec9a49412c/cryptohome/mount_unittest.cc
[modify] https://crrev.com/22f519a8172eea9f9635332c58675bec9a49412c/cryptohome/mock_platform.h
[modify] https://crrev.com/22f519a8172eea9f9635332c58675bec9a49412c/cryptohome/platform.cc
[modify] https://crrev.com/22f519a8172eea9f9635332c58675bec9a49412c/cryptohome/mount_helpers.cc
[modify] https://crrev.com/22f519a8172eea9f9635332c58675bec9a49412c/cryptohome/platform.h

Project Member

Comment 25 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/26019bff6ca8f61c1a04177851beb73c82565f6d

commit 26019bff6ca8f61c1a04177851beb73c82565f6d
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:32 2018

cryptohome: use brillo:LoopDeviceManager in mount-encrypted

brillo::LoopDeviceManager abstracts the setup/teardown of loop
devices and provides a fake interface that can be swapped out
for unittests.

Also, remove similar functions from mount_helpers.

BUG= chromium:808303 
TEST=compiles.

Change-Id: If093ea2cc91ec5f4f0cd688ef8d7b844da45bcad
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116342
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/26019bff6ca8f61c1a04177851beb73c82565f6d/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/26019bff6ca8f61c1a04177851beb73c82565f6d/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/26019bff6ca8f61c1a04177851beb73c82565f6d/cryptohome/mount_encrypted/encrypted_fs.h
[modify] https://crrev.com/26019bff6ca8f61c1a04177851beb73c82565f6d/cryptohome/mount_helpers.h
[modify] https://crrev.com/26019bff6ca8f61c1a04177851beb73c82565f6d/cryptohome/mount_helpers.cc

Project Member

Comment 26 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/a45a6c2162225d5fb4007ff659a273da0a39f8b6

commit a45a6c2162225d5fb4007ff659a273da0a39f8b6
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:33 2018

cryptohome: use brillo::DeviceMapper in mount-encrypted

brillo::DeviceMapper abstracts away the details of setting up,
searching and removing devmapper devices and can be setup
with a fake implementation. With this change, encrypted_fs
is now composed entirely of mock-able or fake-able interfaces
and can now be unittested without much ado.

- Remove mount_helper functions that currently performed this
setup.
- Cleanup path_str() usage since it is no longer needed.

BUG= chromium:808303 
TEST=compiles.

Change-Id: Id80fccae6e612c285f7174a5fc0ab129f07ea9cd
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1116343
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/a45a6c2162225d5fb4007ff659a273da0a39f8b6/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/a45a6c2162225d5fb4007ff659a273da0a39f8b6/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/a45a6c2162225d5fb4007ff659a273da0a39f8b6/cryptohome/mount_encrypted/encrypted_fs.h
[modify] https://crrev.com/a45a6c2162225d5fb4007ff659a273da0a39f8b6/cryptohome/mount_helpers.h
[modify] https://crrev.com/a45a6c2162225d5fb4007ff659a273da0a39f8b6/cryptohome/mount_helpers.cc

Project Member

Comment 27 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/38761570865817d21206197602f45e400a19c734

commit 38761570865817d21206197602f45e400a19c734
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:33 2018

cryptohome: add unittests for EncryptedFs

Add unittests for the setup and teardown of EncryptedFs.

BUG= chromium:808303 
TEST=FEATURES=test emerge cryptohome compiles.

Change-Id: I5a18a8966e9001958037d6d9303ae91b1f40fc5b
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1119568
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/38761570865817d21206197602f45e400a19c734/cryptohome/cryptohome.gyp
[modify] https://crrev.com/38761570865817d21206197602f45e400a19c734/cryptohome/mount_encrypted/encrypted_fs.h
[add] https://crrev.com/38761570865817d21206197602f45e400a19c734/cryptohome/mount_encrypted/encrypted_fs_unittest.cc

Project Member

Comment 28 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/34bed1292b5ef8aa78aeae70c72a39a099ba2ec0

commit 34bed1292b5ef8aa78aeae70c72a39a099ba2ec0
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:34 2018

cryptohome: Record EncryptedFsType in mount-encrypted UMA stats

In preparation for adding a new encrypted filesystem type, record
metrics on the type of encrypted fs used. Currently, all devices
should report a dmcrypt encrypted mount for the stateful partition.

BUG= chromium:808303 
TEST=FEATURES=test emerge cryptohome compiles.

Change-Id: Ie0d69df3613aa1ae06320fc0f949811e16ea17ae
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1152301
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/34bed1292b5ef8aa78aeae70c72a39a099ba2ec0/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/34bed1292b5ef8aa78aeae70c72a39a099ba2ec0/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 30 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/f3c18f27933de3173f691cdc68b9cc9a76f54ac4

commit f3c18f27933de3173f691cdc68b9cc9a76f54ac4
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:35 2018

cryptohome: move mount_encrypted.{cc,h} to mount_encrypted/

Now that everything related to mount_encrypted resides within
cryptohome/mount_encrypted, move the main files into the
subdirectory.

BUG= chromium:808303 
TEST=none

Change-Id: I1a450c58dc830da0e889d01232105bc1bad6e754
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1184321
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/f3c18f27933de3173f691cdc68b9cc9a76f54ac4/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/f3c18f27933de3173f691cdc68b9cc9a76f54ac4/cryptohome/mount_encrypted/tpm2.cc
[modify] https://crrev.com/f3c18f27933de3173f691cdc68b9cc9a76f54ac4/cryptohome/mount_encrypted/encryption_key.h
[modify] https://crrev.com/f3c18f27933de3173f691cdc68b9cc9a76f54ac4/cryptohome/mount_encrypted/tpm1.cc
[modify] https://crrev.com/f3c18f27933de3173f691cdc68b9cc9a76f54ac4/cryptohome/mount_encrypted/encrypted_fs.h
[modify] https://crrev.com/f3c18f27933de3173f691cdc68b9cc9a76f54ac4/cryptohome/mount_encrypted/encryption_key.cc
[modify] https://crrev.com/f3c18f27933de3173f691cdc68b9cc9a76f54ac4/cryptohome/mount_encrypted/tpm.cc
[rename] https://crrev.com/f3c18f27933de3173f691cdc68b9cc9a76f54ac4/cryptohome/mount_encrypted/mount_encrypted.cc
[modify] https://crrev.com/f3c18f27933de3173f691cdc68b9cc9a76f54ac4/cryptohome/cryptohome.gyp
[rename] https://crrev.com/f3c18f27933de3173f691cdc68b9cc9a76f54ac4/cryptohome/mount_encrypted/mount_encrypted.h
[modify] https://crrev.com/f3c18f27933de3173f691cdc68b9cc9a76f54ac4/cryptohome/mount_encrypted/tpm.h

Project Member

Comment 31 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/f486ce09132aa199ae7d1e5fc0935a8c774caa77

commit f486ce09132aa199ae7d1e5fc0935a8c774caa77
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:35 2018

cryptohome: Modernize mount-encrypted

- Use base/logging and remove old logging functions.
- C++-style comments.

BUG= chromium:808303 
TEST=none

Change-Id: Idc940007ee77a1e5d9b706bb9430b0b9f1803455
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1184322
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/f486ce09132aa199ae7d1e5fc0935a8c774caa77/cryptohome/mount_encrypted/mount_encrypted.h
[modify] https://crrev.com/f486ce09132aa199ae7d1e5fc0935a8c774caa77/cryptohome/mount_encrypted/mount_encrypted.cc

Project Member

Comment 32 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/c1675c3e2e91f65ce557d5763d52e49ab7021178

commit c1675c3e2e91f65ce557d5763d52e49ab7021178
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:23 2018

libbrillo: add DevmapperTable and DeviceMapper

blkdev_utils implements utilities to setup block devices.
This patch adds a libdevmapper-based DeviceMapper implementation
to blkdev_utils. DeviceMapper supports the minimal operations
required to manage dm-verity or dm-crypt devices.

* The bulk of the operations are implemented using DevmapperTasks,
which are analogous to libdevmapper dm_task structs.

* DevmapperTable allows easier handling of I/O to the libdevmapper
interface.

* DeviceMapper uses a DevmapperTaskFactory to create tasks, which
can be overriden with a different implementation (eg. based on
ProcessImpl) or a fake implementation (eg. FakeDevmapperTask).

* Add Blob <--> SecureHex conversions for the secure conversions.

(Additional review context: https://chromium-review.googlesource.com/983059)

BUG= chromium:808303 
CQ-DEPEND=CL:1222791
TEST=FEATURES=TEST emerge libbrillo

Change-Id: Ib93d0ed7056a0cb49d2a8895f34adca9862698ed
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1187155
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[add] https://crrev.com/c1675c3e2e91f65ce557d5763d52e49ab7021178/libbrillo/brillo/blkdev_utils/device_mapper_fake.h
[add] https://crrev.com/c1675c3e2e91f65ce557d5763d52e49ab7021178/libbrillo/brillo/blkdev_utils/device_mapper_fake.cc
[add] https://crrev.com/c1675c3e2e91f65ce557d5763d52e49ab7021178/libbrillo/brillo/blkdev_utils/device_mapper_unittest.cc
[modify] https://crrev.com/c1675c3e2e91f65ce557d5763d52e49ab7021178/libbrillo/brillo/secure_blob.cc
[add] https://crrev.com/c1675c3e2e91f65ce557d5763d52e49ab7021178/libbrillo/brillo/blkdev_utils/device_mapper.h
[add] https://crrev.com/c1675c3e2e91f65ce557d5763d52e49ab7021178/libbrillo/brillo/blkdev_utils/device_mapper_task.h
[add] https://crrev.com/c1675c3e2e91f65ce557d5763d52e49ab7021178/libbrillo/brillo/blkdev_utils/device_mapper.cc
[add] https://crrev.com/c1675c3e2e91f65ce557d5763d52e49ab7021178/libbrillo/brillo/blkdev_utils/device_mapper_task.cc
[modify] https://crrev.com/c1675c3e2e91f65ce557d5763d52e49ab7021178/libbrillo/brillo/secure_blob.h
[modify] https://crrev.com/c1675c3e2e91f65ce557d5763d52e49ab7021178/libbrillo/libbrillo.gypi

Project Member

Comment 33 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/c2e72e73f06d33a8d6421bb3ee3f06e46106513f

commit c2e72e73f06d33a8d6421bb3ee3f06e46106513f
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Thu Sep 20 18:39:23 2018

libbrillo: add LoopDeviceManager and LoopDevice.

LoopDeviceManager manages the creation of LoopDevice
objects that represent attached loop devices. In order
to simplify the state of LoopDevices, the private class
members of LoopDevice are constant set at creation.

LoopDeviceManager can be queried to create LoopDevice
objects for already attached devices. Search for attached
loop devices can be done by name or by number, or the
complete list of attached devices.

LoopDevice abstracts the ioctl related functions to a
ioctl runner, which can be replaced by a fake implementation,
as in loop_device_unittest.cc

(Additional review context: https://chromium-review.googlesource.com/1020238)

BUG= chromium:808303 
TEST=FEATURES=test emerge libbrillo

Change-Id: I569d8f12dca90468013b431f594b061ea7550cab
Reviewed-on: https://chromium-review.googlesource.com/1187156
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[add] https://crrev.com/c2e72e73f06d33a8d6421bb3ee3f06e46106513f/libbrillo/brillo/blkdev_utils/loop_device_fake.cc
[add] https://crrev.com/c2e72e73f06d33a8d6421bb3ee3f06e46106513f/libbrillo/brillo/blkdev_utils/loop_device_unittest.cc
[add] https://crrev.com/c2e72e73f06d33a8d6421bb3ee3f06e46106513f/libbrillo/brillo/blkdev_utils/loop_device.h
[modify] https://crrev.com/c2e72e73f06d33a8d6421bb3ee3f06e46106513f/libbrillo/libbrillo.gypi
[add] https://crrev.com/c2e72e73f06d33a8d6421bb3ee3f06e46106513f/libbrillo/brillo/blkdev_utils/loop_device_fake.h
[add] https://crrev.com/c2e72e73f06d33a8d6421bb3ee3f06e46106513f/libbrillo/brillo/blkdev_utils/loop_device.cc

Status: Fixed (was: Assigned)
The last patch series for refactoring just landed, so I'm closing the loop here but I'll monitor build health for a couple of weeks before marking this as verified.
Project Member

Comment 35 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/48fa31632e243c4000c5cd4d3a41cef12258821e

commit 48fa31632e243c4000c5cd4d3a41cef12258821e
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:07:44 2018

Revert "cryptohome: Modernize mount-encrypted"

This reverts commit f486ce09132aa199ae7d1e5fc0935a8c774caa77.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: Modernize mount-encrypted
> 
> - Use base/logging and remove old logging functions.
> - C++-style comments.
> 
> BUG= chromium:808303 
> TEST=none
> 
> Change-Id: Idc940007ee77a1e5d9b706bb9430b0b9f1803455
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1184322
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: Ibb7634577b6cbec01311dea8d94e475b2e04add3
Reviewed-on: https://chromium-review.googlesource.com/1237102
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/48fa31632e243c4000c5cd4d3a41cef12258821e/cryptohome/mount_encrypted/mount_encrypted.h
[modify] https://crrev.com/48fa31632e243c4000c5cd4d3a41cef12258821e/cryptohome/mount_encrypted/mount_encrypted.cc

Project Member

Comment 36 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/9b6727699b6c4ba2aadeb1b528a40a18d99ea4b8

commit 9b6727699b6c4ba2aadeb1b528a40a18d99ea4b8
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:07:52 2018

Revert "cryptohome: move mount_encrypted.{cc,h} to mount_encrypted/"

This reverts commit f3c18f27933de3173f691cdc68b9cc9a76f54ac4.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: move mount_encrypted.{cc,h} to mount_encrypted/
> 
> Now that everything related to mount_encrypted resides within
> cryptohome/mount_encrypted, move the main files into the
> subdirectory.
> 
> BUG= chromium:808303 
> TEST=none
> 
> Change-Id: I1a450c58dc830da0e889d01232105bc1bad6e754
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1184321
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: Idae51b66907493af1109b5813bfea80f0e0924a2
Reviewed-on: https://chromium-review.googlesource.com/1237103
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/9b6727699b6c4ba2aadeb1b528a40a18d99ea4b8/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/9b6727699b6c4ba2aadeb1b528a40a18d99ea4b8/cryptohome/mount_encrypted/tpm2.cc
[rename] https://crrev.com/9b6727699b6c4ba2aadeb1b528a40a18d99ea4b8/cryptohome/mount_encrypted.cc
[rename] https://crrev.com/9b6727699b6c4ba2aadeb1b528a40a18d99ea4b8/cryptohome/mount_encrypted.h
[modify] https://crrev.com/9b6727699b6c4ba2aadeb1b528a40a18d99ea4b8/cryptohome/mount_encrypted/tpm1.cc
[modify] https://crrev.com/9b6727699b6c4ba2aadeb1b528a40a18d99ea4b8/cryptohome/mount_encrypted/encrypted_fs.h
[modify] https://crrev.com/9b6727699b6c4ba2aadeb1b528a40a18d99ea4b8/cryptohome/mount_encrypted/encryption_key.cc
[modify] https://crrev.com/9b6727699b6c4ba2aadeb1b528a40a18d99ea4b8/cryptohome/mount_encrypted/tpm.cc
[modify] https://crrev.com/9b6727699b6c4ba2aadeb1b528a40a18d99ea4b8/cryptohome/cryptohome.gyp
[modify] https://crrev.com/9b6727699b6c4ba2aadeb1b528a40a18d99ea4b8/cryptohome/mount_encrypted/tpm.h
[modify] https://crrev.com/9b6727699b6c4ba2aadeb1b528a40a18d99ea4b8/cryptohome/mount_encrypted/encryption_key.h

Project Member

Comment 37 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/6550ee9ce67d5d833ddcffe68c5f8e8817b635af

commit 6550ee9ce67d5d833ddcffe68c5f8e8817b635af
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:08:02 2018

Revert "cryptohome: Record EncryptedFsType in mount-encrypted UMA stats"

This reverts commit 34bed1292b5ef8aa78aeae70c72a39a099ba2ec0.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: Record EncryptedFsType in mount-encrypted UMA stats
> 
> In preparation for adding a new encrypted filesystem type, record
> metrics on the type of encrypted fs used. Currently, all devices
> should report a dmcrypt encrypted mount for the stateful partition.
> 
> BUG= chromium:808303 
> TEST=FEATURES=test emerge cryptohome compiles.
> 
> Change-Id: Ie0d69df3613aa1ae06320fc0f949811e16ea17ae
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1152301
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: I13de31d5a20a8e6a7dcb5d0d7f9976c1a20fc43b
Reviewed-on: https://chromium-review.googlesource.com/1237104
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/6550ee9ce67d5d833ddcffe68c5f8e8817b635af/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/6550ee9ce67d5d833ddcffe68c5f8e8817b635af/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 38 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/2b513ec22015f81e2e6c82499813ba467b1cf891

commit 2b513ec22015f81e2e6c82499813ba467b1cf891
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:08:11 2018

Revert "cryptohome: remove mount_helpers"

This reverts commit 4fbb095ae1c95a3b3117fbf706b17c9532a50b61.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: remove mount_helpers
> 
> The only function remaining in mount_helpers is used only once
> in encryption_key. Move the function into encryption_key.cc and
> cleanup build targets.
> 
> BUG= chromium:808303 
> TEST=none
> 
> Change-Id: I9c3860338292c80b3262bfb3a5fb4ebbcf056b06
> Reviewed-on: https://chromium-review.googlesource.com/1184320
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: I71ad518acdb12f2f8158c119a6a204c0de6d7c58
Reviewed-on: https://chromium-review.googlesource.com/1237105
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/2b513ec22015f81e2e6c82499813ba467b1cf891/cryptohome/mount_encrypted/encrypted_fs.cc
[add] https://crrev.com/2b513ec22015f81e2e6c82499813ba467b1cf891/cryptohome/mount_helpers.h
[modify] https://crrev.com/2b513ec22015f81e2e6c82499813ba467b1cf891/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/2b513ec22015f81e2e6c82499813ba467b1cf891/cryptohome/mount_encrypted/encryption_key.cc
[modify] https://crrev.com/2b513ec22015f81e2e6c82499813ba467b1cf891/cryptohome/cryptohome.gyp
[add] https://crrev.com/2b513ec22015f81e2e6c82499813ba467b1cf891/cryptohome/mount_helpers.cc

Project Member

Comment 39 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/db5eff048cd04c6c25cd284d13e49bdbdf14eb2f

commit db5eff048cd04c6c25cd284d13e49bdbdf14eb2f
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:08:19 2018

Revert "cryptohome: add unittests for EncryptedFs"

This reverts commit 38761570865817d21206197602f45e400a19c734.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: add unittests for EncryptedFs
> 
> Add unittests for the setup and teardown of EncryptedFs.
> 
> BUG= chromium:808303 
> TEST=FEATURES=test emerge cryptohome compiles.
> 
> Change-Id: I5a18a8966e9001958037d6d9303ae91b1f40fc5b
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1119568
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: I7a0d693db720cdc018e0197421548495a1f87e6c
Reviewed-on: https://chromium-review.googlesource.com/1237106
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/db5eff048cd04c6c25cd284d13e49bdbdf14eb2f/cryptohome/cryptohome.gyp
[modify] https://crrev.com/db5eff048cd04c6c25cd284d13e49bdbdf14eb2f/cryptohome/mount_encrypted/encrypted_fs.h
[delete] https://crrev.com/2b513ec22015f81e2e6c82499813ba467b1cf891/cryptohome/mount_encrypted/encrypted_fs_unittest.cc

Project Member

Comment 40 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/120d093b9e0b2aaed27cd90b37354dd540b89989

commit 120d093b9e0b2aaed27cd90b37354dd540b89989
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:08:27 2018

Revert "cryptohome: use brillo::DeviceMapper in mount-encrypted"

This reverts commit a45a6c2162225d5fb4007ff659a273da0a39f8b6.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: use brillo::DeviceMapper in mount-encrypted
> 
> brillo::DeviceMapper abstracts away the details of setting up,
> searching and removing devmapper devices and can be setup
> with a fake implementation. With this change, encrypted_fs
> is now composed entirely of mock-able or fake-able interfaces
> and can now be unittested without much ado.
> 
> - Remove mount_helper functions that currently performed this
> setup.
> - Cleanup path_str() usage since it is no longer needed.
> 
> BUG= chromium:808303 
> TEST=compiles.
> 
> Change-Id: Id80fccae6e612c285f7174a5fc0ab129f07ea9cd
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116343
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: I9fc7da05337dbd01503377fed5e5342258aa2224
Reviewed-on: https://chromium-review.googlesource.com/1237107
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/120d093b9e0b2aaed27cd90b37354dd540b89989/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/120d093b9e0b2aaed27cd90b37354dd540b89989/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/120d093b9e0b2aaed27cd90b37354dd540b89989/cryptohome/mount_encrypted/encrypted_fs.h
[modify] https://crrev.com/120d093b9e0b2aaed27cd90b37354dd540b89989/cryptohome/mount_helpers.h
[modify] https://crrev.com/120d093b9e0b2aaed27cd90b37354dd540b89989/cryptohome/mount_helpers.cc

Project Member

Comment 41 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/85f2ae93e0bddd00506377a30c0a1fe5622521e9

commit 85f2ae93e0bddd00506377a30c0a1fe5622521e9
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:08:33 2018

Revert "cryptohome: use brillo:LoopDeviceManager in mount-encrypted"

This reverts commit 26019bff6ca8f61c1a04177851beb73c82565f6d.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: use brillo:LoopDeviceManager in mount-encrypted
> 
> brillo::LoopDeviceManager abstracts the setup/teardown of loop
> devices and provides a fake interface that can be swapped out
> for unittests.
> 
> Also, remove similar functions from mount_helpers.
> 
> BUG= chromium:808303 
> TEST=compiles.
> 
> Change-Id: If093ea2cc91ec5f4f0cd688ef8d7b844da45bcad
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116342
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: I8686161e42f3efdf0df66a40c538d73025dbfa74
Reviewed-on: https://chromium-review.googlesource.com/1237108
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/85f2ae93e0bddd00506377a30c0a1fe5622521e9/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/85f2ae93e0bddd00506377a30c0a1fe5622521e9/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/85f2ae93e0bddd00506377a30c0a1fe5622521e9/cryptohome/mount_encrypted/encrypted_fs.h
[modify] https://crrev.com/85f2ae93e0bddd00506377a30c0a1fe5622521e9/cryptohome/mount_helpers.h
[modify] https://crrev.com/85f2ae93e0bddd00506377a30c0a1fe5622521e9/cryptohome/mount_helpers.cc

Project Member

Comment 42 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/7a1fc54d3ee5a6dfddcba5718411793c5782761f

commit 7a1fc54d3ee5a6dfddcba5718411793c5782761f
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:08:40 2018

Revert "cryptohome: Refactor fs utils into platform"

This reverts commit 22f519a8172eea9f9635332c58675bec9a49412c.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: Refactor fs utils into platform
> 
> - Add SetCloseUnusedFileDescriptors for fs functions:
>   this closes all unused file descriptors in the child process.
> - Refactor FormatExt4 to take options and number of blocks.
> - Add Fsck and Resize.
> - Refactor mount-encrypted to reuse fs utils from platform.
> - Remove equivalent functions from mount_helpers.
> 
> BUG= chromium:808303 
> TEST=compiles.
> 
> Change-Id: Id8bb7dcbcf127aff11a6440979b732188d599a75
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116341
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: If08bdddbce21f2ffd4a771ac32a1f493b6661f3f
Reviewed-on: https://chromium-review.googlesource.com/1237109
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/7a1fc54d3ee5a6dfddcba5718411793c5782761f/cryptohome/mount.cc
[modify] https://crrev.com/7a1fc54d3ee5a6dfddcba5718411793c5782761f/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/7a1fc54d3ee5a6dfddcba5718411793c5782761f/cryptohome/mount_helpers.h
[modify] https://crrev.com/7a1fc54d3ee5a6dfddcba5718411793c5782761f/cryptohome/mount_unittest.cc
[modify] https://crrev.com/7a1fc54d3ee5a6dfddcba5718411793c5782761f/cryptohome/mock_platform.h
[modify] https://crrev.com/7a1fc54d3ee5a6dfddcba5718411793c5782761f/cryptohome/platform.cc
[modify] https://crrev.com/7a1fc54d3ee5a6dfddcba5718411793c5782761f/cryptohome/mount_helpers.cc
[modify] https://crrev.com/7a1fc54d3ee5a6dfddcba5718411793c5782761f/cryptohome/platform.h

Project Member

Comment 43 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/9f043c910a2e12f70785cb08bf25ad044d8e5bc5

commit 9f043c910a2e12f70785cb08bf25ad044d8e5bc5
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:08:46 2018

Revert "cryptohome: add Platform to EncryptedFs"

This reverts commit 8e5278a2337c3b93f8c2ef363fcd36753e9c0dcd.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: add Platform to EncryptedFs
> 
> - Add platform to EncryptedFs: this allows us to abstract
>   away a lot of file-related operations into a mockable
>   interface that will (eventuall) be useful for unit-testing.
> 
> - Add functions for Access(), SameVFS() and GetBlkSize().
> 
> BUG= chromium:808303 
> TEST=compiles
> 
> Change-Id: I240934c752f110516165b69ec27f44e6b564b0e0
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116340
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: I1daa3c3afa07cc457c0f102e6b053d9640505de2
Reviewed-on: https://chromium-review.googlesource.com/1237110
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/9f043c910a2e12f70785cb08bf25ad044d8e5bc5/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/9f043c910a2e12f70785cb08bf25ad044d8e5bc5/cryptohome/mount_helpers.h
[modify] https://crrev.com/9f043c910a2e12f70785cb08bf25ad044d8e5bc5/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/9f043c910a2e12f70785cb08bf25ad044d8e5bc5/cryptohome/mount_encrypted/encrypted_fs.h
[modify] https://crrev.com/9f043c910a2e12f70785cb08bf25ad044d8e5bc5/cryptohome/mock_platform.h
[modify] https://crrev.com/9f043c910a2e12f70785cb08bf25ad044d8e5bc5/cryptohome/platform.cc
[modify] https://crrev.com/9f043c910a2e12f70785cb08bf25ad044d8e5bc5/cryptohome/mount_helpers.cc
[modify] https://crrev.com/9f043c910a2e12f70785cb08bf25ad044d8e5bc5/cryptohome/platform.h

Project Member

Comment 44 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/3dca3313870b07222a3eff0c60f053909d344c16

commit 3dca3313870b07222a3eff0c60f053909d344c16
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:08:55 2018

Revert "cryptohome: Modify Platform::Mount to use mount flags."

This reverts commit 039f739bfe95ff5cc490e0c603e3256e0f85eca4.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667
Original change's description:
> cryptohome: Modify Platform::Mount to use mount flags.
> 
> Currently, Platform::Mount uses a base set of mount flags.
> Instead of creating a new function for mounting with flags,
> we modify the signature of Mount since there are not many
> direct users of the mount function. This is in preparation
> of using Mount() with flags in mount-encrypted.
> 
> - Rename kDefaultMountOptions to kDefaultMountFlags to
>   disambiguate between the arguments for flags and options.
> 
> BUG= chromium:808303 
> TEST=compiles
> 
> Change-Id: I69af6dbf765dfa311f45b8e98909dec446450d83
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116339
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: Ifda930303ecf6a73573c13408322c3d8e56b8570
Reviewed-on: https://chromium-review.googlesource.com/1237111
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/3dca3313870b07222a3eff0c60f053909d344c16/cryptohome/mount_unittest.cc
[modify] https://crrev.com/3dca3313870b07222a3eff0c60f053909d344c16/cryptohome/platform.h
[modify] https://crrev.com/3dca3313870b07222a3eff0c60f053909d344c16/cryptohome/mount.cc
[modify] https://crrev.com/3dca3313870b07222a3eff0c60f053909d344c16/cryptohome/platform.cc
[modify] https://crrev.com/3dca3313870b07222a3eff0c60f053909d344c16/cryptohome/mock_platform.h

Project Member

Comment 45 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/4a7c3428b7e47698e357c5ce03372f5db61bca1f

commit 4a7c3428b7e47698e357c5ce03372f5db61bca1f
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:09:01 2018

Revert "cryptohome: breakout fs creation from EncryptedFs::Setup"

This reverts commit 94836b718b6c9766e238ec66f33e19ea067ca856.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: breakout fs creation from EncryptedFs::Setup
> 
> Decouple the calculation of parameters, sparse file creation
> and deletion from the actual setup for better readability
> in EncryptedFs::Setup.
> 
> BUG= chromium:808303 
> TEST=compiles
> 
> Change-Id: I49b637b577e2dc4a76a1d3857cc3243e6713cec6
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116338
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: I5fa27dd9a0bbe6079bea24fa6903673edca3b836
Reviewed-on: https://chromium-review.googlesource.com/1237112
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/4a7c3428b7e47698e357c5ce03372f5db61bca1f/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/4a7c3428b7e47698e357c5ce03372f5db61bca1f/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 46 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/fe949ff9381613ed2143f1301e523ac5c0a9dddc

commit fe949ff9381613ed2143f1301e523ac5c0a9dddc
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:09:06 2018

Revert "cryptohome: Remove duplicate teardown code"

This reverts commit 87cfccb83005480767e83036867c25bac069dd58.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: Remove duplicate teardown code
> 
> - The failure condition for Setup() tries a variation of the
>   Teardown() function. Instead, refactor to a single version of
>   mount teardown in stages. This helps in breaking down Setup()
>   into smaller chunks.
> - Update how dirty_expire_centisecs and lodev are created so that
>   we don't have to manually free them at the end of setup. This
>   also removes the final goto and allows us to put variables
>   closer to where they are actually used (without initializations
>   crossing goto boundaries).
> - The current dirty_expire_centisecs --> commit_interval mapping is
>   not smooth:
>   dirty_expire_centisecs : commit interval
>   0 [set to 0 / read failure] : 600s
>   1-99                        : 5s (ext4 default)
>   100-199                     : 1s
>   200-299                     : 2s
>   ...
>   Instead, default to 5s for all dirty_expire_centisecs < 600. Only
>   use 600s for read failures.
> 
> BUG= chromium:808303 
> TEST=compiles
> 
> Change-Id: Ied21e64dbb6349cba6d77bd182da43113b58aaa0
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116297
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: Ic74fcdf85c92d593b39c3a56b273d4a53ed000dc
Reviewed-on: https://chromium-review.googlesource.com/1237593
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/fe949ff9381613ed2143f1301e523ac5c0a9dddc/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/fe949ff9381613ed2143f1301e523ac5c0a9dddc/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 47 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/0fd412faa9e620de8303eb36b17b9425c0d77a52

commit 0fd412faa9e620de8303eb36b17b9425c0d77a52
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:09:13 2018

Revert "cryptohome: Rename private members of EncryptedFs"

This reverts commit 4f08ef4cbbe696bbc8c872f1cd3a2d62ba377d21.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: Rename private members of EncryptedFs
> 
> Follow C++-style guide in renaming private members
> of EncryptedFs.
> 
> (While this is a pretty small patch, there are a ton
> of such minor changes in refactoring mount-encrypted
> and it might be easier to review if such mechanical
> changes were grouped functionally).
> 
> BUG= chromium:808303 
> TEST=compiles
> 
> Change-Id: Ifb6a289e931c5d1ec10ebe8a57885fd95a0bf632
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116296
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Mattias Nissler <mnissler@chromium.org>

Bug:  chromium:808303 
Change-Id: I54632fc9c7020bfa5cf038a8689d25772d0c2dad
Reviewed-on: https://chromium-review.googlesource.com/1237594
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/0fd412faa9e620de8303eb36b17b9425c0d77a52/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/0fd412faa9e620de8303eb36b17b9425c0d77a52/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 48 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/bd4c721c4709ef90a9fa0a3bc468e5138f7e6d60

commit bd4c721c4709ef90a9fa0a3bc468e5138f7e6d60
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:09:21 2018

Revert "cryptohome: Fix logging and comments"

This reverts commit adb61cb753318045946dd738957b62cdfd1f1d71.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: Fix logging and comments
> 
> Update mount-encrypted to cpp-style logging and comments.
> 
> BUG= chromium:808303 
> TEST=compiles
> 
> Change-Id: I2917425175cdfc135c8e3de1ae3267b403ddb7e7
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116295
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Mattias Nissler <mnissler@chromium.org>

Bug:  chromium:808303 
Change-Id: If4d4670e8eecf807a7f6eed2c33d6aeab7d750eb
Reviewed-on: https://chromium-review.googlesource.com/1237595
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/bd4c721c4709ef90a9fa0a3bc468e5138f7e6d60/cryptohome/mount_encrypted/encryption_key.cc
[modify] https://crrev.com/bd4c721c4709ef90a9fa0a3bc468e5138f7e6d60/cryptohome/mount_encrypted.h
[modify] https://crrev.com/bd4c721c4709ef90a9fa0a3bc468e5138f7e6d60/cryptohome/mount_encrypted/encrypted_fs.cc

Project Member

Comment 49 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/a71f04a06715c8cfa5e61b478695044d2e10a724

commit a71f04a06715c8cfa5e61b478695044d2e10a724
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:09:28 2018

Revert "cryptohome: Modernize mount-encrypted encrypted_fs"

This reverts commit bcec5f516deffbc15ff23da2e057750c03044e31.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: Modernize mount-encrypted encrypted_fs
> 
> - Move to FilePaths and std::string instead of gchar*/char*
> - Adhere to style guide in naming struct, enum and class types.
> - Simplify handling of bind_mounts.
> - Add comments for EncryptedFs and member functions.
> - Remove key_path
> 
> BUG= chromium:808303 
> TEST=compiles
> 
> Change-Id: I2a785c0cb9c9e872d1d0284f1b83097180302e0f
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116294
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: I61160f745f87f93232c488f0d24947944762f94b
Reviewed-on: https://chromium-review.googlesource.com/1237596
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/a71f04a06715c8cfa5e61b478695044d2e10a724/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/a71f04a06715c8cfa5e61b478695044d2e10a724/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/a71f04a06715c8cfa5e61b478695044d2e10a724/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 50 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/6184ed272756dfbbfdca2d36fa4ffd8ae3fd6f7e

commit 6184ed272756dfbbfdca2d36fa4ffd8ae3fd6f7e
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:09:34 2018

Revert "cryptohome: Create EncryptedFs for mount-encrypted"

This reverts commit 757c0a767147117ed95bc9163f15c17422b44455.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: Create EncryptedFs for mount-encrypted
> 
> Minimal changes to encapsulate the filesystem setup in
> mount-encrypted. This is in preparation to introduce
> a new type of encrypted file system.
> 
> Move local functions in an anonymous namespace.
> 
> BUG= chromium:808303 
> TEST=compiles
> 
> Change-Id: I93a28e2026b7d8920077be8c4d93c4d6a6b3a17e
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116293
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: Ic6fe923061a13f60f42b7282b9316b7c567160e4
Reviewed-on: https://chromium-review.googlesource.com/1237597
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/6184ed272756dfbbfdca2d36fa4ffd8ae3fd6f7e/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/6184ed272756dfbbfdca2d36fa4ffd8ae3fd6f7e/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/6184ed272756dfbbfdca2d36fa4ffd8ae3fd6f7e/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 51 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/c2d20ad2d921b4b2422bacfd9ffa46b1f36a9f14

commit c2d20ad2d921b4b2422bacfd9ffa46b1f36a9f14
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:09:41 2018

Revert "cryptohome: Cleanup mount-encrypted hex <--> blob conversions"

This reverts commit f2a30aa5e9c262634818f5c78236425fcf65d0cc.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: Cleanup mount-encrypted hex <--> blob conversions
> 
> Remove hand-rolled functions and reuse existing
> functions for hex to blob conversions and back.
> Also, remove unused variables related to key
> handling.
> 
> BUG= chromium:808303 
> TEST=compiles
> 
> Change-Id: I00f5a3199bcd5b99a1594dc499eb1db5e5cc8253
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116292
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Mattias Nissler <mnissler@chromium.org>

Bug:  chromium:808303 
Change-Id: I16f6862143fbab31c2423ad68851d594375946c8
Reviewed-on: https://chromium-review.googlesource.com/1237598
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/c2d20ad2d921b4b2422bacfd9ffa46b1f36a9f14/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/c2d20ad2d921b4b2422bacfd9ffa46b1f36a9f14/cryptohome/mount_helpers.cc
[modify] https://crrev.com/c2d20ad2d921b4b2422bacfd9ffa46b1f36a9f14/cryptohome/mount_helpers.h

Project Member

Comment 52 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/e605e3f1c1ec41684b40145fdbb85bb9cf36b0bc

commit e605e3f1c1ec41684b40145fdbb85bb9cf36b0bc
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:09:48 2018

Revert "cryptohome: Remove code to migrate to mount-encrypted"

This reverts commit d775a9d36e42c097cf40f23e76b37dce2f351e72.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: Remove code to migrate to mount-encrypted
> 
> Since there are no legacy devices with unencrypted stateful
> partitions, remove all code to do migration.
> 
> BUG= chromium:808303 
> TEST=compiles
> 
> Change-Id: I6c8eccb1a09437b89100a955ed575014a00e94d0
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116291
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Mattias Nissler <mnissler@chromium.org>

Bug:  chromium:808303 
Change-Id: Ifbbf0c69ceb57271c6f4556c1d6c55d2d9b2c9dc
Reviewed-on: https://chromium-review.googlesource.com/1237599
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/e605e3f1c1ec41684b40145fdbb85bb9cf36b0bc/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/e605e3f1c1ec41684b40145fdbb85bb9cf36b0bc/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/e605e3f1c1ec41684b40145fdbb85bb9cf36b0bc/cryptohome/mount_encrypted/encrypted_fs.h
[modify] https://crrev.com/e605e3f1c1ec41684b40145fdbb85bb9cf36b0bc/cryptohome/mount_helpers.h
[modify] https://crrev.com/e605e3f1c1ec41684b40145fdbb85bb9cf36b0bc/cryptohome/mount_helpers.cc

Project Member

Comment 53 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/d541e6e808ce36a192d20b45407a8f8e86aed45d

commit d541e6e808ce36a192d20b45407a8f8e86aed45d
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:09:55 2018

Revert "cryptohome: decouple encrypted fs setup from mount-encrypted"

This reverts commit e5b6195a3ccaaacd299fe006f0c3df1b3595a34e.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> cryptohome: decouple encrypted fs setup from mount-encrypted
> 
> In preparation for refactoring mount-encrypted, separate
> out fs setup functions into a separate file. Additionally,
> split and cleanup includes to a minimal set.
> 
> BUG= chromium:808303 
> CQ-DEPEND=CL:1184322
> TEST=compilation.
> 
> Change-Id: If28c3482b9296116ed3a2477ca1325b295019414
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1116290
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: I34121a772fd43f69612aa45c9b1b51ff4e71dcc5
Reviewed-on: https://chromium-review.googlesource.com/1237600
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[delete] https://crrev.com/e605e3f1c1ec41684b40145fdbb85bb9cf36b0bc/cryptohome/mount_encrypted/encrypted_fs.cc
[modify] https://crrev.com/d541e6e808ce36a192d20b45407a8f8e86aed45d/cryptohome/mount_encrypted.cc
[modify] https://crrev.com/d541e6e808ce36a192d20b45407a8f8e86aed45d/cryptohome/cryptohome.gyp
[delete] https://crrev.com/e605e3f1c1ec41684b40145fdbb85bb9cf36b0bc/cryptohome/mount_encrypted/encrypted_fs.h

Project Member

Comment 54 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/aba1b6ce95d9afe0f4a552129a4f182dc8170577

commit aba1b6ce95d9afe0f4a552129a4f182dc8170577
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:10:05 2018

Revert "libbrillo: add LoopDeviceManager and LoopDevice."

This reverts commit c2e72e73f06d33a8d6421bb3ee3f06e46106513f.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> libbrillo: add LoopDeviceManager and LoopDevice.
> 
> LoopDeviceManager manages the creation of LoopDevice
> objects that represent attached loop devices. In order
> to simplify the state of LoopDevices, the private class
> members of LoopDevice are constant set at creation.
> 
> LoopDeviceManager can be queried to create LoopDevice
> objects for already attached devices. Search for attached
> loop devices can be done by name or by number, or the
> complete list of attached devices.
> 
> LoopDevice abstracts the ioctl related functions to a
> ioctl runner, which can be replaced by a fake implementation,
> as in loop_device_unittest.cc
> 
> (Additional review context: https://chromium-review.googlesource.com/1020238)
> 
> BUG= chromium:808303 
> TEST=FEATURES=test emerge libbrillo
> 
> Change-Id: I569d8f12dca90468013b431f594b061ea7550cab
> Reviewed-on: https://chromium-review.googlesource.com/1187156
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: I147df040914ecfdd802d36a88918c1243a1d3728
Reviewed-on: https://chromium-review.googlesource.com/1237601
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[delete] https://crrev.com/d541e6e808ce36a192d20b45407a8f8e86aed45d/libbrillo/brillo/blkdev_utils/loop_device_fake.cc
[delete] https://crrev.com/d541e6e808ce36a192d20b45407a8f8e86aed45d/libbrillo/brillo/blkdev_utils/loop_device_unittest.cc
[delete] https://crrev.com/d541e6e808ce36a192d20b45407a8f8e86aed45d/libbrillo/brillo/blkdev_utils/loop_device.h
[modify] https://crrev.com/aba1b6ce95d9afe0f4a552129a4f182dc8170577/libbrillo/libbrillo.gypi
[delete] https://crrev.com/d541e6e808ce36a192d20b45407a8f8e86aed45d/libbrillo/brillo/blkdev_utils/loop_device_fake.h
[delete] https://crrev.com/d541e6e808ce36a192d20b45407a8f8e86aed45d/libbrillo/brillo/blkdev_utils/loop_device.cc

Project Member

Comment 55 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/b33c97ee4542d3b310309e59ca4ec3bdb358813b

commit b33c97ee4542d3b310309e59ca4ec3bdb358813b
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:10:27 2018

Revert "libbrillo: Add dependency on lvm2."

This reverts commit 61e684246971b314ef8fe62fbc7a96d9a8b8d765.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> libbrillo: Add dependency on lvm2.
> 
> Add lvm2 to COMMON_DEPEND to build blkdevutils::DeviceMapper.
> 
> BUG= chromium:808303 
> CQ-DEPEND=CL:1187155
> TEST="equery depends lvm2" shows libbrillo
> 
> Change-Id: I08969b3a17276b67567ed8753f75d380546c0bda
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1222791
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: I1fe8a54b5a83932a07a7fb70a85942202dc0eec9
Reviewed-on: https://chromium-review.googlesource.com/1236996
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[modify] https://crrev.com/b33c97ee4542d3b310309e59ca4ec3bdb358813b/chromeos-base/libbrillo/libbrillo-9999.ebuild

Project Member

Comment 56 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/13f4f32e79830c2aa492b9fb489bf940ba1009a7

commit 13f4f32e79830c2aa492b9fb489bf940ba1009a7
Author: Sarthak Kukreti <sarthakkukreti@chromium.org>
Date: Fri Sep 21 01:10:12 2018

Revert "libbrillo: add DevmapperTable and DeviceMapper"

This reverts commit c1675c3e2e91f65ce557d5763d52e49ab7021178.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=887667

Original change's description:
> libbrillo: add DevmapperTable and DeviceMapper
> 
> blkdev_utils implements utilities to setup block devices.
> This patch adds a libdevmapper-based DeviceMapper implementation
> to blkdev_utils. DeviceMapper supports the minimal operations
> required to manage dm-verity or dm-crypt devices.
> 
> * The bulk of the operations are implemented using DevmapperTasks,
> which are analogous to libdevmapper dm_task structs.
> 
> * DevmapperTable allows easier handling of I/O to the libdevmapper
> interface.
> 
> * DeviceMapper uses a DevmapperTaskFactory to create tasks, which
> can be overriden with a different implementation (eg. based on
> ProcessImpl) or a fake implementation (eg. FakeDevmapperTask).
> 
> * Add Blob <--> SecureHex conversions for the secure conversions.
> 
> (Additional review context: https://chromium-review.googlesource.com/983059)
> 
> BUG= chromium:808303 
> CQ-DEPEND=CL:1222791
> TEST=FEATURES=TEST emerge libbrillo
> 
> Change-Id: Ib93d0ed7056a0cb49d2a8895f34adca9862698ed
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/1187155
> Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

Bug:  chromium:808303 
Change-Id: I521a80375dd82c05b74cc10b4162889349117dca
Reviewed-on: https://chromium-review.googlesource.com/1237602
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>

[delete] https://crrev.com/aba1b6ce95d9afe0f4a552129a4f182dc8170577/libbrillo/brillo/blkdev_utils/device_mapper_fake.h
[delete] https://crrev.com/aba1b6ce95d9afe0f4a552129a4f182dc8170577/libbrillo/brillo/blkdev_utils/device_mapper_fake.cc
[delete] https://crrev.com/aba1b6ce95d9afe0f4a552129a4f182dc8170577/libbrillo/brillo/blkdev_utils/device_mapper_unittest.cc
[modify] https://crrev.com/13f4f32e79830c2aa492b9fb489bf940ba1009a7/libbrillo/brillo/secure_blob.cc
[delete] https://crrev.com/aba1b6ce95d9afe0f4a552129a4f182dc8170577/libbrillo/brillo/blkdev_utils/device_mapper.h
[delete] https://crrev.com/aba1b6ce95d9afe0f4a552129a4f182dc8170577/libbrillo/brillo/blkdev_utils/device_mapper_task.h
[delete] https://crrev.com/aba1b6ce95d9afe0f4a552129a4f182dc8170577/libbrillo/brillo/blkdev_utils/device_mapper.cc
[delete] https://crrev.com/aba1b6ce95d9afe0f4a552129a4f182dc8170577/libbrillo/brillo/blkdev_utils/device_mapper_task.cc
[modify] https://crrev.com/13f4f32e79830c2aa492b9fb489bf940ba1009a7/libbrillo/brillo/secure_blob.h
[modify] https://crrev.com/13f4f32e79830c2aa492b9fb489bf940ba1009a7/libbrillo/libbrillo.gypi

Sign in to add a comment