Commit graph

64869 commits

Author SHA1 Message Date
Alessio Balsini
2a1778d340 libsnapshot: Export COW image size
Enable libsnapshot to export the size of the COW image, representing the
fraction of the COW device that is temporarily created in the /data
partition, computed just before initializing a merge operation.
Thise additional information can be used by other components (i.e.,
update engine) to enrich Virtual A/B metrics.

Bug: 154016862
Test: manual OTA
Signed-off-by: Alessio Balsini <balsini@google.com>
Change-Id: I4faa0785f23884e26161e0d51268dd7a305d86bf
2020-05-29 11:59:24 +01:00
Christopher Ferris
d80fc05550 [automerger skipped] Fail explicitly on length overflow. am: bff51b88aa -s ours am: 4f82ed57bd -s ours am: 5ab86ec2f2 -s ours am: 1518d88d3e -s ours
am skip reason: Change-Id Ie49975b8949fd12bbde14346ec9bbb774ef88a51 with SHA-1 bff51b88aa is in history

Change-Id: I30f9950c043a05750e54fe6b24c2952f995bae93
2020-05-29 01:35:34 +00:00
Automerger Merge Worker
92a49637f7 Merge "[automerger skipped] Fail explicitly on length overflow. am: bff51b88aa am: 14fa9c6645 am: b5d10d60e4 -s ours" into rvc-qpr-dev-plus-aosp am: a4fd3120d7 -s ours
am skip reason: Change-Id Ie49975b8949fd12bbde14346ec9bbb774ef88a51 with SHA-1 bff51b88aa is in history

Change-Id: I61a42091b2c04c0857526c15d42c1cc51aa5ca19
2020-05-29 01:35:26 +00:00
Christopher Ferris
f3f530fb0f [automerger skipped] Fail explicitly on length overflow. am: bff51b88aa am: 14fa9c6645 -s ours am: 6e668529c9 -s ours am: d22a828fe1 -s ours
am skip reason: Change-Id Ie49975b8949fd12bbde14346ec9bbb774ef88a51 with SHA-1 68604b9c29 is in history

Change-Id: Ic56db1c7f86b07d9798b2c1362364082a416d72b
2020-05-29 01:35:10 +00:00
Christopher Ferris
1518d88d3e [automerger skipped] Fail explicitly on length overflow. am: bff51b88aa -s ours am: 4f82ed57bd -s ours am: 5ab86ec2f2 -s ours
am skip reason: Change-Id Ie49975b8949fd12bbde14346ec9bbb774ef88a51 with SHA-1 bff51b88aa is in history

Change-Id: I2d17f7f57421b14fbdc310dec06f943f9544d6cf
2020-05-29 01:22:53 +00:00
Automerger Merge Worker
a4fd3120d7 Merge "[automerger skipped] Fail explicitly on length overflow. am: bff51b88aa am: 14fa9c6645 am: b5d10d60e4 -s ours" into rvc-qpr-dev-plus-aosp 2020-05-29 01:22:52 +00:00
Christopher Ferris
1a92306dde [automerger skipped] Fail explicitly on length overflow. am: bff51b88aa am: 14fa9c6645 am: b5d10d60e4 -s ours
am skip reason: Change-Id Ie49975b8949fd12bbde14346ec9bbb774ef88a51 with SHA-1 68604b9c29 is in history

Change-Id: Id35ba0569b03f3aef6cc925baca29d4f5d649765
2020-05-29 01:22:46 +00:00
Christopher Ferris
d22a828fe1 [automerger skipped] Fail explicitly on length overflow. am: bff51b88aa am: 14fa9c6645 -s ours am: 6e668529c9 -s ours
am skip reason: Change-Id Ie49975b8949fd12bbde14346ec9bbb774ef88a51 with SHA-1 68604b9c29 is in history

Change-Id: I551c96f010fa5c7b269681002312d2cd38b2aac0
2020-05-29 01:22:42 +00:00
Christopher Ferris
5ab86ec2f2 [automerger skipped] Fail explicitly on length overflow. am: bff51b88aa -s ours am: 4f82ed57bd -s ours
am skip reason: Change-Id Ie49975b8949fd12bbde14346ec9bbb774ef88a51 with SHA-1 bff51b88aa is in history

