Commit graph

42306 commits

Author SHA1 Message Date
David Anderson
e21fec88d4 Merge "fastbootd: Add commands for logical partitions."
am: 770395dee1

Change-Id: I5bf7664d9f2e621b1c00f11fe8df1bb5b1cf1589
2018-08-09 16:37:02 -07:00
Josh Gao
da23544c88 Merge changes If7c8d38f,I7117dd19,Iaa5006e3,I3a568361,I37df06e4, ...
am: 18eae78c09

Change-Id: I4caf22635eeca749c2d3f2797021e0fb06e6b890
2018-08-09 16:30:42 -07:00
Steven Moreland
d367f37b1e Merge "ParseFloat/ParseDouble, also take std::string"
am: edc9cee49b

Change-Id: Ied3fd7325d8901b2cd155c95239e6dc65032433d
2018-08-09 16:29:19 -07:00
Mark Salyzyn
8aa329d0e2 Merge changes from topic "squashfs+overlayfs"
am: d88b52e7f4

Change-Id: Ifa38f8e48a3110dff9d1339c804855f8a0080ef4
2018-08-09 16:22:24 -07:00
Treehugger Robot
770395dee1 Merge "fastbootd: Add commands for logical partitions." 2018-08-09 23:16:27 +00:00
Josh Gao
18eae78c09 Merge changes If7c8d38f,I7117dd19,Iaa5006e3,I3a568361,I37df06e4, ...
* changes:
  adb: report connection status when we're unauthorized.
  adb: disable test_device.FileOperationsTest.test_pull_symlink_dir.
  adb: fix test_device.FileOperationsTest.test_push_empty
  adb: switch test_adb.py over to double quotes.
  adb: make test_adb.py work on windows.
  adb: switch test_adb.py to python3.
2018-08-09 22:12:46 +00:00
David Anderson
0d4277d7b3 fastbootd: Add commands for logical partitions.
This patch adds the following new commands to fastbootd:

    getvar is_logical:<partition>
    create-logical-logical-partition <partition> <size>
    delete-logical-partition <partition>
    resize-logicallogical-partition <partition> <size>

All of these commands operate on logical partitions only, and require a
properly configured "super" partition to operate.

Bug: 78793464
Test: fastboot create-logical-partition example 4096
      fastboot create-logical-partition example 4096 returns error
      fastboot getvar is-logical:example returns "yes"
      fastboot getvar partition-size:example returns "1000"
      fastboot resize-logicalpartition example 8000
      fastboot getvar partition-size:example returns "2000"
      fastboot delete-logical-partition example
      fastboot getvar is-logical:example returns error
      fastboot getvar is-logical:system_a returns "no"

Change-Id: Iff323eabcf5c559fa04c7c92574650b01803eb1f
2018-08-09 15:06:52 -07:00
Steven Moreland
edc9cee49b Merge "ParseFloat/ParseDouble, also take std::string" 2018-08-09 21:35:31 +00:00
Mark Salyzyn
d88b52e7f4 Merge changes from topic "squashfs+overlayfs"
* changes:
  init: add fs_mgr_overlayfs_mount_all to FirstStageMount
  adb: add overlayfs handling for readonly system filesystems
  fs_mgr: get fs_mgr_mount_all to call fs_mgr_overlayfs_mount_all
  fs_mgr: add overlayfs handling for squashfs system filesystems
2018-08-09 20:44:20 +00:00
David Anderson
dff1cef8ae Merge changes Id2a61d35,Ibe802c36
am: 3cf9f9b838

Change-Id: I56c5e5df0c716d72163aca5a50775ae92228c630
2018-08-09 13:04:12 -07:00
Treehugger Robot
3cf9f9b838 Merge changes Id2a61d35,Ibe802c36
* changes:
  fastbootd: Add support for flashing logical partitions.
  fastbootd: Enable erase and flash commands for physical partitions.
2018-08-09 19:47:17 +00:00
Tom Cherry
f1e6db5567 Merge "init: clarify comment for the restorecon of second stage init"
am: 424ffa2df9

