Commit graph

42477 commits

Author SHA1 Message Date
Spencer Low
40babf0709 adb: win32: fix ReportServerStartupFailure
The code was passing an fd from adb_open() to android::base::ReadFdToString() which actually
takes a C-Runtime fd (on Windows), so it wasn't working.

The fix is to use APIs that deal with C-Runtime fds:
* unix_open()
* android::base::unique_fd
* unix_lseek() (added in this change)

I also removed an unnecessary call to GetProcessId() since we already have the process id
from the structure returned by CreateProcess().

Test: adb start-server on Win10 and Ubuntu (with a failing server)
Test: mma

Change-Id: Id6e2dd5532a02fe5d9caf96aa007a1b3434a0b59
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2018-09-02 19:26:25 -07:00
Treehugger Robot
640ceee567 Merge "Fix the mac fastboot build" 2018-08-31 04:09:25 +00:00
Dan Willemsen
822465a930 Fix the mac fastboot build
The Carbon framework isn't on the list of libraries that Soong allows
linking against, so this broke the Mac build. This compiles just fine
without Carbon though, and I don't see any references to Carbon in the
code.

Test: mma
Change-Id: I83044d244f7cec778c8b8b6132249c0f016c10fc
2018-08-30 18:26:11 -07:00
Dan Willemsen
4d8929773b Merge "Convert fastboot to Soong" 2018-08-30 23:36:54 +00:00
Treehugger Robot
ebb631b0a3 Merge "init: First Stage Mount observe nofail mount flag" 2018-08-30 22:20:39 +00:00
Treehugger Robot
5fdd77b2f1 Merge "adb: don't try to reconnect emulators." 2018-08-30 20:26:18 +00:00
Mark Salyzyn
eafc1c3d58 init: First Stage Mount observe nofail mount flag
MountPartitions should respect nofail.  The nofail flag makes the
partition optional.

Test: manual (future code using feature), and smoke test
Bug: 109821005
Bug: 78914864
Change-Id: I715a66ef1abbe223b0cefe5bd2758f63352b1afc
2018-08-30 13:16:24 -07:00
Treehugger Robot
c47c508dcd Merge "fastboot: Use a single codepath for flashall and update." 2018-08-30 20:12:16 +00:00
Joel Fernandes
3cc906b0c4 Merge "Remove ashmem from system/core" 2018-08-30 19:30:58 +00:00
Christopher Ferris
7f6dab578e Merge "Set errno for all error return cases." 2018-08-30 18:58:19 +00:00
Josh Gao
fc2e56ffd7 adb: don't try to reconnect emulators.
Bug: http://b/113533872
Test: ./test_adb.py
Change-Id: Id591f43b487cc3928390e30f11645990e34a51bf
2018-08-30 11:37:00 -07:00
Dan Willemsen
ab971b5e7e Convert fastboot to Soong
Also fix adb's version number to match.

See build/soong/README.md for more information.

Test: cd system/core/fastboot; mma
Test: fastboot --version
Test: adb --version
Test: out/host/linux-x86/nativetest/fastboot_test/fastboot_test
Test: out/host/linux-x86/nativetest64/fastboot_test/fastboot_test
Change-Id: I65ea39af9183c602e84f3bc0e4a0d066a30fc464
2018-08-30 11:28:18 -07:00
Treehugger Robot
5a139a0d75 Merge "Show bootanimation after decrypt" 2018-08-30 16:53:37 +00:00
Isaac Lee
f32c201743 Show bootanimation after decrypt
Because the original modification (restart SF which is added
for display bootanimation) from O to P causes bootanimation NPE,
 we remove the part of restart SF and add other flow to show
 bootanimation.

Test: manual, ran the test 10 times and it cause no NPE and
      display BootAnimation after decrypt
Test: boot aosp_sailfish

Bug: 79547653
Change-Id: I355ccdbb2e2f27d897e2e0ee00f9300ef38ede03
2018-08-30 16:44:34 +00:00
Tom Cherry
dd2ef111d4 Merge changes I11ff0aed,Ia442a41d
* changes:
  fastboot: remove 'verify'
  fastboot: remove 'powerdown'
2018-08-30 02:18:12 +00:00
Peter Collingbourne
6316be2ed1 Merge "libpixelflinger: Avoid using x18 register in blend implementation." 2018-08-30 01:20:34 +00:00
Treehugger Robot
2dd1ec6d11 Merge "adb should #include <sys/sysmacros.h>" 2018-08-30 00:28:42 +00:00
Treehugger Robot
24b861d742 Merge "Fix bug in fs_mgr with calling vdc" 2018-08-30 00:16:33 +00:00
Treehugger Robot
5dea98f5ea Merge "Remove unused -I of external/safe-iop." 2018-08-30 00:11:18 +00:00
Peter Collingbourne
60143111ea libpixelflinger: Avoid using x18 register in blend implementation.
Instead, use x15 which is one of the available temporary registers.

