History log of /system/vold/main.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
fd3dc3c076f30e19e7ac902ba0531c6bcfe2e042 27-Mar-2017 Jeff Sharkey <jsharkey@android.com> Spread around some O_CLOEXEC love.

Also remove some unnecessary SELinux logic when creating image files
for loop devices.

Test: builds, boots, common operations work
Bug: 34903607
Change-Id: I68dfa022ecc39f56c175e786694e0de35b954ca0
/system/vold/main.cpp
e8fb6c30006650c3b3d2bac18119a98be48f7c2b 09-Mar-2017 Bowgo Tsai <bowgotsai@google.com> vold: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()

The original default /fstab.{ro.hardware} might be moved to /vendor/etc/.
or /odm/etc/. Use the new API to get the default fstab instead of using
the hard-coded /fstab.{ro.hardware}.

Bug: 35811655
Test: boot marlin with /vendor/etc/fstab.marlin
Change-Id: I92d6aefe6ff3433b7d1a671358d990bb7b1f2150
/system/vold/main.cpp
2edbe28add016d95fd91c71fb157542f0ce55979 07-Mar-2017 Wei Wang <wvw@google.com> vold: add coldboot back and make sure it won't block booting

coldboot is needed when device rebooted with USB device attched
so Vold netlink won't miss the information.
This CL added back coldboot and moved down so that it won't block
vold cl and ccl threads.

Bug: 36007238
Test: reboot marlin with flash drive attached and flash drive is recognized
Change-Id: Ie39f348e97a8500515e394e386541289a91b2425
/system/vold/main.cpp
6b455c29be7a0e130d953d5afd79201ff987e294 20-Jan-2017 Wei Wang <wvw@google.com> Remove coldboot from vold

coldboot is now taken care by ueventd, so removing the duplicate
logic to save boottime.
This CL also fixes a missing lock.


Bug: 33786699
Test: manual
Change-Id: I71270252f3153abc815d142b5da7a9cb85b94dac
/system/vold/main.cpp
c976e73bbdfd512482d0ea0c5e10afd53ba85e1e 19-Jan-2017 Dimitry Ivanov <dimitry@google.com> Fix deadlock between vold and init

By setting property after listeners are initialized
we avoid deadlock between vold and init where
vold is waiting on property_service while init is blocked
(and therefore is not able to accept connections) on vdc
which is attempting to communicate with vold.

(This also speeds up boot by 250ms)

Test: Boot a device, check locks and make sure there is no timeout
on property_set(.)
Test: Successfully boot a device with new property service protocol.
Bug: http://b/34278978
Change-Id: I9547d2f19cb35aa452bf01fbff0eb4b32a4824a4
/system/vold/main.cpp
38132a1f667412d6b08ae90cc64a011d76906cc0 09-Feb-2016 Paul Crowley <paulcrowley@google.com> Refactor now that global DE has been reworked

Change-Id: I4d6156332cfc847e25e7c8863fd6a50fa325fb87
/system/vold/main.cpp
285956fe11de221f850e5bf63b071bd8f53bfd10 20-Jan-2016 Paul Crowley <paulcrowley@google.com> Rework FBE crypto to match the N way of doing things

Major rework and refactor of FBE code to load the keys at the right
time and in a natural way. The old code was aimed at our goals for M,
with patches on top, and didn't quite work.

Bug: 22358539

Change-Id: I9bf7a0a86ee3f2abf0edbd5966f93efac2474c2c
/system/vold/main.cpp
9ad4369ce87cb445ea126a8a803e2b42c2c5ea2f 11-Dec-2015 Lenka Trochtova <ltrochtova@google.com> Fix a bug in passing parameters to prepare_user_storage.

Add the serial parameter to prepare_user_storage to avoid
confusion when parsing parameters and passing them around.

Change-Id: Id5516c248401ad50585aa8f6e8b1545a6cded549
/system/vold/main.cpp
395039f0070abed5f6b3617786956ee3e62fe9b5 25-Nov-2015 Lenka Trochtova <ltrochtova@google.com> Introduce support for ephemeral users.

