Commit graph

57425 commits

Author SHA1 Message Date
Nikita Ioffe
41b977a1fa Merge "Improve logging in bootstat." am: 2884943687
Change-Id: Ie6d6012afd1df347303f4054eee1229d98a80be8
2020-04-02 18:37:37 +00:00
Nikita Ioffe
2884943687 Merge "Improve logging in bootstat." 2020-04-02 18:12:55 +00:00
Nikita Ioffe
49062f3b72 Improve logging in bootstat.
This should help in debugging issues related to the mismatch between
actual last reboot reason property and the expected one (see attached
bug).

Test: adb reboot
Test: adb logcat | grep bootstat
Bug: 152900920
Change-Id: I085cf1fb80a30389fd3ba821d40b6111a3294d95
2020-04-02 13:03:21 +01:00
Nikita Ioffe
62a02cc826 Merge "Properly fail userspace reboot if it's not supported" am: 2af5bd00b0
Change-Id: I5bfed4253a2eddde7930c64a3aefa0b87902cfc9
2020-04-02 10:44:21 +00:00
Nikita Ioffe
2af5bd00b0 Merge "Properly fail userspace reboot if it's not supported" 2020-04-02 10:23:45 +00:00
Maciej Żenczykowski
cfe842456e Merge "NetlinkEvent - ignore captive portal and pref64 nd user opts" am: 23bfaae6dc
Change-Id: I14928091507f1bcd1ed74103a65473abff103bf9
2020-04-02 03:07:44 +00:00
Maciej Żenczykowski
23bfaae6dc Merge "NetlinkEvent - ignore captive portal and pref64 nd user opts" 2020-04-02 02:37:19 +00:00
Josh Gao
72138abaa7 Merge changes I90e10c74,I038d1df4,I4299bd96 am: 73d44bb6c2
Change-Id: Ia63c3ad5c91d59de688379c97a820899fe5400ea
2020-04-01 22:51:26 +00:00
Josh Gao
73d44bb6c2 Merge changes I90e10c74,I038d1df4,I4299bd96
* changes:
  adbd: delete unused variable.
  adb: move things around to prepare to add LZ4.
  adb: fix misindentation in Android.bp
2020-04-01 22:38:38 +00:00
Josh Gao
e485bdf06e adbd: delete unused variable.
Bug: https://issuetracker.google.com/150827486
Test: m adb com.android.adbd.apex
Change-Id: I90e10c74d695659c702dea4173cb33ac5ca1a102
2020-04-01 13:09:31 -07:00
Josh Gao
6e697f2f8c adb: move things around to prepare to add LZ4.
Bug: https://issuetracker.google.com/150827486
Test: m adb com.android.adbd.apex
Change-Id: I038d1df4f179ddb23102016d781c9bd90da5a546
2020-04-01 13:09:29 -07:00
Josh Gao
31d42aa73c adb: fix misindentation in Android.bp
Bug: https://issuetracker.google.com/150827486
Test: none
Change-Id: I4299bd962963a58ef5f075405b99b1d1e4c1febc
2020-04-01 13:09:16 -07:00
Tom Cherry
5bff2ac286 Merge "init: don't sync() before shutting down services" am: d54a4bf9a3
Change-Id: I8a6699ee125e03b672bf38e1bb2a41f63fdd2bea
2020-04-01 15:51:40 +00:00
Tom Cherry
d54a4bf9a3 Merge "init: don't sync() before shutting down services" 2020-04-01 15:40:44 +00:00
Nikita Ioffe
92116e4129 Properly fail userspace reboot if it's not supported
Previously, after `adb reboot userspace` is called on a device that
doesn't suppor it, init would've logged an error and quietly exit the
shutdown sequence. This was leaving adb handing forever.

With this approach, init will fail setprop
"sys.powerctl=reboot,userspace" in case userspace reboot is not
supported.

Test: adb root
Test: adb setprop init.userspace_reboot.is_supported 0
Test: adb reboot userspace
Test: atest CtsInitTestCases
Bug: 146639622
Change-Id: I1264078f53ed3ff54638c7f3b6846b7437f98ee5
2020-04-01 14:34:54 +01:00
Nikita Ioffe
24d89ac980 Merge "Make init.userspace_reboot.is_supported a rw property" am: 884b570100
Change-Id: I09a3c3ba50963f2e6e9ecc33a0d9048390c4599f
2020-04-01 13:32:15 +00:00
Nikita Ioffe
884b570100 Merge "Make init.userspace_reboot.is_supported a rw property" 2020-04-01 13:14:21 +00:00
Maciej Żenczykowski
a806a7153f NetlinkEvent - ignore captive portal and pref64 nd user opts
These are provided to userspace by newer kernels.

