Commit graph

51824 commits

Author SHA1 Message Date
David Anderson
272dae3005 Merge "liblp: Support sdcards in PartitionOpener."
am: c5b3c88f8a

Change-Id: I464d2e9f39e49fb529dc4be11ac632ae4a9d6b34
2019-08-22 12:54:01 -07:00
David Anderson
c5b3c88f8a Merge "liblp: Support sdcards in PartitionOpener." 2019-08-22 19:12:40 +00:00
Tom Cherry
e4be3d308d Merge changes Id9534a59,I3ee81536
am: afe45ab5f2

Change-Id: I36290408af2ac500101e30a139c26091c510834f
2019-08-22 10:49:46 -07:00
Tom Cherry
afe45ab5f2 Merge changes Id9534a59,I3ee81536
* changes:
  init: run property service in a thread
  Revert "init: Handle properties in the background of calling fs_mgr"
2019-08-22 17:24:18 +00:00
Jiyong Park
3f1d0c0473 Merge "add nopreload option in public.libraries.txt"
am: 6b20b7cff8

Change-Id: Iad237dabf74e7485e4da71c9d3fc0797965230a2
2019-08-22 00:36:48 -07:00
Treehugger Robot
6b20b7cff8 Merge "add nopreload option in public.libraries.txt" 2019-08-22 07:14:31 +00:00
Inseob Kim
144dc9adfd Merge "Implement sysprop_library API stability check" into stage-aosp-master 2019-08-22 02:52:17 +00:00
David Anderson
d84ebe949d Merge "libdm: Add a helper function for GetState+DeleteDevice checks."
am: b21f3dd761

Change-Id: I07bdebb088ff20c89a53d3445d07baa2b0c545ce
2019-08-21 18:22:12 -07:00
David Anderson
b21f3dd761 Merge "libdm: Add a helper function for GetState+DeleteDevice checks." 2019-08-22 00:57:01 +00:00
David Anderson
251ec05f01 liblp: Support sdcards in PartitionOpener.
Before ImageManager was introduced, gsid avoided using PartitionOpener
when writing to external media. PartitionOpener couldn't interact with
non-boot devices, because it prepends /dev/block/by-name. We hacked
around this in both gsid and in first-stage init, which manually detects
the problem and prepends /dev/block instead.

After the ImageManager refactoring, sdcard support broke in gsid,
because it started relying on PartitionOpener. Let's fix this by allowing
/dev/block for mmcblk* names in PartitionOpener.

Bug: 139204329
Test: fiemap_image_test gtest
Change-Id: Ic1cbdbe0a18fc09522ee38cc62b35fd8193ce250
2019-08-21 12:27:56 -07:00
David Anderson
370226e662 libdm: Add a helper function for GetState+DeleteDevice checks.
Bug: N/A
Test: manual test
Change-Id: Ie97b63b53f548af1e82b73893fa491fac42b32ea
2019-08-21 12:27:56 -07:00
Tom Cherry
26f5e7da3a init: run property service in a thread
It's been a long standing issue that init cannot respond to property
set messages when it is running a builtin command.  This is
particularly problematic when the commands involve IPC to vold or
other daemons, as it prevents them from being able to set properties.

This change has init run property service in a thread, which
eliminates the above issue.

This change may also serve as a starting block to running property
service in an entirely different process to better isolate init from
handling property requests.

Test: CF boots, walleye boots, properties are set appropriately
Change-Id: Id9534a5916abb2f7d2a49cda54e33c1b69c50c2f
2019-08-21 08:26:09 -07:00
David Anderson
55f74e58e5 Merge "fs_mgr: Allow using major:minor device strings in CreateLogicalPartition."
am: 63fe0e9a36

Change-Id: I844b7250167ad5cc79d9ed0157f0da9d269f68bd
2019-08-20 14:01:42 -07:00
David Anderson
63fe0e9a36 Merge "fs_mgr: Allow using major:minor device strings in CreateLogicalPartition." 2019-08-20 20:42:24 +00:00
Josh Gao
1f32a20c5c Merge changes Iacf0093a,I40be3504
am: c2f53906e8

