Commit graph

638 commits

Author SHA1 Message Date
Christopher Morin
017ec6d3a3 Merge "fs_mgr: don't log error messages when missing fstab" am: ace69b2f7b am: e8493e7045
am: 9396edfd2a

Change-Id: I5a492d206299ff0841342796a483dbaebecabad5
2018-01-09 01:50:06 +00:00
Jeff Sharkey
f431cd84e4 Merge changes from topic "resgidz" am: a7004e5fed am: b162da3a47
am: c16340c646

Change-Id: Iaf01b79c1e51f4cba06ee9ea6227c00a3cec4d4d
2018-01-09 01:49:29 +00:00
Christopher Morin
ace69b2f7b Merge "fs_mgr: don't log error messages when missing fstab" 2018-01-08 19:52:32 +00:00
Jeff Sharkey
a7004e5fed Merge changes from topic "resgidz"
* changes:
  Add reserved disk GID to critical component.
  Set reserved GID when setting reserved blocks.
  Allocate GID to use reserved disk space.
2018-01-08 18:17:50 +00:00
Christopher Morin
b22632cd9d Merge "fs_mgr: fix memory leak" am: 9bbcea1878 am: 9b205334d6
am: a7f3fef5cb

Change-Id: Idc2b90bc0a66131769b006f10f09cf92d3c4ccee
2018-01-08 09:58:20 +00:00
Jeff Sharkey
47dc236d2f Set reserved GID when setting reserved blocks.
If we're setting up the number of reserved blocks, we also want to
set our new AID_DISK_RESERVED as the GID that's allowed to use those
blocks.

Test: builds, boots
Bug: 62024591
Change-Id: Iaabfa7d63ad9ff0b9732e2b9996937607d622fe2
2018-01-07 19:24:55 -07:00
Chris Morin
b183e05c3c fs_mgr: don't log error messages when missing fstab
Some devices, such as android on chromebooks, don't need an fstab.

Test: Ensure no error messages are seen from fs_mgr when fstab is
missing.

Change-Id: Ifadb2193743a61d03f1becefd6bc81a61eb45081
2018-01-05 13:37:26 -08:00
Chris Morin
517ed633c2 fs_mgr: fix memory leak
The fstab struct wasn't properly being freed.

Test: Ensure a user of fs_mgr (vold) runs without errors.
Change-Id: I4dcb8ae2ab3e831fbdb13372eb31a67a5d9fb735
2018-01-04 18:48:21 -08:00
Bowgo Tsai
a6252d114f Merge "first stage mount: support mount points like /vendor/abc" am: edaa28771f am: 72db512c47
am: 11e94765c3

Change-Id: I1a28f9ab68ede7e5fe07c991036ed8cc52de6517
2017-12-14 06:57:41 +00:00
Treehugger Robot
edaa28771f Merge "first stage mount: support mount points like /vendor/abc" 2017-12-14 06:45:37 +00:00
Bowgo Tsai
8028189499 first stage mount: support mount points like /vendor/abc
Current syntax of the fstab in device tree (fstab_dt) assumes the
node name is the mount point, which doesn't allow subdir:

    vendor {   <== using "vendor/abc" leads to syntax error in device tree
        compatible = "android,vendor";
        dev = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor";
        type = "ext4";
        mnt_flags = "ro,barrier=1,inode_readahead_blks=8";
        fsmgr_flags = "wait";
    };

This CL adds a new field "mnt_point" in the fstab_dt configuration:

    vendor_abc {
        compatible = "android,vendor_abc";
        dev = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/abc";
        type = "ext4";
        mnt_flags = "ro,barrier=1,inode_readahead_blks=8";
        mnt_point = "/vendor/abc";                          <== new field
        fsmgr_flags = "wait";
    };

The new field is optional and will fallback to using node name as mount
point if it is absent.

Note that this CL also sorts fstab_dt by mount point, because
/vendor needs to be mounted first, which contains a directory
/vendor/abc, before /vendor/abc can be mounted.

Bug: 69955336
Test: first stage mount /vendor/abc on a device
Change-Id: Ie2e519f9801f211a7a221622f32c82bedd00353f
2017-12-14 09:48:26 +08:00
Elliott Hughes
3e2b34136a Merge "Add OWNERS." am: 3289b9c928 am: 515c8fe572
am: aede8375fe

