History log of /system/core/fs_mgr/include/fs_mgr.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
92ca58b5bddd07075faa8179302013f9c13e85b7 01-Mar-2017 Bowgo Tsai <bowgotsai@google.com> fs_mgr: support AVB in fs_mgr_update_verity_state()

fs_mgr_update_verity_state() is invoked by 'verity_update_state' in
init.rc. It will then set property "partition.system.verified" and
"partition.vendor.verified" to verify_mode. We should support this for
AVB as well.

Also change the order of static libs in init to fix the build error
after this change:
system/extras/ext4_utils/ext4_crypt.cpp:69: error: undefined reference to 'property_get'

Bug: 35416769
Test: Mount /system and /vendor with vboot 2.0 (AVB), check the following properties exist.
- [partition.system.verified]: [2]
- [partition.vendor.verified]: [2]
Test: Mount /system and /vendor with vboot 1.0, check the following properties exist.
- [partition.system.verified]: [0]
- [partition.vendor.verified]: [0]

Change-Id: I4328d66a8cb93f26e7960e620a0b2292d5f15900
Merged-In: I4328d66a8cb93f26e7960e620a0b2292d5f15900
(cherry picked from commit aaf70e77dc232fde152249bb6f66a227eab35a10)
/system/core/fs_mgr/include/fs_mgr.h
a01f2f68ec0b76bc6e8c8e80247608b2e8d3a9ae 13-Apr-2017 Bowgo Tsai <bowgotsai@google.com> fs_mgr: adds/changes some public APIs for early mount in init

Several changes in this CL:
- Moves class FsManagerAvbHandle to public API
- Adds a parameter 'wait_for_verity_dev' for FsManagerAvbHandle::SetUpAvb()
to allow not to wait for verity device gets created
- Adds FsManagerAvbHandle::AvbHashtreeDisabled() to query whether AVB is disabled
- Adds fs_mgr_is_avb() to query whether a fstab_rec has MF_AVB flag

Bug: 33254008
Test: test AVB on bullhead
Change-Id: I89c43ca574ae632db8a700fc2590a1f80212c993
Merged-In: I89c43ca574ae632db8a700fc2590a1f80212c993
(cherry picked from commit 80d1ad17ed5dd1ca63cc3cca24e801c9f63bc48f)
/system/core/fs_mgr/include/fs_mgr.h
c1f9cbaf8d627a86209f3afbf5754cb4d470c693 04-Apr-2017 Bowgo Tsai <bowgotsai@google.com> fs_mgr: adding fs_mgr_get_slot_suffix() public API

The function returns "_a" or "_b" based on two possible values in
kernel cmdline:

- androidboot.slot = a or b OR
- androidboot.slot_suffix = _a or _b

Bug: 33254008
Bug: 36533366
Test: boot sailfish
Change-Id: Ia0a524e4145ebf61af5821f42ecad212c95ed748
Merged-In: Ia0a524e4145ebf61af5821f42ecad212c95ed748
(cherry picked from commit 87d0836cda90b33ee97d63ef61a10dd23d82581a)
/system/core/fs_mgr/include/fs_mgr.h
608a4a6b3ee67e9bcd562a41c6a2215b0c1d1cdf 29-Mar-2017 Bowgo Tsai <bowgotsai@google.com> fs_mgr: removing fs_mgr_read_fstab_with_dt()

Currently there is no client requires fs_mgr_read_fstab_with_dt() so
remove this API. Devices with fstab entries in device tree should use
fs_mgr_read_fstab_default() to get default fstab, or just use
fs_mgr_read_fstab_dt() to get those in device tree.

Bug: 35811655
Test: normal boot sailfish
Test: run factory data reset in sailfish
Test: recovery boot sailfish
Test: adb sideload in sailfish

Change-Id: I1579d81cea7366cf3867cfe5ad56feb36cbb7246
(cherry picked from commit acc1c3c7929fcb6def72cc640ef26b4e9ce1b4b4)
/system/core/fs_mgr/include/fs_mgr.h
eeea7249001c9fc44916621d9d4817fb594582bf 10-Mar-2017 Bowgo Tsai <bowgotsai@google.com> Merge changes from topic 'fstab_relocation' am: ac13718d0a am: 8f7125fbee
am: 9fc983315a

Change-Id: Ic62c46c160e9995ff11067300ec5c831301bceb9
47d342739a295a39684c8531d83cd385cbf7d885 06-Mar-2017 Bowgo Tsai <bowgotsai@google.com> fs_mgr: add fs_mgr_read_fstab_with_dt() API

With the early mount support in init, fstab entries of verified partitions
(e.g., /system, /vendor) will be moved into device tree in kernel image.

Those early mount fstab entries will be removed from the fstab file to
prevent duplicated and/or inconsistent settings.

This change adds a new function: fs_mgr_read_fstab_with_dt(), to return
the combined results from both places. It also removes
fs_mgr_read_fstab_file() from the public APIs and makes it as an
internal function.

Bug: 35811655
Test: early mount /vendor with dm-verity on sailfish

