Commit graph

47486 commits

Author SHA1 Message Date
David Anderson
b7fdfb1b67 Merge "fs_mgr: overlay: resize other OTA partitions to zero to make space"
am: 9187a72175

Change-Id: I2d823462a022018d7c471e0c19172a49dc910cb6
2019-05-02 17:41:20 -07:00
David Anderson
9187a72175 Merge "fs_mgr: overlay: resize other OTA partitions to zero to make space" 2019-05-02 23:56:12 +00:00
Josh Gao
dcfc785d20 Merge "adbd: avoid starting multiple worker threads."
am: 5ddd49eeae

Change-Id: I156d55438484681782bef2490c637026b5ab47a9
2019-05-02 14:28:22 -07:00
Treehugger Robot
5ddd49eeae Merge "adbd: avoid starting multiple worker threads." 2019-05-02 21:09:04 +00:00
Mark Salyzyn
c3fc2aa964 fs_mgr: overlay: resize other OTA partitions to zero to make space
If we do not have at least the minimum space to create a scratch
partition, let's resize the other partitions to zero to make the
space and try again.

Specify additional shared library dependencies for remount command.
margin_size could never be calculated because "scratch" partition
does not exist, so use super partition instead as argument to
GetBlockDeviceInfo.

Add a "Now reboot your device for settings to take effect" message
if the -R argument was not supplied.  Adjust some of the messages
to be clearer.

Manual test: On a full DAP device, resize or flash both a and b side
for system, vendor and product with fastboot to duplicate failure
conditions of limited space and check remount command resizes other
side partitions to mitigate.

Test: manual and adb_remount_test.sh
Bug: 131390072
Change-Id: I34c4a973f88a5e1e06b64af9589a84721dd1bbbd
2019-05-02 13:46:22 -07:00
Josh Gao
bead01860d Merge "adb: increase adb [un]root timeout."
am: 6bc132846a

Change-Id: Ia10b398b1305bd6d9ae319cd8b929ee546284739
2019-05-02 09:13:50 -07:00
Treehugger Robot
6bc132846a Merge "adb: increase adb [un]root timeout." 2019-05-02 15:53:20 +00:00
Martin Stjernholm
547c7b6d44 Merge "Reland: Fix libnativeloader to correctly link to the platform namespace."
am: 2d3becd361

Change-Id: Ic9317fd3fceaecbba61840e37ad12f9cb2daaa51
2019-05-02 03:51:25 -07:00
Martin Stjernholm
2d3becd361 Merge "Reland: Fix libnativeloader to correctly link to the platform namespace." 2019-05-02 10:40:04 +00:00
Josh Gao
d8ccd6b57c Merge "adbd: compile a static version."
am: 7a7c71b2b6

Change-Id: I55e95c10ad1b8607206fe405af91af4522c0e57f
2019-05-01 21:53:51 -07:00
Treehugger Robot
7a7c71b2b6 Merge "adbd: compile a static version." 2019-05-02 04:20:24 +00:00
Josh Gao
ef4a999343 adb: increase adb [un]root timeout.
3 seconds isn't generous enough, because if we're rapidly restarting
(e.g. `adb root; adb unroot`), init will wait 5 seconds to restart us.

Test: `adb root && adb unroot`
Change-Id: I353e8d1ee14f3b08416445ff627dea4a49afd9a4
2019-05-01 18:53:43 -07:00
Josh Gao
bde8c848d8 adbd: compile a static version.
Test: mma
Change-Id: I785de074f9b5cc63d1804420b734c4b07081a716
2019-05-01 18:25:52 -07:00
Josh Gao
910ce0ff08 adbd: avoid starting multiple worker threads.
A previous patch intended to make receiving multiple FUNCTIONFS_ENABLEs
non-fatal, but failed to do so because we would try to spawn another
worker thread and hit a different assertion.

