Commit graph

53921 commits

Author SHA1 Message Date
Mark Salyzyn
8c1051918e libmodprobe: Do not reload modules previously instantiated
For modprobe operation.

For an interlocking driver set of about 50 modules, the impact of
their dependencies resulted in a 30 second impact in boot time
trying to load previously loaded modules. This impact is handily
eliminated by keeping a list of modules paths that have been loaded
and skipping them proactively.

Test: Confirmed device boot and 50 module set of drivers functions.
Test: libmodprobe_tests
Bug: 142938937
Bug: 140827934
Change-Id: Iccd11399d6043b38cbd5f93578ee202022e7770c
2019-10-30 07:20:18 -07:00
Treehugger Robot
f77c98a780 Merge "Revert "Revert "Revert "Revert "Use com.android.vndk.current variant for vndk list""""" 2019-10-30 04:29:37 +00:00
Elliott Hughes
d3aee6653f unzip: add -Z for "zipinfo mode".
But don't document it because it's a silly idea. Just call zipinfo
directly if you want zipinfo!

There are multiple uses of `unzip -Z` in the AOSP build, though, so we
may as well support it if people are already using it.

Test: manual
Change-Id: I04b05795badf63febe1210fbeaa96e3bd27237f1
2019-10-29 20:47:16 -07:00
Treehugger Robot
9786fbb9d3 Merge "Fixes typos for adb shell stop/start." 2019-10-30 01:54:51 +00:00
Christopher Ferris
4ca98e18a4 Fix potential bad info in eh_frame_hdr.
Due to a bug, an elf can have FDEs with a length of zero, while still
having another FDE for the same pc with a non-zero length. The
eh_frame_hdr can sometimes point to the zero length FDE, but it should
have pointed to the non-zero length FDE. In order to fix this, if the
eh_frame_hdr points at the zero length FDE then try and find the real FDE
directly from eh_frame.

The change cleans up and removes unused variables from DwarfEhFrameWithHdr
and changes the objects so that all of the DwarfSection objects and
DwarfEhFrameWithHdr object inherit from the same class.

Add new unit tests to verify this functionality.

Bug: 142483624

Test: Unit tests all pass.
Change-Id: I128a916e3ba378931de7d44ee15e57e24d4073df
2019-10-29 18:39:30 -07:00
Tom Cherry
6f061e8d64 logcat: modernize the code
1) Use libbase parsing functions instead of our own versions
2) Remove log_device_t, as it's an unneeded wrapper around log buffers
3) Do not report 'unexpected' if we get a log from a buffer that we
   didn't reqest.  I checked and I don't see any references to this
   happening in practice, so the code is mostly superfluous.  It seems
   reasonable enough to report the actual buffer name instead of
   'unexpected' in any case.
4) Print all buffers that experience an error, not just the first one
   seen.

Test: logcat works, logcat-unit-tests
Change-Id: Ic50074cfb716f63f3eda261f1cd236d7afaf453a
2019-10-29 16:07:51 -07:00
Elliott Hughes
c70a73d057 Merge "zipinfo: support DOS attributes." 2019-10-29 20:50:54 +00:00
Elliott Hughes
2d70aad034 Remove Mac/Windows quick_exit() implementation.
This was added with the intention of using it in adb, but then the
change that would have used it
(https://android-review.googlesource.com/c/platform/system/core/+/273824)
was abandoned.

Remove the corresponding (never used) implementation.

Bug: http://b/31468413
Test: treehugger
Change-Id: I42322d079c175b7c6fbd12940e5bc022bd9ebd1c
2019-10-29 13:30:43 -07:00
Daniel Norman
7171458a30 Fixes typos for adb shell stop/start.
Test: n/a
Change-Id: Idaad0bfbf3c9d3fd7fc768940746c78528116a13
2019-10-29 11:05:45 -07:00
Elliott Hughes
d50952587d zipinfo: support DOS attributes.
golang doesn't include Unix mode by default.

Also show all the deflate variants ("defN" versus "defX").

Cope better with being called directly rather than via symlink.

Test: manual
Change-Id: I23b441c847ce9a557ea866b3c43bdf0542b26f10
2019-10-29 07:55:16 -07:00
Treehugger Robot
ff60db1bb1 Merge "COW partition creator uses DmSnapshotCowSizeCalculator" 2019-10-29 10:42:29 +00:00
Nikita Ioffe
6aa1b01316 Merge changes I7a3c181a,I72c60ec8
* changes:
  Add a test asserting that default fstab has /data entry
  Add fs_mgr_unit_test to CTS
2019-10-29 09:17:04 +00:00
Treehugger Robot
a1015599d3 Merge changes from topic "batt_mon_2_1_types"
* changes:
  healthd: partially fill in health 2.1 HAL fields
  [REFACTOR] healthd: BatteryMonitor use health 2.1 types
2019-10-29 03:52:54 +00:00
Paul Crowley
51c41e94d9 Merge "fs_mgr: Don't parse encryption options, just keep string" 2019-10-29 02:00:36 +00:00
Treehugger Robot
6b9971c55f Merge "Fixed fs_mgr#fs_mgr_read_fstab_file_proc_mounts test" 2019-10-29 01:01:23 +00:00
Yifan Hong
e78ca07631 Merge "fs_mgr: retrofit VAB update after A/B calc COW space." 2019-10-29 00:35:57 +00:00
Yifan Hong
2c74292038 Merge "libsnapshot: Add EnsureMetadataMounted" 2019-10-29 00:35:44 +00:00
Tri Vo
8b1e934555 trusty-ut-ctrl: link statically to libtrusty
Removes the need to push libtrusty.so to run trusty-ut-ctrl binary.

Test: m trusty-ut-ctrl
Change-Id: I19c2957d3eb1dc165e13f2ce5560fe31ea9a2469
2019-10-28 14:54:06 -07:00
Treehugger Robot
85f5a4449c Merge "pragma once for header file" 2019-10-28 21:34:01 +00:00
Jooyung Han
e5811e8967 Revert "Revert "Revert "Revert "Use com.android.vndk.current variant for vndk list""""
This reverts commit 3cb19a74f2.