BUG: 24883058

Change-Id: I77d4757f87214166e7c41c7eb0d06b1cd5f06b20
/system/vold/main.cpp
6bf0547ccce72233bd465178b919fa7f15e48b45 05-Dec-2015 Elliott Hughes <enh@google.com> resolve merge conflicts of b7d5a47cec to master.

Change-Id: I0c5211a00d92d0ee796bb9c77d2e13675a2a3e8d
7e128fbe212c64492afa98bfd6d7fab6f1956831 05-Dec-2015 Elliott Hughes <enh@google.com> Track rename from base/ to android-base/.

Change-Id: I3096cfa50afa395d8e9a8043ab69c1e390f86ccb
/system/vold/main.cpp
c79fb89a10ea9bc3b0f1f9c7caa809a705989479 13-Nov-2015 Jeff Sharkey <jsharkey@android.com> Switch to new FBE emulation property.

Also prepare CE/DE storage directories for owner user at boot.

Bug: 22358539
Change-Id: I76228952c990ebed83360c69ef36321b99114196
/system/vold/main.cpp
c86ab6f538bec63638c168d6c843fe7cf73add3b 26-Jun-2015 Jeff Sharkey <jsharkey@android.com> Trim both internal and adopted private storage.

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
/system/vold/main.cpp
d0640f6358041f7e2657167560b357078db73526 22-May-2015 Jeff Sharkey <jsharkey@android.com> Add f2fs support for private volumes.

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
/system/vold/main.cpp
d0b4295ccc07d0cd715ade415c8c0d7d6945880e 03-Jun-2015 Paul Lawrence <paullawrence@google.com> Move crypt commands to a different listener in vold

In order to prevent this bug from happening, we must allow vold cryptfs
commands to complete while a long running mount is underway.

While waiting for vold to be changed to a binder interface, we will simply
create two listeners, one for cryptfs and one for everything else.

Bug: 19197175
Change-Id: If74142aa81abd58f718a9de6c9e387f6ea442754
/system/vold/main.cpp
65427f1a805ed2b8ee65a30ecf6ea8b14fe1e02b 20-May-2015 Jeff Sharkey <jsharkey@android.com> Offer debug flag to force default primary.

Useful for transforming a secondary SD card slot into a primary SD
card slot without doing a completely different lunch target.

$ adb shell stop
$ adb shell setprop vold.debug.default_primary 1
$ adb shell setprop ro.vold.primary_physical 1
$ adb shell setprop ctl.restart vold
$ adb shell start

Bug: 21017105
Change-Id: I45aac7ab3bb4c5ac3e0140572844883823fc3e4f
/system/vold/main.cpp
e44a41a17b5c2d488442d7805b08231f4b327aca 13-May-2015 Jeff Sharkey <jsharkey@android.com> Communicate if we have adoptable disks.

Bug: 19993667
Change-Id: I3c3dddab157a11038f7160d24d53e728bde2194f
/system/vold/main.cpp
b0667870ff036c598486a8ec87ad2bbe321b2a20 29-Apr-2015 Jeff Sharkey <jsharkey@android.com> Property to enable debugging.

Bug: 19993667
Change-Id: Ie226e06edcb426caca2dbc97d2d5d60ae948c85e
/system/vold/main.cpp
c8e04c5a8285de07d2c84bfbda8eda2c14a9457d 21-Apr-2015 Jeff Sharkey <jsharkey@android.com> Wider volume mutation lock, move force adoptable.

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
/system/vold/main.cpp
5bad3780159761c3899c134ee4a56766ae685a6e 19-Apr-2015 Jeff Sharkey <jsharkey@android.com> Switch logging to system log, persistable prop.

Use system log for more durable log history. Also accept persistable
version of flag to force adoptability.

