Commit graph

43481 commits

Author SHA1 Message Date
Treehugger Robot
239245fe79 Merge "Enable the APEX support on the device side." 2018-12-04 12:29:06 +00:00
Treehugger Robot
a7f54b1592 Merge "C++17 is the default now." 2018-12-04 07:53:24 +00:00
Dan Willemsen
f56dad3fff Merge "Prevent dependency cycle due to system_shared_libs expansion" 2018-12-04 06:19:09 +00:00
Tom Cherry
0c7fb42949 Merge "fs_mgr: Create a C++ Fstab struct" 2018-12-04 00:10:33 +00:00
Jaewoong Jung
7174ec8fff Merge "Revert "Revert "Revert "adb: append the libwinpthread COPYING to adb's NOTICE."""" 2018-12-03 23:57:42 +00:00
Dan Willemsen
d3825898da Prevent dependency cycle due to system_shared_libs expansion
It was discovered that we were building some objects inconsistently due
to an optimization in cc_library to only build objects once and use them
for both the static and shared libraries. But static libraries didn't
get system_shared_libs set automatically, and we didn't notice that we
would have built the objects differently.

So static libraries now get the default system_shared_libs, we allow
adjusting that for static vs shared in a cc_library, and we disable the
optimization if the linked libraries are configured differently between
static and shared in a single cc_library.

This triggers dependency cycles for static libraries that libc/libdl
use, so fix those cycles here.

Test: treehugger
Change-Id: I6ec2ea45292b602d5c506560de8b8d6ae725be6f
2018-12-03 15:50:00 -08:00
Josh Gao
946f7d44c2 Merge "base: add more error-checking overloads for unique_fd." 2018-12-03 22:41:22 +00:00
Treehugger Robot
307337fb40 Merge changes I6a4c3d9b,Ia5cdb797,I946eb605,Ieff3f6ea
* changes:
  init: overlay: allow fs_mgr_overlayfs_required_devices to report partitions
  fastboot: call fs_mgr_overlayfs_teardown() in UpdateSuper
  fs_mgr: overlay: disable overrides in recovery or fastbootd.
  fs_mgr: overlay: umount scratch more aggressively
2018-12-03 20:14:02 +00:00
Treehugger Robot
5d595da516 Merge "fs_mgr fix flags/fs_mgr_flags mismatch" 2018-12-03 19:07:45 +00:00
Daniel Mentz
9cb7704ab4 Merge "Increase netlink uevent rcvbuf size to 16M" 2018-12-03 18:39:42 +00:00
Daniel Mentz
41aa2c3703 Increase netlink uevent rcvbuf size to 16M
Increase size of the NETLINK_KOBJECT_UEVENT socket receive buffer to
16M.  Also, use SO_RCVBUFFORCE to override any limits set by
/proc/sys/net/core/rmem_max.

We had a couple of instances, where we lost critical uevent messages due
to receive buffer overflows.

Bug: 119933843
Change-Id: I6aab183aa0194e173f9175b47c6beb0835cf6675
2018-12-03 18:39:24 +00:00
Tom Cherry
d0be7a5277 fs_mgr: Create a C++ Fstab struct
Create a C++ Fstab struct with the intention to eventually deprecate
the legacy C 'fstab' struct.  This also contains functions for
converting between the two fstab variants to ease in the transition.

Bug: 62292478
Test: boot

Change-Id: I6fb51c6a99e65192708792719df01960cf6b432a
2018-12-03 09:40:55 -08:00
Elliott Hughes
3c59cb8420 C++17 is the default now.
Test: builds
Change-Id: I6814455e9ad2cdcf99ad66de38a3ad0bfb440d80
2018-12-03 09:02:18 -08:00
Mark Salyzyn
acf56c297f init: overlay: allow fs_mgr_overlayfs_required_devices to report partitions
init add support for picking up partitions if specified by
fs_mgr_overlayfs_required_devices() as /dev/block/by-name/<partition>

Test: adb-remount-test.sh
Bug: 119885423
Change-Id: I6a4c3d9b5c2b406178f0acf0a86c52ab17209537
2018-12-03 07:33:38 -08:00
Mark Salyzyn
307a41fe9f fastboot: call fs_mgr_overlayfs_teardown() in UpdateSuper
When the update-super command is issued, we want overlayfs overrides
to disappear without a doubt, which includes non-A/B utilizing
/cache/overlay/ tree.  Call fs_mgr_overlayfs_teardown() on successful
return.

Test: adb-remount-test.sh
Bug: 120034852
Change-Id: Ia5cdb797f7e8350b5591a51fc8ae5f323901aee4
2018-12-03 07:33:38 -08:00
Mark Salyzyn
9040aa5665 fs_mgr: overlay: disable overrides in recovery or fastbootd.
Disable overrides if we are booting up in recovery or fastbootd.
Check for existence of /system/bin/recovery.

