Commit Graph

55070 Commits

Author SHA1 Message Date
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
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
Matthew Maurer 8477031b7c Merge "Add support for mocked RPMB"
am: be9de1ab86

Change-Id: Ifbb116a5b39355a6bf7e905f88d4311ad175bdf1
2019-12-10 09:25:52 -08:00
Matthew Maurer be9de1ab86 Merge "Add support for mocked RPMB" 2019-12-10 17:16:09 +00:00
Tom Cherry ac7b81fc66 Merge "init: clarify a comment"
am: 5642bd2384

Change-Id: I697f6ae3e8431d8548e17e516dfca0e306aaa311
2019-12-10 09:14:26 -08:00
Tom Cherry 095c99d4a3 Merge "logcat: remove unused enum and #def"
am: 89bdf1f26f

Change-Id: Ie1e931c85ea129bd4cd17f5a08cbf710d85d307b
2019-12-10 09:11:45 -08:00
Treehugger Robot 5642bd2384 Merge "init: clarify a comment" 2019-12-10 17:07:30 +00:00
Treehugger Robot 89bdf1f26f Merge "logcat: remove unused enum and #def" 2019-12-10 17:06:50 +00:00
Nikita Ioffe d572c80ace userdata_checkpoint_remount: delete all devices in dm-stack under /data
This enables unmounting + remounting of metadata encrypted ext4
userdata. Also added a sysprop to force unmount+remount logic even for
f2fs userdata which comes handy for testing, since we don't have
metadata encrypted ext4 devices to test on.

Test: adb shell setprop sys.init.userdata_remount.force_umount_f2fs 1
Test: adb shell /system/bin/vdc checkpoint startCheckpoint 1
Test: adb reboot userspace
Test: adb shell dumpsys activity
Bug: 135984674
Bug: 143970043
Change-Id: Icc30f5c99f4d9ee374352610ae17b5d9814f815b
2019-12-10 16:03:45 +00:00
Oli Lan 2e4d37b4f9 Merge changes from topics "createapexdirs", "createapexrollbackdirs"
am: 06126e1b6e

Change-Id: I602e76198932d4afbb46ceb28fb70c3377e545ac
2019-12-10 05:04:07 -08:00
Oli Lan 06126e1b6e Merge changes from topics "createapexdirs", "createapexrollbackdirs"
* changes:
  Create directory for snapshots of DE_sys apex data.
  Create DE_sys APEX data directories.
2019-12-10 12:54:43 +00:00
Yifan Hong be0cd4bd3d Merge "libsnapshot: add library for test helpers"
am: 8759cbd590

Change-Id: Ie90c52432d64324c4e5c11198aa331e9599e19d4
2019-12-10 02:31:39 -08:00
Treehugger Robot 8759cbd590 Merge "libsnapshot: add library for test helpers" 2019-12-10 10:28:42 +00:00
Bowgo Tsai bd0853602b Adding the AVB public key for Q-Developer-GSI
Bug: 144399552
Test: m q-developer-gsi.avbpubkey
Change-Id: If140c429c8b8324c0c2364aa67e72e41748b42b4
2019-12-10 13:02:31 +08:00
Yifan Hong a16f2c81a8 libsnapshot: snaity check overflow bit at the end of update
Make sure CoW device doesn't overflow. Otherwise, data previously
written to snapshot device may be overwritten.

This check acts as a safety guard to bug like b/145180464, where
the computed CoW device size is less than required, but cannot be
caught by FilesystemVerifierAction in update_engine.

Note that this is a sanity check. It doesn't prevent the following:
(1) write a snapshot until it overflows
(2) unmap and re-map the snapshot
(3) Call FinishedSnapshotWrites()

When a snapshot is re-mapped, DeviceMapper::GetTableStatus() won't
return "Overflow".

However, update_engine always writes the full hashtree / FEC / etc.
data (outside of |PartitionUpdate.operations|), calls
FinishedSnapshotWrites(), and then writes the checkpoint. If the process
is interrupted, update_engine does the full FilesystemVerifierAction
from the beginning. Snapshots aren't remapped during the process. Hence,
the hypothetical case above won't happen in reality (at time of writing)
until FilesystemVerifierAction is broken down into steps with
checkpoints.

Still, given the above hypothetical case, this function is only served
as a sanity check.

FinishedSnapshotWrites() now requires all snapshots to be mapped before
calling. Hence, tests needs to be fixed:
- For SnapshotTest (that tests SnapshotManager private APIs), map
  snapshot before calling FinishedSnapshotWrites().
- Factor out common code in SnapshotTest (PrepareOneSnapshot and
  SimulateReboot)
- For SnapshotUpdateTest and children, add MapUpdateSnapshots() helper
  and map all snapshots before calling FinishedSnapshotWrites().

Test: libsnapshot_test
Bug: 145180464

Change-Id: I3558dd1615059ba27f369c27af22e3c686e392f7
2019-12-09 16:06:03 -08:00
Tom Cherry 4b4154be30 logcat: remove unused enum and #def
Test: build
Change-Id: Ie43b4eb39c85b2a8edad4a5a73696dc97f43be68
2019-12-09 13:29:39 -08:00
Tom Cherry 401d0013cc Merge "init: add missing O_CLOEXEC"
am: 687b55261c

Change-Id: I439e986ff89e837ce6a0e8c468a8c16d12f933fa
2019-12-09 09:55:39 -08:00
Tom Cherry 687b55261c Merge "init: add missing O_CLOEXEC" 2019-12-09 17:47:21 +00:00
Tom Cherry cbeaca541c init: clarify a comment
We do not need to set up all directories from system.img for the first
stage ramdisk, only those which first stage init mounts on.

Test: n/a
Change-Id: I877c623bac0b6dd2927ebdefa20da929ff98b341
2019-12-09 07:09:32 -08:00