Bug: http://b/130638368
Test: echo mem | adb shell "su 0 sh -c 'cat > /sys/power/state'"
Change-Id: I53456112244d8b4f7d26df6ec6961389fca70498
2019-05-01 17:27:27 -07:00
Martin Stjernholm
c57ed29dd5 Reland: Fix libnativeloader to correctly link to the platform namespace.
This relands http://r.android.com/951440:

This affected binaries in the Runtime APEX, where the platform namespace is
"platform" rather than "default".

Also extend ANDROID_ADDITIONAL_PUBLIC_LIBRARIES to create links to both to
platform and runtime namespaces, so that it can be used to open up access to
internal libraries in the Runtime APEX as well, which is used by ART gtests
and run tests.

Also update some comments in the ld.config*.txt files to accurately explain
why some namespaces need to be visible, and some other minor changes for
consistency. There are no semantically significant changes in those files.

Test: Flash and boot
Test: Run an ART run test with the internal libarttest.so library
Test: lunch aosp_cf_x86_phone-eng;
  atest android.compilation.cts.AdbRootDependentCompilationTest#testCompile_curProfile \
    com.android.cts.dexmetadata.InstallDexMetadataHostTest#testProfileSnapshotAfterInstall \
    installd_dexopt_test
Bug: 130293232
Bug: 121117762
Change-Id: I3d9f2102a03e83843e15bc78b5ad347220c52769
2019-05-01 16:46:06 +01:00
Martin Stjernholm
a36eda0e18 Merge "Add linker entries for the new libdexfiled_external.so."
am: cc30f4d7dd

Change-Id: I151eef44bf47c6d6fd34dfe68697e485ebb9aaa0
2019-05-01 07:38:13 -07:00
Martin Stjernholm
cc30f4d7dd Merge "Add linker entries for the new libdexfiled_external.so." 2019-05-01 14:30:35 +00:00
Zimuzo Ezeozue
bceb5a6bfb Merge "Attempt native rollback for frequent crashes before boot completed"
am: e9252285ef

Change-Id: Ia7694dbf47cf4792b9adde1158a450900e34aa62
2019-04-30 16:11:46 -07:00
Zimuzo Ezeozue
e9252285ef Merge "Attempt native rollback for frequent crashes before boot completed" 2019-04-30 22:57:39 +00:00
Martin Stjernholm
8a50dad467 Add linker entries for the new libdexfiled_external.so.
Follow up to http://r.android.com/943476. This library is only available in
debug builds of the Runtime APEX.

Test: Flash and boot with eng build
Change-Id: I260f9b838f44ba3f8976c117d9e42fc456239e88
2019-04-30 16:11:30 +01:00
Zimuzo
88de80fc53 Attempt native rollback for frequent crashes before boot completed
Before, if updatable processes crash 4 times in 4mins, a native
rollback will be attempted. This behavior does not detect
system_server early boot deadlocks because the system server requires
at least a min to detect a deadlock, and crash itself. The crashes
don't happen frequently enough for init to detect.

After, this cl, the old behavior exists and additionally, init detects
*any* 4 crashes of updatable processes before boot completed,
regardless of if they happen within 4mins or not.

Test: Manually tested by adding artificial sleep in system_server so
deadlock is triggered before boot. system_server crashes 4 times in
over 4mins and the ro.init.updatable_crashing prop is set to 1.
Bug: 129597207

Change-Id: Ie6fb5693ff4be105bcbe139c22850fb076e40260
2019-04-30 11:19:19 +00:00
Jim Blackler
1376ac38b2 Merge "Allow memory metrics on devices that use kernel LMK"
am: 446014ecf9

Change-Id: I9b24267ab63bd4fb58fb36de50561a9c2bf47939
2019-04-30 03:24:06 -07:00
Jim Blackler
446014ecf9 Merge "Allow memory metrics on devices that use kernel LMK" 2019-04-30 10:05:42 +00:00
Martin Stjernholm
affe1f2617 Merge "Revert "Fix libnativeloader to correctly link to the platform namespace.""
am: 68cf801ad9

