Commit graph

55746 commits

Author SHA1 Message Date
Martijn Coenen
4501ed5c2e Add AID_EXT_DATA_RW / AID_EXT_OBB_RW GIDs.
These will be used as a GID for the Android/data and Android/obb
directories respectively, on devices that don't have sdcardfs.

Bug: 146419093
Test: builds
Change-Id: I52a3235e872eb4b0402f918d5c47661f16626ba6
2020-01-31 15:12:31 +01:00
Hridya Valsaraju
6a879b25d9 Check /sys/kernel/tracing for tracefs
When debugfs is not mounted, atrace should look for
tracefs in /sys/kernel/tracing.

Test: CtsAtraceHostTestCases
Bug: 148436518
Change-Id: I45c0e664892bcda277fd9612106ad5216aea0a1b
2020-01-30 17:38:51 -08:00
Josh Gao
7f72945eff adbd: actually dynamically link against libadbd_auth.
libadbd_auth was accidentally linked as a static library, which defeats
the entire purpose.

Test: treehugger
Test: readelf -d $ANDROID_PRODUCT_OUT/apex/com.android.adbd/bin/adbd
Change-Id: Id5b66745946a8b92e368ee5f3965275ff03e056d
2020-01-30 16:18:43 -08:00
Paul Crowley
7823e327c1 Rename key_dir to metadata_key_dir and refactor
Bug: 147814592
Test: Crosshatch boots
Change-Id: I18b03486d2e93c6103880d1af68d9f70147fde63
2020-01-30 16:03:45 -08:00
Josh Gao
7e015871db Add adbd_test to mts.
Bug: http://b/137798163
Test: mts-tradefed run mts-adbd
Change-Id: I875f224bbcd7b1f81365fffdd8de8d2df4e87c84
2020-01-30 23:53:20 +00:00
Treehugger Robot
d7c1bc73dc Merge "Skip snapshot tests for non-Virtual A/B devices" 2020-01-30 23:49:19 +00:00
Alessio Balsini
fb5de5bc8f Propagate failure of MetadataBuilder creation in CreateUpdateSnapshots
In a device with malformed metadata, the MetadataBuilder returns a
nullptr that may cause segmentation faults when using the builder.
Fix by handling the nullptr exception in CreateUpdateSnapshot and
propagating the error to its caller.

Bug: n/a
Test: libsnapshot_test
Change-Id: Ie9148a552cf4bb223ab8d54b1d30d2b13d92bb22
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-01-30 22:42:54 +00:00
Chih-Hung Hsieh
9911e28043 Allow LOG_ALWAYS_FATAL_IF in constexpr functions
* When __FAKE_USE_VA_ARGS has args that are not constexpr,
  reaching it in a constexpr function will be make the
  constexpr function invalid.
  To allow LOG_ALWAYS_FATAL_IF in a constexpr functions when
  the tested condition is false, it should call __FAKE_USE_VA_ARGS
  only when the tested condition is true.
* Other ALOG*_IF macros are also changed to call
  __FAKE_USE_VA_ARGS only when the tested condition is true.

Bug: 148548418
Test: WITH_TIDY=1 make
Change-Id: Ie8a444dffbf9cbef78e5e0b49b44f4092bcf9982
2020-01-30 09:39:50 -08:00
Alessio Balsini
fce02741d3 Skip snapshot tests for non-Virtual A/B devices
The libsnapshot features are currently not used anywhere else than the
update system with Virtual A/B.
Ignore libsnapshot tests for devices that are not implementing this
feature.

Test: m, snapshot_test, OTA
Bug: 142513589
Change-Id: I4580bae5ed315f21501556eea062e6af1f982ab3
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-01-30 16:23:27 +00:00
Elliott Hughes
b2066fda6d Merge "adb: make the push summary fit in 80 columns." 2020-01-30 16:01:01 +00:00
Maciej Żenczykowski
00a21e3d54 symlink /dev/net/tun -> ../tun
This is the expected location on Linux and this makes 'ip tuntap' work.

Before:
  vsoc_x86_64:/ # ip tuntap add dev tun0 mode tun
  open: No such file or directory
  vsoc_x86_64:/ # ip tuntap add dev tap0 mode tap
  open: No such file or directory
  vsoc_x86_64:/ # ip tuntap list

