Commit Graph

55511 Commits

Author SHA1 Message Date
Kiyoung Kim 288daf9876 Merge "Update ld.config.txt for adbd apex"
am: 7c7d1c600e

Change-Id: I72cd67de14fffa6e43a0f3b9f9167590800ae98c
2020-01-05 17:13:56 -08:00
Kiyoung Kim 7c7d1c600e Merge "Update ld.config.txt for adbd apex" 2020-01-06 01:10:46 +00:00
Oli Lan 95b77d1f24 Merge "Change ownership of apex data directories to root."
am: 931257683d

Change-Id: Icba57e2e3c5fc813b1d2f66da0e1551c06394b5c
2020-01-04 01:12:27 -08:00
Oli Lan 931257683d Merge "Change ownership of apex data directories to root." 2020-01-04 09:10:51 +00:00
Wenhao Wang 22ad80da60 Merge "trusty:storageproxyd: Add ufs to parse_dev_type"
am: d363769dcf

Change-Id: I9ca187d1634a9d66ebb56b28cfeded930875d21f
2020-01-03 16:13:20 -08:00
Wenhao Wang d363769dcf Merge "trusty:storageproxyd: Add ufs to parse_dev_type" 2020-01-04 00:10:57 +00:00
Wenhao Wang 3bf07c27de trusty:storageproxyd: Add ufs to parse_dev_type
Modify parse_dev_type function to accept new dev_type argument "ufs".

Bug: 143636526
Test: Trusty storage tests
Change-Id: I9524fd4cb9619b5ce1f4f46e87f1890f84f4d2f3
2020-01-03 13:47:57 -08:00
TreeHugger Robot 4ff59c0e4e Merge "DO NOT MERGE - Merge QQ1A.200105.003 into stage-aosp-master" into stage-aosp-master 2020-01-03 17:50:03 +00:00
Oli Lan dc5167205d Change ownership of apex data directories to root.
The apex data directories must be accessed by apexd in order for it to
perform snapshot and restore as part of the rollback process. As apexd
runs as root, this CL changes the apex data directories under /data/misc
to be owned by root.

Bug: 141148175
Test: Build and flash; check permissions are set correctly.

Change-Id: Ib534e705802c06900884a15f39fee257d4987f4c
2020-01-03 16:47:38 +00:00
Sam Protsenko 2c7c3c7402 init: Fix writing "reboot recovery" to BCB
When BCB (bootloader message structure inside of misc partition) is
malformed (contains some non-printable characters in its fields),
"reboot recovery" command won't be able to write required string to
"command" field. It can happen for example when partition table was
created anew and 'misc' partition area contains some garbage. Also this
behavior can be emulated with this command:

    $ fastboot erase misc