Reason for revert: Fix b/143374795

Change-Id: I21dae5ff3c9bf05ac15ac26210d7c8d7f9c46e1c
2019-10-28 21:08:04 +00:00
Paul Crowley
4fa841350f fs_mgr: Don't parse encryption options, just keep string
We now defer parsing encryption options to the fscrypt library. To avoid
adding a dependency, we simply record the options string in the fstab
and defer parsing until it's needed.

Bug: 143307095
Test: cuttlefish still boots
Change-Id: Ied13ea2f731c63b0524aed11db6983a86dab9fa1
2019-10-28 13:41:00 -07:00
Elliott Hughes
23a3dceaa5 Merge "libziparchive: add zipinfo(1)." 2019-10-28 19:45:32 +00:00
Alessio Balsini
14d1394a7e COW partition creator uses DmSnapshotCowSizeCalculator
Instead of using heuristics on the calculation of the COW size, use the
class representing the internal structure of the COW device as generated
by the Linux kernel.
This simplifies the forecast of the required COW device size depending
on the write operations performed on the associated snapshot device.

Created also an additional test case for the COW size calculation.

Change-Id: If147001544988716430b36a4c75dfa7f34b4c8d9
Bug: 140835698
Test: libsnapshot_test
Signed-off-by: Alessio Balsini <balsini@google.com>
2019-10-28 18:59:45 +00:00
Greg Kaiser
b6a3d3f9d3 Merge "Revert "Revert "Revert "Use com.android.vndk.current variant for vndk list"""" 2019-10-28 17:12:33 +00:00
Tom Cherry
20d02ca458 Merge "logcat: remove the rest of liblogcat" 2019-10-28 17:01:58 +00:00
Nikita Ioffe
3f334dcaa4 Add a test asserting that default fstab has /data entry
When aosp/1149619 is merged, userspace reboot will start to depend on
the fact that default fstab has an entry for /data, hence this test
to make sure that this is the case.

Bug: 135984674
Test: atest CtsFsMgrTestCases
Change-Id: I7a3c181a6b27a7b4dfc344ff04be712f3fe3376e
2019-10-28 16:47:47 +00:00
Alessio Balsini
70f0be3811 pragma once for header file
Add missing "#pragma once" to header file.

Bug: none
Test: build
Change-Id: I9ea248686dc2affc8ba093c58a2660505f5cc8de
Signed-off-by: Alessio Balsini <balsini@google.com>
2019-10-28 16:38:35 +00:00
Nikita Ioffe
8a603a7f9b Merge "Userspace reboot: Support remounting userdata for f2fs" 2019-10-28 16:28:23 +00:00
Nikita Ioffe
607cbbf1e8 Add fs_mgr_unit_test to CTS
Test: atest --rebuild-module-info CtsFsMgrTestCases
Bug: 135984674
Change-Id: I72c60ec8acdcb3539da091abb4f84e0bc3c6743b
2019-10-28 16:28:02 +00:00
Nikita Ioffe
e93b12847f Fixed fs_mgr#fs_mgr_read_fstab_file_proc_mounts test
It was failing with:
Expected equality of these values:
mnt_opts
Which is: { "data=ordered", "discard", "noatime", "nodev", "nosuid", "rw", "seclabel", "sync" }
fs_options
Which is: { "data=ordered", "discard", "noatime", "nodev", "nosuid", "rw", "seclabel" }

Test: atest fs_mgr_unit_test
Change-Id: I3bb084d62e81fda8948a100515bdaad62d18bb54
2019-10-28 14:42:01 +00:00
Jooyung Han
3cb19a74f2 Revert "Revert "Revert "Use com.android.vndk.current variant for vndk list"""
This reverts commit 74f23d7ae6.

