Commit Graph

359 Commits

Author SHA1 Message Date
Elliott Hughes 96eec68729 Merge "Remove fs_mgr's bogus external/openssl/include LOCAL_C_INCLUDES entry." am: c160675a93 am: ed67c75206 am: 1b4ef805b1
am: 5c25f72e24

Change-Id: I03171bd29805c5073a2bf46135db0b5d1841e490
2017-01-16 18:50:43 +00:00
Elliott Hughes ebeaa67c0c Remove fs_mgr's bogus external/openssl/include LOCAL_C_INCLUDES entry.
Bug: N/A
Test: builds
Change-Id: Icaf095f0c25fae5c1175dbb630bc05c63af72d75
2017-01-15 11:52:35 -08:00
bowgotsai fad8160c34 Merge "fs_mgr: use std::string for function parameters in fs_mgr_dm_ioctl.cpp" am: 8c301d22e4 am: 538cef7b48 am: e7914cbf59
am: 3c79b63ff4

Change-Id: I6c61c76706bcf8b454faa1822f788bb8b5886b55
2017-01-13 18:23:58 +00:00
bowgotsai 47aa2a7520 fs_mgr: use std::string for function parameters in fs_mgr_dm_ioctl.cpp
Make the code more C++-ish by replacing char* or char** with
std::string&.

Bug: 31264231
Test: check device can boot with dm-verity
Change-Id: Ie3ca3f449b52959d1a7b2887d722eb5ce366c4f9
2017-01-13 17:39:04 +08:00
bowgotsai 9ce6950262 Merge "fs_mgr: moves common functions out of fs_mgr_verity.cpp" am: a37ff0dd83 am: ca11618b25 am: bfe74a7ac3
am: e40e90c24d

Change-Id: I0e491ec1f826961c0cebb446ee57be0a9957aadd
2017-01-13 06:36:02 +00:00
bowgotsai 3de625d109 fs_mgr: moves common functions out of fs_mgr_verity.cpp
This commits moves some common functions out of fs_mgr_verity.cpp to be
reused by other verified boot flows. It includes:
 - Move common functions into fs_mgr.c
 - Move dm_ioctl related functions to a new file: fs_mgr_dm_ioctl.cpp

Bug: 31264231
Test: check device can boot with dm-verity

Change-Id: Iaa0d8031efbaae12aa28f872f62d3fc3d3763b51
2017-01-13 10:52:44 +08:00
Alex Deymo 4786e4e24f Remove "_host" and "_static" suffix from libsparse definition. am: b0c395955d am: 7b8d66e7cc am: 11b65cf3be
am: 092a732ef2

Change-Id: I3d9639af9f9f66742660edbbf62f73909c0d6915
2017-01-12 22:45:52 +00:00
Alex Deymo 0638e0e65b Remove "_static" and "_host" suffix from libext4_utils. am: 705353ae27 am: c8f55cc5ca am: 8e3e4effaa
am: 31caef4170

Change-Id: Iaa09dc2c5693cbf889a60382df8051b5e5e74047
2017-01-12 22:45:45 +00:00
Alex Deymo 7b8d66e7cc Remove "_host" and "_static" suffix from libsparse definition.
am: b0c395955d

Change-Id: I8ac6f410a42046c18c29fae9a49479dfbd9bb50c
2017-01-12 21:27:53 +00:00
Alex Deymo c8f55cc5ca Remove "_static" and "_host" suffix from libext4_utils.
am: 705353ae27

Change-Id: I88ab21cc4412d89b831c0d601dbc98fcbcbe4ef4
2017-01-12 21:27:48 +00:00
Alex Deymo 7e0b322978 Merge changes from topic 'host_suffix_cleanup'
* changes:
  Remove "_host" and "_static" suffix from libsparse definition.
  Remove "_static" and "_host" suffix from libext4_utils.
2017-01-12 21:23:11 +00:00
Alex Deymo b0c395955d Remove "_host" and "_static" suffix from libsparse definition.
This now combines all the "libsparse" libraries into the same soong
target. A minor side-effect of this change is that the libsparse
static library depends on the libz shared library instead of the libz
static library. This minor change has no effect since targets using
the static libsparse library need to explicitly include either the
static libz or the shared one.