Change-Id: I6756899be70781ab4f1a5cd2f7d8daf28cb56a23
2018-08-09 11:56:25 -07:00
Treehugger Robot
424ffa2df9 Merge "init: clarify comment for the restorecon of second stage init" 2018-08-09 18:28:49 +00:00
David Anderson
88ef0b1f25 fastbootd: Add support for flashing logical partitions.
When flashing logical partitions, we read the "super" partition metadata
corresponding to the current slot. We then temporarily create a
device-mapper device for that partition, and immediately destroy the
device after all operations are complete. We do not mount partitions
ahead of time, or keep them mounted, because a fastboot operation may
change the layout of the logical partition table (or change which slot
is current).

Bug: 78793464
Test: fastboot flash a logical partition under "super"
Change-Id: Id2a61d3592decabeebfd283c4fd6e6cbe576a18c
2018-08-09 11:15:23 -07:00
Steven Moreland
f1911f4ba3 ParseFloat/ParseDouble, also take std::string
For convenience and to match the integer parsing functions.

Bug: 110758329
Test: m only
Change-Id: I33620d9a29465e1f425872fd57063ac32031988a
2018-08-09 10:49:45 -07:00
Tom Cherry
e85b2addca init: clarify comment for the restorecon of second stage init
Test: we actually do need this restorecon for recovery.
Change-Id: I46a8d6ea5c08b18d79fa6dd8df0f4a98695363e2
2018-08-09 10:40:51 -07:00
David Anderson
12211d163e fastbootd: Enable erase and flash commands for physical partitions.
Bug: 78793464
Test: adb reboot fastboot && fastboot flashall

Change-Id: Ibe802c36f6efe20111a2315616ef34d3a027950f
2018-08-09 09:58:37 -07:00
Tao Bao
47c07649af Merge "fastboot: fastbootd uses libadbd.so."
am: 075c351af2

Change-Id: Ide4d00255ea38dc3b79973094bed5a04c7baf3f7
2018-08-09 09:41:34 -07:00
David Anderson
e60694d66a Merge "fastbootd: Allow returning errors from getvar handlers."
am: 4264b7f5d2

Change-Id: I1e14040ca3aa2dd671e910f0bedd8f138e9ec2f0
2018-08-09 09:40:44 -07:00
Tao Bao
075c351af2 Merge "fastboot: fastbootd uses libadbd.so." 2018-08-09 16:31:29 +00:00
Treehugger Robot
4264b7f5d2 Merge "fastbootd: Allow returning errors from getvar handlers." 2018-08-09 16:28:06 +00:00
Steven Moreland
bff61f2eba Merge "Add ParseFloat (in parsedouble.h)."
am: 9ce0de0ed1

Change-Id: I16d399f1be0a9c5d3ebe20e795b8a69f3fd30e4f
2018-08-09 09:25:41 -07:00
Steven Moreland
9ce0de0ed1 Merge "Add ParseFloat (in parsedouble.h)." 2018-08-09 16:14:18 +00:00
Hans Boehm
cc8c08d1f1 Merge "Revert^2 "Prepare to fail in RefBase destructor if count is untouched""
am: 2d3f234f20

Change-Id: I12acef5c4485616cbb0fd57162bcca0919068132
2018-08-08 22:23:23 -07:00
Hans Boehm
2d3f234f20 Merge "Revert^2 "Prepare to fail in RefBase destructor if count is untouched"" 2018-08-09 05:09:19 +00:00
Steven Moreland
7ab8206b59 Merge "ParseDouble: allow validation only."
am: 4842b1b53e

Change-Id: I24758b950cf256527f6a5f80e22a45d994724aa3
2018-08-08 19:43:43 -07:00
Treehugger Robot
4842b1b53e Merge "ParseDouble: allow validation only." 2018-08-09 02:38:27 +00:00
Josh Gao
232cacc29a Merge "base: move unique_fd fdsan tests into bionic."
am: e74c526513

