Commit Graph

55342 Commits

Author SHA1 Message Date
Ricky Wai 3cca270e95 Create /data_mirror in init.rc
Mount a tmpfs on top of it, and serve as a mirror of /data/data
and /data/user_de, which will be used when zygote forks and
overlay its CE and DE storage to prevent app can see other applications.

Also, changed /data/user/0 from symlink to bind mount, so
/data_mirror/data_ce/null can just bind to /data/user directly.

Bug: 143937733
Test: Directories are created and mounted
Change-Id: Ic72c47c9d3dc0ffc98510f5bb351eccf76524232
2019-12-12 14:44:44 +00:00
Jack Pham b310da608b adbd: Update DeviceInterfaceGUID for WinUSB
The MS OS extended property descriptor is used to convey additional
information to Windows hosts, in this case the DeviceInterfaceGUID
which allows the inbox WinUSB driver to get automatically installed.

However, the ADB windows client looks for USB devices by enumerating
devices with a specific GUID {F72FE0D4-CBCB-407D-8814-9ED673D0DD6B},
and as a result fails to find the device since it was installed with
a different DeviceInterfaceGUID. Update the OS descriptor to pass
back the same GUID the client already uses.

Change-Id: If664cdd9be821c502e8c2048ff79e79e311936f5
2019-12-12 00:13:56 -08:00
David Anderson 864021fbf6 remount: Refactor fs_mgr_overlayfs_scratch_device().
This splits fs_mgr_overlayfs_scratch_device into two new methods. The
first, GetScratchStrategy, returns an enum detailing exactly how the
device will find space for scratch:
 - via system_<other>,
 - via super_<other>, or
 - via a dynamic partition.

The second method, GetScratchDevice, uses the strategy to either return
the underlying block device, or look up a dynamic partition.

fs_mgr_overlayfs_scratch_device will be removed completely in a separate
patch.

Bug: 134949511
Test: adb remount and adb_remount_test.sh
Change-Id: Ic7e3815ada4adaf5fd7c19b84dc22249f3dcc881
2019-12-12 03:06:21 +00:00
Haibo Huang 4a2a6c537f Merge "Add a name for all test suites"
am: b773897b01

Change-Id: I27d9d62cfbdc7b78e01967d439be629237b98c3f
2019-12-11 18:47:54 -08:00
Nikita Ioffe bf06dc17c4 Merge "Move `setprop sys.usb.configfs 0` to `on init` action"
am: 5183983af2

Change-Id: I6285fa0e0b997bcee30a835946a3408b4f8679fe
2019-12-11 18:45:53 -08:00
Treehugger Robot b773897b01 Merge "Add a name for all test suites" 2019-12-12 02:44:26 +00:00
Nikita Ioffe 5183983af2 Merge "Move `setprop sys.usb.configfs 0` to `on init` action" 2019-12-12 02:41:16 +00:00
Josh Gao c01a10f1b6 Merge changes I6ff85723,Ia7d743d5
am: f4ddee0f32

Change-Id: If80e3c463f93ac6eb6785664bc019b3c68b0c648
2019-12-11 18:07:05 -08:00
Josh Gao 2ad160be37 Merge "adb: remove atransport ref counting."
am: d692530a71

Change-Id: I31ab516e0d45a8d14ad1011ae6663a3c07988104
2019-12-11 18:05:27 -08:00
Josh Gao f4ddee0f32 Merge changes I6ff85723,Ia7d743d5
* changes:
  adb: add ls_v2.
  adb: rename syncmsg::*::time to mtime.
2019-12-12 01:39:20 +00:00
Treehugger Robot d692530a71 Merge "adb: remove atransport ref counting." 2019-12-12 00:47:28 +00:00
Bowgo Tsai 58eeaa4272 Merge "Using a dir /avb for DSU avb keys"
am: 1ef36b7491

Change-Id: Ibe5da14c8e8845dcaf59f5f0becacd5c352e2e33
2019-12-11 16:04:43 -08:00
Elliott Hughes d29f94cda8 shell-and-utilities: add bc.
We accidentally dropped this when it moved out of toybox.

Test: treehugger
Change-Id: I7bc0fc2d3fe3822232531465d2c13d306381c4ef
2019-12-11 15:58:38 -08:00
Treehugger Robot 1ef36b7491 Merge "Using a dir /avb for DSU avb keys" 2019-12-11 23:56:09 +00:00
Tom Cherry 49a8af7dff liblog: do not check loggability of event logs before sending to logd
This code was introduced to help performance by skipping sending these
messages to logd when logd would later drop them.  However it has
multiple flaws:

1) Event logs aren't super common and non-loggable event logs are even
   less common, so it would be a trivial benefit if any.
2) This code is not particularly safe as written, which is even
   acknowledged in the comments.
3) This forces processes that write event logs to allocate a rather
   sizable amount of memory.

Therefore, it's better to simply remove this and let logd drop these
messages when it receives them.