Test: builds
Bug: 150648313
Change-Id: I811c75e9a4739db149f502b9a43c99a8ed883341
2020-03-31 20:25:33 -07:00
Tom Cherry
10615eb397 init: don't sync() before shutting down services
Devices in the lab are hitting an issue where they're getting stuck
likely in the sync() call in DoReboot() before we start the reboot
monitor thread and before we shut down services.

It's possible that concurrent writing to RW file systems is causing
this sync() call to take essentially forever.  To protect against
this, we need to remove this sync().  Note that we will still call
sync() after shutting down services.

Note that the service shutdown code has a timeout and there is a
reboot monitor thread that will shutdown the device if more than 30
seconds pass above that timeout.  This change increases that timeout
to 300 seconds to give the final sync() calls explicitly more time to
finish.

Bug: 150863651
Test: reboot functions normally
Test: put an infinite loop in DoReboot and the the reboot monitor thread
      triggers and shuts down the device appropriately
Change-Id: I6fd7d3a25d3225081388e39a14c9fdab21b592ba
2020-03-31 18:59:23 -07:00
Tom Cherry
6ec231e7ad Merge "init: only print backtraces on subsequent reboots with a value" am: e55818cd83
Change-Id: I0b9da3a76c9759e001396fe48268a96f4a143bb1
2020-04-01 01:09:53 +00:00
Tom Cherry
e55818cd83 Merge "init: only print backtraces on subsequent reboots with a value" 2020-04-01 00:53:10 +00:00
Peter Collingbourne
5bdee1788c Merge "Fix off-by-one in ReadBuildIDFromMemory." am: bc1a6191f1
Change-Id: I2e3a745dd1950d460e64cc7d8a60080bfd1ddad7
2020-03-31 23:19:36 +00:00
Peter Collingbourne
bc1a6191f1 Merge "Fix off-by-one in ReadBuildIDFromMemory." 2020-03-31 23:08:12 +00:00
Tianjie Xu
6476fabea6 Merge "Support parsing of data descriptor" am: fcf2d8b89b
Change-Id: I4e93b4535f8d7d268aed2b3396f2008687fedb5b
2020-03-31 22:04:34 +00:00
Tom Cherry
641282d0da Merge "fastbootd: sync() after flashing partitions or updating super" am: 8890d42939
Change-Id: I51ffae77484fea37221e80b4164153d70d31aacf
2020-03-31 22:04:12 +00:00
Tianjie Xu
fcf2d8b89b Merge "Support parsing of data descriptor" 2020-03-31 21:52:52 +00:00
Tom Cherry
8890d42939 Merge "fastbootd: sync() after flashing partitions or updating super" 2020-03-31 21:52:39 +00:00
Tom Cherry
9174a9bff8 init: only print backtraces on subsequent reboots with a value
Userspace reboot resets sys.powerctl to an empty string once it
starts, which was inadvertently triggering the backtrace of the main
init thread.

Test: no more unexpected backtraces
Change-Id: I35d6f1b37aa31a46ae9266647f41a709f28b6099
2020-03-31 14:36:03 -07:00
Tianjie
0ec0eaa214 Support parsing of data descriptor
The size fields in the data descriptor can be either 4 bytes or 8 bytes.
This depends on if the size are read from the zip64 extended field in
the local file header. This cl adds support to parse these cases.

Also fix a misconception in that the uncompressed and compressed size
doesn't need to exist together in the zip64 fields of the central
directory. But they still need to co-exist in the fields of the local
file header.

Bug: 150900468
Test: unit tests pass, python tests pass
Change-Id: Ia54f9bf56c85ff456ead90a136f7fddc5be5220c
2020-03-31 12:01:12 -07:00
Tom Cherry
e4a6ed8534 fastbootd: sync() after flashing partitions or updating super
There is a chance that devices are failing to reboot in the lab due to
sync() taking explicitly long during reboot.  Let's add the sync()'s
here to ensure they get accounted for in the flashing process.

A side benefit is it's likely safer to sync immediately after
flashing than to hope init does it during reboot.

Bug: 150863651
Test: flash local devices successfully
Change-Id: I4c4b0114f3cde8af4b8b2cb283ec21f869ef9f6f
2020-03-31 10:54:58 -07:00
Peter Collingbourne
a7b4c5d25a Fix off-by-one in ReadBuildIDFromMemory.
This was sometimes causing build ids to be truncated, probably because
of memory corruption in std::string. A similar off-by-one was fixed in
ReadBuildID in aosp/939619.

