Commit graph

58787 commits

Author SHA1 Message Date
Jooyung Han
28d0dba1f5 Merge "Fix the order for boot scripts scanning" am: ccab04e5b5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1393378

Change-Id: I948be36054a73a0cf673a726d4d8426990b2736e
2020-08-07 23:43:01 +00:00
Jooyung Han
ccab04e5b5 Merge "Fix the order for boot scripts scanning" 2020-08-07 23:21:55 +00:00
Yifan Hong
833c1b98b3 Merge "Fix allowlist for unreliable pinning." am: 0198ce0ca7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1393698

Change-Id: I73c57a7fa8bceadc2b5bb71c92f353574a25ab33
2020-08-07 17:58:25 +00:00
Yifan Hong
60e1be9200 Merge "libsnapshot_test: skip global setup on non-VAB devices." am: 75d5e98401
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1393640

Change-Id: I78c01b7ad442a1a98278d6f3664828308be1eb77
2020-08-07 17:58:14 +00:00
Treehugger Robot
6252e97df4 Merge "logd: consolidate command handling and fix an error check" am: 2666aaba84
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1393638

Change-Id: I01ec49a6f32a647e5e33df83abda206f51da31f1
2020-08-07 17:57:59 +00:00
Yifan Hong
0198ce0ca7 Merge "Fix allowlist for unreliable pinning." 2020-08-07 17:57:13 +00:00
Yifan Hong
75d5e98401 Merge "libsnapshot_test: skip global setup on non-VAB devices." 2020-08-07 17:57:00 +00:00
Treehugger Robot
2666aaba84 Merge "logd: consolidate command handling and fix an error check" 2020-08-07 17:41:14 +00:00
Tom Cherry
94b299ab43 logd: consolidate command handling and fix an error check
Consolidate command handling for commands that take a buffer ID as
their first argument.  Further use ParseUint instead of atoi(), since
atoi("bad string") returns `0` is the same as LOG_ID_MAIN.

Test: these commands are handled property
Test: `echo -n 'getLogSize ignoreme!\0' | nc -U /dev/socket/logd`
      returns an error
Change-Id: I3e84a6157e16f4c110681da453e1ae1a920da7c4
2020-08-07 09:48:16 -07:00
Treehugger Robot
f0461b29d8 Merge "Delete fiemap_image_test_presubmit" am: 4b3229b216
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1393701

Change-Id: I9093ec3808d44890d7ca9e09b6d78f7908c97c97
2020-08-07 02:43:25 +00:00
Treehugger Robot
4b3229b216 Merge "Delete fiemap_image_test_presubmit" 2020-08-07 02:23:13 +00:00
Jooyung Han
f7c2585f6d Fix the order for boot scripts scanning
To support "override" services, we need to scan partitions from least
speicific to most specific.

Bug: 163021585
Test: m
Change-Id: I26a6de4f7fb571c60038e803137a4b1c237792fd
2020-08-07 10:44:14 +09:00
Yifan Hong
0074cc1831 Merge changes from topic "healthd_test" am: 17ed9c4fb6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1392638

Change-Id: I5410990c3b920f655bd73c1e218c06855a851333
2020-08-07 01:14:28 +00:00
Yifan Hong
17ed9c4fb6 Merge changes from topic "healthd_test"
* changes:
  Add libhealthd_charger_test to presubmit.
  Convert healthd_test to Soong
  Fix AnimationParser remove_prefix test
2020-08-07 00:38:50 +00:00
Yifan Hong
f0cb5a04f3 Delete fiemap_image_test_presubmit
No tests are skipped in presubmit now.

Test: presubmit
Fixes: 148874852

Change-Id: Ic0ce7489ff4a92ab90986dd76f836c262f5aa3fc
2020-08-06 17:38:02 -07:00
Yifan Hong
a7c00a0943 libsnapshot_test: skip global setup on non-VAB devices.
On non-VAB devices, fake super image creation may fail because it
may not support f2fs file pinning.

Also changes global setup to a testing::Environment object because it is
the recommended way in gtest's guide. SnapshotTestEnvironement::TearDown
is automatically executed before RUN_ALL_TEST returns.