Bug: 34220783
Change-Id: I8f41586cf4c3336791cfa57ab4f5ae59a76d7ffa
2017-01-11 19:15:11 -08:00
Alex Deymo 705353ae27 Remove "_static" and "_host" suffix from libext4_utils.
Bug: 34220783
Change-Id: I967dbaa9c48ad1feed2369c3a40f745b86a350f8
2017-01-11 14:05:42 -08:00
Prashant Malani 17f248d2e4 fs_mgr: Fix disable-verity for verifyatboot partitions
This allows a remount to be performed on partitions which have been
verified at boot, without causing the verity service to complain of
"corrupted" blocks that could have been modified as a result of a
remount (while the verity checksum remained unchanged).

(cherry picked from commit dd78ae75ff)

Bug: 32638755
Test: Compile
Change-Id: I77cf7dd20ee5c5f5dac80f73f292e32583fe5906
2017-01-11 22:05:16 +08:00
Prashant Malani 2cdc67eed5 fs_mgr: Add support for at-boot verification
Running dm-verity on heavily accessed partitions leads to performance
slowdowns, especially on low-RAM and slow-CPU devices.

This patch introduces a flag to allow an entire verified partition to be
read once at boot, to check for corruptions. If the reads are
successful, we can mount the partition as raw & read-only, and if not,
we can revert to mounting it as a verity partition, just like before.

Usage of this flag will entail a slowdown of time-to-boot, but should
lead to improvements in runtime performance.

(cherry picked from commit 34543c03e6)

Bug: 32433608
Test: Compile
Change-Id: I97717683a00ad6fa347e63b72b1a9bf1d2946315
2017-01-11 22:00:25 +08:00
Keun-young Park 279be6fd51 Merge "e2fsck: drop -f when TARGET_USES_MKE2FS is enabled" am: f3780f3cc8 am: 3dccdc5ec5 am: ef847af8bf
am: 300f488037

Change-Id: I50206232e1ea0b9e15e8638ccacf662d37b4e64b
2017-01-10 20:11:59 +00:00
Keun-young Park ef847af8bf Merge "e2fsck: drop -f when TARGET_USES_MKE2FS is enabled" am: f3780f3cc8
am: 3dccdc5ec5

Change-Id: I514a3d79707cf2a795beec3f12b66911981410d0
2017-01-10 20:01:27 +00:00
Keun-young Park 22e8199175 e2fsck: drop -f when TARGET_USES_MKE2FS is enabled
- Drop forced (-f) e2fsck check when the product has
  enabled new ext4 generation by setting TARGET_USES_MKE2FS.
- The new generation tool is supposed to give better stability,
  thus justifying dropping -f.
- This should help reducing boot-up time as full check (-f) can
  increase boot-up time significantly depending on amount of data.

bug: 32246772
Test: many reboots
Change-Id: I631525bf7504bbfb025e170c8d24ad9d3ef3532e
2017-01-10 10:17:57 -08:00
Hung-ying Tyan e54025ae28 Merge "fs_mgr: add verify_dev flag to fs_mgr_setup_verity()" am: abc26ed753 am: 7da0c3db16 am: 70bcce4deb
am: 82f542f5a1

Change-Id: I427f830f6021a0abde66e9db200a9ce6ba8ddcea
2017-01-10 04:22:35 +00:00
Hung-ying Tyan 70bcce4deb Merge "fs_mgr: add verify_dev flag to fs_mgr_setup_verity()" am: abc26ed753
am: 7da0c3db16

Change-Id: I0f513c6e794cf5973a1e376bd10d834760ccb708
2017-01-10 04:12:04 +00:00
Treehugger Robot abc26ed753 Merge "fs_mgr: add verify_dev flag to fs_mgr_setup_verity()" 2017-01-10 04:00:19 +00:00
forfun 94c0d782d8 Merge "modify a minor error in mount_with_alternatives Test: when called with end_idx = null" am: 3080ce2fe4 am: d3435f5d31 am: 4d592aba52
am: 7bda65010f

Change-Id: I67f296774e14e1e08a3cfbf3370112dc0f957b0c
2016-12-20 02:25:07 +00:00
forfun 4d592aba52 Merge "modify a minor error in mount_with_alternatives Test: when called with end_idx = null" am: 3080ce2fe4
am: d3435f5d31

Change-Id: If9cd28111e7c8dc2635b27d7bd28fe608eeb78fa
2016-12-20 02:17:06 +00:00
forfun c5c0306424 modify a minor error in mount_with_alternatives
Test: when called with end_idx = null

Change-Id: I7e5d298f496847acb4aefbaad66cd98e907467bc
Signed-off-by: forfun <forfun414@gmail.com>
2016-12-16 07:02:57 +00:00
Hung-ying Tyan ecfce13ce2 fs_mgr: add verify_dev flag to fs_mgr_setup_verity()
Bug: 33682519
Test: Tested on bullhead with https://android-review.googlesource.com/#/c/315463.
Change-Id: Ie12230c6f77a2834c179e44b59817292d58726f7
2016-12-16 15:00:05 +08:00
Jeff Sharkey 38266e5956 Merge commit '04c9a4da7e261b797c726cf31bf0ea232a8f685d' into foobar3 am: 4898fd9f4f
am: 3ca10e64ac