Bug: 19993667
Change-Id: Icdf36799e26038e9a8e2bdaca276d97b22ba3941
/system/vold/main.cpp
502164deaae6d4bd6d6e36cc10fa666ceae92e3c 15-Apr-2015 Jeff Sharkey <jsharkey@android.com> Fix destroy ordering bug; add debug flag.

Bug: 19993667
Change-Id: Ib15e79a94a185843dace35fea7daaea866120f87
/system/vold/main.cpp
9f18fe7807a4e4089778243dbbd08d154ec15540 02-Apr-2015 Jeff Sharkey <jsharkey@android.com> Remove unused code.

Bug: 19993667
Change-Id: I1f6519655c5a366eca25e2329e1bf95d81b3bf8c
/system/vold/main.cpp
f7e86ead9f0217283e547a6fa8e6b3405e91af1d 02-Apr-2015 Jeff Sharkey <jsharkey@android.com> Some CLOEXEC love.

Bug: 19993667
Change-Id: If8c0b346820f30c6a7dac495f935be17d677ffcc
/system/vold/main.cpp
95c87cce353ca2da79aa57a3a5336b45b6f1d018 01-Apr-2015 Jeff Sharkey <jsharkey@android.com> Different blkid and fsck execution domains.

vold works with two broad classes of block devices: untrusted devices
that come in from the wild, and trusted devices like PrivateVolume
which are encrypted.

When running blkid and fsck, we pick which SELinux execution domain
to use based on which class the device belongs to.

Bug: 19993667
Change-Id: I2695f028710a4863f0c3b2ed6da437f466401272
/system/vold/main.cpp
36801cccf27152c9eca5aab6ba3527221525110f 14-Mar-2015 Jeff Sharkey <jsharkey@android.com> Progress towards dynamic storage support.

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
/system/vold/main.cpp
684e662502a310868da052192b80604234b66711 30-Sep-2014 Stephen Smalley <sds@tycho.nsa.gov> Set SELinux contexts on device nodes created by vold.

Extend vold to look up and set SELinux contexts on the
device nodes it creates for extra loop devices and for volumes.
Prior to this change, these device nodes simply inherited the type
of their parent directory /dev/block, i.e. block_device, and vold
therefore required create_file perms to block_device:blk_file.
With this change we can scope vold down to accessing specific
block device types.

This depends on change Id3bea28f5958086716cd3db055bea309b3b5fa5a
to allow vold to use setfscreatecon().

Change-Id: Ib9e8294abb1da94d92503947603ec12e802ff08c
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/system/vold/main.cpp
ba6ae8db137d012c9b8e11f9f8321c7771698e92 16-Jul-2013 Jeff Sharkey <jsharkey@android.com> Add support for more expressive SD card permissions

We now run an sdcard fuse daemon on top of a physical SD card.
Add support for that.

Bug: 10330128

Change-Id: I6a291f861ccb0f2911c07cc8f659e2cec4e6d76c
/system/vold/main.cpp
b9738ea9692f887cf2e2fef132519f4e71cc2905 20-Mar-2013 Ken Sumrall <ksumrall@android.com> vold: set klog level so e2fsck output is logged

When mounting an encrypted filesystem vold calls fs_mgr, which
will call e2fsck on the fielsystem if it's configured to, and
fs_mgr will attempt to log the output the kernel log. However,
if won't log anything unless the klog level is set to 6, aka INFO.

Change-Id: I8ac34941330262ea3414681b872fbbeb75391461
/system/vold/main.cpp
56ad03cae13524b32898dc4ccf01040ced5a53b4 13-Feb-2013 Ken Sumrall <ksumrall@android.com> vold: use unified fstab format

Change vold to use the unified fstab. This includes both
support for sdcards, and changes to the crypto code to work
with some changes to the fs_mgr library api.

Change-Id: Id5a8aa5b699afe151db6e31aa0d76105f9c95a80
/system/vold/main.cpp
29d8da8cefa99e436c13295d4c9bad060ca18a6d 19-May-2011 Ken Sumrall <ksumrall@android.com> vold: allow to store key in a file on another partition