After:
  vsoc_x86_64:/ # ip tuntap add dev tun0 mode tun
  vsoc_x86_64:/ # ip tuntap add dev tap0 mode tap
  vsoc_x86_64:/ # ip tuntap list
  tap0: tap UNKNOWN_FLAGS:800
  tun0: tun UNKNOWN_FLAGS:800

  $ adbz shell ls -ldZ / /dev /dev/tun /dev/net /dev/net/tun
  drwxr-xr-x 25 root   root u:object_r:rootfs:s0         4096 2020-01-25 09:48 /
  drwxr-xr-x 21 root   root u:object_r:device:s0         1240 2020-01-25 09:48 /dev
  drwxr-xr-x  2 root   root u:object_r:device:s0           60 2020-01-25 09:48 /dev/net
  lrwxrwxrwx  1 root   root u:object_r:device:s0            6 2020-01-25 09:48 /dev/net/tun -> ../tun
  crw-rw----  1 system vpn  u:object_r:tun_device:s0  10, 200 2020-01-25 09:48 /dev/tun

Test: see above
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2aa215711454ce4f8a0ef1f34c17621629060fa1
2020-01-30 03:51:33 +00:00
Treehugger Robot
274bd807a6 Merge "Creating logical and snapshot partitions uses timeout in tests" 2020-01-30 02:57:25 +00:00
Hridya Valsaraju
8e50be74ae Mount binderfs
Mount binderfs at /dev/binderfs. Also add symlinks from /dev/binder,
/dev/hwbinder and /dev/vndbinder to /dev/binderfs/binder,
/dev/binderfs/hwbinder and /dev/binderfs/vndbinder respectively.

Bug: 136497735
Test: Cuttlefish boots on Android Common Kernel 4.19 with kernel config
CONFIG_ANDROID_BINDERFS=y.

Change-Id: I349face22a2e73bfd79af0188e41188c323388f7
2020-01-29 17:59:17 -08:00
Alistair Delva
1fad2b39a3 Merge "Correct /sys/kernel/tracing permissions" 2020-01-30 00:08:02 +00:00
David Anderson
838b1a1f94 Merge "fs_mgr: Fix MapScratchPartitionIfNeeded signature" 2020-01-29 22:48:08 +00:00
Treehugger Robot
68acec7723 Merge "Dependency cleanup for snapshot .bp" 2020-01-29 20:55:03 +00:00
Luca Stefani
32835b3967 fs_mgr: Fix MapScratchPartitionIfNeeded signature
Test: lunch aosp_x86_64-user; m

Change-Id: I0cd9be80baab664dd374593c1a4f45cea6a0cc78
2020-01-29 20:58:06 +01:00
Treehugger Robot
77840a1877 Merge "Revive ACgroupController_getFlags LLNDK function to detect missing cgroups" 2020-01-29 18:50:12 +00:00
Treehugger Robot
30abf7a9fc Merge "libsnapshot_test runs as root" 2020-01-29 18:43:53 +00:00
Alessio Balsini
153ccacfb6 Creating logical and snapshot partitions uses timeout in tests
CreateLogicalAndSnapshotPartition is used in first-stage init and by
default never blocks (thanks to a timeout set to 0).  This causes some
libsnapshot tests to fail, because snapshot devices may be accessed
before there actual creation is complete.
Fix by introducing a timeout_ms argument, set to 0 if unspecified.

Test: libsnapshot_test
Bug: 142513589
Change-Id: I5e23adaaf6df8603df501b9a25fdd1e9d8c15252
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-01-29 18:24:50 +00:00
David Anderson
c335a34f6b Merge "set-verity-state: Link to libfs_mgr_binder." 2020-01-29 17:55:06 +00:00
David Anderson
21dcbd15bc Merge "remount: Use /data for backing scratch storage." 2020-01-29 17:55:06 +00:00
Suren Baghdasaryan
cee468fb79 Revive ACgroupController_getFlags LLNDK function to detect missing cgroups
ACgroupController_getFlags was reverted due to LLNDK breakage, however
it allows detection of cgroups that failed to mount in a more efficient
way. Revive the function as a weakly linked symbol to allow for it to
be missing in case older LLNDK library is being used with the new
system software. This effectively reverts the commit
aa1d54f0cc "Remove ACgroupController_getFlags to fix API breakage"'
except it declares ACgroupController_getFlags function as weak and
targets it for API level 30. If LLNKD library does not contain
ACgroupController_getFlags the behavior falls back to the current
way of identifying cgroups that failed to mount.