Bug: 112907825
Test: test-pixelflinger-arm64-t32cb16blend
Change-Id: Icfcaae1d8163880eddc2862af92e5636a03d8b52
2018-08-29 16:23:21 -07:00
David Anderson
cf444f3633 fastboot: Use a single codepath for flashall and update.
This patch extracts the common logic out of the flashall and update
command implementations. There is now a FlashAllTool helper class, and
an ImageSource class for commands to specify how to find built images.

With these paths merged, the update command now supports logical
partitions.

Bug: 78793464
Test: flashall works with or without a super partition
      update works with or without a super partition

Change-Id: I63a8690bbc4da6ea98a07eb2c07166ddd993a7b7
2018-08-29 15:58:34 -07:00
Tom Cherry
e51dadb8a7 fastboot: remove 'verify'
This isn't sent by the fastboot client.
This isn't in our bootloader requirement document.
Neither my hikey nor sailfish respond to this.

Test: fastboot still works
Change-Id: I11ff0aed818d98f3427ed427605d99b3c76ccb06
2018-08-29 15:29:20 -07:00
Ivan Afonichev
0a10040289 adb should #include <sys/sysmacros.h>
On modern systems <sys/sysmacros.h> no longer being included by <sys/types.h>
To use major(), minor() we should include <sys/sysmacros.h> explicitly.
See https://koji.fedoraproject.org/koji/taskinfo?taskID=29356781
Similar changes merged last year:
https://android-review.googlesource.com/c/platform/system/core/+/398913
https://android-review.googlesource.com/c/platform/system/core/+/399050
2018-08-30 01:12:56 +04:00
Tom Cherry
566751444d fastboot: remove 'powerdown'
This isn't sent by the fastboot client.
This isn't in our bootloader requirement document.
Neither my hikey nor sailfish respond to this.
The README.md literally uses this as an example for 'unknown command'

Test: fastboot still works.
Change-Id: Ia442a41de517dae078dd7e73c951aadb97646c73
2018-08-29 14:10:47 -07:00
Paul Lawrence
c735bfe5da Fix bug in fs_mgr with calling vdc
Parameter count was hard coded to 3, make dynamic

Test: Metadata encrypted device boots

Change-Id: I25bb5adb7f27fc392564bfa6ed3ed2efeb5c5a40
2018-08-29 12:56:53 -07:00
Christopher Ferris
9d3f45339a Set errno for all error return cases.
Test: Updated unit tests pass.
Change-Id: I2c1f14ed44ce144a46cb2866c146fca89a05539e
2018-08-29 10:47:06 -07:00
Tom Cherry
7b02605bf2 Merge "Switch root to /system in first stage mount" 2018-08-29 17:05:40 +00:00
Elliott Hughes
f5ca0f7ad4 Remove unused -I of external/safe-iop.
Bug: http://b/25224572
Test: builds
Change-Id: I90c35a38d69f533b8f60c2f357f0e5e36596d050
2018-08-29 09:49:24 -07:00
Treehugger Robot
90cd262d47 Merge "fastboot: Clean up the image array a bit." 2018-08-29 15:46:21 +00:00
Treehugger Robot
379e09927b Merge "fastboot: Flash boot partitions before rebooting to fastbootd." 2018-08-29 15:46:18 +00:00
David Pursell
1735516651 Merge "libcutils test: make set_sched_policy optional" 2018-08-29 15:33:24 +00:00
Elliott Hughes
11cd49c0c8 Merge "Move off safe-iop." 2018-08-29 15:23:09 +00:00
Treehugger Robot
49c4cd4d41 Merge "fs_mgr: set overlayfs_file context" 2018-08-29 14:32:00 +00:00
Treehugger Robot
9177927311 Merge "libdebuggerd: decode fdsan owner tags." 2018-08-29 01:50:19 +00:00
Mark Salyzyn
40b45b87c3 fs_mgr: set overlayfs_file context
Security minded hardening, let's not depend on reboot and restorecon.

Test: manual, make sure all sepolicy context are as expected before reboot
Bug: 109821005
Change-Id: I9d3419ce57be072daa55f704f75df7775fbaf5fb
2018-08-28 22:21:00 +00:00
Treehugger Robot
d2b29eb3af Merge "fs_mgr: overlayfs skip mount points that are more specific" 2018-08-28 22:20:35 +00:00
David Anderson
0debda098f fastboot: Clean up the image array a bit.
This makes the following changes to the images array:
 * The "optional_if_no_partition" flag is removed, as it was a temporary
   workaround for super.img.
 * The "flashall" flag is removed.
 * The "needed_for_fastbootd" flag is now an ImageType enum.

