Commit Graph

564 Commits

Author SHA1 Message Date
Lennart Wieboldt 16f13d01f2 Merge "Remove LOCAL_CLANG and clang: true" am: 80ec81cf4b am: f7b315c985 am: 8a8b97b271 am: e1332dd01b
am: 6da3de27be

Change-Id: I70d004aa8dfdb54e20552af20168892d4caf20c4
2017-07-25 23:06:37 +00:00
Lennart Wieboldt 6da3de27be Merge "Remove LOCAL_CLANG and clang: true" am: 80ec81cf4b am: f7b315c985 am: 8a8b97b271
am: e1332dd01b

Change-Id: I193d86abf96e64b29efc7266f4fa3a26b5d2b3af
2017-07-25 22:39:58 +00:00
Lennart Wieboldt e1332dd01b Merge "Remove LOCAL_CLANG and clang: true" am: 80ec81cf4b am: f7b315c985
am: 8a8b97b271

Change-Id: I7e691abe2e2ccec5d9477c528d603c081c0a5661
2017-07-25 22:35:56 +00:00
Lennart Wieboldt f7b315c985 Merge "Remove LOCAL_CLANG and clang: true"
am: 80ec81cf4b

Change-Id: Ia7f79d8e25ee9870fe44d198568d0e5dabdff811
2017-07-25 22:28:56 +00:00
Lennart Wieboldt cd15fc7ba8 Remove LOCAL_CLANG and clang: true
clang is the default compiler since Android nougat

Test: mma & verified it´s still build with clang
Change-Id: I34adaeef2f6558a09f26027271222bad94780507
Signed-off-by: Lennart Wieboldt <lennart.1997@gmx.de>
2017-07-25 14:29:50 +02:00
Keun-young Park 7f3ffc1f4b Merge "fs_mgr:Add filter condition to make sure that the super block is correct." am: 9dd1a12b1e am: bc4c5032fc am: 29a5cc174c am: 2eba1eb7d2
am: 32d8adf637

Change-Id: Iefdf443ccc4a68ae8e55e088db2da982c998c866
2017-07-21 22:51:48 +00:00
Keun-young Park 32d8adf637 Merge "fs_mgr:Add filter condition to make sure that the super block is correct." am: 9dd1a12b1e am: bc4c5032fc am: 29a5cc174c
am: 2eba1eb7d2

Change-Id: Iab8f87b34561b36ab9bf73fd1bb8662084717808
2017-07-21 22:48:56 +00:00
Keun-young Park 2eba1eb7d2 Merge "fs_mgr:Add filter condition to make sure that the super block is correct." am: 9dd1a12b1e am: bc4c5032fc
am: 29a5cc174c

Change-Id: I84223b5e0cb7bda24cc62377ed88b027b81169f8
2017-07-21 22:46:37 +00:00
Jaegeuk Kim 312142550f Merge "fs_mgr: format f2fs with length=xx fstab" 2017-07-21 22:12:48 +00:00
Keun-young Park bc4c5032fc Merge "fs_mgr:Add filter condition to make sure that the super block is correct."
am: 9dd1a12b1e

Change-Id: I8947564ee32cd90ea8f3a7c986426b9c3dbd70af
2017-07-21 20:11:52 +00:00
Keun-young Park 9dd1a12b1e Merge "fs_mgr:Add filter condition to make sure that the super block is correct." 2017-07-21 20:04:15 +00:00
Jin Qian 3f531ac5cf Merge changes from topic 'mke2fs_2'
am: 176827e166

Change-Id: I933e0d96d9c81c5800e4cf406582277b140f3e2b
2017-07-21 19:06:03 +00:00
Treehugger Robot 176827e166 Merge changes from topic 'mke2fs_2'
* changes:
  fastboot: add mke2fs and e2fsdroid to build package
  fastboot: call mke2fs tools to generate ext4 image
  fs_mgr: call format_f2fs correctly with -f
  init: require e2fsdroid and mke2fs when building init
  init: rename mke2fs tools with _static suffix
2017-07-21 19:00:46 +00:00
katao 4e8d73fa0c fs_mgr:Add filter condition to make sure that the super block is correct.
Because full disk encryption make surper block is not except contents. Only
judge the magic number can prevent most of encrypted surper block.
In particular, magic number plaintext may be equal ciphertext. In order to
avoid this situation, we add the judgment of adaptive situation of the
s_rev_level, s_log_block_size and EXT4_INODE_SIZE.

