Commit graph

2245 commits

Author SHA1 Message Date
Paul Crowley
cfe3972f2d Wait for dm device to be ready before format
It can sometimes take a moment for the dm-device to appear after
creation, causing operations on it such as formatting to fail.
Ensure the device exists before create_crypto_blk_dev returns.

Test: adb sm set-virtual-disk true and format as adoptable.
Bug: 117586466
Change-Id: Id8f571b551f50fc759e78d917e4ac3080e926722
Merged-In: Id8f571b551f50fc759e78d917e4ac3080e926722
2018-11-05 13:59:08 -08:00
Eric Biggers
ddbd8325f5 Merge changes from topic "e4crypt_to_fscrypt"
* changes:
  vold: get the fscrypt kernel API declarations from linux/fs.h
  vold: rename from "ext4 encryption" to fscrypt
2018-10-29 17:19:39 +00:00
Eric Biggers
ba997ee583 vold: get the fscrypt kernel API declarations from linux/fs.h
bionic now has linux/fs.h from the 4.14 kernel, which has the fscrypt
kernel API declarations.  Replace the manual declarations in vold,
except for FS_AES_256_XTS_KEY_SIZE which is not available.

Test: built, booted device with f2fs encryption
Change-Id: I6a0e3117eaebe3baac7385421afce2169d46ad55
2018-10-25 17:12:32 -07:00
Eric Biggers
a701c458ca vold: rename from "ext4 encryption" to fscrypt
We support file-based encryption on both ext4 and f2fs now, and the
kernel API is the same.  So rename things appropriately in vold:

    e4crypt => fscrypt
    ext4enc => fscrypt
    Ext4Crypt => FsCrypt
    EXT4_* => FS_*
    ext4_encryption_key => fscrypt_key

Additionally, the common functions shared by 'vold' and 'init' are now
in libfscrypt rather than ext4_utils.  So update vold to link to
libfscrypt and include the renamed headers.

Note: there's a chance of 'fscrypt' being confused with the dm-crypt
based encryption code in vold which is called 'cryptfs'.  However,
fscrypt is the name used in the kernel for ext4/f2fs/ubifs encryption,
and it's preferable to use the same name in userspace.

Test: built, booted device with f2fs encryption
Change-Id: I2a46a49f30d9c0b73d6f6fe09e4a4904d4138ff6
2018-10-25 17:12:32 -07:00
Bill Yi
0016efbc44 Merge pie-platform-release to aosp-master - DO NOT MERGE
Change-Id: I112d144eac39f426e22d3a66e4fe298306010c13
2018-10-24 14:48:22 -07:00
Bill Yi
8b1136c831 Merge pi-dr1-dev to aosp-master
Change-Id: I5f9eb0c7ea0a3ba88865854e28b73806011d323e
2018-10-19 12:20:56 -07:00
Daniel Rosenberg
aeac5d5f57 [automerger skipped] Merge "Remove spurious function declaration"
am: 090e05bd02  -s ours

Change-Id: I919eeb0ec529c444ea0a32835a4b0306c07fab45
2018-10-16 17:12:32 -07:00
Treehugger Robot
090e05bd02 Merge "Remove spurious function declaration" 2018-10-16 23:55:28 +00:00
Daniel Rosenberg
bc6c1ff8df Merge "Switch to exceptions for most cp calls"
am: ece7e231a6

Change-Id: Ib02d0a002f31834bb07cf8dd9446cec942880a77
2018-10-16 14:34:54 -07:00
Daniel Rosenberg
3bfb996597 Remove spurious function declaration
Test: Nothing changes
Change-Id: I27f0d832d33099efe25794987c307d773b5d987c
Merged-In: Icba16578608a6cbf922472e9d4ae5b8cf5f016c6
2018-10-16 21:28:13 +00:00
Treehugger Robot
ece7e231a6 Merge "Switch to exceptions for most cp calls" 2018-10-16 21:14:34 +00:00
Daniel Rosenberg
73680ec382 Switch to exceptions for most cp calls
This switches the checkpoint calls that don't need to return a value
to return 0 on success, and an error on failure. This will be transalted
to exceptions for java binder users. needsCheckpoint and needsRollback
still return a boolean value.

Test: vdc setCheckpoint 2 then reboot 3 times checking state
Bug: 112901762
Change-Id: Idd3b5e6036631562a86d5123f533b86cf3bd6032
Merged-In: Idd3b5e6036631562a86d5123f533b86cf3bd6032
2018-10-16 20:06:47 +00:00
Daniel Rosenberg
e1e3dc3698 Merge "Handle retry count"
am: e74587af4d