Reason for revert: b/143374795

Change-Id: I35cb387b87d3eb2eb0963b669e359ff538c28c90
2019-10-28 05:07:46 +00:00
Xin Li
f71ca37df4 Merge "Merge Coral/Flame into AOSP master" 2019-10-27 04:44:29 +00:00
Yifan Hong
02f2c1b75a fs_mgr: retrofit VAB update after A/B calc COW space.
When applying retrofit VAB update on a regular A/B device,
if device is at version Android R, update_engine may run
a virtual A/B update directly. In this case, partitions
with suffix B in slot 0 (current slot) should not be treated
as unusable space by CoW.

Fixes: 143323939
Test: libsnapshot_test

Change-Id: Ic845374e519885d21e021e97cb32fab9f5d56a63
2019-10-25 15:54:00 -07:00
Yifan Hong
d2a0247538 libsnapshot: Add EnsureMetadataMounted
In recovery, client is responsible for calling
EnsureMetadataMounted before doing (almost) all
operations on SnapshotManager, e.g.

- CancelUpdate() before sideloading
- BeginUpdate() on retrofit Virtual A/B before sideloading
- Finishing merge before flashing

Test: libsnapshot_test
Test: recovery sideload
Bug: 140749209
Change-Id: I1034a7fa74e31b6850896e61e86341239dbf2699
2019-10-25 15:37:11 -07:00
Tom Cherry
d162f14d6c logcat: remove the rest of liblogcat
There were big changes made to support liblogcat, which has long since
been removed.  This change removes the rest of those changes.

It moves the rest of the global state into a class, particularly for
the logcatd case.  The original code re-uses the same context, but
that doesn't seem right or safe.