Change-Id: I2f2586281ce25cc859eb8cfcc939a31b9745429a
2018-08-08 19:27:34 -07:00
Treehugger Robot
e74c526513 Merge "base: move unique_fd fdsan tests into bionic." 2018-08-09 02:14:48 +00:00
David Anderson
856b7ecbb6 fastbootd: Allow returning errors from getvar handlers.
Currently a few getvar handlers will return invalid strings when an
error occurs. This change allows those handlers to instead send a proper
failure message.

Bug: 78793464
Test: N/A
Change-Id: I7ff7d036c1e6fb0a3d700ecf21b1103ab77278d2
2018-08-08 18:24:09 -07:00
Steven Moreland
586ef26f74 Add ParseFloat (in parsedouble.h).
Bug: 110758329 # for using here
Test: libbase_test (added float_smoke)
Change-Id: I640f85655567c707cbee625ca9c88db2ab91da66
2018-08-08 18:17:21 -07:00
Josh Gao
362e696bbf adb: report connection status when we're unauthorized.
Previously, connecting to devices that end up as unauthorized would
wait 10 seconds before reporting failure to the user. After this
change, notification happens as soon as the adb server realizes.

Test: manual
Change-Id: If7c8d38f22da3d98b952eee6a334abc8566bb751
2018-08-08 17:40:15 -07:00
Josh Gao
a8db274a69 adb: disable test_device.FileOperationsTest.test_pull_symlink_dir.
selinux prevents us from doing this.

Test: python test_device.py
Change-Id: I7117dd19348b0764638977b7c958331a4839ea4f
2018-08-08 17:40:15 -07:00
Josh Gao
6c1b42ccd0 adb: fix test_device.FileOperationsTest.test_push_empty
Test: python test_device.py
Change-Id: Iaa5006e39c3d61374de11c05bcaffb4f30b7512e
2018-08-08 17:40:15 -07:00
Josh Gao
b3610734f8 adb: switch test_adb.py over to double quotes.
Test: ./test_adb.py
Change-Id: I3a568361d54f32cc895cea439de0f2c38aee5e2d
2018-08-08 17:40:15 -07:00
Josh Gao
676f375d9b adb: make test_adb.py work on windows.
Switch from os.pipe to socket.socketpair for the fake adbd termination
termination signaller, that we can select on it on windows.

Test: test_adb.py on windows (2 failures on windows)
Change-Id: I37df06e465ec8be28cfb18a5c21ef30125195004
2018-08-08 17:40:15 -07:00
Josh Gao
9b6522b357 adb: switch test_adb.py to python3.
Currently, test_adb.py doesn't work on Windows, because we're selecting
on a pipe, which doesn't work on Windows. Python 3.5 adds socketpair
support to Windows, so switch over to Python 3 to make it so we can use
that.

Test: python3 test_adb.py
Change-Id: I0fbd1bca0b28324658831d5ef8ee08aefe2b0596
2018-08-08 17:40:15 -07:00
Josh Gao
fa06fc79e2 base: move unique_fd fdsan tests into bionic.
EXPECT_DEATH forks behind the scenes, which turns off fdsan, leading to
these tests failing. Instead of duplicating the special
EXPECT_FDSAN_DEATH macro, just move these tests into the bionic fdsan
tests.

Test: none
Change-Id: Ia7b65d4560601d5a78d143aced887a6773b401c0
2018-08-08 17:38:04 -07:00
Julien Desprez
d8ecfb6db7 Merge "Add adb integration test to general-tests"
am: 7b1d163cb8

Change-Id: I5fc70e76edff1c8924a54e3128733d2b7fcfb20d
2018-08-08 17:23:06 -07:00
Treehugger Robot
7b1d163cb8 Merge "Add adb integration test to general-tests" 2018-08-09 00:05:51 +00:00
Steven Moreland
1b8981e972 ParseDouble: allow validation only.
This change also updates documentation for Parse(Ui|I)nt functions
which recently had a corresponding change applied.

Bug: 110758329
Test: libbase_test
Change-Id: I4842c0500a6e49498eeb8a63d1117c06727fffdf
2018-08-08 16:50:27 -07:00
Hans Boehm
2a019ecf4f Revert^2 "Prepare to fail in RefBase destructor if count is untouched"
This reverts commit b9d0753d2b.

