Commit graph

72925 commits

Author SHA1 Message Date
Jiyong Park
4bd3687422 canned fs_config accepts multiple lines having the same path
Previously, each file/dir in a filesystem had to have exactly one
matching entry in the canned fs_config file. With this change, the
config file can have multiple entries for the same path. e.g.

/lib/libfoo.so 1000 1000 0644
/lib/libfoo.so 1000 2000 0644 capabilities=0x30

In this case, the last matching entry is chosen and used. This is to
make it possible to customize system-provided (and thus generic)
fs_config file with a user-provided (and thus context-specific) one.

Bug: 209971551
Test: m
Change-Id: I43902fed08db1b4968d02c75fac0a47976fff72a
2021-12-14 09:54:34 +09:00
Jiyong Park
d8602917f0 canned_fs_config.cpp is written in C++
This re-writes the file using C++, in preparation for a follow-up
change.

Also, removes debugging code that is no longer used.

Bug: 209971551
Test: m
Change-Id: I82a793cfdd7abd10024e304df7bd4ae323ffeabf
2021-12-14 09:08:42 +09:00
Treehugger Robot
46de7add81 Merge "storaged: Fix bug in empty check" 2021-12-11 03:07:39 +00:00
Rick Yiu
9dfff25365 Merge "libprocessgroup: Use WriteStringToFd for WriteFileAction" 2021-12-11 00:17:55 +00:00
Rick Yiu
d4c53518fe libprocessgroup: Use WriteStringToFd for WriteFileAction
Using WriteStringToFile will hold kernfs_mutex which is a big lock,
so use WriteStringToFd instead. Besides, also support fd cache for it.

Bug: 206970384
Test: build pass
Change-Id: Id79f9e1095f52079393c58edb9a4d526f4cc6b5e
2021-12-10 11:46:26 +08:00
Wei Wang
e797a5c75a Merge "Add a profile for OTA" 2021-12-09 16:48:29 +00:00
Yifan Hong
c232e0af05 Merge "storaged: skip disk_stats test if not supported." 2021-12-09 08:13:26 +00:00
Treehugger Robot
3589db8c3c Merge "Replace test_min_api_level with test_options.min_shipping_api_level" 2021-12-09 05:51:25 +00:00
David Anderson
8189339de3 Merge "init: Add --only-if-running argument to restart command." 2021-12-09 01:10:36 +00:00
Rick Yiu
91ce8bd935 Add a profile for OTA
Add an aggregated profile, OtaProfiles, for OTA process.

Bug: 199006579
Test: build pass
Change-Id: Ie6d5c593096d6ca77cdd8e3765b21bfcfd6641a5
2021-12-09 01:06:59 +00:00
Justin Yun
95c42d97e1 Replace test_min_api_level with test_options.min_shipping_api_level
Test options for the api levels are moved to test_options.
test_min_api_level property will be removed.

Bug: 187258404
Test: build
Change-Id: I1ba26faa83d3872dca757d84d530c9795ee2d283
2021-12-09 00:16:29 +00:00
Greg Kaiser
00c5e4c9ea storaged: Fix bug in empty check
Test: TreeHugger
Bug: 208543110
Change-Id: I89610a1e9e8f6bab57bab593132365f88d4adc76
2021-12-08 10:15:04 -08:00
Yifan Hong
fc5692852e Merge "fastboot: use health AIDL HAL" 2021-12-08 07:33:48 +00:00
Yifan Hong
1407fd04db storaged: skip disk_stats test if not supported.
If HAL does not support disk stats, do not run
corresponding storaged tests.

Also add storaged-unit-tests to Treehugger.

Test: storaged-unit-tests
Bug: 208543110
Change-Id: Ia2acf30ca3e259e0f0744385da69d92f9c00f223
2021-12-08 07:33:09 +00:00
Treehugger Robot
c034ce0880 Merge "storaged: use health HAL" 2021-12-08 04:30:07 +00:00
Treehugger Robot
f060e6492a Merge "snapuserd: opt out of Global ThinLTO to workaround segfault" 2021-12-07 20:02:57 +00:00
Yi Kong
9d0c06d3e2 snapuserd: opt out of Global ThinLTO to workaround segfault
Test: manual
Bug: 208565717
Change-Id: I78397a44a7cbc2e2f04e0c77c4a816b909c95517
2021-12-07 19:12:05 +00:00
Yifan Hong
ecbf9e4f7a Merge "storaged: test do not crash on cuttlefish." 2021-12-07 19:09:04 +00:00
David Drysdale
93f4b0afe7 Merge "Depend on KeyMint HAL via default" 2021-12-07 11:08:42 +00:00
Yifan Hong
4cb88dc811 fastboot: use health AIDL HAL
Bug: 208543110
Test: fastboot getvar
Change-Id: Ib83e7ccd53e49367f7af218ffafb7c0a57a514f6
2021-12-06 23:18:32 -08:00
Yifan Hong
5291a67ee3 storaged: use health HAL
Test: storaged_test
Test: manual
Bug: 208543110

