Commit graph

57510 commits

Author SHA1 Message Date
Nikita Ioffe
2b5ac84d54 Merge "Improve logging in bootstat." am: 2884943687 am: 41b977a1fa
Change-Id: I9d71a07074e78742b6574b558f490b09bbdf8e76
2020-04-02 19:00:40 +00:00
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
a4761a9775 Merge "Properly fail userspace reboot if it's not supported" am: 2af5bd00b0 am: 62a02cc826
Change-Id: I0fbc4b26b5b8ea30f46dcad0d4ebc772bda3c27e
2020-04-02 11:01:40 +00: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
d1d22f15c6 Merge "NetlinkEvent - ignore captive portal and pref64 nd user opts" am: 23bfaae6dc am: cfe842456e
Change-Id: I4610d73436c4d6f6fde83e478d50071c63fb9ff5
2020-04-02 03:34:55 +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
36d298b43e Merge changes I90e10c74,I038d1df4,I4299bd96 am: 73d44bb6c2 am: 72138abaa7
Change-Id: Ie48b479ef861990e3b2ab81cdcc6542232cd09cb
2020-04-01 23:20:14 +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
f84aa059e0 Merge "init: don't sync() before shutting down services" am: d54a4bf9a3 am: 5bff2ac286
Change-Id: I6b9a332da417ffa93fb6127a9f6e207e76fcd848
2020-04-01 16:07:24 +00: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
bc7e502f46 Merge "Make init.userspace_reboot.is_supported a rw property" am: 884b570100 am: 24d89ac980
Change-Id: Ia0d6a68bcff1564866d7305f69742f4233969524
2020-04-01 13:52:32 +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
0c09361d92 Merge "init: only print backtraces on subsequent reboots with a value" am: e55818cd83 am: 6ec231e7ad
Change-Id: Ia166c012bb0156b38e044e9bd1c4523606d1f8f5
2020-04-01 01:20:29 +00: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
d3a0918105 Merge "Fix off-by-one in ReadBuildIDFromMemory." am: bc1a6191f1 am: 5bdee1788c
Change-Id: Ib86c7e50a2c176f88315e28b038579f41ae8f16c
2020-03-31 23:34:39 +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
31988c2f00 Merge "Support parsing of data descriptor" am: fcf2d8b89b am: 6476fabea6
Change-Id: I1753bf5e8ea8a024a80b9276b72816a00846d7e9
2020-03-31 22:18:33 +00:00
Tom Cherry
a25b646f70 Merge "fastbootd: sync() after flashing partitions or updating super" am: 8890d42939 am: 641282d0da
Change-Id: I1dc60e81266f0b11fa4b49534de386b911a9bccb
2020-03-31 22:18:20 +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
Yurii Zubrytskyi
304153cf37 Merge "adb: fix apex installation." am: f8dc296dfd am: 39f4a75392
Change-Id: I4f30b0dd7317d3540254dd9591f2f2ce751241c2
2020-03-31 17:34:59 +00: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
1cf59ba6f6 Merge "rootdir: init.rc: use default dirty writeout policy" am: a76ee8b929 am: 6fa02ca30a
Change-Id: I58005b0aa6730143d75f76704a58081983d9abb3
2020-03-31 16:20:05 +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
1158d91e1b Merge "Statically link libadbd into minadbd." am: db22f23dd3 am: b903481992
Change-Id: Ib6c45e3c5b8b1ee049b9f9a0cb02302ea66c990a
2020-03-31 08:53:49 +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