Test: 1. Config fstab,userdata add flags: forceencrypt=footer,reservedsize=128M
      2. build a new target files, and flash all image.
      3. Config encrypt userdata surperblock,set magic number is 0xEF53
      4. reboot system and check log of fs_mgr.
Change-Id: I925584d58f17afabbb3aa91f8be2302518172bb2
Signed-off-by: katao <katao@xiaomi.com>
2017-07-21 11:35:35 +08:00
Jaegeuk Kim c0d88edfec fs_mgr: call format_f2fs correctly with -f
This patch formats f2fs with -f option.

Change-Id: I3fc415f35d81f22cbf1eadebc619465d36205927
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
(cherry picked from commit 0331c2cf77)
2017-07-20 11:54:47 -07:00
Bowgo Tsai 2e774b01f8 Merge "fs_mgr_verity: allow verification error when the device is unlocked" am: a68f633675 am: 84937296c6 am: e5de94756b
am: 2e19aa92ed

Change-Id: If3779eceac8084723c101a6f7fa9091c4f09128e
2017-07-20 02:03:34 +00:00
Bowgo Tsai 2e19aa92ed Merge "fs_mgr_verity: allow verification error when the device is unlocked" am: a68f633675 am: 84937296c6
am: e5de94756b

Change-Id: Iedca76aea1c93320bbba29bcd013d1cd331380de
2017-07-20 02:01:05 +00:00
Bowgo Tsai 84937296c6 Merge "fs_mgr_verity: allow verification error when the device is unlocked"
am: a68f633675

Change-Id: Iba60c7f544ae86a1487354a9e799cab7167f37ad
2017-07-20 01:55:04 +00:00
Jaegeuk Kim a367430734 fs_mgr: format f2fs with length=xx fstab
Change-Id: Icce29ad918f20b16c9908e7fa3ae19eb8c96760b
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2017-07-19 09:55:56 -07:00
Bowgo Tsai b674894199 fs_mgr_verity: allow verification error when the device is unlocked
On a A/B device, the image combination in VTS is:
  - system.img (userdebug): provided by Google (system as root)
  - vendor.img (user): provided by the OEM

The generic system.img provided by Google doesn't have /verity_key.
So verified boot will fail when it tries to verify the signature of
vendor.img. This CL allows signature verification error (including
no verity_key) when the device is unlocked.

This CL also changes the return value to FS_MGR_SETUP_VERITY_SKIPPED when
signature verification failed in logging mode. Otherwise, first stage
mount will fail because it assumes verity device initialization should be
successful when receiving FS_MGR_SETUP_VERITY_SUCCESS.

Bug: 63821912
Test: boot generic system.img on a A/B device
Change-Id: I33e5ef753913ae9f0c8b02c518ae94d4c8505611
2017-07-19 18:45:40 +08:00
Tom Cherry a222129aff Merge changes from topic 'ext4_encryption_flag' am: 5be05733c2 am: 5a6226929e am: d165de95da
am: e1442a5df0

Change-Id: I470057eb4ccc0536eed869114cb999daf36469dc
2017-07-14 23:22:26 +00:00
Tom Cherry e1442a5df0 Merge changes from topic 'ext4_encryption_flag' am: 5be05733c2 am: 5a6226929e
am: d165de95da

Change-Id: I11ebc6c79bcd5cf6b8fd619b1a71582b7c788d41
2017-07-14 23:18:02 +00:00
Tom Cherry 5a6226929e Merge changes from topic 'ext4_encryption_flag'
am: 5be05733c2

Change-Id: I242f679bb96f9ae71b624db4cbcb54dda5be5ee4
2017-07-14 23:11:43 +00:00
Tom Cherry 5be05733c2 Merge changes from topic 'ext4_encryption_flag'
* changes:
  fs_mgr: set ext4 encryption flag with tune2fs when needed
  fs_mgr: refactor pre-mount logic into prepare_fs_for_mount()
2017-07-14 23:06:30 +00:00
Bowgo Tsai dc43b54d33 Merge "fs_mgr: trim the terminating '\0' when reading from device tree" am: b76158d56a am: 3205cd6cc4 am: 776c67b4d5
am: ec721bdda2

Change-Id: I229b411a591b04de4bb557b1bc5b604d9a2e63d0
2017-07-14 05:32:33 +00:00
Bowgo Tsai ec721bdda2 Merge "fs_mgr: trim the terminating '\0' when reading from device tree" am: b76158d56a am: 3205cd6cc4
am: 776c67b4d5