Change-Id: I28f7a8f3fa9c9837f4043768e70c0d985ed95abd
2017-12-08 01:29:20 +00:00
Jaegeuk Kim
ec87074542 Merge changes from topic "sload_f2fs"
* changes:
  fastboot/fs_mgr/init: add sload_f2fs
  fs_mgr: format f2fs with length=xx fstab
2017-12-08 00:57:42 +00:00
Elliott Hughes
ffeade5465 Merge "Remove dead code." am: a78c686799 am: 4cc92cc03f
am: 99cbff8058

Change-Id: I34c5f9c553b108a32705883e682c13931cdbf033
2017-12-08 00:17:42 +00:00
Elliott Hughes
3289b9c928 Merge "Add OWNERS." 2017-12-07 23:21:26 +00:00
Elliott Hughes
693d63f9cf Add OWNERS.
Bug: N/A
Test: N/A
Change-Id: Ie785058c0f5eb9b4086c98ccba6e63e3ed411b65
2017-12-07 13:30:03 -08:00
Jaegeuk Kim
6a3967a64b fs_mgr: format f2fs with length=xx fstab
Merged-In: Icce29ad918f20b16c9908e7fa3ae19eb8c96760b
Change-Id: Icce29ad918f20b16c9908e7fa3ae19eb8c96760b
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
(cherry picked from commit a367430734)
2017-12-06 22:37:57 -08:00
Elliott Hughes
a78c686799 Merge "Remove dead code." 2017-12-07 00:44:56 +00:00
Elliott Hughes
231f1e664d Remove dead code.
Bug: N/A
Test: boots
Change-Id: Id901d95aa05d26767aa5d956ac6e167db1cc3036
2017-12-06 12:38:41 -08:00
Jaegeuk Kim
2decf61b2d fs_mgr: support quota format for f2fs
This patch adds -O quota for make_f2fs to activate disk quotas, and add -d1 to
show debug messages which was set in all the other make_f2fs calls.

Change-Id: I33ab0f585b1081ff88f298286378f9ff70579b3f
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2017-11-16 22:10:02 -08:00
Xin Li
23e27db576 Merge commit 'a63ccea6abc7ea02e2d98e41c80793ca97237bd3' from
oc-mr1-dev-plus-aosp into stage-aosp-master

Change-Id: Ia33311cd1fd26dfaea59a69317b306fb91203c40
Merged-In: I03d06b10807e8a313c9654c2e1db36bfb59e3f99
2017-11-14 13:19:45 -08:00
Treehugger Robot
6b07ee9fb5 Merge "DO NOT MERGE ANYWHERE Add comments and code about ro.boot.slot back" 2017-11-13 16:36:34 +00:00
Bowgo Tsai
00e169ece6 Merge "first stage mount: abort when failed to parse fstab in device-tree" am: d0d7346dc7 am: 9a9469faeb
am: 71096ca58a

Change-Id: I2367c51e77d5edfb30286188f58fcd8e0ebe3195
2017-11-11 01:55:59 +00:00
Bowgo Tsai
71096ca58a Merge "first stage mount: abort when failed to parse fstab in device-tree" am: d0d7346dc7
am: 9a9469faeb

Change-Id: I771fb1be04a12e8166292442a70b9529368c88b5
2017-11-11 01:53:51 +00:00
Sandeep Patil
25f1631aa7 DO NOT MERGE ANYWHERE Add comments and code about ro.boot.slot back
Taimen bootloader passes androidboot.slot for now.
This reverts commit 211a4a5d5a.

Bug: 68710251
Test: taimen successfully mounts partition in first stage
Change-Id: I046afc99120e7ec9ef4b8ea7a852eb70e7231ea9
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-11-10 16:20:27 -08:00
Bowgo Tsai
ec19cf6306 first stage mount: abort when failed to parse fstab in device-tree
The client of FirstStageMount class should check the existence of fstab
in device-tree prior to using it. So raising a FATAL error inside
FirstStageMount when failed to parsing the fstab, in order to expose
more accurate error messages.

Also fixing a comment in fs_mgr, where it might happen in either
non-A/B or A/B.