Test: vts_libsnapshot_test
Test: make IsVirtualAbEnabled() return false, then all tests are
skipped.

Bug: 162557082
Change-Id: I1382f9a4ddec146fa2d8cfb21ac66ca22a2e110f
2020-08-06 17:21:50 -07:00
Tom Cherry
b19bbaeb41 Merge "Query log size properties only within logd" am: ca0a46aefa
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1390949

Change-Id: Ib26c90b96f0ae2c13563b84b6724a35f8d734f24
2020-08-06 22:14:57 +00:00
Yifan Hong
900fdf47ce Fix allowlist for unreliable pinning.
When checking IsUnreliablePinningAllowed, the existing code calls
IsTestDir on a value starts with "/data", but IsTestDir expects
metadata_dir_. Fix it.

Also, make subdir checks more robust and add test cases for IsSubdir.

Fixes: 162557082
Test: vts_libsnapshot_test
Test: fiemap_image_test

Change-Id: I495cfae3da11d1e0800b8abf520df10dd9a29dce
2020-08-06 15:02:56 -07:00
Tom Cherry
ca0a46aefa Merge "Query log size properties only within logd" 2020-08-06 22:00:29 +00:00
Tom Cherry
39dc221026 Query log size properties only within logd
liblog exposed __android_logger_get_buffer_size() which queries log
size properties, but that should not be a generic library function.
Logd should be the only process that queries these properties and
other processes should query the actual used log sizes from logd via
the android_logger_get_log_*_size() functions.

Also, always use 1MB for log buffer tests, instead of just on host and
various other clean up related to improper types.

Test: log buffers are correctly sized
Merged-In: I9b7c86bf58e569618737afe9097cf1c4d4e61d95
Change-Id: I9b7c86bf58e569618737afe9097cf1c4d4e61d95
2020-08-06 20:32:45 +00:00
Treehugger Robot
fef53055e1 Merge "Add the rough toybox version numbers to the docs." am: b96cc0bfd2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1392868

Change-Id: Ifcf4d254c1455c9dc25264f17733c95b6e61507b
2020-08-06 18:48:23 +00:00
Treehugger Robot
b96cc0bfd2 Merge "Add the rough toybox version numbers to the docs." 2020-08-06 18:30:15 +00:00
Treehugger Robot
356a6f52b6 Merge "cts: Skip CtsInitTestCases over a native bridge." am: 30e542983a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1393376

Change-Id: Ie33a733bb93d55d83d67802001f9218db10b4fd4
2020-08-06 17:51:46 +00:00
Treehugger Robot
30e542983a Merge "cts: Skip CtsInitTestCases over a native bridge." 2020-08-06 17:31:56 +00:00
Elliott Hughes
60dfa184a7 Add the rough toybox version numbers to the docs.
Bug: https://github.com/landley/toybox/issues/230
Test: treehugger
Change-Id: I007cb2fd5fc4b2258394e7472c12df4acb25ebcc
2020-08-06 10:15:25 -07:00
Christopher Ferris
4a59a24c0b Merge "Add new caps from kernel 5.8." am: c625ea6137
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1389265

Change-Id: I3f17a05cedec5ad858e7e6ec758befad687e634f
2020-08-06 16:49:01 +00:00
Christopher Ferris
c625ea6137 Merge "Add new caps from kernel 5.8." 2020-08-06 16:31:03 +00:00
Kazuhiro Inaba
c293c58660 cts: Skip CtsInitTestCases over a native bridge.
The set of linked binaries was making it difficult to run
the test over a native bridge. Since init won't usually
run over a native bridge, the test can be skipped.

Bug: 161081809, 142324733, 162288553
Test: Arm build of CtsInitTestCases skips rammus-arc-r Chromebook.
Change-Id: Icdd8b03111d0f3fd6658ee6d9a97fca27181db45
(cherry picked from commit 9cecf8422a)
2020-08-07 01:11:29 +09:00
Yifan Hong
186b4d9ddd Add libhealthd_charger_test to presubmit.
Test: atest --test_mapping
Change-Id: Idae68e575f66b53c8b587405856b4a1c532ecadc
2020-08-05 20:00:09 -07:00
Yifan Hong
12d15750fe Convert healthd_test to Soong
This makefile is not included before, so it was never built. Also do
the following changes to make sure it works:

- Remove non-existing libhealthd_internal dep
- Add necessary libhealthd_charger dep because it tests AnimationParser
- Since it tests AnimationParser, change its name to
libhealthd_charger_test

Test: run it

Change-Id: If7f91de4b910024f27d09a25ca801e67b98221db
2020-08-05 20:00:09 -07:00
Yifan Hong
2a06ae8299 Fix AnimationParser remove_prefix test
The test fails because TEST_STRING, a char[], is silently
converted to a std::string, passed to remove_prefix, then
the string is destroyed, but a pointer to the string is
returned.

Fix it by changing the signature of remove_prefix to use
std::string_view to be more robust in handling raw char*.

Test: run it
Change-Id: I553c066907f09cf330c8b7a4659db5a1fee82cac
2020-08-05 20:00:09 -07:00
Tom Cherry
969a3f5195 Merge changes I2dd4ec10,I8b9688a9 am: 539f5e3880
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1392134

Change-Id: I52d2e9d2e4682062881781b3b018624c3f3605c6
2020-08-05 23:49:11 +00:00
Tom Cherry
539f5e3880 Merge changes I2dd4ec10,I8b9688a9
* changes:
  logcat: replace write() calls with WriteFully()
  Add android_logger_get_log_consumed_size() and report it in logcat
2020-08-05 23:27:03 +00:00
Eric Biggers
4a15f52193 Merge "fs_mgr: Revert "Try to recover corrupted ext4 /data with backup superblock"" am: 64d1a3d60e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1387869

Change-Id: I99c68fb21b55aadb6f6ed3c82efb05e5d1d3ceb6
2020-08-05 22:46:31 +00:00
Eric Biggers
64d1a3d60e Merge "fs_mgr: Revert "Try to recover corrupted ext4 /data with backup superblock"" 2020-08-05 22:28:53 +00:00
Tom Cherry
3e970d430f logcat: replace write() calls with WriteFully()
There is a possibility of data loss if an interrupt occurs in the
middle of these write() calls.

Test: logcat -g/-S/-B work correctly
Change-Id: I2dd4ec10771714fc49b61538d3028983516e106c
2020-08-05 14:01:11 -07:00
Tom Cherry
06e111a148 Add android_logger_get_log_consumed_size() and report it in logcat
There is an existing API, android_logger_get_log_readable_size() which
historically reported the consumed amount of data for the chatty log
buffer, since consumed and readable are synonymous with that buffer
type.

With log compression, readable and consumed are not synonymous, since
the readable log size is the uncompressed log size whereas the
consumed log size is the compressed log size.

This change adds android_logger_get_log_consumed_size() which returns
the consumed log size and makes android_logger_get_log_readable_size()
return the readable log size.  Note that these values are identical if
compression is not used.

It adds both statistics to logcat:

    main: ring buffer is 1 MiB (429 KiB consumed, 817 KiB readable)
    radio: ring buffer is 1 MiB (339 KiB consumed, 715 KiB readable)
    ...

Test: logcat prints the right values with compression and chatty
Change-Id: I8b9688a987736204e2e6026e8635fbd1a5e68bb7
2020-08-05 13:43:31 -07:00
Tom Cherry
1c99963351 Merge "liblog: add a timeout for logd command socket operations" am: 368c70daba
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1389398

Change-Id: I1361f77d0436fc8596e94c3a30d7b05b209ce612
2020-08-05 19:37:43 +00:00
Tom Cherry
368c70daba Merge "liblog: add a timeout for logd command socket operations" 2020-08-05 19:18:07 +00:00
Christopher Ferris
46f2a82271 Merge "Fix fuzzer so it doesn't add overlapping maps." am: a39e39fe31
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1387875

Change-Id: Ib671925c2226490e586ec152a2d6c1f38005b2ba
2020-08-05 16:52:33 +00:00
Christopher Ferris
a39e39fe31 Merge "Fix fuzzer so it doesn't add overlapping maps." 2020-08-05 16:32:04 +00:00
Joshua Duong
a0c115a38b Merge "[adb] Correctly read host/user name on Windows." am: a65d905b4a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1380298