Bug: 139705697
Test: logging works, liblog-unit-tests
Change-Id: Ide01574112e173d4922137b3d3868cf8c2c09086
2019-12-11 15:46:47 -08:00
David Anderson 9b1a646b54 Merge "remount: Factor some code out of fs_mgr_overlayfs_mount_all()."
am: ce8ab2b546

Change-Id: I8b7cb79f7c074d1e99383d3c534ff93503dd5330
2019-12-11 14:38:11 -08:00
David Anderson ce8ab2b546 Merge "remount: Factor some code out of fs_mgr_overlayfs_mount_all()." 2019-12-11 22:27:38 +00:00
David Anderson cd720dc313 remount: Factor some code out of fs_mgr_overlayfs_mount_all().
To ease on the indentation, this factors the innermost code of
overlayfs_mountall() into a new TryMountScratch() function.

Bug: 134949511
Test: adb remount
Change-Id: I894cbcd17bb6bd64751f235a074fa5ba7ce5157c
2019-12-11 14:26:06 -08:00
Daniel Colascione 275f6c4404 Merge "Revert "Revert "Support socket activation of adb server"""
am: a449a1cfd7

Change-Id: If741b0798e242b8d06eb4bf6dbdb0d059c134306
2019-12-11 13:40:49 -08:00
Josh Gao 9a8366b3d9 adb: remove atransport ref counting.
The reference count is always 0 or 1.

Test: ./test_adb.py
Change-Id: I669f98f4996f4e41ac037f1add9c47819d4003d4
2019-12-11 13:40:41 -08:00
Treehugger Robot a449a1cfd7 Merge "Revert "Revert "Support socket activation of adb server""" 2019-12-11 21:33:48 +00:00
Tom Cherry 682c1fc139 Merge "liblog: simplify fake_log_device"
am: 15eda8c61e

Change-Id: I727dd56f6e083ba488842e58cdf722c1f45bca26
2019-12-11 12:49:55 -08:00
Tom Cherry a5bcb3ce8c Merge "Require 'exact', 'prefix', or '' for match operation in property_contexts"
am: 44c3df91be