Test: adb-remount-test.sh
Bug: 120034852
Change-Id: I946eb605300226d31356ecac209d6367f4e13526
2018-12-03 07:33:38 -08:00
Mark Salyzyn
c0966c9a1b fs_mgr: overlay: umount scratch more aggressively
For specific teardown operations, if we mount scratch with the
intention of it being temporary to strike out content for a specific
partition, umount it.  Otherwise it could interfer with fastboot.

Test: adb-remount-test.sh
Bug: 120034852
Change-Id: Ieff3f6ea0bcda5eb540e9acf6cab8a56d1453b3e
2018-12-03 07:33:38 -08:00
Josh Gao
919b70cde1 Enable the APEX support on the device side.
Test: on device
Merged-In: Ic6e237556fa059e02cf9c55d1c034947b7dfb405
Change-Id: Ic6e237556fa059e02cf9c55d1c034947b7dfb405
2018-12-03 22:29:52 +09:00
Treehugger Robot
67fe6f09d5 Merge "check_fs: skip check_fs if there is no matched EXT4|F2FS_SUPER_MAGIC" 2018-12-03 06:28:34 +00:00
Tom Cherry
7a66be1a54 fs_mgr fix flags/fs_mgr_flags mismatch
Mount flags prefixed with MS_ are intended for the 'flags' entry of
fstab_rec, not fs_mgr_flags.

Coincidentally, this probably has always worked since this maps to the
'wait' flag, which is almost always set for system in the first place.

Test: build
Change-Id: Id4862bc087aa98e1f0e17145dc3ed74b5d867596
2018-11-30 16:17:17 -08:00
Tom Cherry
7f5a2d3c8f Merge "fs_mgr: fix typo from off64_t change." 2018-11-30 23:33:50 +00:00
Jaegeuk Kim
5d14b982fa check_fs: skip check_fs if there is no matched EXT4|F2FS_SUPER_MAGIC
We don't need to call fsck, if magic is not matched at all.

Bug: 111895882
Change-Id: Ie728b02ff2fc7d4a20fc011f66643583ea708f9d
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-11-30 21:29:15 +00:00
Mark Salyzyn
4115c2caf6 Merge "fs_mgr: overlay: test assumption wrong if verity is enabled" 2018-11-30 20:36:27 +00:00
Tom Cherry
2c25796aa0 fs_mgr: fix typo from off64_t change.
I accidentally changed some _mode enums from unsigned int to off64_t
along with the rest changes.  They probably shouldn't have been
unsigned anyway though, so let's make them plain 'int' while we fix
the original typo.

Test: boot
Change-Id: I0c6c51a1a8170056b99087d249539eb79026cffe
2018-11-30 11:29:46 -08:00
Tom Cherry
9d24734b5c Merge "fs_mgr: fixup 'size' attributes of fstab." 2018-11-30 16:33:54 +00:00
Mark Salyzyn
03d6f9a176 fs_mgr: overlay: test assumption wrong if verity is enabled
Test script assumes overlayfs takeup after disable-verity, although
that can happen if verity is already disabled, it is not the case
for devices that just had it disabled.  Move takeup and first stage
init tests downwards to where the condition is guaranteed.

Differentiate the test for devices that support or have verity, and
those that do not.

Fortify test to also use /data mount to check init first stage limit.

Test: adb-remount-test.sh
Bug: 109821005
Change-Id: I5241d6c97bf374614e50aa0aa18a1b9d118be093
2018-11-30 07:49:32 -08:00
Idries Hamadi
fafd21159c Merge "Fix fastdeploy issues when testing Boat Attack Unity3D demo" 2018-11-30 08:43:05 +00:00
Treehugger Robot
e43c146eb4 Merge "fs_mgr: move AVB related source into libfs_avb" 2018-11-30 06:59:38 +00:00
Treehugger Robot
79bd67bb2f Merge "Support product partition for non-treblized devices" 2018-11-30 02:12:15 +00:00
Treehugger Robot
9b52891918 Merge "Validate allocations against mappings" 2018-11-30 01:33:27 +00:00
Treehugger Robot
7472cf6c53 Merge "fs_mgr: add README.overlayfs.md" 2018-11-29 23:39:38 +00:00
Tom Cherry
ac3c7740ad Merge "init: always create a symlink from /init to /system/bin/init" 2018-11-29 23:22:58 +00:00
Jaewoong Jung
0e55778f4e Revert "Revert "Revert "adb: append the libwinpthread COPYING to adb's NOTICE."""
This reverts commit 1272e7a592.

Reason for revert: All notice fix changes have been merged and running peacefully for a sustained period. Now this can be reverted for good.

Change-Id: I74e4e291a504fcb9a14ae50e916e494c7359db34
2018-11-29 23:14:02 +00:00
Tom Cherry
fafbb648e0 fs_mgr: fixup 'size' attributes of fstab.
'off64_t' is the correct way to specify a size of a file system, so we
update the various fs_mgr fstab attributes accordingly.

Test: boot
Change-Id: I07ebe687b7c215a8d07ce49d6d32e81b798d1cd3
2018-11-29 13:32:35 -08:00
Mark Salyzyn
a9a3b73163 fs_mgr: add README.overlayfs.md
Add documentation regarding overlayfs logistics.