Test: build and verify correct operation with a missing cgroup
Change-Id: I9158ef53aba97972d41d71dd3396ac43796a7004
Merged-In: I9158ef53aba97972d41d71dd3396ac43796a7004
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2020-01-29 17:24:06 +00:00
Alistair Delva
ebb5b3bd48 Correct /sys/kernel/tracing permissions
In Android kernels >4.4 we will see an empty /sys/kernel/tracing
directory which is notionally where you should mount tracefs if you
don't want to mount debugfs. As we move towards not mounting debugfs,
ensure that the non-legacy location also has adequate permissions to be
read by tracing tools.

Note that this change will be OK even if the board init.rc doesn't mount
tracefs here, because sysfs will always create this directory.

Bug: 148436518
Change-Id: I674587d0f08effdb8471a82e3b1ceec3af8588de
2020-01-29 09:10:50 -08:00
Alessio Balsini
5dd50b2b84 Dependency cleanup for snapshot .bp
Reorder, remove and fix some of the dependencies in the Android.bp for
snapshot.

Test: m, snapshot_test, OTA
Bug: 142513589
Change-Id: Id214a8d6453a5675e60cda4352094dc3987292ec
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-01-29 16:31:06 +00:00
Alessio Balsini
a7383b4001 libsnapshot_test runs as root
Add flag in Android.bp to force the execution of libsnapshot_test as
root.

Test: m
Bug: 142513589
Change-Id: I9d047a9e1f9ea6d6e5540fa66fb42603ea136641
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-01-29 16:31:06 +00:00
Tom Cherry
20610c3082 Merge changes I303549ae,Ia36e0d2e,Ibdea2961
* changes:
  liblog: fix host tests
  liblog: do not allow loggers to write to binary buffers
  liblog: remove fake_log_device
2020-01-29 16:02:14 +00:00
Nikita Ioffe
2d88794a7d Merge "Trigger boot animation on userspace reboot" 2020-01-29 11:24:01 +00:00
Josh Gao
e30aa60128 Merge "Move jdwp connection abstraction from ART apex to adbd apex." 2020-01-29 00:03:22 +00:00
Tom Cherry
5676f3d916 liblog: fix host tests
1) Fix up the host tests for new logging format
2) Add recently added tests to the host test
3) Ensure that properties are cleaned up by liblog-unit-tests

Test: unit tests
Change-Id: I303549aecc26d11ec87e59d48758ced4c198b72c
2020-01-28 13:07:11 -08:00
Tom Cherry
f48f685e60 liblog: do not allow loggers to write to binary buffers
Do not write to binary buffers, this was already done for logd,
but wasn't explicitly done for other loggers, so do that too.

Test: unit tests
Change-Id: Ia36e0d2e1b6c833780239a5ef459abea99bc4a1f
2020-01-28 13:07:11 -08:00
David Anderson
c13586faea remount: Use /data for backing scratch storage.
Currently, this is only enabled for Virtual A/B devices. When /data uses
F2FS, then proper pinning support must be enabled.

Because /data cannot be mounted in recovery, we can't delete the scratch
image backed by /data while in fastbootd. Instead, we mark it as
disabled in /metadata. The remount command now has an init script that
checks for and removes a disabled scratch partition.

Bug: 134949511
Test: adb remount on V A/B device with patched F2FS
Change-Id: Ifc8720378259654472d3822e97059b6c366f601d
2020-01-28 12:04:38 -08:00
Tom Cherry
e2187bfbbc liblog: remove fake_log_device
This is now dead code as __android_log_stderr_logger() has superseded it.

Bug: 147496863
Test: build
Change-Id: Ibdea2961ec4fc093bf9e35581dc1c46db2cff06a
2020-01-28 10:42:02 -08:00
Tom Cherry
077839ab23 Merge "liblog: always restore errno in logging functions" 2020-01-28 16:25:12 +00:00
Nikita Ioffe
764c1ac8ba Trigger boot animation on userspace reboot
Also reset some more properties to make bootanimation work properly.

Test: adb reboot userspace
Bug: 148172262
Change-Id: I0154d4fe9377c019150f5b1a709c406925db584d
2020-01-28 10:42:44 +00:00
Yabin Cui
15778b7439 Merge "libunwindstack: add simpleperf presumit test." 2020-01-28 03:51:44 +00:00
Maciej Żenczykowski
144f42d23d Merge "add nodad argument to ifc_act_on_address() and add it to header file" 2020-01-28 03:51:01 +00:00
Suren Baghdasaryan
5562b076b7 Merge "libprocessgroup: Prevent aggregate profiles from referencing stale ones" 2020-01-28 00:49:07 +00:00
Tom Cherry
ff464b1288 liblog: always restore errno in logging functions
Some recent changes can have these logging functions potentially set
errno.  This change places android::base::ErrnoRestorer at the entry
point of the public functions where we want to guarantee errno is
restored to ensure this will not happen again.