which leads to 'misc' partition to be filled with 0xFF characters. Hence
this code:

    if (boot.command[0] == '\0') {

won't let us to set new string to "command" field. Let's check if
"command" field is malformed and fix it, before actually checking for
previously set content.

"fastboot erase" shouldn't be used for testing purposes though, as it
doesn't work sometimes due to alignment, on bootloader side:

    Erasing blocks 6144 to 6144 due to alignment
    ........ erased 0 bytes from 'misc'

Instead one might use "dd" command to fill 'misc' with 0xFF's:

    $ dd if=/dev/zero ibs=2k count=1 | tr "\000" "\377" >misc.img
    $ fastboot flash misc misc.img

Test: Fill 'misc' partition with 0xFF's, then do "adb reboot recovery"
Change-Id: Ica8ca31012b9b2249645e7305830c07a20dd013c
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2020-01-03 18:03:04 +02:00
Kiyoung Kim 0513f0e266 Update ld.config.txt for adbd apex
ld.config.txt for ADBD APEX works properly, but it can be reduced into
simpler way. This change updates ADBD APEX linker configuration which
reduces complexity and limit library usage from system partition.

Test: m -j && confirmed adbd works from cuttlefish
Change-Id: Ifcf1323082148aec4b6417c0ba7df0d9fe8ffeb0
2020-01-03 13:37:29 +09:00
Josh Gao 63422602d3 Merge "debuggerd: switch to using platform headers for DEBUGGER_SIGNAL."
am: aceb837ced

Change-Id: I8fefde7ca46e5ac5b6bfb3b8305edc2bed78c640
2020-01-02 16:01:54 -08:00
Josh Gao aceb837ced Merge "debuggerd: switch to using platform headers for DEBUGGER_SIGNAL." 2020-01-02 23:40:53 +00:00
Xin Li b091f4d40b DO NOT MERGE - Merge QQ1A.200105.003 into stage-aosp-master
Change-Id: I307003cb8d6311ed3662535a54ac8586b8a25bd0
2020-01-02 13:29:54 -08:00
Xin Li 0a7b2b68b9 Merge "Skip QQ1A.191205.011 in AOSP master"
am: 410a1d55a6

Change-Id: I9d5ed4f0a7c6e49dcfb5c31a3ffc7d4ef8d77d06
2020-01-02 13:04:35 -08:00
Treehugger Robot 410a1d55a6 Merge "Skip QQ1A.191205.011 in AOSP master" 2020-01-02 20:25:54 +00:00
Xin Li c6449e8bea Skip QQ1A.191205.011 in AOSP master
Change-Id: Iaaae882f78fb6718798d5e6429016c2456e4c457
2020-01-02 11:21:34 -08:00
Kiyoung Kim 3dfaad538f Merge "Update linkerconfig to target out directory"
am: 24ccfc244b

Change-Id: I074b42411163b0aec47e7385ec8fbc3abbe33e87
2020-01-01 20:20:08 -08:00
Kiyoung Kim 24ccfc244b Merge "Update linkerconfig to target out directory" 2020-01-02 04:18:31 +00:00
David Anderson 5924eeb4a4 Merge "overlayfs: Refactor how the scratch device is deduced, again."
am: 81fbcbdbd4

Change-Id: I9799652b1286b20bab8d3ed084da48293146915e
2019-12-30 17:01:22 -08:00
David Anderson 81fbcbdbd4 Merge "overlayfs: Refactor how the scratch device is deduced, again." 2019-12-31 00:24:35 +00:00
David Anderson 23243497fd fastboot: Mount /metadata before overlayfs teardown.
fs_mgr_overlayfs needs access to /metadata to tell whether or not the
scratch partition exists on /data.

Bug: 134949511
Test: adb remount, fastboot flash system
Change-Id: I3a09aae495d691e9c1a1e25a8fb3514e355ecd05
2019-12-30 13:42:57 -08:00
Nikita Ioffe 0a1908cdf3 Merge "Reset sys.shutdown.requested property"
am: e6a32d5d90

Change-Id: I750dd7e95b0ca5611a347c13b8aa57d628da0dbb
2019-12-30 12:03:21 -08:00
Treehugger Robot e6a32d5d90 Merge "Reset sys.shutdown.requested property" 2019-12-30 19:53:52 +00:00
Nikita Ioffe 1131a211dc Reset sys.shutdown.requested property
Otherwise, if userspace reboot is triggered from the framework, it will
end up in userspace reboot loop until watchdog kicks in triggers full
reboot.

Bug: 135984674
Test: adb shell svc power reboot userspace
Change-Id: I0de451aad4ea236a3ff1c20b317b01c6529b6231
2019-12-30 16:06:35 +00:00
Kiyoung Kim 3b2dbe9d75 Update linkerconfig to target out directory
Current linkerconfig targets for specific output file. However,
linkerconfig will generate more than 1 file based on APEX modules, so it
should take argument for target directory rather than target file. This
change updates linkerconfig's argument to point output directory.

Bug: 146993126
Test: m -j passed & Cuttlefish succeeded to boot
Change-Id: I3a720a047077688582436aabd307adafeafc5398
2019-12-30 18:44:41 +09:00
Yifan Hong 61051f6fcc Merge "libfiemap: delete unuseful check"
am: d8a8988c6e

Change-Id: I0b714504d8576bdd7a991d613be31417734116c5
2019-12-27 18:57:58 -08:00
Treehugger Robot d8a8988c6e Merge "libfiemap: delete unuseful check" 2019-12-28 02:55:38 +00:00
Yifan Hong 0ede9b43e5 libfiemap: delete unuseful check
Just let fallocate fails. It also doesn't check for the delta between
the old file and the new file.

Test: unit tests
Change-Id: I05e12b097a973d9fe7fe696cc472bd7ec2d180c7
2019-12-27 15:36:41 -08:00
Ruchir Rastogi 5dbcae5020 Expose libstatssocket as a stable C API
We create a .map.txt file that lists all the stable entry points into
libstatssocket. This should allow other APEXes to link to libstatssocket
without having to copy the library within the APEX.

Test: m -j libstatssocket
Bug: 146377784
Change-Id: I9f77a0c380b6884d9ca60807a8974380420cfe0a
2019-12-27 15:04:54 -08:00
Steve Muckle 6d46873127 Merge "libmodprobe: parse kernel command line for module options"
am: d1e9812217

Change-Id: I4b9c9aba8229497de7054f7d60aa61f860951fc1
2019-12-27 15:01:52 -08:00
Treehugger Robot d1e9812217 Merge "libmodprobe: parse kernel command line for module options" 2019-12-27 22:53:32 +00:00
Tom Cherry ffb8945e59 Merge "liblog: don't destroy global mutexes"
am: 0962561c9b

Change-Id: I3c579a0ebf27f2b552d3fbb07957811fb5fcd447
2019-12-27 14:06:35 -08:00
David Anderson e790acd6cd Merge "init: Use ImageManager for DSUs."
am: bdaa9afbf2

Change-Id: I22777271ed2d85694154c6d577ddb25718a00549
2019-12-27 14:06:02 -08:00
David Anderson caad1ad495 Merge "libfiemap: Add a MapAllImages() helper."
am: 4e5b505751

Change-Id: Ie9d838b6b91e6d0aeb289d075a76f626c9c0901f
2019-12-27 14:05:58 -08:00
David Anderson fa61f9172a Merge "libfiemap: Add a way to get the block device path of a mapped image."
am: 31a35038a0

Change-Id: I143bcfe24cb22e1f36db3b47260ecdc895eb6b5e
2019-12-27 14:05:10 -08:00
Tom Cherry 0962561c9b Merge "liblog: don't destroy global mutexes" 2019-12-27 21:55:59 +00:00
Steve Muckle 373a3cadd7 libmodprobe: parse kernel command line for module options
Bug: 145808811
Test: atest libmodprobe_tests, verify on flame
Change-Id: I0b41b1610fe13ae526d38f029da888f6f0d8a02d
2019-12-27 13:39:23 -08:00
David Anderson bdaa9afbf2 Merge "init: Use ImageManager for DSUs." 2019-12-27 21:13:51 +00:00
David Anderson 4e5b505751 Merge "libfiemap: Add a MapAllImages() helper." 2019-12-27 21:13:51 +00:00
David Anderson 31a35038a0 Merge "libfiemap: Add a way to get the block device path of a mapped image." 2019-12-27 21:13:33 +00:00
David Anderson 7208d546ef Merge "libfiemap: Add helpers to remove images from recovery."
am: 8edafa2393

Change-Id: Ib6d6237baee5c211869f1b2273f683e4a7ad77b0
2019-12-27 13:01:21 -08:00
David Anderson 8edafa2393 Merge "libfiemap: Add helpers to remove images from recovery." 2019-12-27 20:28:48 +00:00
Matthew Maurer e6282d9d33 Merge "trusty: storageproxyd: Fix rebase of UFS support"
am: 369dff24da

Change-Id: I0b85cdb6542efd6ca634a110c45d100b39445b6e
2019-12-26 17:00:51 -08:00
Matthew Maurer 369dff24da Merge "trusty: storageproxyd: Fix rebase of UFS support" 2019-12-27 00:39:32 +00:00
Kiyoung Kim eafc79a135 Merge "Use generated linker config only"
am: 3c0e06d829

Change-Id: I79c3cdb2f34e82e3bdc83b0ea1dfa87735072c04
2019-12-26 16:11:06 -08:00
Kiyoung Kim 3c0e06d829 Merge "Use generated linker config only" 2019-12-27 00:08:06 +00:00
Matthew Maurer 17785fd185 trusty: storageproxyd: Fix rebase of UFS support
The UFS support got rebased on top of the RPMB socket support
improperly. As a result, RPMB socket support was broken due to an
unconditional rmpb_fd = rc which would set the rpmb_fd to be connect()'s
error code in the case of an RPMB socket.

Bug: 146903427
Test: Boot Trusty+Android with the rpmb_dev mock, check for liveness
Change-Id: Ib1220dc49392f1a10369eed7716e44680bd83a66
2019-12-26 15:03:45 -08:00
David Anderson 69def12f08 overlayfs: Refactor how the scratch device is deduced, again.
The previous refactoring did not uncover the full breadth of issues that
arise when trying to use /data for adb remount. In fact, there are a few
distinct use cases for the scratch device, and one function cannot
sensibly provide them all.

(1) First-stage init needs to know if there are dependent devices. This
    would be userdata, super_<other>, or system_<other>. This knowledge
    is dependent on the state in /metadata, fstab, and the kernel
    command-line.

(2) First-stage init and fastbootd need to know where the scratch
    partition is. If it's not in super_<other> or system_<other>, and
    there is no indicator on /metadata, then it might be in a dynamic
    partition.

(3) "adb remount" needs to find a place to put scratch, which
    effectively amounts to the first writable space it can find.
    However, for Virtual A/B, devices, scratch wants to be stored in
    /data, which requires more complex checks and binder calls.

Trying to encapsulate all of this into one function is too difficult, so
instead, this patch breaks GetScratchStrategy into separate functions:
one to return a physical location if a candidate exists, and another to
deduce the "boot" scratch device.

"adb remount" no longer calls GetScratchDevice, since it only needs to
know whether or not a physical candidate was possible.

fs_mgr_overlayfs_teardown calls GetBootScratchDevice, but now only
attempts to make a dynamic "scratch" partition if one definitely exists.
This makes the functionality clearer and reduces fastbootd uart spam.

Bug: 134949511
Test: adb_remount_test.sh on coral
      adb_remount_test.sh on crosshatch
      adb_remount_test.sh on walleye
Change-Id: I5f6a3677bc6adcaaf54c8ab3594643e4f285c04e
2019-12-25 22:32:31 -08:00
David Anderson d5745cce70 libfiemap: Add a MapAllImages() helper.
This adds a helper for first-stage init to easily map partitions backed
by /data. This can be used for the scratch partition as well as DSU
partitions.

Bug: 134949511
Test: fiemap_image_test
Change-Id: I46246b41ce19442d1476b9959e34df0e1bff58c3
2019-12-25 22:32:31 -08:00