Bug: N/A
Test: fastboot builds, flashall works
Change-Id: Id000ea20cf83639cec2c9ae94f28c799b34606f1
2018-08-28 15:17:48 -07:00
Treehugger Robot
24f4ec6012 Merge "llkd: clear PR_SET_DUMPABLE" 2018-08-28 22:13:25 +00:00
Ryan Mitchell
1645312436 Merge "Open zips using _wopen on windows." 2018-08-28 21:26:29 +00:00
Josh Gao
8808f6c1c9 libdebuggerd: decode fdsan owner tags.
Test: debuggerd `pidof system_server` | grep " fd "
Change-Id: Ic4bb30b8602acf5912e776a61825d9645ec93c65
2018-08-28 13:48:08 -07:00
Elliott Hughes
85528e8a75 Move off safe-iop.
Bug: http://b/25224572
Test: ran tests
Change-Id: I6687015eedb28c69d1f57c9d3cd7324d4995e47a
2018-08-28 13:40:04 -07:00
Mark Salyzyn
62aeb16e1d fs_mgr: overlayfs skip mount points that are more specific
This is an optimization to limit us to an optimal set of overlay
mounts.  If an entry is identical or more specific (eg: /vendor is
less specific than /vendor/firmware_file), then no need to craft an
override for it.

We do the check in the setup and mount_all paths.

Test: confirm on devices with more specific mounts they do not get override
Bug: 109821005
Change-Id: If34775455fc7989903f70bc4f075c948db91ce37
2018-08-28 13:32:08 -07:00
Treehugger Robot
065cdf322f Merge "fs_mgr: correct support for ro.build.system_root_image" 2018-08-28 20:31:11 +00:00
David Pursell
6fd4b9b6b5 libcutils test: make set_sched_policy optional
set_sched_policy checks that operations related to the kernel config
CONFIG_CGROUP_SCHEDTUNE are working properly, but this config is not
required so devices without this were failing the test.

This CL splits set_sched_policy into two tests so that the policy and
timerslack tests can be skipped individually when devices don't support
them.

Bug: 113185515, 112550681
Test: libcutils_test{32,64} now pass on aosp_x86_64 emulator
Change-Id: I31638b61e033f0c96b63428a8d27d27dbc36bce3
2018-08-28 13:26:04 -07:00
Josh Gao
06512082d3 Merge changes from topic "fdsan_abort_msg"
* changes:
  debuggerd_test: add test for fdsan abort message.
  debuggerd_handler: receive abort messages via sigqueue(DEBUGGER_SIGNAL).
2018-08-28 20:20:21 +00:00
Mark Salyzyn
4832a8bd76 llkd: clear PR_SET_DUMPABLE
Test: compile
Bug: 33808187
Bug: 111910505
Bug: 80502612
Change-Id: I21ed937d79b3eb81b67ad145664ea82413fb65fd
2018-08-28 13:13:50 -07:00
David Anderson
95d4093b49 fastboot: Flash boot partitions before rebooting to fastbootd.
Userspace fastboot is required when flashing logical partitions. If for
some reason userspace fastboot is broken, the user may be stuck with
bootloader fastboot. To address this scenario, we now flash "boot",
"vbmeta", "recovery", "dtbo", and "dts" before booting into userspace
fastboot, using whatever fastboot is currently active.

Bug: 78793464
Test: fastboot flashall with device in bootloader fastboot
Change-Id: I773707bbbe9235c560416c70976e32fd8e52a5a3
2018-08-28 12:54:01 -07:00
Treehugger Robot
abf8ff7e81 Merge "fs_mgr: Better error messages in fs_mgr_update_verity_state." 2018-08-28 18:58:21 +00:00
Treehugger Robot
9adafe260d Merge "fastboot: Automatically reboot to userspace fastboot." 2018-08-28 18:19:45 +00:00
David Anderson
356386246d fs_mgr: Better error messages in fs_mgr_update_verity_state.
With verity disabled, fs_mgr_update_verity_state spews some confusing
error messages from device-mapper. This change checks whether a device
exists and logs an explicit error.

Bug: N/A
Test: AVB properties are set correctly on AVB device
      Messages are logged correctly with AVB disabled

Change-Id: If490c18cfec2d63ad784972c13ceef63d9aa3e4c
2018-08-28 10:42:00 -07:00