Change-Id: I5cccad6c1d5df0dd0b5505eaf18353c96ba5ea72
2017-07-14 05:26:30 +00:00
Bowgo Tsai 3205cd6cc4 Merge "fs_mgr: trim the terminating '\0' when reading from device tree"
am: b76158d56a

Change-Id: I8498667cfdd266827a936a9e9a0bac50dc9699f4
2017-07-14 05:18:04 +00:00
Bowgo Tsai f559655912 fs_mgr: trim the terminating '\0' when reading from device tree
Bug: 63637343
Test: boot device
Change-Id: I35ead1ad852493f7f92bdb6c87617fde57b3b0be
2017-07-13 15:11:16 +08:00
Eric Biggers e9811f36e5 fs_mgr: set ext4 encryption flag with tune2fs when needed
Upstream kernels (v4.9+, v4.4.67+) have started to enforce that
encryption policies cannot be set on ext4 directories unless
EXT4_FEATURE_INCOMPAT_ENCRYPT is set in the filesystem superblock, as
was the original design.  Since Android's userspace was not setting this
flag, it was not possible to use "file-based encryption" (FBE) on
devices whose kernels enforce this constraint.  Fix this by updating
fs_mgr to set the flag if needed, similar to how it enables the quota
feature if needed.

Note that it would, eventually, be simpler to set this flag at mkfs
time.  But that seems infeasible for now, given the many different ways
the userdata filesystem can be formatted --- including via 'fastboot',
which I believe is expected to still be compatible with old devices
whose kernel and/or e2fsprogs don't support the 'encrypt' flag.

Bug: 36231741
Change-Id: Ibafb9a7116fc853b62f8ee074a78499399f290a6
2017-07-06 13:31:30 -07:00
Eric Biggers 8d3bcd4b6a fs_mgr: refactor pre-mount logic into prepare_fs_for_mount()
There were several duplications in the code that runs before a
filesystem is mounted.  This made it difficult to start running tune2fs
to set the encryption feature flag.  Refactor to deduplicate the logic,
and improve the log messages.

Bug: 36231741
Change-Id: I90846dad9c5ec85b3c5460615dec4cc19cb7e198
2017-07-06 13:31:30 -07:00
Jinguang Dong d974500314 Merge "fs_mgr: Adding logs when failing to wait for a device file" am: 4ca2a30368 am: 694985721f am: 0ac18b28cd
am: febf2ad9d7

Change-Id: I8070df926d9949583e84dca03e5dd8acc78c8968
2017-07-06 04:24:38 +00:00
Jinguang Dong febf2ad9d7 Merge "fs_mgr: Adding logs when failing to wait for a device file" am: 4ca2a30368 am: 694985721f
am: 0ac18b28cd

Change-Id: I055425b0dfdbccbfa9c72e9bb1390ea483afdb9c
2017-07-06 04:23:26 +00:00
Jinguang Dong 694985721f Merge "fs_mgr: Adding logs when failing to wait for a device file"
am: 4ca2a30368

Change-Id: I19ba38a596527a4544437d126c80123381b065b4
2017-07-06 04:20:55 +00:00
Treehugger Robot 4ca2a30368 Merge "fs_mgr: Adding logs when failing to wait for a device file" 2017-07-06 04:19:00 +00:00
Jinguang Dong 9d344969b0 fs_mgr: Adding logs when failing to wait for a device file
During mount operations, fs_mgr_wait_for_file() is invoked to
ensure the device file exists before starting to mount it. Adding
logs when the wait fails and also skip mounting as it won't be
successful. Also merge fs_mgr_test_access() and wait_for_file()
as fs_mgr_wait_for_file().

Test: Boot device and manually trigger the timeout issue
Test: Check and confirm whether timeout log info is inside ksmg.

Change-Id: Ide6d7fdca41e03e169e4400f91b7dea327985aaf
2017-07-06 09:51:02 +08:00
Bowgo Tsai e892b7cdef Merge "fs_mgr: allow no verity metadata when the device is unlocked." am: cd0c2d8962 am: 328b56585e am: 06c6bf67e9
am: 3f10ecabf8

Change-Id: Id5317f717bf6d7a1e1be695b773b9abcad41ee56
2017-07-06 01:37:53 +00:00
Bowgo Tsai 3f10ecabf8 Merge "fs_mgr: allow no verity metadata when the device is unlocked." am: cd0c2d8962 am: 328b56585e
am: 06c6bf67e9

