Commit Graph

56494 Commits

Author SHA1 Message Date
Tom Cherry d44a5f840d liblog: null terminate log_msg
Also, use LOGGER_ENTRY_MAX_LEN instead of sizeof(log_msg) for ensuring
that the read did not overflow, since sizeof(log_msg) is one byte
longer to allow for placing a null terminator already.

Bug: 148966104
Test: liblog unit tests
Change-Id: Id4fe8aa5da44e9d62f59b6541f157a4e7b038d07
2020-02-05 15:04:32 -08:00
Alessio Balsini c352179e10 fiemap: add image_test and writer_test tests to presubmit
Add fiemap_image_test and fiemap_writer_test to TEST_MAPPING to be run
by TH as presubmits.
Because of a bug under investigation, the actual
fiemap_image_test_presubmit is used instead of the original, that has
one test case disabled.

Bug: none
Test: TH, fiemap_image_test, fiemap_writer_test
Change-Id: I63b5e69b5c245a18eceb1e5896df7bd0577f289b
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-05 22:08:29 +00:00
Keun young Park 606af6dfff bootstat: Migrate to StatsLog for metrics
- All events are migrated to StatsLog atoms.
- Still keep the string based name for BootEvent logging as that makes it
  easier for debugging purpose.

Bug: 132691841
Test: check boot related stats are pushed after boot up
      $ adb shell cmd stats print-stats

Change-Id: I33313695a8a2d0a3c74f7705c0843c8c4bad2133
Merged-In: I33313695a8a2d0a3c74f7705c0843c8c4bad2133
2020-02-05 12:53:24 -08:00
Alessio Balsini f6034544c0 fiemap: fix fiemap size and log message when last extent
Fix the total fiemap struct plus extents size allocation.
Fix also the logging in IsLastExtent, that was printing error messages
every time.

Bug: none
Test: fiemap_*_test
Change-Id: I85c6af63ba3a75b993a5e8ad7d7170dc7af59582
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-05 18:27:40 +00:00
Tom Cherry 57b9428471 init: use ErrnoErrorf() instead of ErrnoError() << StringPrintf()
Test: force init to print this line and see the log message
Change-Id: Ibb74572347f915cd76cc50f4c19126b66f562810
2020-02-05 07:57:14 -08:00
Tom Cherry f8e6bf6d81 Check Errorf()/ErrnoErrorf() format string at compile time
fmtlib provides compile time checking of format strings that we're not
currently using.  This change makes Errorf() and ErrnoErrorf() into
macros such that we can take advantage of this capability.

Test: build successfully normally
Test: fail the build if using an invalid format string
Change-Id: Icb8ba8cb973bbd1fa4755a62e7598bdbb0113757
2020-02-05 07:57:14 -08:00
Automerger Merge Worker 5ffc6801e3 Merge "first_stage_mount: reading all avb_keys before chroot" am: e6211eb978
Change-Id: Id494214f11d81185345ebf4b471bb794ea64cfb7
2020-02-05 13:57:46 +00:00
Treehugger Robot e6211eb978 Merge "first_stage_mount: reading all avb_keys before chroot" 2020-02-05 13:42:34 +00:00
Jiyong Park 17730e7cf6 use apex_test for test apexes
... so that the build system can distinguish testing APEXes and installable APEXes, and apply
different rules to them.

Bug: 146308764
Test: m
Change-Id: I5fdab94da352e8014225b2454aacc2a5b5fc6a52
2020-02-05 18:44:10 +09:00
Bowgo Tsai e0f5c10691 first_stage_mount: reading all avb_keys before chroot
Avb keys used to verify a partition are stored in the first-stage
ramdisk. However, after /system is mounted, init will chroot into it.
This makes those keys inaccessible for later mounts, e.g., /vendor or
/product.

This change retains avb keys by reading all of them before chroot
into /system.

Note that it is intentional to perform public matching for both
preload_avb_key_blobs and fstab_entry.avb_keys in libfs_avb.
As some keys might only be availble before init chroots into /system,
e.g., /avb/key1 in the first-stage ramdisk, while other keys might
only be available after the chroot, e.g., /system/etc/avb/key2.