Change-Id: I76c8625e58de0efb7b1d937ce7bcb8499c7fc279
2018-10-15 21:19:59 -07:00
Treehugger Robot
e74587af4d Merge "Handle retry count" 2018-10-16 01:25:34 +00:00
Daniel Rosenberg
80d1ca5600 Handle retry count
Test: vdc setCheckpoint 2 then reboot 3 times checking state
Bug: 112901762
Change-Id: I85a71d059bca27b76175b9bd8465cc453f0ddb8d
2018-10-15 22:13:41 +00:00
Bill Rassieur
87135e28b2 Merge PPR2.181005.003 from pi-release-2 into pi-platform-release.
Change-Id: Ifb0130fa2b413d1b8a769684cffb6c6621ea9859
BUG: 117431430
2018-10-10 17:33:05 +00:00
Daniel Rosenberg
0b875d7630 Merge "Add checkpointing support for A/B updates"
am: ba1752008d

Change-Id: I62cb1c6dce6c9eca1c3651b05d23cb893559d370
2018-10-04 18:48:04 -07:00
Daniel Rosenberg
ba1752008d Merge "Add checkpointing support for A/B updates" 2018-10-05 01:31:18 +00:00
Paul Lawrence
1c6d73bfcc Merge "Use unique points for fstab"
am: 1e1893812c

Change-Id: I64ce90c05417b8b96ddc1e96cd505ca2aff86082
2018-10-03 17:28:34 -07:00
Treehugger Robot
1e1893812c Merge "Use unique points for fstab" 2018-10-03 23:57:39 +00:00
Daniel Rosenberg
d399249855 Add checkpointing support for A/B updates
This adds implicit rollback support during A/B style updates.
If you explicitly start a checkpoint with -1, needsRollback will
trigger if the update fails, and should be used if any additional
cleanup is needed that is not covered by A/B itself.

Test: All Checkpoint tests pass
Bug: 111020314
Change-Id: I88b4a1098c6bac4dc1438a54c8a8f59577a6c17b
2018-10-03 15:39:25 -07:00
Paul Lawrence
2040089ab0 Use unique points for fstab
Test: Checkpoint test script runs and passes
Change-Id: I13005da22aef5fda3d1e0941949db02ff0ff0870
2018-10-03 14:19:31 -07:00
Paul Lawrence
61c3eaf068 Merge "Make checkpointing work on ext4"
am: ac244261c8

Change-Id: I78da54f117c9c2710d2d1fbe4ec7e902bf944d5d
2018-10-03 13:31:25 -07:00
Treehugger Robot
ac244261c8 Merge "Make checkpointing work on ext4" 2018-10-03 20:15:48 +00:00
Paul Lawrence
1abb2fe278 Make checkpointing work on ext4
Test: All tests pass
Change-Id: I2a6cdf1edfe752f4633e1931e75d18659653938c
2018-10-03 09:15:27 -07:00
Mark Salyzyn
74a6c69e57 Merge "Protect /mnt/scratch from stale umount on userdebug"
am: b39e6f2887

Change-Id: I2505bc0cf4fe31123c47bd10619830298c3a033a
2018-10-02 15:24:57 -07:00
Treehugger Robot
b39e6f2887 Merge "Protect /mnt/scratch from stale umount on userdebug" 2018-10-02 21:31:12 +00:00
Mark Salyzyn
c4405e9c17 Protect /mnt/scratch from stale umount on userdebug
On userdebug protect /mnt/scratch. On user builds ensure that
/mnt/scratch is considered a stale mount so it can not be used.
vold runs before ro.debuggable is set, so this must be a compile
time decision.

Minor technical debt cleanup associated with using android::base.

Test: compile
Bug: 109821005
Change-Id: I8efdbedfe850dd24daecf03a37aea61de47edc7d
Merged-In: I8efdbedfe850dd24daecf03a37aea61de47edc7d
2018-10-02 18:00:49 +00:00
Sudheer Shanka
96707825f2 Merge "Remove unmount_tree in VolumeManager."
am: 9931db7e59

Change-Id: Ib02f999eb66c5685752abf99c0c77ba49dd60d74
2018-09-28 17:33:19 -07:00
Sudheer Shanka
9931db7e59 Merge "Remove unmount_tree in VolumeManager." 2018-09-28 23:49:51 +00:00
Sudheer Shanka
99d304ac60 Remove unmount_tree in VolumeManager.
This is not needed anymore since everything else is updated
to use android::vold::UnmountTree.

Bug: 111890351
Test: manual
Change-Id: Idb574469763fa3438fbfc40d6da786d87ac63c38
2018-09-28 13:38:39 -07:00
Sudheer Shanka
f5b24f1015 Merge "Add unmountTree to utils."
am: a64572431e

