Commit Graph

52589 Commits

Author SHA1 Message Date
lijiazi 513c989908 Uevent: remove useless dir
There are no uevent fils in these dirs, so there's no need to
traverse these dirs.

Test: manual

Change-Id: I57b82846ad863952d8717e6c3ab80c1e243ee4f8
Signed-off-by: lijiazi <lijiazi@xiaomi.com>
2019-09-24 17:36:45 +08:00
Chin-Ting Kuo df6a780ee7 Allow --disable-verification when top-level vbmeta is in 'boot'
If top-level vbmeta struct is in 'boot' partition,
the "flags" element offset of top-level vbmeta header
from the beginning of boot partition is 123 plus
top-level vbmeta offset recorded in the boot image footer.

Bug: 139639521
Test: m fastboot
Test: fastboot --disable-verification flashall
Test: fastboot --disable-verification flash boot boot.img, checks the
      flag isn't changed if the device has vbmeta partition
Test: fastboot --disable-verification flash vbmeta vbmeta.img
Change-Id: Ibf73c9330639e971ee3873ac19f072cf7baed55b
2019-09-24 12:35:26 +08:00
nelsonli 5642e23949 [vts-core] Add libdm_test in vts-core
Add libdm_test to vts-core suite and skip the test if the
first-api-level < 29.

Bug: 132702215
Test: atest vts_libdm_test
Change-Id: Ic805a4c08e5bf9f6c69019d4ea01825ae888e1fe
2019-09-24 11:34:59 +08:00
Yifan Hong 8a679e673f snapshotctl: merge when boot
Test: reboot after OTA on virtual A/B device, see merge
Bug: 135752105

Change-Id: I92eb8d0961635008366c336ead40e3038173257f
2019-09-23 18:50:12 -07:00
Yifan Hong 2feb47a29b libsnapshot: add snapshotctl
... which handles merge when boot completed. It also
dumps debug information when requested.

Bug: 135752105
Test: adb shell su 0 snapshotctl dump
Test: call snapshotctl merge at different stage of OTA:
  - before OTA (exit normally)
  - during OTA is applied (exit with error)
  - after OTA is applied but before reboot (exit with error)
  - after reboot (finish merge and exit normally)
  - Manually stop its execution during merge and run again
      (finish merge and exit normally)

Change-Id: Idcc6aea8d7bbeb9a1a288c966b8f5e14b3f6a3e7
2019-09-23 18:50:12 -07:00
Treehugger Robot f08e28e440 Merge "Remove vendor_availble of propertyinfoserializer" 2019-09-23 22:25:29 +00:00
Ashwini Oruganti 1d02c2addc Update auditParse to not prepend "b/" to bug IDs
Instead, the bug_map entries will now include the b/ prefix. This will
allow arbitrary URLs to be added as well to SELinux denial messages

Bug: 141014771
Test: Generated a denial, verified that the bug id in the dmesg logs
remains unchanged.

Change-Id: I4679117abdc2e13af81336b0b7fd8d69def80147
2019-09-23 14:26:34 -07:00
Steven Moreland 30a3b92c0e Merge "libutils: Trace.h for everything but windows" 2019-09-23 16:23:06 +00:00
Zimuzo Ezeozue fc48a62d4c Merge "Prepare pass_through mounts" 2019-09-23 16:02:19 +00:00
Christopher Ferris 9cb8e435eb Merge "Increase timeouts." 2019-09-23 15:21:15 +00:00
Zim fc64dad122 Prepare pass_through mounts
Execute mkdir -p /mnt/pass_through/0/emulated
and bootstrap the emulated volume for user 0.

The 'pass_through' paths allow us bind mount the lower
filesystem directly into /storage, bypassing any sdcardfs
of FUSE mounts.

This change is part of enabling upcoming platform changes that are
described in the bug linked below.

Bug: 135341433
Test: builds, boots and pass through directories are created
Change-Id: I46ce207d06a1ec550b8bacac259387371fc0b841
2019-09-23 14:21:27 +01:00
nelsonli 8abba2607b [vts-core] add copy rules for *-gsi.avbpubkey
For using Gtest to run vts_security_avb_test and test it in the
vts-core, we have to add this rule to copy the *-gsi.avbpubkey to the
testcase folder.

Bug: 132702215
Test: 1. add data: "q-gsi.avbpubkey" to Android.bp of the module
      2. m module_name