Bug: 129873279
Change-Id: I401fe7f991dbd135f5b4836381b48ea3c6a2243f
2020-03-31 10:29:38 -07:00
Yurii Zubrytskyi
39f4a75392 Merge "adb: fix apex installation." am: f8dc296dfd
Change-Id: I3ce241b4c9c48d20eaa5cb221ff8d04c215ca713
2020-03-31 17:11:02 +00:00
Yurii Zubrytskyi
f8dc296dfd Merge "adb: fix apex installation." 2020-03-31 16:56:07 +00:00
Jaegeuk Kim
6fa02ca30a Merge "rootdir: init.rc: use default dirty writeout policy" am: a76ee8b929
Change-Id: I5c2ff99cc705e4d454539e734549e1e2e019fc8a
2020-03-31 16:05:16 +00:00
Jaegeuk Kim
a76ee8b929 Merge "rootdir: init.rc: use default dirty writeout policy" 2020-03-31 15:57:22 +00:00
Josh Gao
b903481992 Merge "Statically link libadbd into minadbd." am: db22f23dd3
Change-Id: I8967341c18c7702ed405c464f901589461bd5f77
2020-03-31 08:41:06 +00:00
Josh Gao
db22f23dd3 Merge "Statically link libadbd into minadbd." 2020-03-31 08:25:27 +00:00
Josh Gao
a056a8f239 Merge "adb: temporarily kill adb_benchmark." am: d6211a2dde
Change-Id: I8bf789ca5eef0cc43dc019e79f99c098eb85f6a9
2020-03-31 03:56:10 +00:00
Josh Gao
d6211a2dde Merge "adb: temporarily kill adb_benchmark." 2020-03-31 03:40:47 +00:00
Josh Gao
3c1803cab5 adb: fix apex installation.
Incremental doesn't support apex installation, but we were exiting
instead of returning -1 to fall back to regular installation.

Bug: http://b/151900478
Test: manual
Change-Id: Id27009250090a65fbb45bb65fc39c1799bf1f861
2020-03-31 02:08:14 +00:00
Josh Gao
3735614b28 Statically link libadbd into minadbd.
Bug: http://b/150317254
Test: booted aosp_walleye-eng into recovery
Change-Id: Ie479ae2fbaf1006228a531dab26c7d535ed403db
2020-03-30 18:51:15 -07:00
Jaegeuk Kim
58ff5075ac rootdir: init.rc: use default dirty writeout policy
This patch removed the old writeout policy tune which was never touched since
2009. In the meantime, most of Android devices are equipped with over 4GB DRAM
and very fast flash storages like UFS, which becomes more like desktop or
servers in 2009. So, it'd be worth to go back to use the default kernel configs.

Bug: 129751503
Change-Id: Idb58f5b01bbc4afd270cffba5b8912ea3565819f
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2020-03-31 01:49:13 +00:00
Josh Gao
0a9431d0f3 Merge "Move adbd's legacy USB implementation to fastboot." am: fd193bd291
Change-Id: I935ccc046e2975413b7390b1b439d2e0380566e0
2020-03-31 00:37:42 +00:00
Josh Gao
fd193bd291 Merge "Move adbd's legacy USB implementation to fastboot." 2020-03-31 00:24:20 +00:00
Josh Gao
c6cb89ea80 adb: temporarily kill adb_benchmark.
Temporarily delete adb_benchmark, since it seems difficult to make this
sensibly work with a single target that's used for both libadb and
libadbd benchmarking.

Bug: http://b/150317254
Test: treehugger
Change-Id: Ibf81fdff4f2b7304b586ce9a7955b4bc2c11484e
2020-03-30 16:43:06 -07:00
Josh Gao
0871824de6 Move adbd's legacy USB implementation to fastboot.
This code path is effectively dead in adbd, and fastboot's dependency on
libadbd makes it hard to refactor adbd's dependencies.

Bug: http://b/150317254
Test: built and flashed aosp_walleye-eng
Change-Id: I5118136d32fdcbbd011559ed0a4a71e1dc7bf064
2020-03-30 16:43:06 -07:00
Nikita Ioffe
663cd35030 Make init.userspace_reboot.is_supported a rw property
General recommendation is to avoid read-only properties, and instead control
"read-onlines" by only allowing init/vendor_init to set the property.

Since ro.init.userspace_reboot.is_supported was added in this release, and
nobody outside of the platform is querying it directly, it should be fine to
simply rename it.

Test: adb shell getprop init.userspace_reboot.is_supported
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 152803929
Change-Id: I7552d5ccc6e9b750a6081947eef8fcb027be13e1
2020-03-30 23:40:45 +01:00
Peter Collingbourne
3d89a46db3 Merge "Read fault address on arm64 using proposed kernel API." am: cd63cae6b2
Change-Id: I87988443ee8e910345038880ede59937bd87ada0
2020-03-30 21:55:47 +00:00
Peter Collingbourne
cba2467937 Merge "Create a debugger_process_info data structure with the process info pointers." am: 5677803cb7
Change-Id: I4442107d1c6cc10a0765548e92af9fe89c2d575a
2020-03-30 21:55:26 +00:00
Peter Collingbourne
cd63cae6b2 Merge "Read fault address on arm64 using proposed kernel API." 2020-03-30 21:40:58 +00:00