Add support for keeping the keys in a separate file on another partition,
for devices with no space reserved for a footer after the userdata filesystem.

Add support for encrypting the volumes managed by vold, if they meet certain
criteria, namely being marked as nonremovable and encryptable in vold.fstab.
A bit of trickiness is required to keep vold happy.

Change-Id: Idf0611f74b56c1026c45742ca82e0c26e58828fe
/system/vold/main.cpp
c1d80272b117cf837de93fadd8d456d89a203e2f 20-Nov-2010 Jean-Baptiste Queru <jbq@google.com> am 08da5c1f: Merge "vold: replace strsep by strtok_r"

* commit '08da5c1f17afefe3c9f4f4d4456c5757dede62e1':
vold: replace strsep by strtok_r
74ca25a716a060b4f676277262d112b569c5fbd2 15-Nov-2010 Jinho You <l04f3rs@gmail.com> vold: replace strsep by strtok_r

It permits more white spaces between words in vold.fstab.

Change-Id: I38250c3dcc860643e4f102e980fe844693a1451a
/system/vold/main.cpp
99635f6c289fe2528c226403ea215c917ce86037 26-Jun-2010 Mike Lockwood <lockwood@android.com> Use new kernel notifications to determine if USB mass storage is available.

The usb_mass_storage switch no longer exists in our 2.6.35 kernel.
Instead we will consider mass storage to be available if both USB is connected
and the USB mass storage function is enable.

Change-Id: I730d1b3cb3cac664fc2abcdc36cd39856a08404a
Signed-off-by: Mike Lockwood <lockwood@android.com>
/system/vold/main.cpp
97ac40e4e6f3ed0bd5d6878d7d8d4a54fcaecb76 24-Mar-2010 San Mehat <san@google.com> vold: Switch from LOG -> SLOG

Change-Id: I48ee8bd90b47f5845f069cdf4d1b8ba6ecdb1b39
Signed-off-by: San Mehat <san@google.com>
/system/vold/main.cpp
f1b07fb5e30667833d7a2a5b7e95eada881a2802 02-Mar-2010 San Mehat <san@google.com> vold: Don't bail out on init failure & bump version number

Signed-off-by: San Mehat <san@google.com>
/system/vold/main.cpp
79e31bedcaabcca55aaf40a9de61abed11c9a2e0 04-Jan-2010 San Mehat <san@google.com> vold2: Don't bail out if the UMS switch isn't there

Signed-off-by: San Mehat <san@google.com>
/system/vold/main.cpp
0cde53ce7b44ce189d0bc6fa81c0036e096deb51 22-Dec-2009 San Mehat <san@google.com> vold2: Manually bootstrap the ums switch since switch kernel uevents are broken

Signed-off-by: San Mehat <san@google.com>
/system/vold/main.cpp
a2677e4ad01f250b0765f04adf0acfa6627efc98 13-Dec-2009 San Mehat <san@google.com> vold2: Get mounting/unmounting/formatting/sharing working

Signed-off-by: San Mehat <san@google.com>
/system/vold/main.cpp
ae10b91044bf76b40b77d81c169e48e0bbdf6d75 12-Oct-2009 San Mehat <san@android.com> vold2: Rename DeviceVolume -> DirectVolume

Signed-off-by: San Mehat <san@android.com>
/system/vold/main.cpp
3578c41ef138cb3edf38bb488cb9864921f55c79 12-Oct-2009 San Mehat <san@android.com> vold2: Add block device udev bootstrapping

Signed-off-by: San Mehat <san@android.com>
/system/vold/main.cpp
f1b736bc5605e92e917ab27f5abf3ba839be2270 11-Oct-2009 San Mehat <san@android.com> system: vold2: Initial skeleton for vold2.

Let there be light.

Signed-off-by: San Mehat <san@android.com>
/system/vold/main.cpp