Change-Id: Id1f3d275fdeadca1b23a086725b3f63aedc5a141
2017-07-06 01:12:59 +00:00
Bowgo Tsai 328b56585e Merge "fs_mgr: allow no verity metadata when the device is unlocked."
am: cd0c2d8962

Change-Id: Icebfb3c34b3c2878c4015f36dafe893c577b40c9
2017-07-06 00:46:09 +00:00
Treehugger Robot cd0c2d8962 Merge "fs_mgr: allow no verity metadata when the device is unlocked." 2017-07-06 00:29:47 +00:00
Mark Salyzyn 054192270f Merge "fs_mgr: report errno string for __mount errors" am: 6333cd0938 am: eef732555d am: ab6f80c350
am: 0c7862b805

Change-Id: Ica3272ac4c2e76fe2df04eeaa6e07e18d768b0f1
2017-07-05 22:00:16 +00:00
Mark Salyzyn 0c7862b805 Merge "fs_mgr: report errno string for __mount errors" am: 6333cd0938 am: eef732555d
am: ab6f80c350

Change-Id: I1dcef448c82402404652921f8113b2a576158f57
2017-07-05 21:58:15 +00:00
Mark Salyzyn eef732555d Merge "fs_mgr: report errno string for __mount errors"
am: 6333cd0938

Change-Id: Ic3c85f6ed01d5edd2bfd0a29063610b4d8159f31
2017-07-05 21:54:17 +00:00
Bowgo Tsai d1fe3bdbd6 fs_mgr: allow no verity metadata when the device is unlocked.
To boot with generic system.img for project Treble, we should allow no verity
metadata when the device is unlocked. The previous fix checks system property
"ro.boot.flash.locked" but it's unavailable during first stage mount.
This CL checks "androidboot.verifiedbootstate" in kernel command line instead.

Bug: 63268209
Test: boot sailfish without metadata on /vendor

Change-Id: Ifd1dbeb2a2f09cd06903ecdd59bc94b3905a3fbd
2017-07-05 17:22:35 +08:00
Mark Salyzyn 69a5bd4357 fs_mgr: report errno string for __mount errors
Need to know why the mount failed.  clang_format adjustment.

Basically change LINFO to PINFO to cause the log message for the mount
report to be accompanied by a strerror(errno) message appended to the
end so that it is clear why the mount was rejected.

Test: manual
Bug: 63100799
Change-Id: Ic958299759befe5d5b11bdc95fea5d64cad86412
2017-06-28 21:52:34 +00:00
Jiyong Park 28bd98999b resolve merge conflicts of 645026c74 to oc-dr1-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Merged-In: If8fc73e4ae4c2f8281c41a12f1c18079aab8baa2
Change-Id: Iadfcd7e75044d62f2015dc62c69ee68869b40cd7
2017-06-28 22:52:25 +09:00
Jiyong Park 22ca4f76c2 resolve merge conflicts of 20d9cf2ee to stage-aosp-master
Test: I solemnly swear I tested this conflict resolution.
Merged-In: If8fc73e4ae4c2f8281c41a12f1c18079aab8baa2
Change-Id: Ie7feb839c9da2a11579ed850680c044c9fc3432a
2017-06-28 05:55:43 +00:00
Treehugger Robot 20d9cf2ee7 Merge "fs_mgr: add libfstab for vendor" 2017-06-28 04:57:48 +00:00
TreeHugger Robot 05f113c038 Merge "fs_mgr: add libfstab for vendor" 2017-06-28 03:45:36 +00:00
Jiyong Park e7df1f7623 fs_mgr: add libfstab for vendor
libfstab is a subset of libfs_mgr, intended for vendors to use. It
exposes APIs for reading fstab. Note this 'visible to vendor' does not
mean that the API should be stable forever. The API can be changed in
later releases of Android, ,but the newer Android must not cause
run-time error when there is an older version of this static library
being used somewhere.

Bug: 62990533
Test: BOARD_VNDK_VERSION=current m -j libfstab.vendor
Change-Id: I371174fa1f6b4de6d6dd437b84ce4ed1e8740672
Merged-In: If8fc73e4ae4c2f8281c41a12f1c18079aab8baa2
2017-06-28 11:24:25 +09:00
Mark Salyzyn 4a4259b51b Merge changes Ibe1feb39,I05be83e4,If1422e4d am: a4f086ab20 am: 3a156e6c2b am: ca0c0bb96e
am: 872206fd80

Change-Id: I9c08baaf94f2eaaf2ad9633e70b9cd0c1dd484ed
2017-06-27 22:14:25 +00:00