Commit graph

576 commits

Author SHA1 Message Date
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
Nick Kralevich
e8a19bdba0 am 9aace96c: am 311edc8c: Merge "Add SELinux restorecon calls on ASEC containers."
* commit '9aace96cd0f4606d48d7d9052fb134f80a5c961c':
2014-04-30 01:00:09 +00:00
Colin Cross
02cb9f5ea3 am 4c20805a: am 1d8e3ce8: Merge "vold: fix errors inside ALOGV"
* commit '4c20805a33ff194454e5cce3de44943a245e5a44':
2014-04-30 01:00:08 +00:00
Paul Lawrence
bf85d892e9 Merge "Add keymaster support to cryptfs" 2014-04-18 20:26:11 +00:00
Paul Lawrence
69f4ebd81e Add keymaster support to cryptfs
Use keymaster to wrap the cryptfs keys.

Requires selinux change
  https://googleplex-android-review.git.corp.google.com/#/c/449411

Bug: 9467042
Change-Id: If25a01cb85ed193a271d61382de0560d85553b7e
2014-04-18 11:40:13 -07:00
Mohamad Ayyash
e8feb83976 Merge "vdc: fix segfault" 2014-04-16 17:54:35 +00:00
Mohamad Ayyash
5e900ac898 vdc: fix segfault
Change-Id: I1a35fe15b311d3f5203c5bc02d3db87e942cf554
2014-04-15 18:08:05 -07:00
Paul Lawrence
45f10533f8 Revert "Revert "Encrypt phone even if pattern or no keyguard""
Don't block based on keyguard type, and pass type to encryption function.

Requires:
  https://googleplex-android-review.git.corp.google.com/#/c/444201/
or encryption will no longer work.

This reverts commit efec3f2927.

Change-Id: I431589a56eb11118027e0a5a84f55e973b1084aa
2014-04-10 14:30:31 +00:00