Commit graph

55679 commits

Author SHA1 Message Date
Nikita Ioffe
64e28438c8 Merge "Don't retrigger bootstat during userspace reboot." 2020-02-03 17:02:49 +00:00
Alessio Balsini
a60f6a35ec Missing UpdateState::Cancelled string conversions
Add the missing UpdateState::Cancelled conversions from/to string.

Bug: none
Test: build
Change-Id: I097d80e21521725fbb02f3ef37b22e95a5e83929
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-03 16:37:51 +00:00
Tom Cherry
db8881b769 Merge "init: handle process actions when waiting for exec services" 2020-02-03 14:02:40 +00:00
Oli Lan
a466ca8ff4 Allow apexd to snapshot and restore DE data.
This calls into apexd to allow it to snapshot and restore DE apex data
in the case of a rollback. See the corresponding apexd change for more
information.

Cherry-pick from (unsubmitted) internal CL: ag/10163227

Bug: 141148175
Test: atest StagedRollbackTest#testRollbackApexDataDirectories_DeSys
Change-Id: Ia4bacc9b7b7a77038ba897acbc7db29e177a6433
2020-02-03 11:47:15 +00:00
Zimuzo Ezeozue
294c16024b Merge "Harden /mnt/pass_through paths" 2020-02-03 11:34:52 +00:00
Alessio Balsini
fb19ed9130 Update assertion on DmTargetDefaultKey param string
Due to some recent code updates that introduced some additional
extra_argv, the DmTargetDefaultKey::GetParameterString() test was
failing.
Update the string accordingly.

Bug: none
Test: libdm_test
Change-Id: I63fab27e32a08211a43d4804d90a6f19ea4edc06
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-03 10:37:36 +00:00
Nikita Ioffe
4d8e3eaf9f Don't retrigger bootstat during userspace reboot.
Userspace reboot can be treated as extension of runtime restart: instead
of restarting just system_server, it restarts all post-data services.

Test: adb reboot userspace
Test: checked bootstat didn't run again.
Test: system/core/bootstat/boot_reason_test.sh
Bug: 135984674
Change-Id: Ieda4b201f9b9294a3a54b7f0118ee769f5dd2065
2020-02-03 10:30:06 +00:00
Treehugger Robot
e6acbfe556 Merge "Add AID_EXT_DATA_RW / AID_EXT_OBB_RW GIDs." 2020-02-03 10:14:33 +00:00
Josh Gao
28bf90f32b Merge "libadbconnection_client: apply version script to library." 2020-02-03 09:28:57 +00:00
Nikita Ioffe
03aaecbd99 Merge "Don't reset sys.usb.configfs during userspace reboot" 2020-02-03 08:12:38 +00:00
Treehugger Robot
cb1a8e7fdd Merge changes from topics "dm-default-key-v2", "metadata_cipher"
* changes:
  Set metadata cipher in fstab
  Add support for v2 of dm-default-key
2020-02-01 16:12:30 +00:00
Treehugger Robot
afb6b354a9 Merge "Propagate failure of MetadataBuilder creation in CreateUpdateSnapshots" 2020-02-01 12:22:38 +00:00
Howard Ro
de6a99d702 Merge changes from topic "libmetricslogger"
* changes:
  Deprecate libmetricslogger
  Remove libmetricslogger dependency from bootstats
2020-02-01 06:56:38 +00:00
Treehugger Robot
a6c834f960 Merge "Check /sys/kernel/tracing for tracefs" 2020-02-01 06:50:45 +00:00
Daniel Rosenberg
ebfe359ca8 Make /data/media case insensitive
Use chattr to apply +F to /data/media
This will fail on devices who do not support casefolding on userdata.

Bug: 138322712
Test: /data/media is set to +F.
Change-Id: Ib341c23a0992ee97b23113b3a72f33a61e583b04
2020-01-31 18:34:03 -08:00
Daniel Rosenberg
29bc5d4924 Add support for casefold and product ID to format
Product ID Quotas require wider inodes. For Ext4, quotas and casefolding
are enabled later via tune2fs

Bug: 138322712
Bug: 138321217
Test: Build with and without casefolding and quotas. Verify fs features
Change-Id: I99819f6c38adabcf7a1f944085f9005134e6fc5f
2020-01-31 18:34:03 -08:00
Howard Ro
327240192b Deprecate libmetricslogger
There's no more usage of libmetricslogger.

Bug: 147777989
Test: compiles and confirmed that there's no usage of it
Merged-In: Ie990f7f1651b7717f21553481dc8635a01993777
Change-Id: Ie990f7f1651b7717f21553481dc8635a01993777
2020-01-31 17:52:12 -08:00
Howard Ro
fe0b389190 Remove libmetricslogger dependency from bootstats
These are either already migrated or are planned to be migrated to
statsd.

