Commit Graph

55483 Commits

Author SHA1 Message Date
Dan Shi 6a606448a0 Merge "Add fuzzy_fastboot to vts-core suite" 2020-01-07 18:21:29 +00:00
Bowgo Tsai a61c3ab44f Support AVB chain partitions for HASH descriptors
Commit Ida1a6da988c10d364b3ccdaa6c5d63e5264d1b27 allows specifying
AVB-related partitions to be probed in first-state mount, e.g.,
"avb=vbmeta_system" in the fs_mgr_flags will make init wait uevents
for vbmeta_system partition, which is required for AVB verification.

However, when specifying "avb=dtbo" to chain a /dtbo partition, first-stage
init will emit the following error as it assumes all partitions are
verified by Hashtree descriptors.

  init: [libfs_avb]Hashtree descriptor not found: dtbo

This change fixes this by skipping raw partitions for first-stage mounting,
where raw partitions should already be verified by bootloader with Hash
descriptors. Although first-stage init does not perform Hash verification,
it still reads all Hash/Hashtree descriptors to calculate then compare
the "VBMeta Digest" passed from bootloader.

  https://android.googlesource.com/platform/external/avb/#The-VBMeta-Digest

The following is an example of a fstab entry to chain /dtbo partition:

  /dev/block/bootdevice/by-name/dtbo  /dtbo  emmc  defaults  slotselect,avb=dtbo,first_stage_mount

Bug: 146935233
Test: enable /dtbo as a chain partition, then boot the device
Change-Id: I590f1d9b78ef89b5aef21cb7bf19fdb90b27f808
2020-01-07 22:17:27 +08:00
Jiyong Park 016059dd46 Add /system/lib to the permitted paths for ns of APEXes
With b/144533348, there will be symlinks from libs in APEXes to the libs
in the system partition. This is to reduce the size of APEXes when the
APEX is bundled with the platform.

Adding the /system/lib to the permitted paths so that the realpaths of
the symlinks are allowed for the namespaces.

Note that this however does not open all libs in the system partition to
the APEX namespaces, because searching of the libs are NOT done in
/system/lib, but in /apex/<module>/lib directory.

Bug: 144533348
Test: m
Change-Id: I4bb1d6cb5dbf647ae669f49aa5ccb178f5488b5e
2020-01-07 19:53:38 +09:00
Ruchir Rastogi ae9375f13e Merge "Fix bug in stats_event_benchmark"
am: 3bf8858105

Change-Id: I2194294ddc098edcba44172d82fca061f21b5f3b
2020-01-06 16:48:28 -08:00
Treehugger Robot 3bf8858105 Merge "Fix bug in stats_event_benchmark" 2020-01-07 00:43:49 +00:00
Dan Shi 44b29c643a Add fuzzy_fastboot to vts-core suite
The binary is required by FastbootVerifyUserspaceTest.
Disable test config generation as fuzzy_fasboot itself is not part of
vts-core suite.

Bug: 147249791
Test: atest FastbootVerifyUserspaceTest
Change-Id: Ief86f33b41990a354497b128e154da04fec58ae9
2020-01-06 15:52:10 -08:00
Ruchir Rastogi d177461a72 Fix bug in stats_event_benchmark
Now, the number of elements in each simulated stats_event is correctly
sampled from a uniform distribution.

Rerunning the benchmarking tests indicates that truncating the buffer
increases the number of cycles require to log an event by only 1.6%.

Test: m libstatssocket_benchmark
Test: bit libstatssocket_benchmark:*
Change-Id: I8d5c1734861038beec8eeb7ce1f84a24bde25a75
2020-01-06 23:10:51 +00:00
Ruchir Rastogi 1662e44207 Merge "Expose libstatssocket as a stable C API"
am: 2ff1eac71a

Change-Id: Icbf9b17fdf5360bcb552c6b60002a71feb782a1b
2020-01-06 13:19:59 -08:00
Bookatz 6f22965053 Merge "CtsLiblogTestCases secondary_user"
am: c940977dd9

Change-Id: If1dcf4c9d6c62c22cba0cc80174bb825bc0c4f41
2020-01-06 13:08:47 -08:00
Ruchir Rastogi 2ff1eac71a Merge "Expose libstatssocket as a stable C API" 2020-01-06 20:57:55 +00:00
Bookatz d55cbf3d95 Merge "CtsLogdTestCases secondary_user"
am: 28becd0399