Bug: 147585411
Test: specify avb_keys for a partition and checks the keys are preloaded
Test: atest libfs_avb_test
Test: atest libfs_avb_internal_test
Change-Id: I6bd490c4215480db2937cdfc3fea0d616e224a91
2020-02-05 15:51:41 +08:00
Automerger Merge Worker f55fe4193e Merge "Delete dangerous comparison operators from base::expected" am: ab65ef22a5
Change-Id: I7fb13884c54e4c3da8911fe0158798d32ad65578
2020-02-05 06:08:36 +00:00
Bernie Innocenti ab65ef22a5 Merge "Delete dangerous comparison operators from base::expected" 2020-02-05 05:51:45 +00:00
Automerger Merge Worker 967f4e0703 Merge "liblp: add test to presubmit" am: 3cbb753b0d
Change-Id: I148ce167ed644e252d85b73f4bda217ff4fb3855
2020-02-05 01:33:35 +00:00
Treehugger Robot 3cbb753b0d Merge "liblp: add test to presubmit" 2020-02-05 01:20:36 +00:00
Automerger Merge Worker 4b093c83ff Merge "adb: report error in copy_to_file." am: c71a1e7ab0
Change-Id: I9df74be0db95a7b589eae18ed9b1a8077e8215fa
2020-02-05 00:00:18 +00:00
Josh Gao c71a1e7ab0 Merge "adb: report error in copy_to_file." 2020-02-04 23:49:37 +00:00
Automerger Merge Worker 579f86807a Merge "libsnapshot::RemoveAllUpdateState log stack" am: e8cd50a7a0
Change-Id: Ibd57b43485a327fb5c33f708712d4e3037ab6ba5
2020-02-04 23:43:20 +00:00
Yifan Hong e8cd50a7a0 Merge "libsnapshot::RemoveAllUpdateState log stack" 2020-02-04 23:31:47 +00:00
Automerger Merge Worker 7954933e64 Merge "Make /data/media case insensitive" am: 02e5e1ea22
Change-Id: I881108eaacf8cf728d76712dfb14d4edc5bbab6c
2020-02-04 23:13:11 +00:00
Automerger Merge Worker f3e7db571b Merge "Set e2freefrag and e2fsdroid as required by libfs_mgr_defaults" am: 405d26dacb
Change-Id: I647101b7959a32e1028cc93c040b449a5920601e
2020-02-04 23:04:49 +00:00
Daniel Rosenberg 02e5e1ea22 Merge "Make /data/media case insensitive" 2020-02-04 23:03:38 +00:00
Treehugger Robot 405d26dacb Merge "Set e2freefrag and e2fsdroid as required by libfs_mgr_defaults" 2020-02-04 22:57:36 +00:00
Automerger Merge Worker b7faf5e351 Merge "Make snapshotctl logging better." am: c19b08a66a
Change-Id: If7dace11f0abbd6b88e81fa06cdd0ce1c7575c5b
2020-02-04 22:29:29 +00:00
Automerger Merge Worker 5f1a3a9a3f Merge "snapshot/test: Add delay to all the CreateLogicalAndSnapshotPartitions" am: b34a729469
Change-Id: Iafad2a6dcc7602f54fb8b0ae499f79e3aa433f3f
2020-02-04 22:28:44 +00:00
Yifan Hong c19b08a66a Merge "Make snapshotctl logging better." 2020-02-04 22:18:33 +00:00
Treehugger Robot b34a729469 Merge "snapshot/test: Add delay to all the CreateLogicalAndSnapshotPartitions" 2020-02-04 22:16:52 +00:00
Yifan Hong e8148150c3 libsnapshot::RemoveAllUpdateState log stack
Bug: 148818798
Test: apply OTA but cancel it in the middle, then
      delete /data/misc/update_engine/prefs/*, then
      reapply it again (to trigger CancelUpdate()).
      Stack is dumped.

Change-Id: I2dfb6b7f15b9d5854d0b81ed8ad260538d21c922
2020-02-04 14:01:24 -08:00
Yifan Hong 12fe03d470 Make snapshotctl logging better.
snapshotctl merge --logcat --log-to-file
- If --logcat, log to logcat
- If --log-to-file, log to /data/misc/snapshotctl_log/
- If both, log to both
- If none, log to stdout

Test: manually test these 4 cases
Bug: 148818798
Change-Id: I44b52936c0d095867acc6ee781c6bec04f6ebd6b
2020-02-04 14:01:24 -08:00
Automerger Merge Worker d365a4f57c Merge "Extra logging for metadata errors" am: 1b727bce06
Change-Id: I4ee69a940fab624a13a2066a1d03c81c4edfc637
2020-02-04 21:56:53 +00:00
Josh Gao 3828ebcdd8 adb: report error in copy_to_file.
Previously, if we failed to read a file after successfully opening it,
(e.g. because it's a directory), we would return prematurely without
notifying our caller, which would then wait forever for a response that
isn't coming.

Switch all of the adb install callsites over to checking the result,
but leave the other callsites ignoring the result, because they're
either deprecated, or don't care.

Bug: http://b/145621968
Test: mkdir foo.apk; adb install foo.apk
Change-Id: Ia82f8280b144f7881e067a10cd17f9a89019cf3f
2020-02-04 13:47:57 -08:00
Treehugger Robot 1b727bce06 Merge "Extra logging for metadata errors" 2020-02-04 21:37:42 +00:00
Alessio Balsini 13d2d968d9 liblp: add test to presubmit
Add liblp_test to TEST_MAPPING to be triggered as TH presubmit test.

Bug: none
Test: liblp_test
Change-Id: If4d60e816e4e1b321603e1a5ed00e21297567d38
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-04 21:33:56 +00:00
Alessio Balsini 272ef868f1 Extra logging for metadata errors
Increase logging in metadata image management.

Bug: none
Test: m
Change-Id: Ie49ca9ac90cd593c95d31f4651ae724d617d5695
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-04 20:49:59 +00:00
Alessio Balsini 841bccc1eb snapshot/test: Add delay to all the CreateLogicalAndSnapshotPartitions
In tests CreateLogicalAndSnapshotPartitions may give flaky results
because not synchronous.
Add a bounded delay that prevents this behavior defined by a single
constexpr.

Bug: none
Test: libsnapshot_test
Change-Id: Iad3c24b1d3e82e3bd695d6dbbc8af8eab75bee32
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-04 19:33:35 +00:00
Automerger Merge Worker 71c9eef34e Merge "tests: handle legacy and new bootstat complete" am: 09b9fc56a2
Change-Id: Ic453aba0c23499188702a7785e0b5c54e7e85986
2020-02-04 19:18:49 +00:00
Treehugger Robot 09b9fc56a2 Merge "tests: handle legacy and new bootstat complete" 2020-02-04 19:06:42 +00:00
Automerger Merge Worker 16dbe5dedd Merge "task_profiles.json: Fix uclamp attribute" am: 44da3704f7
Change-Id: I1b22629b71508585b04e04f87745d8f3ea54c18f
2020-02-04 18:00:15 +00:00
Treehugger Robot 44da3704f7 Merge "task_profiles.json: Fix uclamp attribute" 2020-02-04 17:50:11 +00:00
Mark Salyzyn 3576ed043c tests: handle legacy and new bootstat complete
Regression from commit cb1a8e7fdd
("Don't retrigger bootstat during userspace reboot.")

sys.boot_completed and either sys.logbootcomplete (legacy) or
sys.bootstat.first_boot_completed set to determine if the display
has gone active for bootstat.  For adb remount test we have no
desire or need to wait for bootstat complete, reduce script
complexity.

Also solve a possible problem with no content supplied to xargs.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Test: adb-remount-test.sh
Bug: 148804390
Bug: 135984674
Change-Id: Ieefddf583ff7422e8811d2e338a0f16c8943b0d7
2020-02-04 09:01:31 -08:00
Quentin Perret 20b2f1e0ab task_profiles.json: Fix uclamp attribute
task_profiles.json currently uses attributes of a defunct version of
uclamp, which was used for testing.

Let's use the attributes that actually got merged upstream instead.

Bug: 143710295
Change-Id: Ic6a14f52e14efeefc91f6e6bf580c15e2eded82e
Signed-off-by: Quentin Perret <qperret@google.com>
2020-02-04 13:10:31 +00:00
Bernie Innocenti 1cc76dfe84 Delete dangerous comparison operators from base::expected
These operators were included because they're present in the draft
standard proposal of std::expected, but they were deemed to lead to
bugs, particularly when T is implicitly convertible to bool.

Change-Id: Ib149decf1f230198f358dc1ae0eaed71961363f6
Test: m
2020-02-04 12:55:23 +00:00
Automerger Merge Worker 4a0bbf0838 Merge "Add libadbd_auth to adbd's required list." am: 955601beb4
Change-Id: I0d2443f77cd44ec8766ba89ed6419cc7ea97504e
2020-02-04 10:29:18 +00:00
Josh Gao 955601beb4 Merge "Add libadbd_auth to adbd's required list." 2020-02-04 10:16:41 +00:00
Josh Gao 9952258416 Add libadbd_auth to adbd's required list.
It seems like we might not be tracking dependencies properly on
devices with flattened APEXes? Add libadbd_auth to adbd's required
list to work around this for now.

Bug: http://b/148812347
Test: `ls $ANDROID_PRODUCT_OUT/system/lib/libadbd_auth.so` before and after when building a go device
Change-Id: If60abeb00797e37bf6a5a037249a21877e0b3d26
2020-02-04 07:17:19 +00:00
Automerger Merge Worker 545c380d43 Merge "Mount binderfs" am: b970633642
Change-Id: Id6892daceffdf3b9288761ecc55045e2e5c37ca2
2020-02-04 00:57:37 +00:00
Treehugger Robot b970633642 Merge "Mount binderfs" 2020-02-04 00:50:10 +00:00
Automerger Merge Worker 80183a10cd Merge "Add adbd_test to mts." am: d0854b3397
Change-Id: I5a6c747472a69cd80962e5681ce5b626ff88d879
2020-02-03 23:40:19 +00:00
Josh Gao d0854b3397 Merge "Add adbd_test to mts." 2020-02-03 23:30:12 +00:00
Automerger Merge Worker c50d82e418 Merge "Add support for casefold and product ID to format" am: 2e10d8f74f
Change-Id: I06c6d888848c4a138729c560af21f9f984f793bb
2020-02-03 23:24:09 +00:00
Daniel Rosenberg 2e10d8f74f Merge "Add support for casefold and product ID to format" 2020-02-03 23:12:15 +00:00