Change-Id: I810231f39c970da4d2b8ab63daeee02379c7f952
2019-09-23 16:23:50 +08:00
Inseob Kim fa2ba387b9 Remove vendor_availble of propertyinfoserializer
Bug: N/A
Test: m
Change-Id: I68a2bb323ac7cdc0abf3047e96ee02df010ff3c1
2019-09-23 16:13:45 +09:00
Treehugger Robot cb2598e485 Merge "Remove static vndk dep from vendor modules" 2019-09-23 07:04:15 +00:00
Howard Chen e6d71689bb Merge "Mount multiple DSU partitions when present." 2019-09-21 02:48:37 +00:00
Christopher Ferris 11555f0961 Increase timeouts.
There is still some flakiness, so increase the timeout values.
Also remove the TEMP_FAILURE_RETRY macro usage in TIMEOUT calls.
That macro disables the ability of the alarm code to interrupt
the system call.

Bug: 141045754

Test: Unit tests pass.
Change-Id: Ia3c95dccc3076a3fd5ef6432097a57e4ccee4df3
2019-09-20 15:07:03 -07:00
Yifan Hong e71efc3dc4 Merge changes from topic "libsnapshot_api_update_engine"
* changes:
  libsnapshot: Cancel/merge existing update before begin
  libsnapshot: operator<< for UpdateState
2019-09-20 20:56:50 +00:00
Steven Moreland 1cb99ea59b libutils: Trace.h for everything but windows
libcutils has trace implemented for host. In order to increase code
portability, opening that up for libutils Trace.h usage as well.

Bug: 124524556
Test: use Trace.h on host glinux
Change-Id: Ia873f88e7436a18f6c0f761000bf697c68ffea17
2019-09-20 11:28:00 -07:00
Martin Stjernholm 96f16688c9 Rename ANDROID_RUNTIME_ROOT to ANDROID_ART_ROOT following APEX module name change.
Test: Boot
Bug: 135753770
Change-Id: Ie9a8043ee350164c01a66f1a7ab1b3205076a5c4
2019-09-20 16:07:04 +01:00
Tom Cherry 03642ad8b8 Merge "init: create sockets before forking" 2019-09-20 14:59:58 +00:00
Tom Cherry 89562f11c8 Merge changes Iff879def,I79c72346
* changes:
  Simply reboot if the boringssl self test fails
  init: reboot immediately if /data isn't mounted
2019-09-20 14:59:42 +00:00
Martin Stjernholm 22784574fa Merge "Revert "Include com.android.runtime in the "runtime" linker namespace."" 2019-09-20 12:55:38 +00:00
Treehugger Robot 1b31d85b07 Merge "Remove unused libnativeloader-dummy-headers" 2019-09-20 11:09:30 +00:00
Bowgo Tsai f016f256b5 Separate system_ext_sepolicy.cil out of system sepolicy
Currently system sepolicy can be extended via:
  - BOARD_PLAT_PUBLIC_SEPOLICY_DIR
  - BOARD_PLAT_PRIVATE_SEPOLICY_DIR

To support having a single shared core system sepolicy, those
customization should be moved to the newly added system_ext partition.