Change-Id: I4787e48d5abe6a0a282ebe0b65705853b67e4849
2019-04-29 17:35:51 -07:00
Treehugger Robot
68cf801ad9 Merge "Revert "Fix libnativeloader to correctly link to the platform namespace."" 2019-04-30 00:13:22 +00:00
Tom Cherry
047e9407f3 Merge "liblog: display valid utf8 characters with 'printable' log format"
am: 6682d3bbba

Change-Id: I5051f7579274992ec59d4225ee5a537934345f04
2019-04-29 16:33:44 -07:00
Tom Cherry
6682d3bbba Merge "liblog: display valid utf8 characters with 'printable' log format" 2019-04-29 23:17:12 +00:00
Josh Gao
6848befe69 Merge "adb: restore generation of public key in adb keygen."
am: fe6cc3e2d3

Change-Id: Ifaa0d70091189374c2294d021ede28d8786b5710
2019-04-29 15:53:43 -07:00
Treehugger Robot
fe6cc3e2d3 Merge "adb: restore generation of public key in adb keygen." 2019-04-29 22:31:17 +00:00
Martin Stjernholm
b9259a9cbe Revert "Fix libnativeloader to correctly link to the platform namespace."
This reverts commit 4ca0ca67bf.

Reason for revert: Breaks android.compilation.cts.AdbRootDependentCompilationTest#testCompile_curProfile and others: http://g/art-team/R2nEDA1Ka_s

Change-Id: Ia6285648133d21e61040efafc73cac97d702a7c4
2019-04-29 20:57:16 +00:00
Josh Gao
032989a2ba adb: restore generation of public key in adb keygen.
We don't need the public key to be generated at ~/.android/adbkey.pub,
but it's still useful to be able to generate the public key for use with
ADB_VENDOR_KEYS.

Bug: http://b/119634232
Test: manual
Change-Id: Iecd6ff1bba4af4ba142456034f3faf52bb9e017d
2019-04-29 12:36:32 -07:00
Tianjie Xu
979f05c621 Merge "Support adb rescue wipe command"
am: 56311071fe

Change-Id: I19eea45c09b8a5bc1064701af9b5f4d6bb8494a4
2019-04-29 11:00:14 -07:00
Tianjie Xu
56311071fe Merge "Support adb rescue wipe command" 2019-04-29 17:47:20 +00:00
Andreas Gampe
7b3377cdc6 Merge "Nativeloader: Restrict anonymous namespace creation"
am: d21a090f79

Change-Id: Ic080bbb6bb6f0a8ecadd31ee3d29b89546475782
2019-04-29 09:26:07 -07:00
Tom Cherry
9158984894 liblog: display valid utf8 characters with 'printable' log format
This started as a change to use mbrtowc() instead of
utf8_character_length() as mbrtowc() does everything that
utf8_character_length() intends to do, but is a libc function. The
change was further intended to add unit tests to ensure that these
functions operate as intended.

It turns out that utf8_character_length() returned an error for the
utf8 characters that I tested, so this also has the side effect of
allowing valid utf8 characters to be printed in the 'printable' log
format, which was the original intention.

Also, print the binary data as hex instead of octal, since it is a
more suitable choice.

Test: new unit tests, existing unit tests, logcat -v printable
Change-Id: I4cc95aee81519411ef47892ca74eb31117c972d2
2019-04-29 09:14:37 -07:00
Treehugger Robot
d21a090f79 Merge "Nativeloader: Restrict anonymous namespace creation" 2019-04-29 16:08:15 +00:00
Martin Stjernholm
487b5784b6 Merge "Fix libnativeloader to correctly link to the platform namespace."
am: bce25d2363

Change-Id: Ic5178afa9241f697d04a8ea93534620582b6d291
2019-04-29 08:21:46 -07:00
Treehugger Robot
bce25d2363 Merge "Fix libnativeloader to correctly link to the platform namespace." 2019-04-29 15:08:52 +00:00
Martin Stjernholm
4ca0ca67bf Fix libnativeloader to correctly link to the platform namespace.
This affected binaries in the Runtime APEX, where the platform namespace is
"platform" rather than "default".

