Commit graph

42664 commits

Author SHA1 Message Date
Hridya Valsaraju
4af80901a6 Support fastboot variable 'variant'.
Bug: 79480454
Bug: 78793464
Test: fastboot getvar variant
Change-Id: Iefef82c147d8405318c793ad0a73f00674bbb63d
Merged-In: Iefef82c147d8405318c793ad0a73f00674bbb63d
(cherry picked from commit 4785287a00)
2018-09-28 11:38:58 -07:00
Treehugger Robot
e4931c5bd4 Merge "Support 'fastboot getvar unlocked' command." 2018-09-26 16:21:28 +00:00
Tao Bao
6cc0d76d83 Merge "Revert "mkbootimg: Build mkbootimg with Soong."" 2018-09-26 15:20:50 +00:00
Tao Bao
55a78bf580 Revert "mkbootimg: Build mkbootimg with Soong."
This reverts commit 51360fc349.

Reason for revert: Triggered some crash in Soong.

Bug: 116698229
Change-Id: Iab4827fdadc65cbabb60aa07eeac7b33acea68a0
2018-09-26 15:19:24 +00:00
Tao Bao
0baf7f7250 Merge "mkbootimg: Build mkbootimg with Soong." 2018-09-26 15:00:23 +00:00
Martijn Coenen
1e3764575e Merge "init: start apexd as early as we can." 2018-09-26 06:56:26 +00:00
Treehugger Robot
5952034c25 Merge "Set device lock status from kernel command line." 2018-09-26 02:02:13 +00:00
Treehugger Robot
c448000e42 Merge "Pass OEM commands to HAL" 2018-09-26 00:29:21 +00:00
Hridya Valsaraju
dca328d55c Support 'fastboot getvar unlocked' command.
Test: fastboot getvar unlocked.
Bug: 78793464

Change-Id: Ie59c6db90a503e9a6e9ac1c416e4ee5deac60479
2018-09-25 16:25:46 -07:00
Hridya Valsaraju
a15fe31507 Pass OEM commands to HAL
Bug: 78793464
Bug: 79480454
Test: fastboot oem command

Change-Id: Ibaabef6ea725857102f7531997fcff2a1dbdc1ca
Merged-In: Ibaabef6ea725857102f7531997fcff2a1dbdc1ca
(cherry picked from commit 993b4edb0f)
2018-09-25 22:55:47 +00:00
Hridya Valsaraju
5ed32780b4 Set device lock status from kernel command line.
Device is considered to be unlocked if
androidboot.verifiedbootstate is "orange".

Test: adb shell getprop ro.boot.flash.locked

Change-Id: Id3aeec757908ea63a37e28ad880a6c71d53083ac
2018-09-25 15:49:59 -07:00
Doug Horn
b0719e3aee Merge "Build both static and shared lib." 2018-09-25 22:29:31 +00:00
Tao Bao
51360fc349 mkbootimg: Build mkbootimg with Soong.
Test: mmma -j system/core/mkbootimg
Test: m dist
Change-Id: Ib2588a6e4a559a99f0a35ece50e1e054e7899e01
2018-09-25 15:16:12 -07:00
Tao Bao
2c7c800122 Merge "Add a recovery ACPIO section to boot image" 2018-09-25 22:14:49 +00:00
Treehugger Robot
c47765b4d4 Merge "Add libgrallocusage/OWNERS" 2018-09-25 22:05:41 +00:00
Treehugger Robot
613963cd55 Merge "liblp: Add MetadataBuilder::UsedSpace()" 2018-09-25 20:53:12 +00:00
Mark Salyzyn
5095d89425 liblp: Add MetadataBuilder::UsedSpace()
MetadataBuilder::AllocatableSpace() represents the total space
available.  Adding MetadataBuilder::UsedSpace() to represent the
space used by the existing set of partitions.  This will allow a
caller to predict if a partition can be resized (Grown), or to
create a partition to use up the free space (i.e. scratch).