Change-Id: I60d42fc4f2e411f375fe98d1c8e145ce79c52f88
2021-12-06 23:09:37 -08:00
Yifan Hong
e8474c2a10 storaged: test do not crash on cuttlefish.
If device does not have disk stats, do not crash the
test. Check for null C strings before converting it
to std::string.

Test: storaged-unit-tests
Change-Id: I46c87b6b6876fb0fbdb403c0015886d6d4cca0c6
2021-12-06 23:09:37 -08:00
David Anderson
6c31ab7a13 Merge changes I350c8c88,I1e462fad
* changes:
  libsnapshot: Fix unmapping getting skipped for userspace snapshots.
  libsnapshot: Don't map "b" partitions during testing.
2021-12-07 02:58:45 +00:00
David Anderson
d2f8d51444 libsnapshot: Fix unmapping getting skipped for userspace snapshots.
When the dm-user device isn't shut down, COW files cannot be deleted.

Bug: 208944665
Test: vts_libsnapshot_test
Change-Id: I350c8c88c69f9b151032635b0229d281a4bb47ce
2021-12-05 22:39:50 -08:00
David Anderson
266f57d672 libsnapshot: Don't map "b" partitions during testing.
This is testing behavior that no longer exists. We never perform an OTA
while system_other is mapped, since it would collide with the snapshot
for system.

Bug: 208944665
Test: vts_libsnapshot_test
Change-Id: I1e462fad3fd59b8b881d98da982a7c22408b837b
2021-12-05 22:39:49 -08:00
Treehugger Robot
4bf3c13dc5 Merge "Explain why snapuserd is a static binary." 2021-12-03 23:54:20 +00:00
David Anderson
6d7c7a2156 init: Add --only-if-running argument to restart command.
If surfaceflinger crashes before zygote starts, it will restart zygote
too early. Add this argument will allow it to only restart zygote if
it's already running.

Bug: 197224273
Test: manual test
Change-Id: I0ac8dbeaf0a002f8cfcfcc0f63d4b90d08393c5c
2021-12-03 15:49:39 -08:00
Elliott Hughes
17572ca9e7 Explain why snapuserd is a static binary.
Static binaries are pretty rare (and usually a bad idea) but there's a
rationale for this one, so we should record it.

Test: treehugger
Change-Id: I7fc5c32bbbec1ccf195d94eaedfb1bd718a364e1
2021-12-03 13:57:10 -08:00
David Anderson
f7da22dfe5 Merge "libsnapshot: Fix test failure in CancelOnTargetSlot." 2021-12-03 20:02:09 +00:00
David Anderson
35cbd4d472 Merge "libsnapshot: Fix crash in MakeXorBlockString test." 2021-12-03 19:28:41 +00:00
David Anderson
ce474ea501 libsnapshot: Fix test failure in CancelOnTargetSlot.
This test fails because CreateLogicalPartitions is effectively called
twice without unmapping anything.

Bug: 208944665
Test: run_snapshot_tests.sh
Change-Id: I7e79f43e8de2f79bb72888c4198a95d9bd76bcdd
2021-12-02 23:51:40 -08:00
David Anderson
8875abd9ab libsnapshot: Fix crash in MakeXorBlockString test.
std::string doesn't like being initialized with negative values, so use
memset() instead.

Bug: 208944665
Test: vts_libsnapshot_test
Change-Id: I42a1a01fd9e59ffc9913c9df9f4bb8ab85113356
2021-12-02 23:51:39 -08:00
David Drysdale
c5b7d179c2 Depend on KeyMint HAL via default
This allows for easier bumping of the KeyMint version level.

At the moment this change should have no effect: the same dependency
is used, just reached via a default rather than explicitly.

However, when the KeyMint version increases in the near future, using
this default should mean that no change is needed here: the default
definition will change to -V2 and this will be referenced here.

Test: TreeHugger
Change-Id: Ic250e5b91ee2b48cd7a05783ce21af16ae330ed1
2021-12-02 08:16:25 +00:00
Jooyung Han
e8e5b5bb28 Merge "Set min_sdk_version" 2021-12-02 02:27:20 +00:00
Jooyung Han
b1ac9b4275 Set min_sdk_version
Many modules requiring min_sdk_version have been used without setting
it, but hard-coded as "30" in allowlist.