Change-Id: I9c51e8a28ce3297fa1f978790d2696a92b08049f
2016-12-16 05:45:38 +00:00
Jeff Sharkey 4898fd9f4f Merge commit '04c9a4da7e261b797c726cf31bf0ea232a8f685d' into foobar3
Change-Id: Ia462030220115d6a602c2fcbcbccea162ca335bb
2016-12-15 22:27:41 -07:00
Jeff Sharkey 6d89610d1a Add fs_mgr option to enable/disable quotas.
To support upcoming disk usage calculation optimizations, this change
adds a new 'quota' mount flag.  As part of mounting an ext4 device,
we now enable/disable the quota feature using tune2fs to match the
requested value in the fstab.

When changing the quota status, we force a fsck pass on the device
before actually mounting it to prime the quota data structures which
are stored in hidden inodes.

Changing quota state and priming the data structures needs to happen
before we actually mount the device, so fs_mgr is the best place to
place this logic.

Test: builds, boots, enables and disables quota
Bug: 27948817
Change-Id: I7ccbf97cbc4a679bdd7a31a77be4b99aa9a88e66
2016-12-15 16:35:50 -07:00
liminghao 9a0fd1d5d3 fs_mgr: support to reserved some blocks for an ext2/3/4 partition.
These reserved blocks used to root or claim to CAP_SYS_RESOURCES process.

Change-Id: I4893bdb08399bf31a7640d4a63f4952cd636576f
Merged-In: I4893bdb08399bf31a7640d4a63f4952cd636576f

Signed-off-by: liminghao <liminghao@xiaomi.com>
2016-12-15 16:26:53 -07:00
Tom Cherry adedc7f5f7 fs_mgr: fix header ordering am: e35e4e4e39
am: 67b9a04352

Change-Id: Id247deeb6e025f19621e5ce5d59614893f19d4b8
2016-12-01 03:16:47 +00:00
Tom Cherry e35e4e4e39 fs_mgr: fix header ordering
A merge conflict resolution un-alphabetized the order of these
headers; this commit puts them back in order.

Change-Id: I13c26fbb8f88fe2ce0b332721235b3e4eba7deaf
2016-11-30 17:22:55 -08:00
Prashant Malani cfbf6d71a9 fs_mgr: Fix disable-verity for verifyatboot partitions
am: dd78ae75ff

Change-Id: I40ef02da9a34a44b8d8b42bf8d0197653019c06a
2016-11-30 03:23:57 +00:00
Tom Cherry 524afcec4a resolve merge conflicts of 34543c0 to nyc-mr1-dev-plus-aosp
Change-Id: I20f24693f201f1a15ded1fd6dfb6d56a58ebcaa8
2016-11-29 17:17:26 -08:00
liminghao 7ac1234b08 fs_mgr: support to reserved some blocks for an ext2/3/4 partition.
These reserved blocks used to root or claim to CAP_SYS_RESOURCES process.

Change-Id: I4893bdb08399bf31a7640d4a63f4952cd636576f
Merged-In: I4893bdb08399bf31a7640d4a63f4952cd636576f

Signed-off-by: liminghao <liminghao@xiaomi.com>
2016-11-23 14:58:13 -08:00
Jin Qian 960584eeb0 Merge "fs_mgr: change MF_MAX_COMP_STREAMS define to match internal master"
am: 72662414f6

Change-Id: I2d761ee4db65f6c5c98f3cea2f58588e4bc66ec5
2016-11-22 18:47:38 +00:00
liminghao eae23801cc fs_mgr: support to reserved some blocks for an ext2/3/4 partition.
These reserved blocks used to root or claim to CAP_SYS_RESOURCES process.

Change-Id: I4893bdb08399bf31a7640d4a63f4952cd636576f
Signed-off-by: liminghao <liminghao@xiaomi.com>
2016-11-18 18:10:31 -08:00
Jin Qian 0067e03251 fs_mgr: change MF_MAX_COMP_STREAMS define to match internal master
Change-Id: I53a8c6158b4dd1bf5e14ef0a842b7f43ca8bae31
2016-11-18 16:38:40 -08:00
Peter Enderborg 3c4dfb6fc4 Merge "Add support for max_comp_streams option for zram"
am: a9ea1e4d99