Change-Id: Icd3fbe9bb509b1ee64da84518d4399485851bd2d
2020-01-06 12:29:27 -08:00
Bookatz b6257841cc Merge "CtsInitTestCases secondary_user"
am: 37eab5723d

Change-Id: I1beb125da1f6260602370af4f51d7633109ab8da
2020-01-06 12:29:04 -08:00
Bookatz 49cf5de812 Merge "CtsFsMgrTestCases secondary_user"
am: fb11bfd77d

Change-Id: I3cbb1dee08e8ac0ea5ae341eee0ac3aefe17003d
2020-01-06 12:27:38 -08:00
Treehugger Robot c940977dd9 Merge "CtsLiblogTestCases secondary_user" 2020-01-06 19:36:44 +00:00
Treehugger Robot 28becd0399 Merge "CtsLogdTestCases secondary_user" 2020-01-06 19:15:59 +00:00
Treehugger Robot 37eab5723d Merge "CtsInitTestCases secondary_user" 2020-01-06 19:13:39 +00:00
Treehugger Robot fb11bfd77d Merge "CtsFsMgrTestCases secondary_user" 2020-01-06 19:03:04 +00:00
Bookatz 42a4ca6a45 CtsLiblogTestCases secondary_user
Marks this CTS test module as supporting secondary_user, meaning that
the tests are eligible to be run from a regular Android user other
than the system user (i.e. other than user 0).

Note that 'user' here refers to the concept of users in Android
Multiuser; it is NOT the same as a uid.

Bug: 141773058
Test: module passed with secondary_user params
 (--enable-optional-parameterization --module-parameter secondary_user)

Change-Id: Iaff9fb5d21473129ce3a802d179db474f7c763bc
2020-01-06 09:58:07 -08:00
Bookatz 18a7a5bd89 CtsInitTestCases secondary_user
Marks this CTS test module as supporting secondary_user, meaning that
the tests are eligible to be run from a regular Android user other
than the system user (i.e. other than user 0).

Note that 'user' here refers to the concept of users in Android
Multiuser; it is NOT the same as a uid.

Bug: 141773058
Test: module passed with secondary_user params
 (--enable-optional-parameterization --module-parameter secondary_user)

Change-Id: Ic8d29cabe2542d75c8f873b677550db9f11b3050
2020-01-06 09:54:20 -08:00
Bookatz 1a9e4fa25e CtsLogdTestCases secondary_user
Marks this CTS test module as supporting secondary_user, meaning that
the tests are eligible to be run from a regular Android user other
than the system user (i.e. other than user 0).

Note that 'user' here refers to the concept of users in Android
Multiuser; it is NOT the same as a uid.

Bug: 141773058
Test: module passed with secondary_user params
 (--enable-optional-parameterization --module-parameter secondary_user)

Change-Id: Ic1c3c5f86e0178c8e3e2ec8c3d3069ecd9e580e9
2020-01-06 09:52:54 -08:00
Bookatz 685e19dc97 CtsFsMgrTestCases secondary_user
Marks this CTS test module as supporting secondary_user, meaning that
the tests are eligible to be run from a regular Android user other
than the system user (i.e. other than user 0).

Note that 'user' here refers to the concept of users in Android
Multiuser; it is NOT the same as a uid.

Bug: 141773058
Test: module passed with secondary_user params
 (--enable-optional-parameterization --module-parameter secondary_user)

Change-Id: I1829a4297a49cd38b4b8a2558c92941acab8ab9a
2020-01-06 09:49:17 -08:00
Martijn Coenen 9226bb304a Disable dm-verity hash prefetching.
Prefetching appears to have a slightly negative effect on boot time, and
actually makes boot time much worse when the available dm-bufio cache
shrinks. Since we anticipate the dm-bufio cache will shrink (because of
an increasing number of APEX dm-verity targets), disable prefetching
completely.

We've run this change on Pixel 2 since August, and haven't observed any
negative effects. Boot time slightly decreased. With the increased
amount of APEXes we already have, this should now result in an even more
significant boot time decrease.

Bug: 136247322
Test: atest google/perf/boottime/boottime-test
Change-Id: Id588669af1b0b9daaf15323dccf33411e03b8633
2020-01-06 09:41:49 +01:00
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