Change-Id: I2fba3614685bf9f852a789cda6f53013e2164e60
/system/core/fs_mgr/include/fs_mgr.h
eebe07c5397c09b78fd8905182bb380e4799a013 25-Feb-2017 Wei Wang <wvw@google.com> Merge "fs_mgr: fix const parameter in fs_mgr_do_tmpfs_mount" am: 7a5d535cd2 am: be838ae027
am: 771f642d89

Change-Id: Ie8cd01116a1f0437eee80168dc5f6aa57b08fa55
4d71bc5350a9715314e5d54b32fc4220a9e4787a 25-Feb-2017 Wei Wang <wvw@google.com> fs_mgr: fix const parameter in fs_mgr_do_tmpfs_mount

Bug: 35425974
Test: mma, marlin/angler boot
Change-Id: Ibadd04ad3a7c4ea184a6344d566302d577d8fee3
/system/core/fs_mgr/include/fs_mgr.h
72b689bf342e09fb71b243d66b44a789038ffb6d 24-Feb-2017 Sandeep Patil <sspatil@google.com> Merge changes from topic 'early-mount-verity' am: 93072f2ce3 am: 2eb715d866
am: d93e05052a

Change-Id: I014d926e0bf7f560b7fbfa32f11b078dc7b6edc4
c20c0c2cdd593f6b54bf467167a5f2ed3c602ab8 24-Feb-2017 Sandeep Patil <sspatil@google.com> early_mount: fs_mgr: move all fstab logic into fs_mgr

With init parsing fstab fragments from kernel separately, the fs_mgr
would completely miss the device tree entries. That leads to things like
'adb remount' to go through without warning for verity even if /system
is verified. This happens because 'verity_update_state' completely
misses the partitions passed to android through the device tree.

solution is to teach fs_mgr about device tree fstab entries and add 2
new public APIs.

1. fs_mgr_read_fstab_dt() - reads device tree and returns fstab
generated from it.

2. fs_mgr_read_fstab_default() - reads both device tree fstab and
/fstab.{ro.hardware} and returns the combined table.

This also reduces the hardcoded /fstab.{ro.hardware} occurence only to
fs_mgr and for eveyone who wants to read the "default" fstab must be
changed to call fs_mgr_read_fstab_default() instead. e.g. adb.

b/27805372

Test: Angler was used since it has 2 early mounted partitions instead of
one. 1 verified and 1 unverified.
- Boot angler successfully without early mount
- Boot angler successfully with /vendor early mount and test if 'adb
remount' warns us about verity
- Boot angler successfully with both /system and /vendor early mounted
and ensure 'adb remount' warns us about verity.
- check partitions.system.verified status after /system early mount ot
ensure it is set to VERITY_MODE_DEFAULT.
- 'adb disable-verity' with early mounted /system doesn't work due to
missing changes in adb

TODO:
change adb to use the new fs_mgr_read_fstab_default() API

Change-Id: I82038d87c7a44488e938acce2cc1082c08f6f73a
Signed-off-by: Sandeep Patil <sspatil@google.com>
/system/core/fs_mgr/include/fs_mgr.h
bb5a8380b0e35d3b7ac45ccf326fed130f0beb89 23-Feb-2017 Sandeep Patil <sspatil@google.com> Merge changes from topic 'early-mount-support' am: 4bd3facbb1 am: e0d7b830f0
am: 5f08cb2aea

Change-Id: I40a70549a545d9d1dd4f007f5fd259102785412c
05ff38ba43eb7a882873312f12fc019b42f37b34 17-Feb-2017 Sandeep Patil <sspatil@google.com> init: early_mount: disallow partitions to be verified at boot

While technically possible, the verification at boot basically will
block init for as long as the entire partition is read while nothing
else is running. Disallow that as this is not going to be used anywhere.

Bug: 27805372
Test: boot angler with verifyatboot fs_mgr option for early mounted
vendor partition. That resulted in a panic() as expected.

Change-Id: I9da5caa163cae8bce6dbfb630f0ed5605ea044a0
Signed-off-by: Sandeep Patil <sspatil@google.com>
/system/core/fs_mgr/include/fs_mgr.h
4129f20aafe07431a5950271cf7b9014bee53550 16-Feb-2017 Sandeep Patil <sspatil@google.com> fs_mgr: make fs_mgr_setup_verity public API

Consequently this removes the 'early' version of the exact same API.
This is to be used by early mount code where we need to do
1. setup verity
2. create verity device
3. mount partition
as separate steps since that happens during init first stage.

b/27805372

Test: Boot sailfish successfully

Change-Id: I01abecfdfa210d3e240a291ddcb3d2e9ed39ede6
Signed-off-by: Sandeep Patil <sspatil@google.com>
/system/core/fs_mgr/include/fs_mgr.h
56f9ada93d83dcd66322635138e334e25bb5e1bd 14-Feb-2017 Sandeep Patil <sspatil@google.com> fs_mgr: add fs_mgr_do_mount_one() API

This is to be used in early mount case where we will have a fully
prepared fstab_rec. fs_mgr_do_mount() does a lot more checks and
spends time preparing verity / avb devices before it does the actual
mount.

b/33254008

Test: Boot sailfish

