- 01 Jul, 2015 1 commit
-
-
Jeff Sharkey authored
Refactor fstrim code to be encapsulated in unique task object, and give it option of benchmarking when finished. Trimming now includes both storage from fstab and adopted private volumes. Cleaner timing stats are logged for each unique volume. Add wakelock during ongoing async move tasks. Push disk sysfs path to framework so it can parse any SD card registers as desired. Bug: 21831325 Change-Id: I76577685f5cae4929c251ad314ffdaeb5eb1c8bf
-
- 26 Jun, 2015 1 commit
-
-
Jeff Sharkey authored
Some storage devices can be formatted as bare partitions, without an MBR or GPT header. If we found no partitions, try poking at the raw disk, and treat it as a public volume if we found a valid filesystem. Bug: 20503551 Change-Id: I80304e1ad865435321c341b667c0daf2daf4d56c
-
- 22 Jun, 2015 1 commit
-
-
Jeff Sharkey authored
Report both the disk and the partition GUID for private volumes to userspace, and offer to forget the encryption key for a given partition GUID. Bug: 21782268 Change-Id: Ie77a3a58e47bf3563cdb3e4b0edfab1de4d0e6b4
-
- 09 Jun, 2015 1 commit
-
-
Jeff Sharkey authored
When formatting volumes, pass along fsType string which can be "auto" to let the volume select the best choice. For now, private volumes assume that MMC devices (like SD cards) are best off using f2fs when both kernel support and tools are present, otherwise fall back to ext4. Use blkid when mounting to pick the right set of tools. Move filesystem utility methods into namespaces and place in separate directory to be more organized. Bug: 20275581 Change-Id: Id5f82d8672dda2e9f68c35b075f28232b0b55ed4
-
- 29 Apr, 2015 1 commit
-
-
Jeff Sharkey authored
Bug: 19993667 Change-Id: If6a79391e34b652b2ba4e6df40a8e712f7a2e172
-
- 21 Apr, 2015 1 commit
-
-
Jeff Sharkey authored
We eventually should move back to per-disk locks, but use a giant lock to keep development rolling forward. Also move force adoptable flag to framework since, since encrypted devices don't have persisted properties loaded early during boot. Bug: 19993667 Change-Id: Ifa3016ef41b038f8f71fc30bc81596cfd21dcd2a
-
- 19 Apr, 2015 2 commits
-
-
Jeff Sharkey authored
Bug: 19993667 Change-Id: I47099c262686127f82dd376570d49cf0ad119842
-
Jeff Sharkey authored
Bug: 19993667 Change-Id: I20dc183a35c11b5b4ba6139e690929b9c279b830
-
- 18 Apr, 2015 1 commit
-
-
Jeff Sharkey authored
This is cleaner and more direct than the reverse of having the disk publish child volume membership. Rename state constants to match public API. Add state representing bad removal. Make it clear that volume flags are related to mounting. Send new unsupported disk event when we finish scanning an entire disk and have no meaningful volumes. Bug: 19993667 Change-Id: I08a91452ff561171a484d1da5745293ec893aec0
-
- 15 Apr, 2015 2 commits
-
-
Jeff Sharkey authored
Otherwise we get really excited and trip over ourselves while partitions are still being created. Bug: 19993667 Change-Id: I034e56b3063a71d73f9311a945c05ea2ae255f7d
-
Jeff Sharkey authored
Bug: 19993667 Change-Id: Id125d9252bf7130516c0ec619d5f067fea24d560
-
- 14 Apr, 2015 1 commit
-
-
Jeff Sharkey authored
Bug: 19993667 Change-Id: Ib15e79a94a185843dace35fea7daaea866120f87
-
- 12 Apr, 2015 1 commit
-
-
Jeff Sharkey authored
When a private volume is mounted, create an emulated volume above it hosted at the /media path on that device. That emulated volume is automatically torn down when unmounting the private volume. Add "removed" state for volume, which signals to framework that media has left the building, send when the volume is destroyed. Bug: 19993667 Change-Id: I1f82b51de578ac5cfcc5d7b9a6fb44f6f25c775c
-
- 11 Apr, 2015 1 commit
-
-
Jeff Sharkey authored
Sadly setexeccon() is process global, so we need to carefully ensure that all exec() are mutually exclusive to avoid transitioning into unwanted domains. Also, because we have several threads floating around, we need to guard all our FDs with O_CLOEXEC. Format all newly created volumes immediately after partitioning, but silence all events emitted from those volumes to prevent the framework from getting all excited. Unify all notify events under a single codepath to make them easy to silence. Sent SIGINT before escalating to SIGTERM when unmounting. Bug: 19993667 Change-Id: Idc6c806afc7919a004a93e2240b42884f6b52d6b
-
- 01 Apr, 2015 1 commit
-
-
Jeff Sharkey authored
This adds support for private volumes which is just a filesystem wrapped in a dm-crypt layer. For now we're using the exact same configuration as internal encryption (aes-cbc-essiv:sha256), but we don't store any key material on the removable media. Instead, we store the key on internal storage, and use the GPT partition GUID to identify which key should be used. This means that private external storage is effectively as secure as the internal storage of the device. That is, if the internal storage is encrypted, then our external storage key is also encrypted. When partitioning disks, we now support a "private" mode which has a PrivateVolume partition, and a currently unused 16MB metadata partition reserved for future use. It also supports a "mixed" mode which creates both a PublicVolume and PrivateVolume on the same disk. Mixed mode is currently experimental. For now, just add ext4 support to PrivateVolume; we'll look at f2fs in a future change. Add VolumeBase lifecycle for setting up crypto mappings, and extract blkid logic into shared method. Sprinkle some more "static" around the cryptfs code to improve invariants. Bug: 19993667 Change-Id: Ibd1df6250735b706959a1eb9d9f7219ea85912a0
-
- 31 Mar, 2015 2 commits
-
-
Jeff Sharkey authored
Change-Id: I4e30ecff3c29d0f8351c6f43de1c979c8c792fab
-
Jeff Sharkey authored
Wire up new Disk and VolumeBase objects and events to start replacing older DirectVolume code. Use filesystem UUID as visible PublicVolume name to be more deterministic. When starting, create DiskSource instances based on fstab, and watch for kernel devices to appear. Turn matching devices into Disk objects, scan for partitions, and create any relevant VolumeBase objects. Broadcast all of these events towards userspace so the framework can decide what to mount. Keep track of the primary VolumeBase, and update the new per-user /storage/self/primary symlink for all started users. Provide a reset command that framework uses to start from a known state when runtime is restarted. When vold is unexpectedly killed, try recovering by unmounting everything under /mnt and /storage before moving forward. Remove UMS sharing support for now, since no current devices support it; MTP is the recommended solution going forward because it offers better multi-user support. Switch killProcessesWithOpenFiles() to directly take signal. Fix one SOCK_CLOEXEC bug, but SELinux says there are more lurking. Bug: 19993667 Change-Id: I2dad1303aa4667ec14c52f774e2a28b3c1c1ff6d
-
- 16 Mar, 2015 1 commit
-
-
Dan Albert authored
Change-Id: I23b1281a63031a7481ea7b33c9ddbdbe7d3d6174
-
- 13 Mar, 2015 1 commit
-
-
Jeff Sharkey authored
This is the first in a series of changes that are designed to introduce better support for dynamic block devices. It starts by defining a new Volume object which represents a storage endpoint that knows how to mount, unmount, and format itself. This could be a filesystem directly on a partition, or it could be an emulated FUSE filesystem, an ASEC, or an OBB. These new volumes can be "stacked" so that unmounting a volume will also unmount any volumes stacked above it. Volumes that provide shared storage can also be asked to present themselves (through bind mounts) into user-specific mount areas. This change also adds a Disk class which is created based on block kernel netlink events. Instead of waiting for partition events from the kernel, it uses gptfdisk to read partition details and creates the relevant Volume objects. Change-Id: I0e8bc1f8f9dcb24405f5e795c0658998e22ae2f7
-