Bug: 69102431
Test: boot sailfish
Change-Id: Ifb525beaa3423b118644778bfe0f84bff9465303
2017-11-10 12:53:46 +08:00
Oleg Matcovschi
342b9e534c Merge "fs_mgr: support reading fstab based on ro.boot.hardware.platform" am: 3d879b10d8 am: 45aa5ed89a
am: 317ec5cf5b

Change-Id: I750a68f64cab44ac05922ca9b6c57ca59768c367
2017-11-01 21:56:29 +00:00
Chih-Hung Hsieh
a5c93733a6 Merge "Use -Werror in system/core" am: 4ef714eae0 am: 57270f809a
am: 6e28ff2ce6

Change-Id: I4549365b266f536fb076dd637d1e3259e27d73b9
2017-11-01 21:55:47 +00:00
Oleg Matcovschi
317ec5cf5b Merge "fs_mgr: support reading fstab based on ro.boot.hardware.platform" am: 3d879b10d8
am: 45aa5ed89a

Change-Id: I71f449c2ae0a24a736f460cb64e501e09485bf30
2017-11-01 21:24:35 +00:00
Chih-Hung Hsieh
6e28ff2ce6 Merge "Use -Werror in system/core" am: 4ef714eae0
am: 57270f809a

Change-Id: If5d4ec1749ff2acbce781b0b6678a53fc7169d90
2017-11-01 21:23:58 +00:00
Treehugger Robot
3d879b10d8 Merge "fs_mgr: support reading fstab based on ro.boot.hardware.platform" 2017-11-01 20:46:22 +00:00
Chih-Hung Hsieh
122352d983 Use -Werror in system/core
* Move -Wall -Werror from cppflags to cflags.
* Fix/suppress warning on unused variables.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I1e05e96a1d0bcb2ccef1ce456504b3af57167cc5
2017-11-01 11:32:55 -07:00
Oleg Matcovschi
018d7f69da fs_mgr: support reading fstab based on ro.boot.hardware.platform
This change adds fstab.${ro.boot.hardware.platform} file into list of
searched fstab filenames.
The ${ro.boot.hardware.platform} helps consolidate init sequence based
on platform. Potentially it allows same build serve different devices.

Bug: 68663168
Change-Id: I822d5bc432e823218ebc640093cfbe5e9271d3b1
2017-11-01 09:38:21 -07:00
Bowgo Tsai
609a29956b Merge "fs_mgr: removing is_device_secure()" am: af54c27e1b am: 6353d514e8 am: ee042cac71
am: 2da820c0ab

Change-Id: I5f111f4e0b47dfc6a5da35cbbec2b842c6e72150
2017-10-15 04:14:53 +00:00
Bowgo Tsai
2da820c0ab Merge "fs_mgr: removing is_device_secure()" am: af54c27e1b am: 6353d514e8
am: ee042cac71

Change-Id: I3579738b8d9a3d4026294ba3392b56a55aedb9a9
2017-10-15 03:26:47 +00:00
Bowgo Tsai
6353d514e8 Merge "fs_mgr: removing is_device_secure()"
am: af54c27e1b

Change-Id: I22cac8bba9115765527b2c484b4ce9c15fe816cc
2017-10-15 02:48:33 +00:00
Bowgo Tsai
744361fc57 fs_mgr: removing is_device_secure()
Previously there is no vboot 1.0 metadata for ENG builds. It relies on
is_device_secure() to query "ro.secure" and skip setting up dm-verity
if the value is 0 (meaning ENG build).

This change will be submitted together with other changes to add vboot
1.0 metadata for ENG builds with a "disable magic". The resulting
metadata will be the same as triggering an "adb disable-verity" on an
USERDEBUG image.

Bug: 63056044
Test: boot sailfish eng/userdebug builds

Change-Id: I35eef771e1b30bfc6d01b8ed76b40c942fe7b783
2017-10-13 06:34:12 +08:00
Tom Cherry
0d946de389 Merge "Move some properties users to __system_property_read_callback()" am: 4a5a337ef2 am: 604f61dcbd am: 6597b95707
am: 33c3c190f7

Change-Id: I40a1f94388407d4c79437f44b64006609830fa9d
2017-10-12 17:14:22 +00:00
Tom Cherry
33c3c190f7 Merge "Move some properties users to __system_property_read_callback()" am: 4a5a337ef2 am: 604f61dcbd
am: 6597b95707