Test: gTest liblp.UseAllDiskSpace
Bug: 109821005
Change-Id: Iae487d869fe18310c76b48c4281f1d6c1ee333cd
2018-09-25 13:48:14 -07:00
Treehugger Robot
c105f4b63a Merge "adb: remount for /system as root" 2018-09-25 20:38:01 +00:00
Treehugger Robot
37d8bbdf9c Merge "fs_mgr: init: adb: add fstab argument to fs_mgr_overlayfs_mount_all" 2018-09-25 20:37:15 +00:00
Jesse Hall
f0fc98cf13 Add libgrallocusage/OWNERS
Test: none
Change-Id: Ie1a0384f91f0a13167c5b18416d7da505ab41825
2018-09-25 13:33:35 -07:00
Treehugger Robot
09e7b12a7a Merge "fs_mgr: Move fs_mgr_overlayfs_already_mounted higher in file." 2018-09-25 18:11:31 +00:00
Doug Horn
2306f46f9a Build both static and shared lib.
Bug: 111611872
Test: Compile, verify output.
Change-Id: I3a8ce3dbad2738e376a131a8e8613b3a4f6bf033
2018-09-25 10:56:25 -07:00
Treehugger Robot
6544056d54 Merge "Support 'adb reboot fastboot' command conditionally." 2018-09-25 17:17:08 +00:00
Treehugger Robot
00781649fb Merge "liblp: test: fix liblp.UpdateAnyMetadataSlot" 2018-09-25 17:05:19 +00:00
Mark Salyzyn
04aa426c5f adb: remount for /system as root
We can not mount overlayfs on root / as it will intercept all file
transactions.  Thus must remount /system instead.

Test: manual
Bug: 109821005
Bug: 115751838
Change-Id: Idf646b8c1ca8a0d006bf64e23a76a7e909f9162a
2018-09-25 07:30:57 -07:00
Mark Salyzyn
f35db9b11b fs_mgr: init: adb: add fstab argument to fs_mgr_overlayfs_mount_all
Add an fstab argument for fs_mgr_overlayfs_mount_all so that it can
leverage the locally and timely acquired fstab entries.  Affects all
callers, adb and init.

Test: manual
Bug: 109821005
Bug: 115751838
Change-Id: I96e2045d88525a6ce39bef63327a0fcf0704e9bc
2018-09-25 07:30:55 -07:00
Chen, ZhiminX
97f1325820 Add a recovery ACPIO section to boot image
For non-A/B devices, the recovery partition should be
self-sufficient and not depend on any other partition.
Since recovery may need load ACPIO before access to devices,
we need to make sure that the the recovery image also contains
the information from the ACPIO image.

Test: can generate image with acpio/acpi
Fixes: 111871613

Change-Id: I77b95a4c78a7e967f5e682ba7053f9d03f4ca51c
2018-09-25 07:48:26 +00:00
Hridya Valsaraju
542582689d Support 'adb reboot fastboot' command conditionally.
Devices not supporting logical partitions do not require the command.

Bug: 78793464
Test: 'adb reboot fastboot' reboots to bootloader for a device
not supporting logical partitions.

Change-Id: I0a7b6d4335040e24efbf461e2dd2d56ab1985b7f
2018-09-25 03:52:12 +00:00
Tom Cherry
c30240f475 Merge "fastboot: clean up CheckRequirements" 2018-09-25 00:29:38 +00:00
Stephen Hines
9b92f57a0a Merge "Fix two clang-tidy issues in crasher.cpp." 2018-09-24 22:25:59 +00:00
Stephen Hines
8395de6927 Fix two clang-tidy issues in crasher.cpp.
TEMP_FAILURE_RETRY's result was unused for the call to read(), so now
mark it as such to silence a possible unused result warning. For
__read_chk(), this function is an internal implementation detail of
FORTIFY in Bionic. Under clang-tidy, FORTIFY checks are actually
removed, so this now results in an unknown function being called. The
code should not be explicitly depending on an implementation detail, but
we can just suppress the failing case to retain test coverage of the
actual implementation.

Bug: http://b/110779387
Test: Build using WITH_TIDY=1
Change-Id: If83ac1d6f3b6dc32c0d0fb56d8e675e53b586f78
2018-09-24 13:18:22 -07:00
Tom Cherry
ad13cf96f0 Merge "Use vector<char> instead of char* and malloc() for images" 2018-09-24 20:08:32 +00:00
Mark Salyzyn
a526bbea4d fs_mgr: Move fs_mgr_overlayfs_already_mounted higher in file.
Move fs_mgr_overlayfs_already_higher, and switch to const auto& opt.

Test: manual
Bug: 109821005
Change-Id: Iccf05c823ea8946ef87292d8ee355af57d00abdf
2018-09-24 10:21:02 -07:00
Mark Salyzyn
20ff1b2033 liblp: test: fix liblp.UpdateAnyMetadataSlot
Move test to verify we can't read unwritten metadata from
liblp.UpdateAnyMetadataSlot to liblp.CreateFakeDisk.