Change-Id: I3f8b8eb76f73f6b39971f2399f90c1225a136398
2020-05-29 01:18:09 +00:00
Christopher Ferris
b5d10d60e4 Fail explicitly on length overflow. am: bff51b88aa am: 14fa9c6645
Change-Id: Ida4a6a83dddfe5b79038b699d43d1ed65c63ebd3
2020-05-29 01:10:04 +00:00
Christopher Ferris
6e668529c9 [automerger skipped] Fail explicitly on length overflow. am: bff51b88aa am: 14fa9c6645 -s ours
am skip reason: Change-Id Ie49975b8949fd12bbde14346ec9bbb774ef88a51 with SHA-1 68604b9c29 is in history

Change-Id: I191153e6bd3e904a1f23b363fa28b9ec3c5bcbe0
2020-05-29 01:10:04 +00:00
Christopher Ferris
4f82ed57bd [automerger skipped] Fail explicitly on length overflow. am: bff51b88aa -s ours
am skip reason: Change-Id Ie49975b8949fd12bbde14346ec9bbb774ef88a51 with SHA-1 68604b9c29 is in history

Change-Id: I7eaaa53f408d2c1b2e7ea4c85b55c32e3361ad9e
2020-05-29 00:57:53 +00:00
Christopher Ferris
14fa9c6645 Fail explicitly on length overflow. am: bff51b88aa
Change-Id: I32ab0d7fd109283f47914aef7bdbd9f220f3c1e3
2020-05-29 00:56:38 +00:00
Christopher Ferris
bff51b88aa Fail explicitly on length overflow.
Instead of aborting when FileMap::create detects an overflow, detect the
overflow directly and fail the call.

Bug: 156997193

Test: Ran unit tests, including new unit test that aborted before.
Merged-In: Ie49975b8949fd12bbde14346ec9bbb774ef88a51
Change-Id: Ie49975b8949fd12bbde14346ec9bbb774ef88a51
(cherry picked from commit 68604b9c29)
2020-05-28 15:46:51 -07:00
Steven Moreland
fcd8ed55cb Merge "String16::remove - avoid overflow" 2020-05-28 20:06:34 +00:00
TreeHugger Robot
0ff588afbd [automerger skipped] Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev am: 87ee2378de am: 5deb52967b am: 8c4d766269 -s ours am: f0b35c8a21 -s ours
am skip reason: Change-Id I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c with SHA-1 c631f94c77 is in history

Change-Id: I6f24f3f302882d7cf2a63eee8eee2777038e79c4
2020-05-28 18:31:08 +00:00
TreeHugger Robot
cca2e025f1 [automerger skipped] Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev am: 87ee2378de -s ours am: a913d2648c -s ours am: 5ad43a35a1 -s ours am: a4a1490349 -s ours
am skip reason: Change-Id I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c with SHA-1 c631f94c77 is in history

Change-Id: I14ad4bc3f8b9dc086cb26775a97734530942464a
2020-05-28 18:30:33 +00:00
TreeHugger Robot
6c3d7b5799 [automerger skipped] Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev am: 87ee2378de am: 5deb52967b -s ours am: b0c0a4f76c -s ours am: fd0dc4fd94 -s ours
am skip reason: Change-Id I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c with SHA-1 a2cc1ebb72 is in history

Change-Id: Ibabb9415fc925a19385d2aa4289ef9b04525bb55
2020-05-28 18:29:26 +00:00
TreeHugger Robot
f0b35c8a21 [automerger skipped] Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev am: 87ee2378de am: 5deb52967b am: 8c4d766269 -s ours
am skip reason: Change-Id I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c with SHA-1 c631f94c77 is in history

Change-Id: Icb1685e24500dc2b54b99f8d741c02f11b179669
2020-05-28 18:12:00 +00:00
TreeHugger Robot
a4a1490349 [automerger skipped] Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev am: 87ee2378de -s ours am: a913d2648c -s ours am: 5ad43a35a1 -s ours
am skip reason: Change-Id I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c with SHA-1 c631f94c77 is in history

Change-Id: I9713467c0e2c9429eeffee88263b981e71e42f7a
2020-05-28 18:11:51 +00:00
TreeHugger Robot
fd0dc4fd94 [automerger skipped] Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev am: 87ee2378de am: 5deb52967b -s ours am: b0c0a4f76c -s ours
am skip reason: Change-Id I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c with SHA-1 a2cc1ebb72 is in history

Change-Id: I5a86a4f57768c81ee7812453f4e479d35bde8065
2020-05-28 18:10:52 +00:00
TreeHugger Robot
5ad43a35a1 [automerger skipped] Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev am: 87ee2378de -s ours am: a913d2648c -s ours
am skip reason: Change-Id I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c with SHA-1 c631f94c77 is in history