Test: build
Change-Id: Iab4170ab16b9c7301474a509ee42d38b370b91a4
2020-01-27 13:50:44 -08:00
Suren Baghdasaryan
8438595f21 libprocessgroup: Prevent aggregate profiles from referencing stale ones
Currently when vendor overrides a profile the profile object is being
replaced with a new one. However the old profile might have been
referenced by an aggregate profile and with such profile replacement
the aggregate profile is left referencing a stale object. Fix this by
replacing the content of the old profile with the content from the new
one instead of replacing the object itself.

Bug: 148311066
Test: override profiles referenced in aggregate profile and verify
Test: correct replacement
Change-Id: Iabddbf3580455e5263fedad6665cf52fb323e50a
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2020-01-27 21:07:27 +00:00
Tom Cherry
347d6406f0 Merge "liblog: use default tag for loggability checks if no tag is provided" 2020-01-27 20:36:28 +00:00
Elliott Hughes
00ff8d7021 adb: make the push summary fit in 80 columns.
Elide $ANDROID_PRODUCT_OUT for a large saving:

  /data/: 2 files pushed. 734 files skipped. 6.5 MB/s (830776 bytes in 0.122s)
  /product/: 0 files pushed. 357 files skipped.
  /system/: 7 files pushed. 2638 files s...d. 16.3 MB/s (3785511 bytes in 0.221s)
  /system_ext/: 1 file pushed. 90 files ...d. 13.2 MB/s (1152016 bytes in 0.084s)
  /vendor/: 0 files pushed. 200 files skipped.

And drop the repeated "files" when talking about how many were skipped
for a small saving:

  /data/: 2 files pushed, 734 skipped. 6.4 MB/s (830776 bytes in 0.124s)
  /product/: 0 files pushed, 357 skipped.
  /system/: 7 files pushed, 2638 skipped. 13.8 MB/s (3785511 bytes in 0.262s)
  /system_ext/: 1 file pushed, 90 skipped. 12.2 MB/s (1152016 bytes in 0.090s)
  /vendor/: 0 files pushed, 200 skipped.

Bug: http://b/131717844
Test: adb sync
Change-Id: I9d24df49498211bc2b8dcebcc6d8bd557da214c1
2020-01-27 10:05:36 -08:00
Tom Cherry
2ec6a53a46 liblog: use default tag for loggability checks if no tag is provided
Bug: 116329414
Bug: 119867234
Test: new unit tests
Change-Id: I92a3f4f95e5f482f6fe20f17ed83c8ed367b06dc
2020-01-27 09:38:54 -08:00
Quentin Perret
16604b4141 Merge "libprocessgroup: ensure schedboost_enabled is true with uclamp" 2020-01-27 17:24:06 +00:00
David Anderson
21394f6e85 Merge "Fix mounting /data on Virtual A/B devices without metadata encryption." 2020-01-27 16:01:59 +00:00
Treehugger Robot
e32697ee3e Merge "add NOLINTNEXTLINE(google-explicit-constructor)" 2020-01-27 14:52:49 +00:00
Zimuzo Ezeozue
4858f38514 Merge "Change gid bit of /mnt/media_rw to external_storage" 2020-01-27 13:01:52 +00:00
Zimuzo Ezeozue
8e4cf5b436 Merge "Add external_storage gid" 2020-01-27 12:22:16 +00:00
Ryan Savitski
98b185a8b1 Merge "unwindstack: RegsArm64: fix harmless off by 1 + iterate GPRs contiguously" 2020-01-27 12:18:53 +00:00
Quentin Perret
64811b7b13 libprocessgroup: ensure schedboost_enabled is true with uclamp
In the current state, schedboost_enabled() is true if and only if
schedtune is in use. As a result, all tests conditioned by
schedboost_enabled() will be skipped on devices using uclamp since it is
and extension of the CPU controller.

Fix this by making schedboost_enabled() return true if either schedtune
or the CPU controller is enabled.

Bug: 44953631
Change-Id: Idaadf252c9cf411a176180ab8988d559ca8a1332
Signed-off-by: Quentin Perret <qperret@google.com>
2020-01-27 11:04:03 +00:00