Test: gTest liblpg_test
Bug: 109821005
Change-Id: I4714c949e2b2d9de6444996a2af2992a821c4a85
2018-09-24 10:20:57 -07:00
Treehugger Robot
f86e85cb0a Merge "init: Cleanly exit subcontext processes upon init's death" 2018-09-22 00:12:09 +00:00
Mark Salyzyn
6aaff2fe7d Merge "fs_mgr: overlayfs: const to kNames" 2018-09-21 22:59:19 +00:00
Mark Salyzyn
0006b4de0c Merge "fs_mgr: liblp: add additional debugging details" 2018-09-21 22:58:34 +00:00
Treehugger Robot
a988b4d9ed Merge "fs_mgr: Support checkpoints" 2018-09-21 20:43:48 +00:00
Tom Cherry
692c9973e1 Merge "liblog#__android_log_btwrite__android_logger_list_read fail" 2018-09-21 20:34:15 +00:00
Mark Salyzyn
e5ecbb5e50 fs_mgr: overlayfs: const to kNames
Test: compile
Bug: 109821005
Change-Id: I792dc74a7646f4512af201b1451b9f078cea32bf
2018-09-21 13:26:40 -07:00
Mark Salyzyn
a2af0dec14 fs_mgr: liblp: add additional debugging details
Test: none
Bug: 109821005
Change-Id: I759e76f793e8dd6f26f649dc727e80c9955e764f
2018-09-21 13:26:37 -07:00
Tom Cherry
4aa60b382c fastboot: clean up CheckRequirements
CheckRequirements() had various issues that are cleaned up here,

1) Move from C string parsing to C++
2) Moved from C data structures to C++, including fixing memory leaks.
3) Removed the 'cur_product' global and the 'query_save' function that
   stores it
4) Actually writing tests for the parsing function for
android-info.txt
5) Check that a variable needs to be checked for a given product before
   trying to read it.  Previously, fastboot would fail if a variable
   isn't recognized on a device, even if the check should be ignored.

A lot of flexibility is allowed for the input strings, to keep
backwards compatibility with the previous parsers.

Test: fastboot works, unit tests

Change-Id: Idc3bba8b8fe829d8eefe5f6c495e63a9441c0b60
2018-09-21 12:50:39 -07:00
Luis Hector Chavez
7235359d2e init: Cleanly exit subcontext processes upon init's death
This change makes the subcontext processes cleanly exit in the event of
the init's socket being closed. If that was an accident, init will
respawn the process immediately. Otherwise, it will just quietly go
away.

Bug: 80425914
Test: kill -9 $INIT_PID  # Outside of an Android container
Change-Id: I664f11d1b3700ea46857abf24857335fe28e92fa
2018-09-21 12:29:52 -07:00
Daniel Rosenberg
4c93b256f6 fs_mgr: Support checkpoints
Adds support for partitions with checkpointing enabled. If the
checkpoint= fs_mgr flag is set, and the system has checkpointing on,
the partition will be mounted in checkpointing mode.

Test: Use vdc checkpoint commands, the checkpoint=fs fs_mgr flag
      in the fstab, and a kernel containing the f2fs checkpoint
      changes. https://lkml.org/lkml/2018/8/21/22
Change-Id: I3ea8da932de06fcfd2eed06b8640a8b1df837f1f
2018-09-20 17:28:23 -07:00
Tom Cherry
dfd85df11a Use vector<char> instead of char* and malloc() for images
And fix the associated memory leaks in the process.

Test: fastboot works
Change-Id: I6e41f351ca6cebf79282d30b1eca1506496e0c21
2018-09-20 16:48:36 -07:00
Josh Gao
3da42a6c05 Merge "libziparchive: encode type in fdsan owner tag." 2018-09-20 19:22:03 +00:00
Treehugger Robot
50947c1b29 Merge "Reduce libziparchive internal hashtable memory size" 2018-09-20 06:45:33 +00:00
Christopher Ferris
b649d39bd7 Merge "Fix implicit fall through switch cases." 2018-09-20 00:21:30 +00:00
Treehugger Robot
903eb5125e Merge "init: annotate intended fallthrough" 2018-09-20 00:07:24 +00:00
Tom Cherry
ae8a6b9af3 init: annotate intended fallthrough
Bug: 116020901
Test: treehugger
Change-Id: I5f4a5ebf09572501f564dce506ee0978354fde67
2018-09-19 14:34:51 -07:00