Bug: 158059172
Test: m
Change-Id: I0b461c28077584f2db2d2f688423f2227c0a2d1a
2021-12-02 09:23:42 +09:00
Akilesh Kailash
cddf0f75cf Merge "snapuserd: Address alignment fault on 32-bit systems" 2021-12-01 20:36:24 +00:00
Akilesh Kailash
14e9504d2e snapuserd: Address alignment fault on 32-bit systems
When the scratch space is mmap'ed, the metadata buffer
will be un-aligned. This may lead to alignment fault
on 32-bit systems. Address this by temporarily copying
it to buffer.

No perf impact as this code path is not in I/O path
and the copy is a for the size of metadata buffer which
is 8k.

Bug: 206426215
Test: Full and Incremental OTA on pixel
1: Compile snapuserd as 32 bit and reproduced the bug on pixel.
2: With fix - OTA applied successfully.
3: Reboot the device when merge was in-flight as the fix is primarily
in that path.
4: Verify merge completion and data integrity post merge.

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I63c0d862057ebf138c9d1696a942030e30598739
2021-12-01 20:23:58 +00:00
Armelle Laine
904cae37ce Merge "trusty: update default_applicable_licenses "Android-Apache-2.0"" 2021-11-30 23:41:46 +00:00
David Anderson
437fb62cf6 Merge "init: Remove first_stage_mount support for AVB 1.0." 2021-11-30 23:03:14 +00:00
David Anderson
36ba349e8f init: Remove first_stage_mount support for AVB 1.0.
Bug: 204598884
Test: treehugger
Change-Id: I6927198b706136de9721df86e24e5828c9f4f1c2
2021-11-30 00:57:48 -08:00
Christopher Parsons
aa6964861a Merge "Remove libdl from shared_libs" 2021-11-29 22:48:53 +00:00
Chris Parsons
820da65897 Remove libdl from shared_libs
This entry is redundant, as system_shared_libs by default includes
libdl.

This should be a no-op change for the current build system, but avoids
an issue on the alternative (experimantal) build system, Bazel.

Test: md5sum libutils.so before/after on aosp_flame, verified no changes
Change-Id: I18f6e67c3e23299a0f1e0ef530a0a809b068dc03
2021-11-29 17:43:04 -05:00
Armelle Laine
c2cc120d60 trusty: update default_applicable_licenses "Android-Apache-2.0"
rpmb_dev is a rpmb device stub used in emulation
as well as platform early bringup so we don't expect
any open source developer to be impacted by the migration
from MIT to Apache 2.0.
Note that with such a migration to Apache 2.0, recipients
won't receive lesser permissions, they just have updated
requirements for which license text to share along with the code.

Bug: 191508826
Test: None
Signed-off-by: Armelle Laine <armellel@google.com>
Change-Id: I0ae2bc66901344f8f9227e929a98946e52c50355
2021-11-29 19:53:54 +00:00
Treehugger Robot
4bbf1c9d24 Merge "Make libmini_keyctl_static available in recovery" 2021-11-23 17:54:31 +00:00
Treehugger Robot
a927f51846 Merge "mini_keyctl: add OWNERS" 2021-11-23 12:23:49 +00:00
Jeff Vander Stoep
26083e88e5 mini_keyctl: add OWNERS
Test: n/a
Change-Id: Ib068ec6658779b2baa0772b5ae3a2e4665caa260
2021-11-23 11:16:05 +00:00
Jeff Vander Stoep
3bada5cbcd Make libmini_keyctl_static available in recovery
So libfsverity_init can be used in init to load fsverity keys in
early boot.

Bug: 199914227
Test: build
Change-Id: I514ab602ef03f4528cb013bd268fa6dfcb7eb5b2
2021-11-22 21:35:04 +01:00
Treehugger Robot
e33c0e547d Merge "Mark fs-verity support for /metadata if first_api_level >= R" 2021-11-22 20:23:44 +00:00
Akilesh Kailash
04eecd441c Merge changes from topic "vabc-user-snapshots"
* changes:
  snapuserd: Add unit test for test merge code path
  libsnapshot: Add vts_userspace_snapshot_test
  libsnapshot: Integrate userspace snapshots APIs
2021-11-22 20:16:06 +00:00
Treehugger Robot
1d02ce9ad4 Merge "Configure Trusty KeyMint devices to use attest_keys." 2021-11-22 18:21:09 +00:00