Change-Id: I0ef7127e1352b7dc9ae226bee7fe340d864f97ab
2016-11-18 23:25:21 +00:00
Peter Enderborg 4d217f02d3 Add support for max_comp_streams option for zram
With this option the fstab can include a parameter for zram
the enables more streams for kernels that does not have
dynamic stream task handling.

Test: Made sure max_comp_streams is set according to fstab.
Change-Id: I22e158a075a8a86b4e80d3b13989896929c0d223
2016-11-18 21:19:25 +00:00
Peter Enderborg b43760c042 Add support for max_comp_streams option for zram
With this option the fstab can include a parameter for zram
the enables more streams for kernels that does not have
dynamic stream task handling.

Test: Made sure max_comp_streams is set according to fstab.
Change-Id: I22e158a075a8a86b4e80d3b13989896929c0d223
2016-11-17 14:59:48 -08:00
Prashant Malani 5995cdc751 fs_mgr: Fix disable-verity for verifyatboot partitions am: dd78ae75ff am: afa252cc40
am: 019eab30ac

Change-Id: I7d560cd83601053386eaf233bf7308d23f3b1945
2016-11-16 21:22:54 +00:00
Prashant Malani 019eab30ac fs_mgr: Fix disable-verity for verifyatboot partitions am: dd78ae75ff
am: afa252cc40

Change-Id: I464a044ba086aa26d3f5afd799c3c76043f833cb
2016-11-16 21:15:08 +00:00
Prashant Malani dd78ae75ff fs_mgr: Fix disable-verity for verifyatboot partitions
This allows a remount to be performed on partitions which have been
verified at boot, without causing the verity service to complain of
"corrupted" blocks that could have been modified as a result of a
remount (while the verity checksum remained unchanged).

Bug: 32638755
Change-Id: I77cf7dd20ee5c5f5dac80f73f292e32583fe5906
2016-11-15 13:03:11 -08:00
Jin Qian 905948ed74 fs_mgr: fix clang static analyzer warning
Pointer from strdup is lost hence triggers mem leak warning from
clang, since ptr returned from basename may not point to start of
duplicated string any more.

Switch to use gnu version of basename which doesn't modify input
string so that strdup is no longer necessary.

Bug: 27126348

Change-Id: Iadb5cf343437a1e27e588ee067b084897633ea07
Merged-In: I937a68c01c223230932c932bffdd35da6503c3c4
2016-11-08 20:07:31 +00:00
Jin Qian 6352c2e7fe fs_mgr: fix clang static analyzer warning
Pointer from strdup is lost hence triggers mem leak warning from
clang, since ptr returned from basename may not point to start of
duplicated string any more.

Switch to use gnu version of basename which doesn't modify input
string so that strdup is no longer necessary.

Bug: 27126348

Change-Id: I937a68c01c223230932c932bffdd35da6503c3c4
2016-11-07 15:47:24 -08:00
Prashant Malani aef042cfee resolve merge conflicts of 863442b to nyc-mr2-dev-plus-aosp
Change-Id: If8787efbbf81d5e86625b2f4e771f6720c99c4c1
2016-11-01 11:34:32 -07:00
Prashant Malani 34543c03e6 fs_mgr: Add support for at-boot verification
Running dm-verity on heavily accessed partitions leads to performance
slowdowns, especially on low-RAM and slow-CPU devices.

This patch introduces a flag to allow an entire verified partition to be
read once at boot, to check for corruptions. If the reads are
successful, we can mount the partition as raw & read-only, and if not,
we can revert to mounting it as a verity partition, just like before.

Usage of this flag will entail a slowdown of time-to-boot, but should
lead to improvements in runtime performance.

Bug: 32433608
Change-Id: I97717683a00ad6fa347e63b72b1a9bf1d2946315
2016-10-27 21:17:31 -07:00
Wei Wang 496e667966 Merge "Make sure wait for the dm device"
am: d70a5feb60

Change-Id: If1e188c32548995413e49c1f7edece8d2c526bb2
2016-10-26 22:35:28 +00:00
Wei Wang dba750e0e0 Make sure wait for the dm device
Bug: 32408249
Test: on m/s
Change-Id: I65fa4fec94c82ef51d2c8d0aabf9e90b8448f27f
2016-10-26 13:40:23 -07:00
Mark Salyzyn 82ce1f1ff2 fs_mgr: use __android_log_is_debuggable()
am: e528be5e7d

Change-Id: I3dbe3e0f6e3076a24af3fd868907ad7e688517e5
2016-10-18 16:46:19 +00:00