Change-Id: I600a93630d381239f6630ab484360e5da42bcaeb
2020-05-28 17:51:23 +00:00
TreeHugger Robot
8c4d766269 Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev am: 87ee2378de am: 5deb52967b
Change-Id: Ib06a59a90d5df2c8544644fc7d43a7d70fa6cf43
2020-05-28 17:51:17 +00:00
TreeHugger Robot
b0c0a4f76c [automerger skipped] Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev am: 87ee2378de am: 5deb52967b -s ours
am skip reason: Change-Id I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c with SHA-1 a2cc1ebb72 is in history

Change-Id: I05d8491a4238ac4c8c91305f2c4b4bbaf57b7822
2020-05-28 17:50:36 +00:00
TreeHugger Robot
5deb52967b Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev am: 87ee2378de
Change-Id: Ic154da64a7f07f052c874842b08ddaf9d12a271f
2020-05-28 17:31:40 +00:00
TreeHugger Robot
a913d2648c [automerger skipped] Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev am: 87ee2378de -s ours
am skip reason: Change-Id I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c with SHA-1 a2cc1ebb72 is in history

Change-Id: Ib85cadc0fc64c4d4635202468c8f01fe2047bdc1
2020-05-28 17:28:39 +00:00
TreeHugger Robot
87ee2378de Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev 2020-05-28 17:05:49 +00:00
Tom Cherry
d0294ee425 Merge changes I5cf0d014,Ib46f0646 am: 609630e7ba am: d090042c44 am: 4644c78ffe am: 3e1c7b4775 am: bc06740bdb
Change-Id: I657c8aa015e09867182c4f125b5d05c70711ff54
2020-05-28 16:27:45 +00:00
Elliott Hughes
5b01199fbe Merge "Make systemTime() abort on bad input." am: 49cd73754e am: 9e4815691d am: bd81e6f1d5 am: e863944567 am: 07413a6f85
Change-Id: I775902300685fb71d4c5ec2031973ba0184c9a2d
2020-05-28 16:27:05 +00:00
Tom Cherry
bc06740bdb Merge changes I5cf0d014,Ib46f0646 am: 609630e7ba am: d090042c44 am: 4644c78ffe am: 3e1c7b4775
Change-Id: Id4f6639b0620405d16265dd1a71f99296196b04f
2020-05-28 16:08:15 +00:00
Elliott Hughes
07413a6f85 Merge "Make systemTime() abort on bad input." am: 49cd73754e am: 9e4815691d am: bd81e6f1d5 am: e863944567
Change-Id: I8abe34cc46c824d7392d984de6de884120d54f64
2020-05-28 16:07:54 +00:00
Tom Cherry
3e1c7b4775 Merge changes I5cf0d014,Ib46f0646 am: 609630e7ba am: d090042c44 am: 4644c78ffe
Change-Id: I31e9dbe495f0dc85cc8a0859b4f6fa2ca5cc7f25
2020-05-28 15:48:02 +00:00
Elliott Hughes
e863944567 Merge "Make systemTime() abort on bad input." am: 49cd73754e am: 9e4815691d am: bd81e6f1d5
Change-Id: I88d7b8504511de3736297a079efcc6e3b24aca85
2020-05-28 15:47:47 +00:00
Tom Cherry
4644c78ffe Merge changes I5cf0d014,Ib46f0646 am: 609630e7ba am: d090042c44
Change-Id: I552b8b216c2918826053657dac1c6a6786ede3e6
2020-05-28 15:35:36 +00:00
Elliott Hughes
bd81e6f1d5 Merge "Make systemTime() abort on bad input." am: 49cd73754e am: 9e4815691d
Change-Id: Ie0670256eb5afcf4be34c0aa5ad8db2c12e93ca6
2020-05-28 15:35:26 +00:00
Tom Cherry
d090042c44 Merge changes I5cf0d014,Ib46f0646 am: 609630e7ba
Change-Id: I66754d24b58cde35284b4e0b0621e3f40b587948
2020-05-28 15:29:37 +00:00
Tom Cherry
609630e7ba Merge changes I5cf0d014,Ib46f0646
* changes:
  logd: remove LogBufferElement dependency of LogReaderThread
  logd: rename FlushToResult to FilterResult
