Commit graph

73373 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
Yifan Hong
51f11baa5b Merge "healthd: *charger_test links to a.h.health@2.x statically." am: c7facae95a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1920840

Change-Id: I9ad1a0b8ce08e4de19a7281b7943c877c9bbbf86
2021-12-13 23:02:56 +00:00
Yifan Hong
c7facae95a Merge "healthd: *charger_test links to a.h.health@2.x statically." 2021-12-13 22:36:30 +00:00
Yifan Hong
5771858dc0 healthd: *charger_test links to a.h.health@2.x statically.
These libraries might not be installed on the device
any more.

Fixes: 210093617
Test: run it
Change-Id: Ic1bc6ba3c78ccaad93aef00ab695f3c2acd2b367
2021-12-13 14:12:05 -08:00
Treehugger Robot
6ef37c8225 Merge "libutils: do not follow process's group" am: 83347fdb7c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1920521

Change-Id: I9a1d34d84355e3651c478ee4c8f7cde82d19c3a4
2021-12-13 20:29:38 +00:00
Treehugger Robot
83347fdb7c Merge "libutils: do not follow process's group" 2021-12-13 20:02:31 +00:00
Wei Wang
e73180f8f5 libutils: do not follow process's group
1) App doesn't have cgroup access and there is no purpose of reading cgroup
for app. For system_server it should be known in foreground group. So
there is no benefit of reading group.

2) Reading cgroup in apps can also cause contention for other cgroup
operations.

3) vendor can change cgroup setting and get_sched_policy may return
incorrect information for get_sched_policy_profile_name.

Test: Boot
Bug: 210011562
Signed-off-by: Wei Wang <wvw@google.com>
Merged-In: I8e8c8b346984781c56ec93c0616121f7d5c99fe5
Change-Id: I8e8c8b346984781c56ec93c0616121f7d5c99fe5
(cherry picked from commit defb7773121545130fff80928ebcd7d6015be1d1)
2021-12-13 10:05:05 -08:00
Treehugger Robot
2ae516ef50 Merge "storaged: Fix bug in empty check" am: 46de7add81
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1915078

Change-Id: I14b3bfa86cffc6aa2b33fe48196e4089de1e14a4
2021-12-11 03:21:51 +00:00
Treehugger Robot
46de7add81 Merge "storaged: Fix bug in empty check" 2021-12-11 03:07:39 +00:00
Rick Yiu
18173b1e54 Merge "libprocessgroup: Use WriteStringToFd for WriteFileAction" am: 9dfff25365
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1895031

Change-Id: Ifbe096257f40ca43e12b6f4156c1c146c3916794
2021-12-11 00:36:44 +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
270aca8a98 Merge "Add a profile for OTA" am: e797a5c75a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1914609

Change-Id: I80fc7b21d3966329ae08513b21488931c0a4079f
2021-12-09 17:04:26 +00:00
Wei Wang
e797a5c75a Merge "Add a profile for OTA" 2021-12-09 16:48:29 +00:00
Yifan Hong
43373678d9 Merge "storaged: skip disk_stats test if not supported." am: c232e0af05
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1912710

Change-Id: Idef33600e262756c6c262e266ffda7e099a209ba
2021-12-09 08:31:01 +00:00
Yifan Hong
c232e0af05 Merge "storaged: skip disk_stats test if not supported." 2021-12-09 08:13:26 +00:00
Treehugger Robot
ff5182de81 Merge "Replace test_min_api_level with test_options.min_shipping_api_level" am: 3589db8c3c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1905070

Change-Id: Id9c39332454f3b9ab8f45487b1eaf34b27274e40
2021-12-09 06:06:51 +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
3a9fc6ea0a Merge "init: Add --only-if-running argument to restart command." am: 8189339de3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1910536

Change-Id: I840853a26ff4b76431c78145df81a2617207bd6a
2021-12-09 01:26:55 +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
c85081b431 Merge "fastboot: use health AIDL HAL" am: fc5692852e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1912711