Change-Id: I15d46ae8ea0688f5dca1e33823d4371486545ba6
2019-12-11 12:49:28 -08:00
Haibo Huang 0c01bb6edf Add a name for all test suites
(for the new googletest

Test: run tests
Change-Id: I3856a4a8f3ed23bcfcc59bec7624595e91740be0
2019-12-11 12:46:20 -08:00
Tom Cherry 15eda8c61e Merge "liblog: simplify fake_log_device" 2019-12-11 20:41:31 +00:00
Tom Cherry 44c3df91be Merge "Require 'exact', 'prefix', or '' for match operation in property_contexts" 2019-12-11 20:41:21 +00:00
Nikita Ioffe a4da27f40a Merge "userdata_checkpoint_remount: delete all devices in dm-stack under /data"
am: da776c394d

Change-Id: I3c8af83bbe2850efc413e8b11983d00f516231f5
2019-12-11 10:47:16 -08:00
Nikita Ioffe da776c394d Merge "userdata_checkpoint_remount: delete all devices in dm-stack under /data" 2019-12-11 18:40:21 +00:00
Tom Cherry 4b077c51f2 Require 'exact', 'prefix', or '' for match operation in property_contexts
The previous code would lazily check for 'exact' and accept any other
value as a prefix match.  This should be a tighter check allowing only
'exact', 'prefix', or an empty string for this option.

Test: build fails if an invalid string is used for the match operation
Test: build succeeds normally
Test: `getprop -Z` shows exact vs prefix is differentiated correctly
Change-Id: I21dcb193810d65f468f8960967eabfd261f71e21
2019-12-11 07:56:51 -08:00
Tom Cherry c619e49f74 liblog: simplify fake_log_device
This still fakes the long removed /dev/log devices, whereas it only
needs to print to stderr, so simplify that code.

Use std::mutex now that it is C++ to easy portability concerns.

Use the proper liblog headers for formatting information instead of
hardcoding a copy.

Test: liblog-host unit test
Change-Id: I310a6e7ad939960300eafa729cbfc535c5ced445
2019-12-11 07:20:37 -08:00
Tom Cherry 6f56f9b5c1 Merge "liblog: add a test for liblog on host"
am: 1ccaf2b8ee

Change-Id: I96fcc8339752237f4dec9b6cdf313aba19385e1d
2019-12-11 06:42:07 -08:00
Tom Cherry 1ccaf2b8ee Merge "liblog: add a test for liblog on host" 2019-12-11 14:36:56 +00:00
Gavin Corkery 98e3829fe0 Merge "Store crashing process name in sysprop"
am: d1f5a817af

Change-Id: I8df1f5722875a407741c6941aa38e30658efe812
2019-12-11 04:03:59 -08:00
Gavin Corkery d1f5a817af Merge "Store crashing process name in sysprop" 2019-12-11 11:50:59 +00:00
Bowgo Tsai a2ac846ff3 Using a dir /avb for DSU avb keys
Previously the AVB public keys for DSU is hard coded for each key path.
This adds the burden for maintaining the codebase, e.g., need to change
avb_keys each time when any new key is added or some old key is deleted.

With commit Ie74845d8c8e4aa45e8a9e3b862424cec641f8090, it's possible to
load avb keys from a directory. Let's use "/avb" for DSU AVB keys.

Also removing fstab entries that specifying vbmeta_partition. The AVB
keys used in DSU flow should be a separate set from the original
vbmeta.img (or vbmeta_system.img).

The following link has more info about DSU:
  https://developer.android.com/topic/dsu

Bug: 141284191
Bug: 144399552
Test: boot a GSI via DSU

Change-Id: I6bc1e068368e64cb0bbf6ef63805444b35a1fdfb
2019-12-11 09:00:46 +00:00
Daniel Colascione 3ec7be7a84 Revert "Revert "Support socket activation of adb server""
Test: actually build both device and client adb this time

This reverts commit c77904e3c5.

Change-Id: I8c2b8f24884ff36ff2460dab2500bad777100dfd
2019-12-11 08:20:20 +00:00
Bowgo Tsai f0b73557a3 Merge "Allowing the fs_mgr flag of avb_keys to be a dir"
am: 9af7878ec5

Change-Id: I9889465217c81308cc18b2ccae8a8580d013b780
2019-12-10 22:03:26 -08:00
Treehugger Robot 9af7878ec5 Merge "Allowing the fs_mgr flag of avb_keys to be a dir" 2019-12-11 04:26:57 +00:00
Kiyoung Kim 5b4162c464 Merge "Move linker config under /linkerconfig"
am: 597eca8a8c

Change-Id: I88bf213b85759f2716012e9967924cf0febb1297
2019-12-10 18:59:46 -08:00
Kiyoung Kim 597eca8a8c Merge "Move linker config under /linkerconfig" 2019-12-11 02:55:06 +00:00
Yifan Hong 712c32b2b9 fastboot: Flashall does proper snapshot cancel
Fix typo.
Test: flashall

Change-Id: I54a51a489aef2e1de5e682f5e97b95b2278085ec
2019-12-10 18:12:55 -08:00
Tom Cherry d953ba3c82 liblog: add a test for liblog on host
Test: this test
Change-Id: I60fa8b82dbc010395762eba70502b89b295e29f5
2019-12-10 15:35:19 -08:00
Gavin Corkery 5d0deb563d Store crashing process name in sysprop
As part of Watchdog-triggered rollback logging, it would
be useful to know the service which has caused
updatable_crashing to be set. Store this in a new property
sys.init.updatable_crashing_process_name.

Test: manual
Bug: 138782888
Change-Id: Iffa38b2b746abbb5d823a8d69b7b8d2456836f4e
2019-12-10 23:00:24 +00:00
Steven Moreland aca5fcae52 Merge "statusToString: parenthesize strerror"
am: b033ea31ad

Change-Id: I8fcb607cf3b24588bf873ca3ebe0c71ef9a790db
2019-12-10 13:05:02 -08:00
Steven Moreland b033ea31ad Merge "statusToString: parenthesize strerror" 2019-12-10 20:57:10 +00:00
Christopher Ferris 71ac5c883b Copy necessary ipt_ULOG.h structure to source.
The ipt_ULOG.h file has been deprecated, so it's being removed from
the bionic uapi kernel headers. Since this is the only code that
is using that file, copy the one structure needed to parse one type
of message into the file that needs it.

Test: Builds.
Change-Id: Ib879e655d598256c424792675d24e647eee33f89
2019-12-10 12:53:39 -08:00
Nikita Ioffe c796f918db Move `setprop sys.usb.configfs 0` to `on init` action
This should solve the problem of
`property:sys.usb.config=adb && property:sys.usb.configfs=0` action
being wrongly triggered during userspace reboot.

Also reset some adbd-related property in `on userspace-reboot-requested`
action to make sure that userspace reboot sequence is as close as
possible to normal boot sequence w.r.t adbd.

Test: adb reboot userspace
Test: checked property:sys.usb.config=adb && property:sys.usb.configfs=0
  action is not triggered

Bug: 135984674
Change-Id: Icf40386399ee84d01228020e65f71ba473d72822
2019-12-10 19:16:15 +00:00
Steven Moreland 1e8e49cc2c statusToString: parenthesize strerror
For clarity, when printint w/o delination, noticed in b/145776393.

Test: view output of statusToString from a dumpsys change
Change-Id: I5ea9f052c223f167dd58923e2470c852907c97b8
2019-12-10 18:43:53 +00:00
Elliott Hughes cd2a3a0b05 Merge "Be more careful about symlinking a file that actually exists on the host."
am: 3498578c4c

Change-Id: Icf731c09c568f4062353d3e52c0cccc77cba57e8
2019-12-10 10:05:28 -08:00
Elliott Hughes 3498578c4c Merge "Be more careful about symlinking a file that actually exists on the host." 2019-12-10 17:59:15 +00:00