Change-Id: I4481b5af8d900c8b7e3355b7513c325d8f2ecff2
Signed-off-by: Sandeep Patil <sspatil@google.com>
/system/core/fs_mgr/include/fs_mgr.h
1ccb3b0050ec6c40c217d7e435610063e31eb706 14-Feb-2017 Sandeep Patil <sspatil@google.com> Merge changes from topic 'pre-early-mount' am: 1549257ff5 am: c027aac7c8 am: 9e140bb206
am: 7f9c89ffcb

Change-Id: Ie4531a9e4457110d3e496bb3ba1b267c211ce5ef
35403ebaf85aa229973275be9f5229d453799811 09-Feb-2017 Sandeep Patil <sspatil@google.com> init: early_mount: add support to mount non-verity partitions early

This is done by parsing 'androidboot.fstab=<fstab>' kernel cmdline
option to get the fstab file that *only* specifies partitions to be
mounted early (i.e. in init's first stage).

Note that, the same fstab file may not be used as an argument to
mount_all later in the boot as that will cause fs_mgr to fail with
EBUSY.

TODO:
- Possibly add a new mount_mode so the same fstab can be used for
early_mount, 'mount_all --early/--late' etc.
- Add support for dm-verity enabled partitions to mount early.
- Add support for getting fstab arguments through DT instead of kernel
cmdline.

Bug: 27805372

Test:
Boot angler by passing a seperate fstab file using the kernel
cmdline option to mount vendor partition early, remove the vendor
partition entry from the main fstab file for the test.

Boot sailfish by passing a seperate fstab entry via device tree
to mount vendor partition early. Remove vendor partition entry from
the main fstab file for the test

Change-Id: I18785b893c54c8cee960ab44d5e8f83e5d624aa8
Signed-off-by: Sandeep Patil <sspatil@google.com>
/system/core/fs_mgr/include/fs_mgr.h
b478f706d76483519a197ad24c0acbb146ebe10e 02-Feb-2017 Eric Biggers <ebiggers@google.com> fs_mgr: allow specifying HEH filenames encryption

Make the fs_mgr changes needed to support specifying aes-256-heh
filenames encryption. To do this, extend the "fileencryption" fstab
option to have the syntax
fileencryption=contents_encryption_mode[:filenames_encryption_mode].
The previous filenames encryption mode, aes-256-cts, remains supported
and will be used by default if no mode is explicitly specified.

For consistency, also make "aes-256-xts" an alias for the "software"
contents encryption mode.

Bug: 34712722
Change-Id: I74c0f5fe7cddde7055d7b031d96a2916ca611eb7
/system/core/fs_mgr/include/fs_mgr.h
46fec487a9d0175461f3702e8fb9fa66a6a83f74 25-Jan-2017 Connor O'Brien <connoro@google.com> Add eraseblk and logicalblk fs_mgr flags

When doing a factory reset in recovery, flash erase & logical block
sizes are needed for tuning the parameters of the new userdata image.
Add flags to allow this information to be stored in recovery.fstab

Test: Factory reset marlin & confirm userdata is rebuilt correctly
Bug: 33243520
Change-Id: I6c4414d4e9026be4a3646523656ac151e93015e7
Signed-off-by: Connor O'Brien <connoro@google.com>
/system/core/fs_mgr/include/fs_mgr.h
8b7eb7bb2a9cff199cfd65641521a31119cd7179 03-Nov-2016 Jin Qian <jinqian@google.com> 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
Test: compile

Change-Id: I937a68c01c223230932c932bffdd35da6503c3c4
/system/core/fs_mgr/include/fs_mgr.h
6d89610d1ab32cc75473c873aa07d6e40fe20c8d 14-Dec-2016 Jeff Sharkey <jsharkey@android.com> 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
/system/core/fs_mgr/include/fs_mgr.h
9a0fd1d5d303b0d39b051bd3324b30a3afa0635f 22-Jul-2016 liminghao <liminghao@xiaomi.com> 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>
/system/core/fs_mgr/include/fs_mgr.h
3c4dfb6fc484a00cdd54de968ad8aecf23fcaa4d 19-Nov-2016 Peter Enderborg <peter.enderborg@sonymobile.com> Merge "Add support for max_comp_streams option for zram"
am: a9ea1e4d99

Change-Id: I0ef7127e1352b7dc9ae226bee7fe340d864f97ab
4d217f02d3327cc06a3266c3e1022cef7dd753ff 26-Aug-2016 Peter Enderborg <peter.enderborg@sonymobile.com> 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
/system/core/fs_mgr/include/fs_mgr.h
905948ed74f60cb14940e96819f6f95aeda98f86 03-Nov-2016 Jin Qian <jinqian@google.com> 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
/system/core/fs_mgr/include/fs_mgr.h
d61a7e2da4e6184797f866abf8020bfe3b928ab0 23-Aug-2016 Wei Wang <wvw@google.com> Split fstab mount into 2 phases

This will make it possible to start some key services before mounting
data partition

Bug: 30118894
Change-Id: Ia9f8cc035de6cc0df9a61605864915efa0266d7f
(cherry picked from commit abfbec342fdd2fc9d139a88a2d950953918e1b4e)
/system/core/fs_mgr/include/fs_mgr.h
254f44363b85f4665b1942762a708bf87301a462 23-Aug-2016 Wei Wang <wvw@google.com> Split fstab mount into 2 phases

This will make it possible to start some key services before mounting
data partition

(cherry picked from commit abfbec342fdd2fc9d139a88a2d950953918e1b4e)

Bug: 30118894
Change-Id: Ia9f8cc035de6cc0df9a61605864915efa0266d7f
/system/core/fs_mgr/include/fs_mgr.h
1263097328ef8c21fbbed22b006430e507502ffd 18-Aug-2016 Hung-ying Tyan <tyanh@google.com> Merge "Mount /vendor and /odm early" am: 35569e9d68 am: 46bfc918d0
am: d1f49a43fd

Change-Id: I6dc53f60771ad0e660e248efdc1b13734fba3061
46bfc918d04a59baec50abae7ea01ff754aed7e3 18-Aug-2016 Hung-ying Tyan <tyanh@google.com> Merge "Mount /vendor and /odm early"
am: 35569e9d68

Change-Id: I9b5360bf3036fa88e770d686ab06b8f4cff80d7c
99c4a8a6b3852c33828b03cbd0aef0c625957a39 01-Feb-2016 Hung-ying Tyan <tyanh@google.com> Mount /vendor and /odm early

Right now these two partitions are mounted in the fs stage of the init
process. As a result, many vendor/ODM files needed earlier in the boot
process (e.g., init.<hardware>.rc, fstab.<hardware>.rc,
uevent.<hardware>.rc, SELinux policy files etc) can only live on the root
partition.

To prevent vendors/ODMs from polluting the root partition, this patch makes
it possible to mount the vendor and ODM partitions in the first stage of the
init process. The fstab info of both partitions to be mounted early is
composed from new kernel cmdline arguments android.early.prefix and
android.early.fstab.

For example, with:
android.early.prefix=/sys/devices/1010000.msdc0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/
android.early.fstab=mmcblk0p10+/odm+ext4+ro+verify\nmmcblk0p09+/vendor+ext4+ro+verify

the final fstab string will be:
/sys/devices/1010000.msdc0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p10 /odm ext4 ro verify
/sys/devices/1010000.msdc0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p09 /vendor ext4 ro verify

The android.early.prefix is optional. When it is missing, the final fstab
string will be directly converted from android.early.fstab.

This patch also makes sure that the early mounted partitions are dm-verity
enabled so that they are trust worthy to store system files.

BUG=27805372

Change-Id: I3cf32482a5ec65445ba3aedab2164c7ba8f12694
/system/core/fs_mgr/include/fs_mgr.h
8b1707ec3a59d8fd38921a0b55382cfc94daaecc 07-Jun-2016 Chuanxiao Dong <chuanxiao.dong@intel.com> Merge "fs_mgr: fix encryptable=footer support" am: b67fed557f am: 7f06a23414
am: aa0318c9e9

* commit 'aa0318c9e9b97b2644c7428313fbeec4f86d12fd':
fs_mgr: fix encryptable=footer support

Change-Id: Ic8d662bd960a4e40f0a3073ff2442b5d1eb20d99
aa0318c9e9b97b2644c7428313fbeec4f86d12fd 07-Jun-2016 Chuanxiao Dong <chuanxiao.dong@intel.com> Merge "fs_mgr: fix encryptable=footer support" am: b67fed557f
am: 7f06a23414

* commit '7f06a234140a1dc5c0160fca03b7fcf0fd35939a':
fs_mgr: fix encryptable=footer support

Change-Id: Iea56bd3856a241100bd23b3a06c3284c47bff5c0
b67fed557f68714ba602ecbf3b4fa8bd06faf831 07-Jun-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "fs_mgr: fix encryptable=footer support"
496e073864b3c08fb4d24152ceaad69f12d56ab3 28-May-2016 Stephen Hines <srhines@google.com> resolve merge conflicts of 5fb629a to nyc-mr1-dev-plus-aosp

Change-Id: I6424b08182637e7885b57119bc5eb6d5e3708c45
5fb629a2126665c4c24c599626233dfc61be5db9 28-May-2016 Chih-Hung Hsieh <chh@google.com> resolve merge conflicts of e845c04 to nyc-dev-plus-aosp

Change-Id: I423f722dcc3821b9be52613d68640b49cbac70a6
4e898a01fd4df477f079a6140590f5ec8535102b 24-May-2016 Paul Lawrence <paullawrence@google.com> Make file encryption type available

Bug: 28905864
Change-Id: I5f59f824fd92c32ff87aa730dc5c0f250564c0a9
/system/core/fs_mgr/include/fs_mgr.h
c713bce90183fa4ade82bc6f4b08280d32f1fb58 19-May-2016 Chih-Hung Hsieh <chh@google.com> Fix misc-macro-parentheses warnings in init and other core modules.

Bug: 28705665
Change-Id: Ice67cebb8c42538f8fb9cf1756678f41a9d68a31
/system/core/fs_mgr/include/fs_mgr.h
5b8a108ef5c9ec2a11a1b7afd4e9d4a4d8444854 05-May-2016 Paul Lawrence <paullawrence@google.com> Add fileencrypted=software/ice to fstab options

Bug: 28616054
Change-Id: If9dd4a17641412607ca4e4fed7f7dbf661ff0d25
/system/core/fs_mgr/include/fs_mgr.h
e3a3288dddcde8c180dfe2935335ca3c475e37a2 12-Apr-2016 Daniel Rosenberg <drosen@google.com> resolve merge conflicts of 2857bd1 to nyc-dev

Change-Id: I3dc666cd44deb3e8438c2a482328f79e7a67e81e
de551ffee965c7b5e5a87f64cce6b0a7d9f38641 08-Apr-2016 Daniel Rosenberg <drosen@google.com> Add nofail fstab option

This option allows fs_mgr to ignore mount errors on an optional
partition to allow booting to continue.

Bug: 28071890
Change-Id: I71a2b3c1c573297cab18884b4c4bd7c27ced2901
/system/core/fs_mgr/include/fs_mgr.h
d38e3c522c162972bb348c0258e3f9e975191c4f 08-Apr-2016 Daniel Rosenberg <drosen@google.com> Add nofail fstab option

This option allows fs_mgr to ignore mount errors on an optional
partition to allow booting to continue.

Bug: 28071890
Change-Id: I71a2b3c1c573297cab18884b4c4bd7c27ced2901
/system/core/fs_mgr/include/fs_mgr.h
d78dff162262d9b682bb431bb7477b73d2b1620e 08-Mar-2016 Chuanxiao Dong <chuanxiao.dong@intel.com> fs_mgr: fix encryptable=footer support

If the userdata partition has the encryptable=footer fstab option,
fs_mgr must leave room for the crypt footer.

Change-Id: Id07818c5d93aafc27577f72fb0a780f26db51b16
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
/system/core/fs_mgr/include/fs_mgr.h
1098aacde46dffeb97d03e4079a9ef8ffac8199e 05-Mar-2016 Paul Lawrence <paullawrence@google.com> Distinguish between unencrypted and unencryptable

Set ro.crypto.state flag to unencrypted and unsupported accordingly

Bug: 18002358
Change-Id: I1f88ce9704c5505d7b63256e2ebe5f8441c79ad0
/system/core/fs_mgr/include/fs_mgr.h
69080180cee82bec39148ccab8b0a7928c42ae0e 02-Feb-2016 Paul Lawrence <paullawrence@google.com> Remove code to handle non-default file encryption

Change-Id: I6d986853929c0237c0d958329b8e9aab47907a00
/system/core/fs_mgr/include/fs_mgr.h
b262d6864eea115b06edf1846ea862e48cd5398d 29-Oct-2015 Paul Lawrence <paullawrence@google.com> Add developer option to convert from FDE to FBE

This set of changes adds the screen that offers this conversion,
and the plumbing so the option is only available on suitable
devices.

It does not implement the conversion mechanism.

Change-Id: Idbe5ef5d5fad197cc8187e1b288c57feef2c2c0b
/system/core/fs_mgr/include/fs_mgr.h
e498c7ca2cdbf4a16aa155bca3357c4ece401854 14-Apr-2015 Ed Tam <etam@google.com> resolved conflicts for merge of d0b6de41 to master

Change-Id: I1d1f6b1cdbd7ee441682c4258a11fb3198ca7d94
438443e742d9cfb91c1193144a3b41744ffad34b 14-Apr-2015 Ed Tam <etam@google.com> resolved conflicts for merge of 79f33846 to lmp-mr1-dev-plus-aosp

Change-Id: I24c60a2747931917a3ea09b953905ce0f4145280
79f338465213885900cea5a39f3aeeea083bbe51 05-Sep-2013 Chris Fries <cfries@motorola.com> fs_mgr: introduce fs_mgr_format to format wiped partitions

Move fastboot's format logic into fs_mgr, to consolidate the knowledge
about how to do this (and when to wipe metadata).

Try to format these formattable paritions if they are wiped.

If formatting fails, we will fall out to let recovery mode handle it.

Bug: 20082763
Change-Id: I397cc197550e78d932e8a154fd234695c46dbe7b
/system/core/fs_mgr/include/fs_mgr.h
856006047b50e006b067dee9d44f73463cbd452c 07-Apr-2015 Sami Tolvanen <samitolvanen@google.com> am 93c4b6c8: am ddaebb24: am 284c5cb2: Merge "Set verity mode as the verified property value"

* commit '93c4b6c85ac4350029e1a78c16663f61c777ac14':
Set verity mode as the verified property value
284c5cb2a16d21e5d5123ae6a0d731dcc6beadca 07-Apr-2015 Sami Tolvanen <samitolvanen@google.com> Merge "Set verity mode as the verified property value"
c410b3bd63828730623b9c5ccf15242175ac3c10 26-Mar-2015 Paul Lawrence <paullawrence@google.com> Revert "Revert "Adding e4crypt support""

Fix build break caused by original change

This reverts commit 84b0bab58fcc7f225e9a17a15c531b0c2fc509c5.

(cherry picked from commit bbb4c85bdcc9a1bce315ed9d61a228bb1b992a1c)

Change-Id: If0ead0f2656b69f33f72c64b03a05784455a4143
/system/core/fs_mgr/include/fs_mgr.h
b8c9d273a07f3fc45780e763bb3f7f6266b8cab7 26-Mar-2015 Paul Lawrence <paullawrence@google.com> Revert "Revert "Adding e4crypt support""

Fix build break caused by original change

This reverts commit 84b0bab58fcc7f225e9a17a15c531b0c2fc509c5.

Change-Id: I99fbd7c3d1ed92db1f546033c8493bb71a327924
/system/core/fs_mgr/include/fs_mgr.h
454742392f72079dbdb0d23ea24e01b5703c1aa5 30-Mar-2015 Sami Tolvanen <samitolvanen@google.com> Set verity mode as the verified property value

Set the verity mode as the value for partition.%s.verified to make it
easier for userspace to determine in which mode dm-verity was started.

Change-Id: Icc635515f8a8ede941277aed196867351d8387cb
/system/core/fs_mgr/include/fs_mgr.h
b042a2e8bdb932d13fd2684d90cf92db09b6039f 26-Mar-2015 Sami Tolvanen <samitolvanen@google.com> am c28e2598: am 3fdc2f2b: am d33c6c0e: Merge "Use structured format for verity metadata"

* commit 'c28e2598af394834dbf6532f1cf252705fabd76b':
Use structured format for verity metadata
84b0bab58fcc7f225e9a17a15c531b0c2fc509c5 26-Mar-2015 Paul Lawrence <paullawrence@google.com> Revert "Adding e4crypt support"

This reverts commit 6095afc115fe3a4b7d151b4fcc164e00f9df9659.

Change-Id: Icedfe0036223d7f42eaaefc4a35ad0f2efb14e4e
/system/core/fs_mgr/include/fs_mgr.h
946a0f3e1925c8cc9be08e3e34758d577cbe7f31 22-Mar-2015 Sami Tolvanen <samitolvanen@google.com> Use structured format for verity metadata

Specify the location of verity metadata in fstab, and use a
type-length-value format for the metadata that allows other
data to be stored in the same location in an extensible way.

Change-Id: Id8711f7d51dc1e4e9a4d84f9951240f64528e69d
/system/core/fs_mgr/include/fs_mgr.h
6095afc115fe3a4b7d151b4fcc164e00f9df9659 26-Feb-2015 Paul Lawrence <paullawrence@google.com> Adding e4crypt support

Add file encryption flag to fstab.

If file encryption flag set in fstab, handle identically to block
encrypted volumes.

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

Change-Id: I28c236959f2d7d5f0dccc8ea45c325ea0cf871fc
/system/core/fs_mgr/include/fs_mgr.h
ef0947479a5ae489d529acbe41898f54235d7578 20-Mar-2015 Sami Tolvanen <samitolvanen@google.com> am 54bac178: am ddd0639e: Merge "Add init command to set verified properties"

* commit '54bac178ce0ee9d243bfbfc9c18dafbb14cd3f92':
Add init command to set verified properties
acbf9bef43bc650ed84ba891183ebdf689dafb64 19-Mar-2015 Sami Tolvanen <samitolvanen@google.com> Add init command to set verified properties

Add a command that updates dm-verity state and sets partition.%.verified
properties used by adb remount.

This is needed in init since fs_mgr cannot set properties:
I6a28cccb1ccce960841af20a4b20c32d424b5524

Change-Id: I0fdf5bc29c56690dcadff9d0eb216d3c68483538
/system/core/fs_mgr/include/fs_mgr.h
fe6fcc4cc16a7b6c23910c24372cf1f6bce5006a 06-Mar-2015 JP Abgrall <jpa@google.com> fs_mgr: recognize a notrim mountpoint flag

Some partitions don't need trimming.
Needs a vold:fstrim change

Bug: 19624276
Change-Id: I8df715bd18688d7921afa2f3743f7d2a68760699
/system/core/fs_mgr/include/fs_mgr.h
6904e0c263a02f08c9c6f555dceafa2cce467954 04-Mar-2015 Sami Tolvanen <samitolvanen@google.com> am a88fb24a: Merge "Add fs_mgr support for dm-verity modes"

* commit 'a88fb24ab43eec9710a0d4d15aedb6d4bc51a2ec':
Add fs_mgr support for dm-verity modes
51bf11ad95aa871e4131edf4d9d72cc7c7034cdc 16-Feb-2015 Sami Tolvanen <samitolvanen@google.com> Add fs_mgr support for dm-verity modes

Add support for dm-verity modes and storing persistent state in
a location specified by the following properties:

ro.verity.state.location
ro.verity.state.offset

If these properties do not exist, dm-verity is always loaded in
EIO mode. If the properties do exist, but the location does not
have valid state data, dm-verity is loaded in RESTART mode. The
mode is updated to LOGGING if a dm-verity triggered restart has
occurred.

Change-Id: Ibb82953594d234f81ad21c40f524190b88e4ac8f
/system/core/fs_mgr/include/fs_mgr.h
317b4024a2a46b8c57abfa08f2a649df13572bd3 06-Feb-2015 Paul Lawrence <paullawrence@google.com> Revert "Make encryption configurable"

This reverts commit bda6272446454886339841a62daaa1b66c07ad60.

The original fix seems to have led to boot failures in QA. Rather than
risk shipping, revert the change. Bug 18764230 reopened.

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

Bug: 19278390
Bug: 19199624

Change-Id: I8b6ab585666f2b0f585ffb2a5f61ac2e3462e06e
/system/core/fs_mgr/include/fs_mgr.h
36d0eaecd7bd7970b91ac35d6753bf715097e3b9 21-Jan-2015 Paul Lawrence <paullawrence@google.com> Make encryption configurable

Delay mounting encryptable but unencrypted volumes until we can
check the ro.vold.forceencrypt flag, then optionally encrypt.

Requires matching vold change from
https://googleplex-android-review.git.corp.google.com/#/c/615309/

Bug: 18764230
Change-Id: If22008be8de6a4f3216b349f81ace49be1730314
/system/core/fs_mgr/include/fs_mgr.h
bda6272446454886339841a62daaa1b66c07ad60 21-Jan-2015 Paul Lawrence <paullawrence@google.com> Make encryption configurable

Delay mounting encryptable but unencrypted volumes until we can
check the ro.vold.forceencrypt flag, then optionally encrypt.

Requires matching vold change from
https://googleplex-android-review.git.corp.google.com/#/c/615309/

Bug: 18764230
Change-Id: If22008be8de6a4f3216b349f81ace49be1730314
/system/core/fs_mgr/include/fs_mgr.h
ec900bba20630934dc51a1b3a57d6d7a30fed325 09-Oct-2014 Paul Lawrence <paullawrence@google.com> Revert "Revert "Enable verity on userdebug, and add disable-verity to adb""

This reverts commit 152d2d4234ba89e0c20c4af13e291b6049a7bc33.

Fixed build error, and also fixed memory leak spotted from warning.

(cherry-pick of bbb36319119edde9377fb80015235893c30d2bc9.)

Bug: 17691572
Change-Id: I23b5ba537f7b557432041d4338b38b9be434e981
/system/core/fs_mgr/include/fs_mgr.h
bbb36319119edde9377fb80015235893c30d2bc9 09-Oct-2014 Paul Lawrence <paullawrence@google.com> Revert "Revert "Enable verity on userdebug, and add disable-verity to adb""

This reverts commit 152d2d4234ba89e0c20c4af13e291b6049a7bc33.

Fixed build error, and also fixed memory leak spotted from warning.

Bug: 17691572
Change-Id: I23b5ba537f7b557432041d4338b38b9be434e981
/system/core/fs_mgr/include/fs_mgr.h
152d2d4234ba89e0c20c4af13e291b6049a7bc33 09-Oct-2014 Nick Kralevich <nnk@google.com> Revert "Enable verity on userdebug, and add disable-verity to adb"

Build is broken.

system/core/fs_mgr/fs_mgr_verity.c: In function 'fs_mgr_setup_verity':
system/core/fs_mgr/fs_mgr_verity.c:103:20: error: 'verity_table_signature' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (!RSA_verify(key,
^
system/core/fs_mgr/fs_mgr_verity.c:374:11: note: 'verity_table_signature' was declared here
char *verity_table_signature;
^
cc1: all warnings being treated as errors
make: *** [out/target/product/minnow/obj/STATIC_LIBRARIES/libfs_mgr_intermediates/fs_mgr_verity.o] Error 1
make: *** Waiting for unfinished jobs....

This reverts commit d4cea0bc16d1ad96cc6d6177232d7b339785460c.

Change-Id: I6862cc79ef9d944a2472b6fb2e46dae514cea8ce
/system/core/fs_mgr/include/fs_mgr.h
d4cea0bc16d1ad96cc6d6177232d7b339785460c 07-Oct-2014 Paul Lawrence <paullawrence@google.com> Enable verity on userdebug, and add disable-verity to adb

Bug: 17691572

Change-Id: I58f588f318e7952d06a41325337d946d7c007e31
/system/core/fs_mgr/include/fs_mgr.h
cf234dc7e081ac4063c3c5ddcdd4da40c82d51cb 09-Sep-2014 Paul Lawrence <paullawrence@google.com> Preserve errno from fsmgr_do_mount

Bug: 17358530
Change-Id: I4cd7403c0b7c4f878d6afa5199f998e6f614adb9
/system/core/fs_mgr/include/fs_mgr.h
cee206880ef80ac570df6b369d12f111c00f653a 02-Jul-2014 JP Abgrall <jpa@google.com> [HACK]fs_mgr+init: Format via recovery if encryptable /data is wiped

If the encryptable partition is wiped (4KB worth of 0 or 0xff),
then reboot into recovery to format /data+/cache

This is while waiting for the Mac OS support to format f2fs.
The flashstation running on Mac OS will currently just erase userdata
and not format it with f2fs.

Bug: 15720406
Bug: 15747366
Change-Id: Ib7cca3e1701483a09573457a835750f34da71ee0
/system/core/fs_mgr/include/fs_mgr.h
f22b7452940c99b830749cabdd929f9f7cfdaacc 02-Jul-2014 JP Abgrall <jpa@google.com> fs_mrg: clean up multi-type mount_all

Move the code that attempts to mount alternative fstab entries
into its own function.
Clarify return codes.
Suggest wipe via recovery in error messages.

Bug: 15747366
Change-Id: I3634477cd4d1d73f974f3e906c53285f0d9e0eac
Signed-off-by: JP Abgrall <jpa@google.com>
/system/core/fs_mgr/include/fs_mgr.h
5c01dac6d81a804dcff233da777882bec852f25b 18-Jun-2014 JP Abgrall <jpa@google.com> fsmgr: support multiple fs-types/mountpoint

Previous attempt was broken.
It would incorrectly be affected by mount failures.

This changes allows an fstab to contain multiple lines for a given
mount point.
The lines sharing a mount MUST be after each other.

The 1st matching line is the primary when it comes to mounting
and look ups for wiping.

Mounting based on a mount_point will attempt each dup in turn
until one succeeds.
The reported error will be that of the last failed attempt.

This is to allow quick experimentation between different FSes.

Bug: 15702546
Change-Id: I378d68ad13eb0098ec1ccb8dcf108b82acbe9ebb
Signed-off-by: JP Abgrall <jpa@google.com>
/system/core/fs_mgr/include/fs_mgr.h
f786fe54388cb4461f8e13845ca6a1df0d2e1236 18-Jun-2014 JP Abgrall <jpa@google.com> fsmgr: revert multiple fs-types/mountpoint (fix N5 boot)

This is apparently breaking N5, so reverting for now.

This reverts commit a794f86522f9125f2547c94ebc7c74d1e7ace013.

Bug: 15709256
Change-Id: I37a5160eead17e153e2c83fa94632ffa5d8553c2
/system/core/fs_mgr/include/fs_mgr.h
a794f86522f9125f2547c94ebc7c74d1e7ace013 18-Jun-2014 JP Abgrall <jpa@google.com> fsmgr: allow for a multiple fs-types for a mount point.

This changes allows an fstab to contain multiple lines for a given
mount point.
The lines sharing a mount MUST be after each other.

The 1st matching line is the primary when it comes to mounting
and look ups for wiping.

Mounting based on a mount_point will attempt each dup in turn
until one succeeds.

This is to allow quick experimentations between different FSes.
It does not deal with checkfs yet, because the underlying invocation
of fs-type appropriate fsck does not handle the error code.
Only the primary FS (1st in the dups) is checked.

Change-Id: I8329737454b53e2681436fe85cd00a9bc522676b
Signed-off-by: JP Abgrall <jpa@google.com>
/system/core/fs_mgr/include/fs_mgr.h
cdc1cfb3e51f3caddc1f290b46dc789c036f22ed 11-Apr-2014 Sasha Levitskiy <sanek@google.com> Cleanup: warning fixit.

bootable/recovery has a dependent commit: I9adb470b04e4301989d128c9c3097b21b4dea431

Change-Id: Icf23e659265d71d5226d527c2b40cfbc132320ee
Signed-off-by: Sasha Levitskiy <sanek@google.com>
/system/core/fs_mgr/include/fs_mgr.h
887f2892062c64fa688fc9525ebd09cc98ca70d8 12-Sep-2013 Ken Sumrall <ksumrall@android.com> New fstab flags to support more expressive SD card permissions

Bug: 10330128

Change-Id: I41fb178b839487b604762fbc1ccba097d25c7aa0
/system/core/fs_mgr/include/fs_mgr.h
3ad3d1c4b5856d4e314febc5671c74e78a76db00 23-Feb-2013 Geremy Condra <gcondra@google.com> Add basic verity support to fs_mgr.

This change adds a "verify" fs_mgr flag specifying that
the device in question should be verified.

Devices marked with this flag are expected to have a
footer immediately after their data containing all
the information needed to set up a verity instance.

Change-Id: I10101f2c3240228ee0932e3767fe35e673d2e720
/system/core/fs_mgr/include/fs_mgr.h
5bc31a2632f453e03edac714b865773970bba608 09-Jul-2013 Ken Sumrall <ksumrall@android.com> Add support for swap entries in fstab

Swap entries can optionally specify a swapprio= or zramsize= flag
in the fs_mgr flags field.

Change-Id: I30530501efd4112af4e158898a9f65f6443c4fdb
/system/core/fs_mgr/include/fs_mgr.h
ab6b852235d99d752678312c155a3f1c140fb483 13-Feb-2013 Ken Sumrall <ksumrall@android.com> fs_mgr: support a unified fstab format.

Update fs_mgr to support more flags needed to unify the 3
fstabs currently in android into one.

Change-Id: Ie46cea61a5b19882c55098bdd70f39e78fb603be
/system/core/fs_mgr/include/fs_mgr.h
7574c035b2dcf8316c562c648113be6be65cb061 07-Jan-2012 Ken Sumrall <ksumrall@android.com> A filesystem manager library to mount filesystems for init.

Instead of specifying in init what to mount, and having various hacks in init
itself to deal with encryption, use a filesystem manager library to do the
work, that can also be invoked by vold when mounting an encrypted volume.
Keep all the magic filesystem info an a device specific fstab file.

Change-Id: Ib988f1e4fb0638ba1d5fd98407fa6d8cf862aaca
/system/core/fs_mgr/include/fs_mgr.h