Change-Id: I2a6f732e9ffb66f7da42d89998691e2dfd0c92a6
2021-12-08 07:41:53 +00: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
dfb242c8fb Merge "storaged: use health HAL" am: c034ce0880
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1912632

Change-Id: I05e7edaf46bde61390d2de3bfa62be8afcb8945f
2021-12-08 04:49:37 +00:00
Treehugger Robot
c034ce0880 Merge "storaged: use health HAL" 2021-12-08 04:30:07 +00:00
Treehugger Robot
94174d5131 Merge "snapuserd: opt out of Global ThinLTO to workaround segfault" am: f060e6492a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1912774

Change-Id: I2cc9f2f6170747db1c0396a28349839f6608a3f1
2021-12-07 20:37:51 +00:00
Treehugger Robot
f060e6492a Merge "snapuserd: opt out of Global ThinLTO to workaround segfault" 2021-12-07 20:02:57 +00:00
Yifan Hong
94fd5ca73c Merge "storaged: test do not crash on cuttlefish." am: ecbf9e4f7a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1912709

Change-Id: If4f59651f27ff14b56b3ac8d857418dd38242f51
2021-12-07 19:26:56 +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
8a5a70395e Merge "Depend on KeyMint HAL via default" am: 93f4b0afe7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1904171

Change-Id: Iac644b8ff00d19cb13e1ce9853b7fe2ad4a342a0
2021-12-07 12:15:18 +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
d22ff3b332 Merge changes I350c8c88,I1e462fad am: 6c31ab7a13
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1911212

Change-Id: I1d306a83f479a32c6b9fa781abf2f7be6a6ec26a
2021-12-07 03:17:44 +00: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
Kalesh Singh
ccf343fa5b Add group ID for reading tracefs
Add AID_READTRACEFS and mount tracefs with gid=AID_READTRACEFS

Bug: 209513178
Test: adb shell ls -l /sys/kernel/tracing/events
Change-Id: Ibbfdf8a4b771bd7520ecbaaf15a1153d6bf0e599
2021-12-06 16:25:04 -08:00
David Anderson
6637ff0add libsnapshot: Fix artifact cleanup.
When deleting dm devices in between tests, we need to differentiate
between "already merged snapshot" and "in-progress snapshot owned by
dm-user".

Bug: 208944665
Test: vts_libsnapshot_test passes
Change-Id: I875067c93fcef932d887a4bc82d81194b3444d72
2021-12-05 22:39:51 -08: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
f08411529f libsnapshot: Unify vts_libsnapshot_test harness.
A few major changes in this patch:

The userspace tests have been folded back into the main test file, with
some runtime checks to gate any dependent assertions.

The default test mode is to test using the device's native
configuration. However, there is now a -force_config flag with three
options:
 - "dmsnap" to test the old dm-snapshot code path. This is for legacy
   VAB (no compression, no snapuserd).
 - "vab" to test userspace merges.
 - "vabc" to test userspace merges with compression.

Note that "dmsnap" + "snapuserd" is not possible to test anymore, as the
code will soon be deleted.

The test suite uses the force_config flag to propagate settings to
SnapshotManager/snapuserd.

In addition, there is a new test wrapper, "run_snapshot_tests.sh". This
shell script can be run on the host or device, and will invoke
vts_libsnapshot_test. Once all three configurations are passing, they
will be added to this harness, and presubmit will be changed to run the
harness instead. The default mode will continue to be used for VTS.

Bug: 208944665
Test: vts_libsnapshot_test
Change-Id: I0bb0fdc936ce748c5fbe8ec2acb1eda6c16b11ae
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
c74097ccc1 Merge "Explain why snapuserd is a static binary." am: 4bf3c13dc5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1910141

Change-Id: Ie7cd5367b75b0052acb7678aa600c78072dfd80e
2021-12-04 00:24:53 +00: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