Change-Id: I21f8c74909b218a2d35d149305d9858722911cd1
2019-08-20 13:40:55 -07:00
Josh Gao
c2f53906e8 Merge changes Iacf0093a,I40be3504
* changes:
  adb: fdevent: add fdevent_context_epoll.
  adb: extract soon-to-be-common code.
2019-08-20 20:00:34 +00:00
Jiyong Park
5db5d198ff add nopreload option in public.libraries.txt
A lib with 'nopreload' option in public.libraries.txt is not preloaded
during zygote. This is useful for seldom used public libraries; they
don't contribute to the zygote startup time and only affect the apps
that they are used.

Bug: 132911956
Test: libnativeloader_test
Change-Id: I6f97c90e6721aec7f2f96c8fc7b963b34f8edd3e
2019-08-21 00:35:34 +09:00
Inseob Kim
34114e3df3 Implement sysprop_library API stability check
sysprop_library now checks the API stability itself, cutting dependency
on java_sdk_library. Under the directory {module_dir}/api,
{module_name}-current.txt and {module_name}-latest.txt hold API
signatures.

When sysprop_library is built, or a user run "m {module_name}-check-api"
command, API check is performed. First, current.txt must have exactly
same signature with built sysprop_library module. Second, current.txt
must be compatible with latest.txt.

Build system emits a handy error message to generate/update those API
files, in case of missing or mismatching. Also, a script file for
freezing API files is introduced.

Bug: 131637873
Test: 1) m && boot blueline
Test: 2) m {sysprop_library} performs API check
Test: 3) manual test for check-api, freezing api
Change-Id: I6b95eebafaf88ad326be5d7c890e000cbdb79cb5
Merged-In: I6b95eebafaf88ad326be5d7c890e000cbdb79cb5
(cherry picked from commit f711999132)
2019-08-20 16:16:40 +09:00
Yi Kong
4a2b31f210 Merge "Fix ODR violation"
am: ebfd2a468b

Change-Id: Id3af3d8d9c6e5b42a1ef4712171a486d9c81c8aa
2019-08-19 17:12:28 -07:00
Yi Kong
ebfd2a468b Merge "Fix ODR violation" 2019-08-19 23:58:50 +00:00
Josh Gao
ada40cd6b8 Merge "adb: fix mac build"
am: ef356fa5bd

Change-Id: Ia7324a9137ce296f2090c82993b1c4726bb25553
2019-08-19 16:54:43 -07:00
Josh Gao
ef356fa5bd Merge "adb: fix mac build" 2019-08-19 23:18:01 +00:00
Adrian Roos
68c14d10b8 adb: fix mac build
Ensure that off64_t is defined when building adb for mac

Fixes: 139646013
Test: make # On mac
Change-Id: I32b68738d71c8a63a35c22434092933dcabac1ce
(cherry picked from commit 2167b9082d)
2019-08-19 10:51:00 -07:00
Yi Kong
0f6537c437 Fix ODR violation
host_init_verifier statically links libprocessgroup, which has shared
dependency on libjsoncpp. Right now it also has shared dependency on
libjsoncpp, resulting in ODR violation:

 ERROR: AddressSanitizer: odr-violation (0x7fce895f3220):
 [1] size=8 'Json::kNullRef' external/jsoncpp/src/lib_json/json_value.cpp:37:22
 [2] size=8 'Json::kNullRef' external/jsoncpp/src/lib_json/json_value.cpp:37:22
 These globals were registered at these points:
 [1]:
 #0 0x56276926ef0d (/usr/local/google/buildbot/src/android/master/out/host/linux-x86/bin/host_init_verifier+0xd1f0d)
 #1 0x7fce894ac1d9 (/lib64/ld-linux-x86-64.so.2+0x101d9)

 [2]:
 #0 0x56276926ef0d (/usr/local/google/buildbot/src/android/master/out/host/linux-x86/bin/host_init_verifier+0xd1f0d)
 #1 0x7fce894ac1d9 (/lib64/ld-linux-x86-64.so.2+0x101d9)