2020-05-28 15:25:20 +00:00
Elliott Hughes
9e4815691d Merge "Make systemTime() abort on bad input." am: 49cd73754e
Change-Id: If0fe073f61a54a04abf8bb8f8d6a71bbaad204c4
2020-05-28 15:24:36 +00:00
Elliott Hughes
49cd73754e Merge "Make systemTime() abort on bad input." 2020-05-28 15:11:20 +00:00
Alistair Delva
73cd637d0e Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" am: 510d2437b4 am: f19c48f85f am: e25f3d349a am: 14c99a08e6 am: 7bbd2a0e21
Change-Id: Ice7f0f743d501f19819269e660fb536c2f51f73b
2020-05-28 01:11:30 +00:00
Alistair Delva
7bbd2a0e21 Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" am: 510d2437b4 am: f19c48f85f am: e25f3d349a am: 14c99a08e6
Change-Id: I58dcdc024cd0039df1d77653f43b880870c221a7
2020-05-28 00:57:41 +00:00
Alistair Delva
14c99a08e6 Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" am: 510d2437b4 am: f19c48f85f am: e25f3d349a
Change-Id: I6a89ffb7bd4251e6d84dd2f2f74d8805a0f9c3db
2020-05-28 00:47:09 +00:00
Alistair Delva
e25f3d349a Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" am: 510d2437b4 am: f19c48f85f
Change-Id: I88a1fec9407fbdb9c175aaa0b35fd5e6dbc69519
2020-05-28 00:31:39 +00:00
Steven Moreland
f251c1c581 String16::remove - avoid overflow
Bug: 156999009
Test: libutils_test (cases added)
Change-Id: Iad46d95d9848928ba81000090b2fe9aec1e5eaac
2020-05-28 00:31:01 +00:00
Alistair Delva
f19c48f85f Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" am: 510d2437b4
Change-Id: Ic6737e2aaf9fc1309d4e5bd20e92378037686228
2020-05-28 00:19:05 +00:00
Alistair Delva
c631f94c77 Add ro.boot.fstab_suffix and modify mount_all to use it
Currently the ReadDefaultFstab function, which calls GetFstabPath,
makes some assumptions about what the fstab will be called and where
it is located. This is being used by vold to set up userdata encryption
and for gsid, and is even used in the default boot control HAL, so it
has become quite baked.

The original way for a board to specify things to mount was to use the
"mount_all /path/to/fstab" command in init.rc. However, due to the
above functionality, the path after mount_all is no longer very useful,
as it cannot differ from the inferred path, or userdata encryption and
other features will be broken.

On Cuttlefish, we have an interest in being able to test alternative
userdata configurations (ext4 vs f2fs, encryption on/off, etc.) and
currently the only way to achieve this is to either a) modify the
ro.hardware or ro.hardware.platform properties, which breaks a bunch
of things like default HAL filenames, or regenerate our odm.img or
vendor.img filesystems. We can't simply install another fstab and
point to it with "mount_all".

This change allows the fstab path to be omitted from "mount_all", and
adds another property which overrides the existing checks for
fstab.${ro.hardware} and fstab.${ro.hardware.platform}. Specifying
${ro.boot.fstab_suffix} will cause fstab.${ro.boot.fstab_suffix}
to be checked first.

Bug: 142424832
Test: booted cuttlefish with 'mount_all ${ro.hardware} --late'
Test: booted cuttlefish with 'mount_all --late'
Test: booted cuttlefish with 'mount_all --late' and fstab_suffix=f2fs
Test: partially booted cuttlefish with 'mount_all ${ro.hardware}'
Test: partially booted cuttlefish with 'mount_all'
Change-Id: I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c
Merged-In: I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c
2020-05-28 00:07:05 +00:00
Alistair Delva
510d2437b4 Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" 2020-05-28 00:04:02 +00:00
Elliott Hughes
842e1cc17e Make systemTime() abort on bad input.
There's no CHECK in libutils, sadly.

Bug: http://b/157167405
Test: treehugger
Change-Id: I1532bf80ba7fdafad016610be3c782b547417126
2020-05-27 15:31:55 -07:00
Tom Cherry
70fadea36f logd: remove LogBufferElement dependency of LogReaderThread
In the future, not all log buffers will be implemented in terms of
LogBufferElement.

Test: build
Change-Id: I5cf0d01414857b1bfa08c92a4f8035b43ef2aad7
2020-05-27 15:13:52 -07:00
Tom Cherry
3e61a1368a logd: rename FlushToResult to FilterResult
This was a typo; the enum corresponds to the result of the 'Filter'
function, not the 'FlushTo' function.

Test: build
Change-Id: Ib46f0646570b6dbaac17ae9fc95c990128cdbe72
2020-05-27 15:09:34 -07:00