Also extend ANDROID_ADDITIONAL_PUBLIC_LIBRARIES to create links to both to
platform and runtime namespaces, so that it can be used to open up access to
internal libraries in the Runtime APEX as well, which is used by ART gtests
and run tests.

Also update some comments in the ld.config*.txt files to accurately explain
why some namespaces need to be visible, and some other minor changes for
consistency. There are no semantically significant changes in those files.

Test: Flash and boot
Test: Run an ART run test with the internal libarttest.so library
Bug: 130293232
Bug: 121117762
Change-Id: I7ebaf5370dd0f533b1bb5f0e67e7c3c1df48e512
2019-04-29 13:09:08 +01:00
Jim Blackler
3947c938a7 Allow memory metrics on devices that use kernel LMK
Bug: 130017100
Test: Tested manually
Change-Id: I37f6edb71decc1260bd521595842508926fa86aa
2019-04-29 11:02:51 +00:00
xunchang
c2265c5343 Support adb rescue wipe command
Support `adb rescue wipe` command on the host side. This command runs
under the rescue mode and wipes data (and cache/metadata).

Bug: 131037235
Test: run adb rescue wipe

Change-Id: Ib3a3f2d564cc19d0446540d616cc21489ba558c2
2019-04-26 10:37:13 -07:00
Andreas Gampe
b9df7d936c Nativeloader: Restrict anonymous namespace creation
Create the anonymous namespace only from a non-empty library path.

This is a better heuristic than the current "first-come" one. It
allows creating classloaders that are not directly related to an
app's "main" classloader, that is, do not have any library path.
This is the case, for example, for shared libraries, including
preloaded ones.

Longer-term, the anonymous namespace creation should be made
explicit, so that the framework can have full control.

Bug: 130623656
Test: m
Test: manual
Change-Id: I8251363b372e365d10ae09d23df93d76388ac7f9
2019-04-26 08:55:53 -07:00
Joseph Jang
57f086ea4c Merge "init: Add reboot timeout handler"
am: 67231474fe

Change-Id: I233976350653d41b76c1413aa4b6212b4a206a13
2019-04-26 01:40:51 -07:00
Misha Wagner
2ded863997 Merge "Add UID printing to tombstone headers"
am: 79474ce6f3

Change-Id: I9284850d1dafe216e44feb041c21ca78a8ec64ee
2019-04-26 01:40:11 -07:00
Joseph Jang
67231474fe Merge "init: Add reboot timeout handler" 2019-04-26 08:23:06 +00:00
Misha Wagner
79474ce6f3 Merge "Add UID printing to tombstone headers" 2019-04-26 08:22:17 +00:00
josephjang
aaddf282ec init: Add reboot timeout handler
In order to prevent device stuck at reboot, we try to create shutdownt
monitor thread with a timeout (default 30s). It will dump init process
and blocked tasks call trace in last kmsg then trigger kernel panic to
reboot device.

Test: reboot device

bug: 128561401
Change-Id: Ieb400ab9fbd983544b61241a4f4b8aa2f4baa863
2019-04-26 06:02:09 +08:00
Ian Kasprzak
e285dbeae3 Merge "Revert "Add a way to turn off unique_fd's operator int.""
am: e30fe5fe89

Change-Id: Icfde91e105016922777dc24e0676de9b88b42058
2019-04-25 10:24:50 -07:00
Ian Kasprzak
e30fe5fe89 Merge "Revert "Add a way to turn off unique_fd's operator int."" 2019-04-25 17:16:55 +00:00
Tom Cherry
b7ff39410f Merge "liblog: remove LIBLOG_WEAK"
am: 81f5424560

Change-Id: Ib47fb2cf497fd76159614ae8f8da4383761ee882
2019-04-25 08:59:31 -07:00