Test: none
Bug: 109821005
Change-Id: I8092fdd548a28f8c860b5dd6175b657728a48801
2018-11-29 12:22:53 -08:00
David Anderson
d57025dc46 Merge "fastboot: Delete logical "other" partitions on retrofit devices." 2018-11-29 19:52:12 +00:00
Colin Cross
3ca1976fa7 Validate allocations against mappings
Bug 120032857 is seeing what appears to be allocations with incorrect
end addresses, leading to a much later crash when it tries to map
a zero page outside the valid virtual address space.  Detect allocations
that extend outside the highest or lowest memory mapping and crash
immediately instead.

Test: memunreachable_test
Bug: 120032857
Change-Id: I9be670a025143e7078360a6bf7a83219279614d9
2018-11-29 11:02:56 -08:00
Tom Cherry
9843007327 init: always create a symlink from /init to /system/bin/init
Even though it isn't strictly needed when not system-as-root, for
backwards compatibility, it is desired to keep this symlink.

Bug: 119851742
Test: tree-hugger
Change-Id: I47bc25ab257336f56ef09b5db6ebaf6b17daad35
2018-11-29 09:39:30 -08:00
Treehugger Robot
044e02764d Merge "Run BoringSSL self test during startup" 2018-11-29 16:56:19 +00:00
Tom Cherry
3ecaf2e7f5 Merge "init: clean up the 1st/2nd stage init split" 2018-11-29 16:50:37 +00:00
Ivan Lozano
4cafb54481 Merge "Revert "Disable XOM in init."" 2018-11-29 15:58:11 +00:00
Bowgo Tsai
c1bc2813c9 fs_mgr: move AVB related source into libfs_avb
This CL also adds namespace android::fs_mgr and remove FsManager* prefix
for class names. Note that android::fs_mgr::FsManagerAvbOps will be removed
in later CLs when fs_mgr doesn't rely on libavb->avb_slot_verify() to
parse vbmeta structs.

Some lingering sources for by_name_symlink_map_ are also removed.

Bug: 112103720
Test: boot crosshatch_mainline-userdebug
Change-Id: I2d1a5cc39bcd5a699da8d5539f191d8c7737c4af
2018-11-29 22:21:33 +08:00
Idries Hamadi
49cdcfd3f3 Fix fastdeploy issues when testing Boat Attack Unity3D demo
The --fastdeploy switch caused errors when CRC collisions were present in the input apk and/or
an apk with a similar package name to the input apk was already installed on the device.

Test: mm -j 64
Test: adb install -r --fastdeploy --force-agent --local-agent /mnt/raid/boat-attack-apk/boat-attack-swappy.apk

Bug: 119934862
Change-Id: Ibfe0cec38bdbb7371803fc2f73b0ec1697cef624
2018-11-29 14:16:04 +00:00
Idries Hamadi
01011fee14 Merge "Add OWNERS file to fastdeploy so idries@ can approve changes" 2018-11-29 11:37:51 +00:00
Treehugger Robot
cbc4116352 Merge "fs_mgr: skip fs_mgr_overlayfs_required_devices w/o overlayfs in kernel" 2018-11-29 03:37:37 +00:00
Elliott Hughes
894da4e0fd Merge "tombstoned: fixed tombstones failed issue" 2018-11-29 01:48:29 +00:00
David Anderson
0c73234fe0 fastboot: Delete logical "other" partitions on retrofit devices.
On retrofit devices, if both slots contain dynamic partition builds,
then "flashall" will attempt to write secondary images to dynamic
partitions in the other slot. At worst, this can fail with an error. At
best, it will result in the "other" partition not being mounted on first
boot.

This patch therefore deletes logical partitions for secondary images, on
retrofit devices only. On a Pixel device on the "b" slot, this means
"system_a" and "vendor_a" will be deleted before flashing, and therefore
system_other and vendor_other will be flashed to physical partitions
instead.

Bug: 120034852
Test: fastboot set_active a
      fastboot flashall
      fastboot set_active b
      fastboot flashall

Change-Id: I6affe9a6c639b0495bffc77fcf20f329b86ad159
2018-11-28 17:47:21 -08:00
Christopher Ferris
e2e519ea2f Merge "Add support for caching small reads." 2018-11-29 01:10:24 +00:00
Mark Salyzyn
3a08c73ae0 fs_mgr: skip fs_mgr_overlayfs_required_devices w/o overlayfs in kernel
Check if overlayfs is supplied in the kernel before proceeding to
determining if there is a disabled verity and an overlayfs filesystem
to deploy.

Test: adb-remount-test.sh
Bug: 119929969
Change-Id: I28116f0aa6959040bb9f38f46c058a221591f735
2018-11-28 16:20:00 -08:00
Treehugger Robot
4055587ddd Merge changes Ic4e1a1de,Icfceaa46
* changes:
  fastboot: propagate error for format command
  fs_mgr: overlayfs: resize scratch should it be too small
2018-11-28 23:34:29 +00:00