Move host_init_verifier to libjsoncpp_headers to fix the ODR violation.

Bug: 139546461
Bug: 131328001
Test: Run ASAN host_init_verifier
Change-Id: I54a51138d61fff37f092ffaa0758817600a0af9d
2019-08-18 17:57:35 -07:00
Yifan Hong
81e069c454 Merge "liblp: UpdateMetadataForInPlaceSnapshot"
am: 70a368119d

Change-Id: I4a552aa7a056bb8c56c504b448f5d8ae68e1e827
2019-08-16 18:30:04 -07:00
Yifan Hong
70a368119d Merge "liblp: UpdateMetadataForInPlaceSnapshot" 2019-08-17 00:18:54 +00:00
Josh Gao
2702caf209 Merge "Revert "adb: daemon: Assign valid fd to usb_handle ep0 file descriptor""
am: 7195a09fca

Change-Id: Iab705da597548bf7e99f3a0ae96fa5c3d8af73bf
2019-08-16 14:26:08 -07:00
Josh Gao
7195a09fca Merge "Revert "adb: daemon: Assign valid fd to usb_handle ep0 file descriptor"" 2019-08-16 21:02:05 +00:00
Mark Salyzyn
3b8ef8c890 Merge "fs_mgr: overlayfs: empty system partitions excluded."
am: e5aa946b63

Change-Id: I088a0ba5fd02460913c4e9d9bd7ae61c07c58a68
2019-08-16 11:27:19 -07:00
Yifan Hong
d7a3a7120d Merge "liblp: CreateLogicalPartition with a given mapped name"
am: 1d6d4507a4

Change-Id: I90c2871353c6161bfcd8455f9584af5bb6afcf8c
2019-08-16 11:25:04 -07:00
Mark Salyzyn
e5aa946b63 Merge "fs_mgr: overlayfs: empty system partitions excluded." 2019-08-16 17:41:32 +00:00
Yifan Hong
1d6d4507a4 Merge "liblp: CreateLogicalPartition with a given mapped name" 2019-08-16 17:41:22 +00:00
David Anderson
243ffd6522 Merge "libsnapshot: Improve test reliability."
am: c1c6008b78

Change-Id: Idfcb6fe480477af27dc8f6e71ac0f0a1567f9610
2019-08-16 08:20:46 -07:00
David Anderson
8cbf0b9397 Merge "libsnapshot: Don't compare strings for snapshot state."
am: f79af03011

Change-Id: I15c66ebd7af0d17cae47b4836a1620374d279957
2019-08-16 08:20:09 -07:00
David Anderson
c1c6008b78 Merge "libsnapshot: Improve test reliability." 2019-08-16 14:54:22 +00:00
David Anderson
f79af03011 Merge "libsnapshot: Don't compare strings for snapshot state." 2019-08-16 14:53:14 +00:00
David Anderson
3b5d5b5b8a libsnapshot: Improve test reliability.
The test suite is still quite buggy if interrupted. This fixes a number
of issues (such as bad ordering of setup calls), and refactors things to
add more ASSERTs.

Bug: 139204329
Test: libsnapshot_test gtest
Change-Id: I224608715c29f343b34512a9ac1143f0dde932e9
2019-08-15 17:42:51 -07:00
David Anderson
f27c063ba9 libsnapshot: Don't compare strings for snapshot state.
Convert the string field to an enum. We still write a string back to the
state file.

Bug: N/A
Test: libsnapshot_test gtest
Change-Id: I7cc1cb597dacd7d6faaaba05fb01c0a86bd54c8f
2019-08-15 17:42:47 -07:00
Yifan Hong
cddb335ac6 Merge "Rename libfiemap libraries."
am: 536dd4292e