Bug: 147777989
Bug: 148575354
Test: compiles
Merged-In: I00b110dcf5cf4a0fb1673fe05004662b6f3327d0
Change-Id: I00b110dcf5cf4a0fb1673fe05004662b6f3327d0
2020-01-31 17:39:02 -08:00
Maciej Żenczykowski
8fda5feb25 Merge "symlink /dev/net/tun -> ../tun" 2020-02-01 01:24:57 +00:00
Josh Gao
24b01d2de8 libadbconnection_client: apply version script to library.
Previously, we were using the version script for only the stubs in the
library, which led to symbols from libc++_static leaking out.

Bug: http://b/148504737
Test: booted a user build
Change-Id: Ie22856f7d16cc837eb961f70195d49898bf7fb49
2020-01-31 16:51:54 -08:00
Greg Kaiser
49a542a979 Revert "Mount binderfs"
This reverts commit 8e50be74ae.

Reason for revert: Several devices did not boot
Test: Local build with this reverted had the device boot
Bug: 148689473
Merged-In: I97e96bd86d02a9fe70c5ef02df85c604b0cfb3c3

Change-Id: Ic4a2990e7c0cb08c374a336422c08d9aad28049d
2020-01-31 23:37:21 +00:00
Paul Crowley
3d8e105510 Set metadata cipher in fstab
Bug: 147814592
Test: Cuttlefish can use adiantum
Change-Id: I9207ffcdb74dcd36c8b2534b51233a3f8e80dc0b
2020-01-31 14:45:00 -08:00
Paul Crowley
f1b264f17c Add support for v2 of dm-default-key
Version 2 of dm-default-key has an extra parameter and always sets the
DUN.

Bug: 147814592
Test: Cuttlefish boots with keydirectory flag
Test: Crosshatch formatted before this change boots after it
Change-Id: I309bcc3f907a6df745f5c073b0017a7dd5b5354b
2020-01-31 14:45:00 -08:00
Paul Crowley
60a55d91dc Merge "Rename key_dir to metadata_key_dir and refactor" 2020-01-31 21:49:13 +00:00
Yifan Hong
3aa3b3c627 charger: uses health HAL service.
hwservicemanager starts in charger, so directly get the health HAL
service.

Also sets up Android base kernel logging.

Bug: 142674987

Test: turn off device and charge, health HAL starts before charger, and inspect logs
      to confirm charger is reading from health HAL
Test: make health HAL start after charger, and inspect logs to confirm
      charger is reading from health HAL.

Change-Id: I5ba50a4b931735d1d14a50940e37c1e407dda34d
2020-01-31 13:29:21 -08:00
Tom Cherry
2f6f86ff72 Merge "libbase: Have LogdLogger use LOGGER_ENTRY_MAX_PAYLOAD for its buffer" 2020-01-31 21:03:31 +00:00
Tom Cherry
42ee2e4f8f libbase: Have LogdLogger use LOGGER_ENTRY_MAX_PAYLOAD for its buffer
LogdLogger has its own buffer for adding the file and line number to
FATAL messages, but it is much lower than LOGGER_ENTRY_MAX_PAYLOAD and
that causes problems now that more logs are piped through this logger,
so increase the limit to maximum.

Also, in the case that the file and line number are not added, simply
pass the buffer through to liblog, since there is no reason to copy to
a separate buffer.

Bug: 148678509
Test: build, unit tests
Change-Id: I064aa34641e784dca6c529c51cb192069821d64a
2020-01-31 20:01:47 +00:00
Treehugger Robot
938379de5b Merge "Mount binderfs" 2020-01-31 18:46:14 +00:00
Chih-hung Hsieh
e2a1705f1f Merge "Allow LOG_ALWAYS_FATAL_IF in constexpr functions" 2020-01-31 18:15:06 +00:00
Tom Cherry
44d5ec37a7 init: handle process actions when waiting for exec services
We currently do not handle process actions (restarting services or
exiting timedout services) when we are waiting for an exec service,
but this seems to be the wrong behavior.  Particularly, an exec
service may depend on a previously started service and if that service
crashes, we will deadlock unless init restarts it.

Bug: 146920034
Test: build, boot
Change-Id: Id2fc936b8a7b989862ba4c32c398a544941e0e76
2020-01-31 08:33:36 -08:00
Zim
a67b40bc2a Harden /mnt/pass_through paths
Only the FUSE daemon (with media_rw gid) needs access to paths on
/mnt/pass_through. And even then, it only needs execute access on the
dirs, since there will always be a bind mount either from sdcardfs or
the lower filesystem on it and that bind mount correctly handles ACLs
for the FUSE daemon.

Test: manual
Bug: 135341433
Change-Id: I999451e095da355e6247e9e18fb6fe1ab8fc45d6
2020-01-31 16:26:13 +00:00
Nikita Ioffe
4f8e05663e Don't reset sys.usb.configfs during userspace reboot
Test: adb reboot userspace (on blueline)
Test: adb reboot userspace (on cuttlefish)
Bug: 147726967
Change-Id: Id4a367e74b418a85e8454e952e12e0723efc9b8a
2020-01-31 15:59:19 +00:00
Nikita Ioffe
abe52dcb88 Merge "Whitelist reboot reasons related to userspace reboot failure" 2020-01-31 15:11:12 +00:00
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