Change-Id: Ib6763ccc6a0b02949c6a0e004c18502cac7ea46f
2017-10-12 17:08:32 +00:00
Tom Cherry
604f61dcbd Merge "Move some properties users to __system_property_read_callback()"
am: 4a5a337ef2

Change-Id: Ia1553f78fc024d2c43ef9ddb0c191b7fe83a87ff
2017-10-12 17:01:14 +00:00
Tom Cherry
4a5a337ef2 Merge "Move some properties users to __system_property_read_callback()" 2017-10-12 16:53:41 +00:00
Bowgo Tsai
faaed16548 Merge "fs_mgr: removing __BEGIN_DECLS and __END_DECLS" am: 85b80dc18d am: a4b15d7e2c am: c13381d680
am: 5bcacab65f

Change-Id: I5273783cdf84cca84084bb9b3513d68bef2af203
2017-10-11 02:08:06 +00:00
Bowgo Tsai
5bcacab65f Merge "fs_mgr: removing __BEGIN_DECLS and __END_DECLS" am: 85b80dc18d am: a4b15d7e2c
am: c13381d680

Change-Id: I06eb6e086a1fbdff4de1c4bed28d136c5e81caab
2017-10-11 02:02:30 +00:00
Bowgo Tsai
a4b15d7e2c Merge "fs_mgr: removing __BEGIN_DECLS and __END_DECLS"
am: 85b80dc18d

Change-Id: I6c86972b32534f7962656531de072a2ccc654ed8
2017-10-11 01:53:35 +00:00
Tom Cherry
31121cafec Move some properties users to __system_property_read_callback()
This is needed if they will ever handle ro. properties that have
values longer than 92 characters.

Bug: 23102347
Bug: 34954705
Test: read and write properties with value length > 92 characters
Change-Id: I44aa135c97ec010f12162c30f743387810ae2c5d
2017-10-10 15:03:33 -07:00
Bowgo Tsai
d837f837ad fs_mgr: removing __BEGIN_DECLS and __END_DECLS
fs_mgr isn't usable by C now as we've migrated all fs_mgr clients in AOSP
to CPP. Removing the support for C clients.

Bug: 67024518
Bug: 67444051
Test: boot sailfish

Change-Id: Iac57f51eb6a524c6dcdc625c83af75602b4f9b3b
2017-10-10 18:17:29 +08:00
Bowgo Tsai
85a4b43b74 Merge "fs_mgr_fstab: removing fs_mgr_get_entry_for_mount_point_after()" am: 16e31801a5 am: b08be62fca am: af8315d4de
am: 772b0833e0

Change-Id: I436f36b974ef46186229b6cc4198a4e23c1b6390
2017-09-30 01:17:47 +00:00
Bowgo Tsai
772b0833e0 Merge "fs_mgr_fstab: removing fs_mgr_get_entry_for_mount_point_after()" am: 16e31801a5 am: b08be62fca
am: af8315d4de

Change-Id: I479153f77d9308f56412e9a991a6b669cf390d97
2017-09-30 01:12:14 +00:00
Bowgo Tsai
b08be62fca Merge "fs_mgr_fstab: removing fs_mgr_get_entry_for_mount_point_after()"
am: 16e31801a5

Change-Id: I59b8971b02f59f16082bc48ef96203ef13788277
2017-09-29 08:38:15 +00:00
Bowgo Tsai
c55f188207 fs_mgr_fstab: removing fs_mgr_get_entry_for_mount_point_after()
No fs_mgr client is using fs_mgr_get_entry_for_mount_point_after(), which
supports matching a mount point iteratively by specifying a starting entry
in the fstab. So removes it.

Also switch the public API from C/C++ to C++-only:
    fs_mgr_get_entry_for_mount_point(struct fstab* fstab, const char* path);
==> fs_mgr_get_entry_for_mount_point(struct fstab* fstab, const std::string& path);

Bug: 67024518
Test: boot sailfish, manually test fs_mgr_get_entry_for_mount_point().

Change-Id: I38e18fa6bd9485b6cd31b55474406a511df3f506
2017-09-28 15:28:59 +08:00