Change-Id: I7c7c1d1152ec6b74c713f8c0fcbb2bd473a482d3
2019-08-15 17:39:34 -07:00
Dan Albert
8c2b3a8cde Revert "adb: daemon: Assign valid fd to usb_handle ep0 file descriptor"
This reverts commit b2d79c5e48.

Bug: http://b/135753060
Test: treehugger
Change-Id: I2b1b2b7dfb7bab783e4ed40e295329525ceaa0dd
(cherry-picked from internal commit ba4684c2b2)
2019-08-15 17:27:49 -07:00
Yifan Hong
536dd4292e Merge "Rename libfiemap libraries." 2019-08-15 23:52:23 +00:00
David Anderson
4929df0c44 fs_mgr: Allow using major:minor device strings in CreateLogicalPartition.
IPartitionOpener is useful for writing gtests, however, it can't easily
be used with CreateLogicalPartition. fs_mgr assumes the super partition
name will map to /dev/block/by-name/super whereas in tests we want to
redirect it to a different block device.

This CL makes two changes. First, it adds a new method to IPartitionOpener
to return a "device string" for a device name. The string must either be
an absolute path (for example /dev/block/by-name/super) or a major:minor
sequence, since device-mapper will accept either.

Second, CreateLogicalPartition now accepts an optional IPartitionOpener.
When converting block devices to paths, it uses the opener instead of
automatically prepending /dev/block/by-name.

Bug: 139204329
Test: liblp_test gtest
      libsnapshot_test gtest

Change-Id: Id6b3120cc2ef5c0dd941b29ff96215ad3c8ec848
2019-08-15 16:39:48 -07:00
Yifan Hong
48c1294538 Merge changes from topic "liblp_virtualab_prepare"
am: f093f2173b

Change-Id: I26a7222a01679fde82c9987747ebf2a1fba278da
2019-08-15 13:22:54 -07:00
Tom Cherry
3707d328a1 Revert "init: Handle properties in the background of calling fs_mgr"
This reverts commit 71bdf2820e.
Test: boot
2019-08-15 13:07:24 -07:00
Yifan Hong
f093f2173b Merge changes from topic "liblp_virtualab_prepare"
* changes:
  liblp: Don't halve super partition for virtual a/b devices
  liblp: MetadataBuilder::GetBlockDevicePartitionName
  liblp_test_static: GetMockedInstance->GetMockedPropertyFetcher
  libsnapshot: UnmapSnapshot: don't delete device that doesn't exist.
  liblp: change some functions to use string_view
2019-08-15 19:29:34 +00:00
Mark Salyzyn
18085418ee fs_mgr: overlayfs: empty system partitions excluded.
Beside using the 1% threshold for determining that a filesystem
should be an overlayfs candidate, do so also if the free space
is below 8MB.  This will cover nearly empty filesystems that can
not be right-sized below the smallest ext4 filesystem size.

Adjust the test to cover the new cases.

Should test all system partitions, including new /system_ext and
any others that get added in the future.

Fix instance of dir that were supposed to be die.  Using || die
does not work as expected within a function, so use if ! <cond>.

Test: adb-remount-test.sh
Bug: 139471424
Change-Id: If3e4cac5dce7bee998727052130eaf362e9e2fb5
2019-08-15 11:37:18 -07:00
Yurii Zubrytskyi
2bb4f40d82 Merge "[base] Make MappedFile work with OS file handles"
am: 5f0e5e0ecc

Change-Id: Iae9f09cfa4dc86485ebb6f3fe70e999bd0a7fa8e
2019-08-15 10:16:23 -07:00
Yurii Zubrytskyi
5f0e5e0ecc Merge "[base] Make MappedFile work with OS file handles" 2019-08-15 16:50:31 +00:00
cfig
9674b347fe Merge "libsparse: replace legacy min() with std::min()"
am: 31f6263bc1

Change-Id: I5ceec7e0e23cc19c9c35757a86d9176333aa7232
2019-08-15 07:52:44 -07:00
Treehugger Robot
31f6263bc1 Merge "libsparse: replace legacy min() with std::min()" 2019-08-15 14:32:36 +00:00