Commit graph

583 commits

Author SHA1 Message Date
Daniel Rosenberg
e068a491c2 Fat.cpp: Tuned FAT parameters according to SD Association recommendations.
Updated cluster size to be 32k, and aligned the starting cluster of the root
directory to be cluster aligned.

Change-Id: I759997569f7a0263a076cc462b235a6cf54e0c5f
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2014-07-15 17:07:55 -07:00
Elliott Hughes
231bdba012 Fix an accidental PRId64 to PRIx64.
Change-Id: Ic5313289d826bac74c3466b33f1f167a8f0955ad
2014-06-25 18:36:19 -07:00
Elliott Hughes
cb33f5741c resolved conflicts for merge of afa60cee to master
Change-Id: I1568def8839bed4d4d2dadbd97194d5603edc627
2014-06-25 18:31:47 -07:00
Elliott Hughes
afa60cee41 am c0c28675: Merge "Fix vold %lld to PRId64."
* commit 'c0c2867518eed4539444434c95fad8185a6ac08e':
  Fix vold %lld to PRId64.
2014-06-26 00:37:45 +00:00
Elliott Hughes
c0c2867518 Merge "Fix vold %lld to PRId64." 2014-06-25 17:34:34 +00:00
Elliott Hughes
7373716c6d Fix vold %lld to PRId64.
Change-Id: I6eb9f21fff124b8b22f4fae2ac74c2b41d93b384
2014-06-25 17:27:42 -07:00
JP Abgrall
62c7af38f2 cryptfs: makefs F2FS if the partition type is F2FS.
When a crypto is enabled with a wipe flag (obsolete?),
it will correctly handle the fstab's choice for the fs type.

Remove the dead code for FAT_FS which was un-invocable.

Change-Id: I8d141a0d4d14df9fe84d3b131484e9696fcd8870
Signed-off-by: JP Abgrall <jpa@google.com>
2014-06-16 13:01:23 -07:00
Daniel Rosenberg
e9196fecbb Increase asec image size for reflecting ext4 reserved clusters
From Shawn Heo's patch:

Ext4 introduced reserved clusters to prevent costly zeroout, or
unexpected ENOSPC. The size is 2% or 4096 clusters, whichever
is smaller (http://lwn.net/Articles/546473/).

So, we need to allocate additionally this amount of free space
to asecs when vold create asec images. This is required when
Android runs on Linux kernel 3.10 or later.

see: https://android-review.git.corp.google.com/#/c/96160

Change-Id: Iacff16b8cf0314493c355fa741bcfa519f744d6c
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2014-06-11 00:50:53 +00:00
Daniel Rosenberg
fcd34a0ddd Added support for ext4 ASEC resizing.
ASECs formatted as ext4 can now be resized using vdc asec resize.
Refactored some common code.
Requires resize2fs.

Change-Id: Ie78bb6015114a7bc4af42b16d1f299322ffc1e2a
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2014-06-10 22:15:33 +00:00
Paul Lawrence
73d7a02dc6 On low power turn off rather than rebooting to allow device to charge
The code was using encrypted_upto == 0 as an indicator that encryption
has succeeded. This meant that if no encryption happened, we would reboot
continually.

We now set encrypted_upto to fs_size when encryption is complete.

Also don't start to encrypt unless we are at 10% power. Stop when we
get to 5% power. This should lead to partial encryptions only very
rarely.

Bug: 15513202
Change-Id: I6214d78579d1fbbe2f63ee8862473d86a89d29b3
2014-06-09 15:15:32 -07:00
The Android Automerger
cba4ab2aeb am df293f14: merge in master-release history after reset to b31f33b5e4
* commit 'df293f14f5bdb4f572c7f836ebb0802a177836ff':
  Fix encryption on Nakasi
2014-06-06 15:42:06 +00:00
Dan Albert
9c7a5826ec am ea256025: am 45faade2: Merge "Replaces uses of index() with strchr()."
* commit 'ea256025669f4a5dd8c59e4c70ec7154a198be48':
  Replaces uses of index() with strchr().
2014-06-05 20:33:07 +00:00
Dan Albert
ea25602566 am 45faade2: Merge "Replaces uses of index() with strchr()."
* commit '45faade28ae9e245e7c611c26990254aba006d2a':
  Replaces uses of index() with strchr().
2014-06-05 20:29:33 +00:00
Dan Albert
45faade28a Merge "Replaces uses of index() with strchr()." 2014-06-05 19:56:04 +00:00
Paul Lawrence
a96d9c9b38 Calculate time to go while encrypting
@bug 15159008

Change-Id: I6a96eeab180dceb0613202ba5d252036a0d5376f
2014-06-05 19:44:57 +00:00
Paul Lawrence
58c58cf7ef Show correct percentage when encrypting used blocks only
Bug: 12975202
Change-Id: I7e4adfa2c4951055bbb2c11986a7784f465f586f
2014-06-05 19:44:07 +00:00
Dan Albert
dd58c430b3 Replaces uses of index() with strchr().
Bionic is removing index() because it was removed from POSIX 2008.

Change-Id: I704fb8962ff2c08b8f12245d2db2118d410826b0
2014-06-05 11:44:40 -07:00
Daniel Rosenberg
6a74dcaa6e Fixed bugs with ASEC filesystem.
Changed ext4 to be 4kb aligned, and fat to be 32kb aligned.
Fixed issue that could potentially cause unencrypted ext4
ASECS to overwrite the ASEC super block when filled.

Change-Id: I890426c82ac9cbc65add85a8e3f5063504193c31
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2014-05-28 23:23:47 +00:00
JP Abgrall
12e36398b5 am 099b20f3: am 1881395b: am c6752b06: Merge "vold: wildcard support for device path matching"
* commit '099b20f3ce42a49ba49a1a70a818047ea59612ad':
  vold: wildcard support for device path matching
2014-05-27 19:28:07 +00:00
JP Abgrall
099b20f3ce am 1881395b: am c6752b06: Merge "vold: wildcard support for device path matching"
* commit '1881395b696017dfb40a01e718cc8dc2ea7a38e9':
  vold: wildcard support for device path matching
2014-05-27 19:24:03 +00:00
JP Abgrall
1881395b69 am c6752b06: Merge "vold: wildcard support for device path matching"
* commit 'c6752b06987207bd69b12ad1feadd358e296d52e':
  vold: wildcard support for device path matching
2014-05-27 19:21:48 +00:00
JP Abgrall
c6752b0698 Merge "vold: wildcard support for device path matching" 2014-05-27 19:19:32 +00:00
The Android Automerger
df293f14f5 merge in master-release history after reset to b31f33b5e4 2014-05-22 07:22:42 -07:00
The Android Automerger
be320c8db9 merge in master-release history after reset to b31f33b5e4 2014-05-22 05:51:14 -07:00
The Android Automerger
da0b1a9f63 merge in master-release history after reset to b31f33b5e4 2014-05-21 05:51:09 -07:00
The Android Automerger
88c25e48da merge in master-release history after reset to b31f33b5e4 2014-05-20 05:51:25 -07:00
The Android Automerger
dee8b2372f merge in master-release history after reset to b31f33b5e4 2014-05-19 05:50:25 -07:00
The Android Automerger
6b6bc5f2e8 merge in master-release history after reset to b31f33b5e4 2014-05-18 05:50:13 -07:00
The Android Automerger
5b1d492d26 merge in master-release history after reset to b31f33b5e4 2014-05-17 05:51:52 -07:00
Cylen Yao
b31f33b5e4 Support non-sequential partition index
Add support for the storage with non-sequential partition index
Ex: if using  extended partition, the index of the partition will be greater than 5

[toddpoynor@google.com: fixup mPendingPartCount data type]
Change-Id: I5dbc870fbaac24045f5b994fcb899d5df73c6a55
2014-05-16 13:15:27 -07:00
Todd Poynor
89ec37fcdd Updates for BatteryProperty 64-bit property values
Change-Id: I4838d384e14a7c2c0b607c0bd693e9c7bef75fb7
2014-05-16 03:06:10 +00:00
The Android Automerger
92bd5a7fd1 merge in master-release history after reset to 8c00839714 2014-05-15 05:51:29 -07:00
Cylen Yao
27cfee3fa4 avoid fs_mkdirs when SD card removed
Must limit vold calls to fs_mkdirs() only when the volume is mounted.
If NOT, it will trigger selinux warning as follows.
audit(1398835637.785:8): avc:  denied  { write } for  pid=137 comm="vold" name="sdcard0" dev="rootfs" ino=3191 scontext=u:r:vold:s0 tcontext=u:object_r:rootfs:s0 tclass=dir

Change-Id: I1113fc961cbdd8bbd2fcbf740c2f504628c8399d
Signed-off-by: Cylen Yao <cylen.yao@mediatek.com>
2014-05-14 20:42:13 -07:00
The Android Automerger
c53713bc5d merge in master-release history after reset to 8c00839714 2014-05-14 05:51:48 -07:00
The Android Automerger
e630fcdf93 merge in master-release history after reset to 8c00839714 2014-05-13 05:51:16 -07:00
The Android Automerger
e619817e83 merge in master-release history after reset to 8c00839714 2014-05-12 05:50:20 -07:00
The Android Automerger
ddf384dae6 merge in master-release history after reset to 8c00839714 2014-05-11 05:50:08 -07:00
The Android Automerger
d80416001c merge in master-release history after reset to 8c00839714 2014-05-10 05:51:27 -07:00
The Android Automerger
a62481c8c7 merge in master-release history after reset to 8c00839714 2014-05-08 05:51:02 -07:00
Paul Lawrence
a8014507b0 Fix encryption on Nakasi
We need to make sure we don't try to read the flags on keymaster
version 2 or below, or we get random junk.

Requires
  https://googleplex-android-review.git.corp.google.com/#/c/460689/

Bug: 14384714
Change-Id: I5a4ede1bec0347b8319cedaae6535201c122cf48
2014-05-07 11:47:02 -07:00
Paul Lawrence
8c00839714 Fix encryption on Nakasi
We need to make sure we don't try to read the flags on keymaster
version 2 or below, or we get random junk.

Requires
  https://googleplex-android-review.git.corp.google.com/#/c/460689/

Bug: 14384714
Change-Id: I5a4ede1bec0347b8319cedaae6535201c122cf48
2014-05-06 22:16:16 +00:00
Octavian Purdila
46c301c03e vold: wildcard support for device path matching
Switching the kernel to the new sysfs layout (unselecting
CONFIG_SYSFS_DEPRECATED) complicates VolD block device recognition.

The uevents are reporting full specific paths, such as:

/devices/pci0000:0e/0000:0e:18.0/mmc_host/mmc0/mmc0:1234/block/mmcblk0

Because the full device path may contain variable IDs (in this MMC
case "1234") using full path entries in fstab does not work. Android
supports partial matches but only as a prefix at the beginning of the
path.

This patch adds support for matching shell wildcard patterns via
fnmatch(). The prefix matching rule is preserved, but if it is
detected a warning is issued.

Change-Id: Ia0c5eddec06bd71bec6ce838be3b5345278e0bab
Author:    Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Radu Moisan <radu.moisan@intel.com>
Signed-off-by: Jim Bride <jim.bride@intel.com>
Reviewed-by: Bergeron, Michael <michael.bergeron@intel.com>
Tested-by: Uyyala, Sridhar <sridhar.uyyala@intel.com>
Reviewed-by: Leung, Daniel <daniel.leung@intel.com>
Reviewed-by: Uyyala, Sridhar <sridhar.uyyala@intel.com>
2014-05-05 18:23:27 +03:00
JP Abgrall
8ee0410a4d am 2d3c0c05: am a821d50b: am 470f0b3f: Merge "Avoid segv by checking argc in "storage user <mountpoint>""
* commit '2d3c0c05e9cce7bad6afd3ceacca85b297367894':
2014-04-30 12:50:51 +00:00
Nick Kralevich
2c4963a816 am a7a612bf: am 15c3e01e: am 3c0d02aa: Merge "Convert all selinux_android_restorecon and _setfilecon calls to new API."
* commit 'a7a612bf9b302962908f709ccc27a781356ac73b':
2014-04-30 12:50:50 +00:00
Mark Salyzyn
86abdc4c8c am 598fdf7a: am 3d9b98cc: am 1dc1fb4a: Merge "vold: suppress unused argument warning messages"
* commit '598fdf7abe087a3f45b5ab0c932ad339b2e5bb4a':
2014-04-30 12:50:50 +00:00
Nick Kralevich
90665929ac am e8a19bdb: am 9aace96c: am 311edc8c: Merge "Add SELinux restorecon calls on ASEC containers."
* commit 'e8a19bdba03cdb323732fc9d4178456a87ee11d5':
2014-04-30 12:50:49 +00:00
Colin Cross
8e0f2a5a0a am 02cb9f5e: am 4c20805a: am 1d8e3ce8: Merge "vold: fix errors inside ALOGV"
* commit '02cb9f5ea3c1177f89e7403bc253164e4a65cbfe':
2014-04-30 12:50:49 +00:00
JP Abgrall
2d3c0c05e9 am a821d50b: am 470f0b3f: Merge "Avoid segv by checking argc in "storage user <mountpoint>""
* commit 'a821d50bd43809414521590ebe65601b823f8095':
2014-04-30 01:00:10 +00:00
Nick Kralevich
a7a612bf9b am 15c3e01e: am 3c0d02aa: Merge "Convert all selinux_android_restorecon and _setfilecon calls to new API."
* commit '15c3e01e05359fb11ce5e63934d7c3d54d0d6e93':
2014-04-30 01:00:10 +00:00
Mark Salyzyn
598fdf7abe am 3d9b98cc: am 1dc1fb4a: Merge "vold: suppress unused argument warning messages"
* commit '3d9b98cc833dc7c07da6bb0cc27926c68b63c276':
2014-04-30 01:00:09 +00:00