Test: logcat works, logcat-unit-tests
Test: logpersist works, including last log cat and log rotation
Change-Id: Iee6a2a0319265e87be0bc8fec2b11e8fd2b65ed4
2019-10-25 15:00:16 -07:00
Paul Crowley
82f1cbea1e Merge "Use new libfscrypt interface" 2019-10-25 18:05:26 +00:00
Xin Li
128bbfc7be Merge Coral/Flame into AOSP master
Bug: 141248619
Change-Id: I32e18ca4131b81846dca976699df8be71549e4e1
Merged-In: I6b95cf1a731c4dc09a7897f3114e2ad6595d60bb
2019-10-25 10:28:40 -07:00
Elliott Hughes
2672413d91 libziparchive: add zipinfo(1).
Useful for debugging and hermetic builds. (Various places in the build
check to see that a file was stored uncompressed.)

Test: manual
Change-Id: I127e5689cd493ab06739b765beed50912dc9cc1d
2019-10-25 10:07:08 -07:00
Tom Cherry
c8ef01344d Merge changes from topic "remove-legacy-logger_entry-structs"
* changes:
  liblog: document the liblog<->logd protocol format
  liblog: remove unused parts of android_log_transport_context
  Remove old logger_entry_v* formats
  liblog: disable header_abi_checker
2019-10-25 16:53:20 +00:00
Nikita Ioffe
59cb3c6221 Merge "init/reboot.cpp: user lower_snake_case instead of camelCase" 2019-10-25 16:03:34 +00:00
Nikita Ioffe
12a36076a7 Userspace reboot: Support remounting userdata for f2fs
Test: adb reboot userspace
Test: adb shell /system/bin/vdc startCheckpoint 1;
      adb reboot userspace
Bug: 135984674
Change-Id: I227f2c1cc18495d893decb2df5173fc7a7919df6
2019-10-25 16:27:10 +01:00
Jooyung Han
7234df438a Merge "Revert "Revert "Use com.android.vndk.current variant for vndk list""" 2019-10-25 08:21:13 +00:00
Paul Crowley
9107e6f4f1 Use new libfscrypt interface
Bug: 143307095
Test: treehugger
Change-Id: Icc97ff5b32e8d291a75c62640b4d9b8e4f64de09
2019-10-24 20:47:48 -07:00
Max Spector
2f32c28f5b Merge "Liblogd log fuzzer" 2019-10-25 00:21:11 +00:00
Nikita Ioffe
e7ec8c81e4 init/reboot.cpp: user lower_snake_case instead of camelCase
Also removed unused parameter from TryUmountAndFsck.

Test: builds
Change-Id: I1a892a0356afb08bf0680476ae1170ea568c65e2
2019-10-25 00:44:26 +01:00
Yifan Hong
3d613876e9 Merge "libsnapshot: Only EnsureImageManager when it is needed."
am: 81a0738c68

Change-Id: I6b95cf1a731c4dc09a7897f3114e2ad6595d60bb
2019-10-24 14:52:19 -07:00
Yifan Hong
81a0738c68 Merge "libsnapshot: Only EnsureImageManager when it is needed." 2019-10-24 21:32:58 +00:00
Josh Gao
b555d6ba5d Merge changes from topics "adbd_reboot", "adbd_verity"
am: 18bbb2d821

Change-Id: Ie53f91b3e381bc4c8b1ab4afe8c66a82fc29bc73
2019-10-24 14:31:59 -07:00
Josh Gao
0d6c43bcf2 Move enable-verity/disable-verity out of adb to a helper binary.
am: f61f41494e

Change-Id: I04d51685d97beb1d481693823e35781243ecce8a
2019-10-24 14:31:51 -07:00
Josh Gao
2900290499 Use adbd_system_binaries to track adbd's dependencies.
am: 7b7ee191dc

Change-Id: Iad5c3797db17e27c311e787a8879a7ea7793f466
2019-10-24 14:31:41 -07:00