Change-Id: I95aefaaf1a599266532149e848c4bc0d373dc926
2020-08-05 15:45:29 +00:00
Joshua Duong
a65d905b4a Merge "[adb] Correctly read host/user name on Windows." 2020-08-05 15:25:47 +00:00
Christopher Ferris
ab60ca583a Add new caps from kernel 5.8.
Test: Builds and boots on a bonito.
Change-Id: I8dff4818bb98be3d731256be100a1c4aed4d414c
2020-08-04 22:57:44 -07:00
Tom Cherry
0d847fb4cb liblog: add a timeout for logd command socket operations
Add a 2s timeout for logd command socket operations:
  android_logger_clear
  android_logger_get_log_readable_size
  android_logger_get_log_size
  android_logger_set_log_size
  android_logger_get_statistics
  android_logger_get_prune_list
  android_logger_set_prune_list

That correspond to:
  logcat -c
  logcat -g
  logcat -G
  logcat -S
  logcat -p
  logcat -P

These operations should return immediately in typical circumstances,
but if logd is stuck, they would otherwise block indefinitely.  This
allows the commands to gracefully timeout instead.

Test: kill -s STOP `pidof logd`; logcat -g (and other options)
      times out appropriately
Test: logcat -g (and other options) work successfully otherwise
Change-Id: I6c4671a9b3daa4a454c0a14ae7d0b7d3b08be77a
2020-08-04 17:41:47 -07:00
Christopher Ferris
63525c8d6c Fix fuzzer so it doesn't add overlapping maps.
The fuzzer was creating individual maps that overlapped with other maps.
Since this is not possible in the real world unless the kernel is broken,
do not let the fuzzer do this. This resulted in memory leaks, because some
parts of the code have this assumption baked in.

Bug: 160895854

Test: Ran fuzzer test case that leaked memory and verified it no longer does.
Change-Id: I9f3c1e28781093b041b747e1566fb51d40d2bf71
2020-08-04 16:08:12 -07:00
Tom Cherry
daa14e59cd Merge "libmodprobe: remove SetMinimumLogSeverity() from constructor" am: 03325fb854
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1387857

Change-Id: Ifed528d6dfaaebe116b6b0714a77def969b76a27
2020-08-04 21:57:12 +00:00
Tom Cherry
03325fb854 Merge "libmodprobe: remove SetMinimumLogSeverity() from constructor" 2020-08-04 21:30:09 +00:00
Eric Biggers
dc3e897a88 fs_mgr: Revert "Try to recover corrupted ext4 /data with backup superblock"
This reverts commit 72abd7b246
(change Ia39af3340c0e241f62557b7c2cc8b800443342f9).

When vold enables either FDE or metadata encryption, it encrypts the
filesystem in-place.  Unfortunately, due to a bug, for ext4 filesystems
it hasn't been encrypting the backup superblocks.

Also, in read_ext4_superblock(), the check for
StartsWith(blk_device, "/dev/block/dm-") can return true even if the
encryption mapping hasn't been added yet, since when a GSI image is
booted the userdata block device is a logical volume using dm-linear.

The result is that read_ext4_superblock() can recognize a backup
superblock when the encryption mapping hasn't been added yet, causing
e2fsck to run without the encryption mapping and corrupt the filesystem.

https://android-review.googlesource.com/c/platform/system/vold/+/1385029
will fix this for new or factory-reset devices.  However, there probably
are many existing devices that already have their backup superblocks
unencrypted.  Therefore, the EncryptInPlace fix isn't enough and we have
to revert the change that started using the backup superblocks too.

Bug: 161871210
Bug: 162479411
Change-Id: I279f84c072bc6c8d3e251a5e95c78f8d6c0d50ba
2020-08-04 11:34:30 -07:00
Steven Moreland
b76d1b8873 Merge "perfboot: significant figures + units for summary" am: fe8dec0447
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1386892

Change-Id: I0c3c4c09a23c9a9dd041b0d4d822d885bf1047b0
2020-08-04 18:28:54 +00:00