Change-Id: Ifdbdc90e22b4a681dcf0766919807109cf78ffca
2018-09-27 13:14:30 -07:00
Sudheer Shanka
a64572431e Merge "Add unmountTree to utils." 2018-09-27 19:54:23 +00:00
Sudheer Shanka
89ddf99119 Add unmountTree to utils.
Bug: 111890351
Test: builds without any errors
Change-Id: I62a94c9e8d101756b686b402774f08a1d71cf875
2018-09-27 10:29:02 -07:00
Daniel Rosenberg
7e84915c17 Merge "Add support for checkpointing"
am: a3381ffc3f

Change-Id: I52e70b0f886281280bb050751060b975e103376d
2018-09-25 15:10:22 -07:00
Treehugger Robot
a3381ffc3f Merge "Add support for checkpointing" 2018-09-25 21:52:19 +00:00
Oleksiy Avramchenko
1fe4696cdd Merge changes from topic "exfat-update"
am: a2a227e382

Change-Id: I13daa826be04c72ab18175d3ceee6212b7304731
2018-09-24 12:01:36 -07:00
Treehugger Robot
a2a227e382 Merge changes from topic "exfat-update"
* changes:
  Use exFAT for SDXC cards
  Add GetBlockDevSize, GetBlockDevSectors helpers
2018-09-24 18:52:56 +00:00
Jeff Sharkey
92c182e4c7 Merge "Update vold to log only debug or higher level messages."
am: 9bd07d8760

Change-Id: Idd8482fc0287d51d962ead0dd4c1f8f8e514d9de
2018-09-24 10:25:07 -07:00
Jeff Sharkey
9bd07d8760 Merge "Update vold to log only debug or higher level messages." 2018-09-24 17:06:25 +00:00
Oleksiy Avramchenko
4cff06d45f Use exFAT for SDXC cards
When both VFAT and exFAT are supported VFAT will only be used to
format card. Use exFAT for cards larger than 32GB per SDXC standard.

Test: build, manual, mount exFAT volume
Bug: 80202067
Change-Id: If504f9685256a669c5801a69d69d5a214ad27455
2018-09-24 14:28:24 +02:00
Oleksiy Avramchenko
625dc787c6 Add GetBlockDevSize, GetBlockDevSectors helpers
Helpers to get a block device size in bytes or 512 byte sectors,
using BLKGETSIZE64 and returning value of uint64_t type.

This also removes get_blkdev_size().

Test: build, manual, mount exFAT volume
Bug: 80202067
Change-Id: Ib07e8ac6ef7ff49de0ed570d1fa202e8b558b80c
2018-09-24 14:25:24 +02:00
Daniel Rosenberg
65f99c9e8b Add support for checkpointing
Checkpointing uses a combination of files on the meta partition
and the checkpoint= fs_mgr flag. Checkpointed partitions will
revert to their starting state on reboot unless checkpoint commit
is called.

Test: Run vdc commands, check file on metadata
Merged-In: Icba16578608a6cbf922472e9d4ae5b8cf5f016c6
Change-Id: Icba16578608a6cbf922472e9d4ae5b8cf5f016c6
2018-09-21 21:54:11 +00:00
Sudheer Shanka
4b6ca4ea65 Update vold to log only debug or higher level messages.
This will allow adding lots of verbose logs which can be enabled
only during local testing/debugging. Update the existing verbose
level logs to debug level since we want those to be logged by
default.

Test: manual
Change-Id: Ib05e2b6efa71308458d49affb6ed81d3975b28ab
2018-09-21 11:16:51 -07:00
Yifan Hong
e0a7888435 Merge "health.filesystem HAL renamed to health.storage"
am: 15b9656ae9

Change-Id: Id587f968eea321254589a0d0f3cd5fc23be56739
2018-09-20 22:38:46 -07:00
Paul Crowley
50cd072d3b Merge "clang-format the rest of the files"
am: 1934619b8b

Change-Id: I6265495330a13f687628b2143b9f78eb25380104
2018-09-20 22:38:27 -07:00
Yifan Hong
15b9656ae9 Merge "health.filesystem HAL renamed to health.storage" 2018-09-20 17:26:53 +00:00
Treehugger Robot
1934619b8b Merge "clang-format the rest of the files" 2018-09-20 17:14:35 +00:00
Paul Crowley
8915d62847 clang-format the rest of the files
Apply clang-format to fix the remaining files not fixed by
change I23cde3f0bbcac13bef555d13514e922c79d5ad48

Test: Format-only changes; treehugger suffices.
Change-Id: I1bfd5c8d68d298596875d5edae26cdfe27c03489
Merged-In: I1bfd5c8d68d298596875d5edae26cdfe27c03489
2018-09-20 06:27:22 -07:00
Paul Crowley
957b9544dd Merge "clang-format many files."
am: a676df01e2

Change-Id: Iecaed7fd342df49d628c2bc68f1bf5439163d918
2018-09-19 17:13:35 -07:00