Reason for revert: Re-land with MacOS workaround.

Test: Build (on Linux) and boot AOSP, with weak symbols enabled and disabled.

Change-Id: I5150cd90367178f3b039761dca3bccc9c2987df1
2018-08-08 16:30:12 -07:00
Tao Bao
b71eedf912 fastboot: fastbootd uses libadbd.so.
The size of `fastbootd` goes down from 64088-byte to 38488-byte
(aosp_taimen-userdebug) after the change.

Bug: 78793464
Test: `m -j installclean && m -j fastbootd`. Check that
      $OUT/recovery/root/system/lib64/libadbd.so exists and
      $OUT/recovery/root/system/bin/fastbootd depends on that.
Change-Id: Ic36c98da1a0dda4e0d86e671f858c42578f53f90
2018-08-08 15:54:48 -07:00
Hridya Valsaraju
b5ff114a62 Merge "fastbootd: Implement the getvar command."
am: 70306b9271

Change-Id: I72bd78bfc8ab0c18006614990ad7fa4a44a8a7c7
2018-08-08 15:47:20 -07:00
Mark Salyzyn
934db8a4a5 init: add fs_mgr_overlayfs_mount_all to FirstStageMount
Test: compile & smoke
Bug: 109821005
Bug: 110985612
Change-Id: I51a4b7fc123e736035f74e126f71288721dc9fab
2018-08-08 15:42:46 -07:00
Mark Salyzyn
c60153f742 adb: add overlayfs handling for readonly system filesystems
adb verity-on setup overlayfs directories, do not skip if verity
feature not configured for device.

adb verity-off teardown overlayfs directories, do not skip if verity
feature not configured for device.

adb remount setup overlayfs directories and mount if possible, and
do so without a reboot if possible.

Test: compile
Bug: 109821005
Bug: 110985612
Change-Id: I28c4c23fea44b886c5523f0286a523f0b0485df0
2018-08-08 15:42:44 -07:00
Mark Salyzyn
d9e6c2020e fs_mgr: get fs_mgr_mount_all to call fs_mgr_overlayfs_mount_all
After fs_mgr_mount_all has added the resources, let
fs_mgr_overlayfs_mount_all to read-only mount overlayfs over the
possible system partitions.

Test: compile
Bug: 109821005
Bug: 110985612
Change-Id: I7101a04c57de1a26283b1523636d07fa8e19ffc7
2018-08-08 15:38:53 -07:00
Mark Salyzyn
b28389f5ee fs_mgr: add overlayfs handling for squashfs system filesystems
Logistics for adb remount on developer builds for readonly system
partitions using overlayfs to deal with not being able to remount
with read-write.

Conditions are that filesystem is squashfs, read-only, debug build,
kernel supports overlayfs.  The default is a valid /cache/overlay/
directory, with .../<mount_point>/upper and .../<mount_point>/work,
associated with each system partition <mount_point>.

Will take the sepolicy of context of lowerdir as rootcontext= option.

Add fs_mgr_overlayfs_mount_all() to recurse through
fs_mgr_read_fstab_default(), and checking against /proc/mounts to
add any acceptable overlayfs mounts.  The checking with /proc/mounts
makes sure we do not overlayfs overtop an overlayfs.

Add fs_mgr_overlayfs_setup(const char*, const char* bool*) and
fs_mgr_overlayfs_teardown(const char*, bool*) to respectively setup
or teardown the overlayfs support directories.  Return value
includes success and optional supplied change booleans.

Test: compile
Bug: 109821005
Bug: 110985612
Change-Id: Ie9b4e9ca0f2bdd9275ac2e2e905431636948e131
2018-08-08 15:38:53 -07:00
Treehugger Robot
70306b9271 Merge "fastbootd: Implement the getvar command." 2018-08-08 22:37:00 +00:00
Florian Mayer
09336fe231 Merge "Allow to get raw register data on all platforms."
am: ec004eb1b3

Change-Id: I57b8c1521f7d5bf5bbcdd26c930a44d19e8fc744
2018-08-08 14:55:59 -07:00