System-ext-specific sepolicy files will be installed into
/system_ext/etc/selinux/*. system_ext_sepolicy.cil is merged into
precompiled_sepolicy at build-time. In case precompiled_sepolicy can't
be used (e.g. system-only-ota), the init will merge this file with
the rest of the sepolicy at runtime.

Bug: 137712473
Test: boot aosp_crosshatch with system_ext_sepolicy.cil
Test: boot aosp_crosshatch without system_ext_sepolicy.cil
Change-Id: Ib37622271b559d65462de99ff424be831004508a
2019-09-20 18:20:21 +08:00
nelsonli 2e9edcb042 [vts-core] Add vts_core_liblp_test to vts-core
Add vts_core_liblp_test to vts-core suite and skip the test if the
first-api-level < 29.

Bug: 132702215
Test: atest vts_core_liblp_test
Change-Id: I09ea8ff923b5300bae513146f6d07dc029d36661
2019-09-20 16:06:18 +08:00
Inseob Kim c8f80ffe0d Remove static vndk dep from vendor modules
Shared VNDK should be used instead for vendor modules.

Bug: 137178339
Test: m
Test: run property_info_checker on host
Change-Id: I40672d0f6251148915f9ae2e2a14f291d9c2b6c5
2019-09-20 15:31:39 +09:00
Howard Chen 1b094939e5 Mount multiple DSU partitions when present.
There might be partitions like product or system_ext in addition
to the system partition. Those partitions can contain dependencies
required by the system so we need to make the init to recognize
these partitions and mount them accordingly.

Bug: 140092208
Test: gsi_tool install & reboot
Change-Id: Ie5ef063292c3656e79cce9f887f23a8faa1ba2be
2019-09-20 14:10:52 +08:00
Treehugger Robot c00229c34a Merge "Use Android systemTime implementation for host linux." 2019-09-20 01:28:28 +00:00
Tom Cherry 5241d10049 init: create sockets before forking
There is a race condition with Service::Start and socket creation.
Since socket creation currently happens after the fork(), it's
possible that init can continue executing other commands before the
socket is created.  If init starts another service that relies on that
socket, it isn't guaranteed to be available.

Particularly, we've seen this with hwservicemanager starting after
logd, but hwservicemanager's logs sometimes not showing up.

Bug: 140810300
Test: boot and logging functions correctly

Change-Id: Ib2932e836d345830cd38f3b556598508fd953058
2019-09-19 16:10:30 -07:00
Brett Chabot 1af6acc4d3 Use Android systemTime implementation for host linux.
The Android framework, notably android.view.Choreographer, assumes
that System.nanoTime and SystemClock.uptimeMills return consistent
values. This was true on device, but not on host.

This commit makes those values consistent on host linux. The necessary
support should be in place in kernels 2.6.39 and newer, which have been
available since 2012.

Test: m -j libutils
Change-Id: I833a89a810ae9fb3e8c01f6095ee2aca893c284f
2019-09-19 15:32:33 -07:00
Tom Cherry a76bfb2d97 Simply reboot if the boringssl self test fails
If this check fails and an OTA or mainline module update has recently
happened, we want to rollback the recent change.  The easiest way to
handle this is to reboot, which will trigger the fallback mechanisms
that are already in place.

Bug: 141082587
Test: device reboots if self test fails
Test: device rolls back a recently applied OTA with failing self test
Test: device rolls back a recently applied conscrypt apex update with
      failing self test
Change-Id: Iff879deff09d347262dc7a2acadb9164a5029d4a
2019-09-19 14:59:07 -07:00
Elliott Hughes c21c0ac740 Merge "Remove unused big-endian cruft." 2019-09-19 21:26:11 +00:00
Tom Cherry 2436e6b15a init: reboot immediately if /data isn't mounted
All of the logic in reboot.cpp is meant to safely shutdown services,
safely unmount emulated RW file systems, then finally unmount the
remaining RW file systems, particularly /data.  If /data hasn't been
mounted, then none of this logic is required.

Running this logic caused a lock up when shutting down blueline from
early-init.  Vold, or potentially a related HAL, locked up during the
ShutdownVold() calls.  debuggerd separately locked up in the watchdog
thread.

Therefore, this change immediately reboots if /data is not mounted.
It also removes the lines to call into debuggerd.  debuggerd will not
run due to SELinux in any case, so it can only be used when hands-on
debugging a device.

Bug: 141082587
Test: shutdown with /data mounted continues as normal
Test: shutdown from early-init immediately shuts the device down
Change-Id: I79c72346b17c7dfe57e955d9739bcaf559badc14
2019-09-19 14:05:56 -07:00
Treehugger Robot bac7609c48 Merge "Add deps to files used by backwards compatibility checker" 2019-09-19 20:33:35 +00:00
Martin Stjernholm 59b54f42bb Revert "Include com.android.runtime in the "runtime" linker namespace."
No longer required for hwasan builds, since b/140790209 is fixed.

This reverts change-id I27069b20f7c7068b931340f548b284ce1676466c.

This also reverts the identified change for the memory regression in
b/140648539.

Test: Build & boot on taimen_hwasan-userdebug
Test: Build & boot on crosshatch_hwasan-userdebug
Bug: 140790209
Bug: 139408016
Bug: 140648539
Change-Id: Ib61c53571a4de0970a86ebc391a2ce780247943a
2019-09-19 19:11:47 +01:00
Dan Willemsen 20de6c909f Add deps to files used by backwards compatibility checker
Any used files need to be in the dependencies list for rules. In this
case, this is more than what's actually read in the script, but the
older ones shouldn't change as much, and replicating the logic is
non-trivial.

Bug: 130111713
Test: run with RBE, no longer see error about file not found
Change-Id: I88baf541ce6250a5dbf7b8a7d6b8005ed7cf5cc6
2019-09-19 17:49:44 +00:00
Tom Cherry 0b4f560f87 Merge "init: degeneralize subcontext init into only vendor_init" 2019-09-19 15:39:40 +00:00
Alistair Delva 40ffdc681c Merge "libutils: increase test TIMING_TOLERANCE_MS" 2019-09-19 15:00:12 +00:00
Christopher Ferris 88bef19e64 Merge "Add support for scudo native allocator." 2019-09-19 14:42:23 +00:00
Christopher Ferris 3a8974d0b2 Merge "Add TEMP_FAILURE_RETRY where appropriate." 2019-09-19 14:42:20 +00:00
Treehugger Robot da6525c2db Merge "Construct the super_vbmeta image" 2019-09-19 10:21:53 +00:00
Kaiwen Szu 6dd098cb1e Construct the super_vbmeta image
This commit constructs the super_vbmeta image to eliminate the
need of adding /vbmeta_system and/or /vbmeta_vendor when AVB
chain partition is used with Android Dynamic Partition.

See BOARD_AVB_VBMETA_SYSTEM under the link:
https://android.googlesource.com/platform/external/avb/#build-system-integration

The structure of super_vbmeta :

|     VBMeta Table    | (fixed-length 2KiB)
| Backup VBMeta Table | (fixed-length 2KiB)
|     VBMeta Images   | (fixed-length 64KiB each)

The structure of VBMeta Table :

| Super VBMeta Header | (fixed-length 128B)
|  VBMeta Descriptors | (variable-length)

The VBMeta Table records the slot number of each
vbmeta image within the /super_vbmeta partition.

Bug: 137054296
Test: m libvbmeta_test
Test: ./out/host/linux-x86/nativetest/libvbmeta_test/libvbmeta_test
Change-Id: I01aeadd850750ae87d9125484c1b1f570bb84756
2019-09-19 12:05:09 +08:00
Treehugger Robot 08c4133c91 Merge "Lengthen ScopedDisableMallocTimeout timeout to 10 seconds" 2019-09-19 02:14:19 +00:00
Christopher Ferris 172b0a0834 Add TEMP_FAILURE_RETRY where appropriate.
Bug: 141045754

Test: Ran unit tests in a loop on walleye and cuttlefish.
Change-Id: I87b912e76889ed207ab17b862e4786ee44a382ba
2019-09-18 19:05:25 -07:00
Treehugger Robot ea378530d6 Merge "<android-base/endian.h>: fix interoperability issue" 2019-09-19 00:17:22 +00:00
Colin Cross 4e3387cb5f Lengthen ScopedDisableMallocTimeout timeout to 10 seconds
memunreachable_unit_test is flaking sometimes with timeouts in
ScopedDisableMallocTimeout.  They can't be real deadlocks, which
is what this timeout is designed to detect, the Enable() called
from the signal handler wasn't doing anything because disabled_
hadn't been set yet.

Lengthen the timeout to 10 seconds, and set disabled_ before
starting to take the malloc locks in malloc_disable.  If this
really deadlocked then calling malloc_enable inside malloc_disable
would make a mess of the locks, but it would at least unlock
whatever lock was deadlocked and give the test a chance to
report the error.

Bug: 141229513
Test: atest memunreachable_unit_test
Change-Id: I3578964577025aaa4bbba09027afd22997d4adbd
2019-09-18 17:07:22 -07:00
Christopher Ferris 5db009286d Add support for scudo native allocator.
Bug: 137795072

Test: All unit tests pass when using scudo or jemalloc.
Change-Id: I20c71811d9e43663c495a1e51988acfef9fc8584
2019-09-18 16:41:25 -07:00
Tom Cherry 14c2472734 init: degeneralize subcontext init into only vendor_init
This code is more generic than it needs to be and one of the side
effects is that an extra init process is forked for odm_init, despite
it having the same context as vendor_init.  I don't think anything is
going to change regarding that soon, so this change stops forking that
extra process to save its memory and simplifies the code overall.

Bug: 141164879
Test: init still uses vendor_init for vendor_scripts
Test: init unit tests
Test: init only has one subcontext process
Change-Id: I0d224455604a681711e32f89fb20132378f69060
2019-09-18 14:02:14 -07:00
Steven Moreland c1e04d8ac5 libutils: increase test TIMING_TOLERANCE_MS
25 -> 100, because we are seeing larger values sometimes on cuttlefish.

Fixes: 141212746
Test: libutils_test
Change-Id: I371416473b97f46891104ff9d893ec38c25728aa
2019-09-18 20:35:49 +00:00
Treehugger Robot 948e4fa316 Merge "adb: fix adb remount -R" 2019-09-18 18:48:58 +00:00