Commit graph

45139 commits

Author SHA1 Message Date
Bowgo Tsai
2badf73b99 fs_mgr_remount: fix a typo
Replacing "ro.boot.vbmeta.devices_state" with
"ro.boot.vbmeta.device_state" to check if the device is locked.

Bug: 132224452
Test: tree hugger
Change-Id: If4f312730cc82ad5a5d5104a7aca8b9691cf6600
2019-05-09 13:19:29 +08:00
Treehugger Robot
72fe284022 Merge "init: move "started at" environment var names to headers" 2019-05-09 00:10:40 +00:00
Mark Salyzyn
44505ecdd9 init: move "started at" environment var names to headers
Move "FIRST_STAGE_STARTED_AT" to env_first_stage_started_at variable
in first_stage_init.h.  Move "SELINUX_STARTED_AT" to
env_selinux_started_at variable in selinux.h.

Test: build
Bug: 124491153
Bug: 129780532
Change-Id: I512d1835dcee5a3d034ac453b27b0709eed23cff
2019-05-08 13:50:21 -07:00
Treehugger Robot
a6e6c7d966 Merge "init: ro.boottime.init.first_stage" 2019-05-08 18:33:29 +00:00
Elliott Hughes
1d5745fb40 Merge "libziparchive: remove now-unused FindEntry overload." 2019-05-08 17:05:46 +00:00
Mark Salyzyn
10377df9f8 init: ro.boottime.init.first_stage
Add a property ro.boottime.init.first_stage to provide us a
first stage init duration from start to exec completed in
nanoseconds.

For consistency, report nanoseconds duration for
ro.boottime.init.selinux as well instead of milliseconds.
Now also report consistently from start to exec completed
instead of just the selinux load time.

SideEffects: ro.boottime.init.selinux is reported to TRON and
             may alarm with the millionfold increase in precision.
             ro.boottime.init is now also consistent with ns
             precision.

Test: inspect
Bug: 124491153
Bug: 129780532
Change-Id: Iff4f1a3a1ab7ff0a309c278724c92da0832b9a69
2019-05-08 16:07:10 +00:00
Tom Cherry
766e878253 Merge "Add default executable permission in odm/bin" 2019-05-08 15:31:28 +00:00
Jiyong Park
3e182b6170 Merge changes I43be5550,Ic40da64f,If8241959
* changes:
  Refactor public_libraries.*
  Introduce utils.h
  Move public libraries list to a separate source file
2019-05-08 12:24:59 +00:00
Treehugger Robot
26ec31ce8d Merge "Remove sbin from fs_config.cpp" 2019-05-08 06:23:30 +00:00
Jiyong Park
5b8b306b42 Refactor public_libraries.*
- shorten the long const variables
- merge {oem|product}_public_libraries into extended_public_libraries

Bug: 130388701
Test: build & pass presubmit tests

Change-Id: I43be555041466118f2b2d188f5da3ff0d8ed7d8d
2019-05-08 13:51:43 +09:00
Jiyong Park
f8802e5f0a Introduce utils.h
Introduce utils.h to have common routines.

Bug: 130388701
Test: build & pass presubmit tests
Change-Id: Ic40da64fefc1f2216bdea9ea93a15e5abb8f23a4
2019-05-08 13:49:49 +09:00
Jiyong Park
40a6077244 Move public libraries list to a separate source file
Functions for reading the public libraries list are moved out of
library_namespace.cpp to public_libraries.cpp.

In addition, library-local symbols are moved from android namespace to
android::nativeloader namespace.

Bug: 130388701
Test: build & pass presubmit tests
Change-Id: If82419598304d56d29bfec4ef553443c788d0f53
2019-05-08 13:49:42 +09:00
Dimitry Ivanov
9a45f8ff4c Merge "Enable native_bridge_support" 2019-05-07 21:47:41 +00:00
Treehugger Robot
eabbfb9e81 Merge "Support booting a chained boot-debug.img" 2019-05-07 17:27:22 +00:00
Tom Cherry
2f74a26a2d Remove sbin from fs_config.cpp
There is no longer a /sbin on Android.

Bug: 73660730
Test: build
Change-Id: I3f5ce292790392a02aa4a1c661f44b4c7e1570dc
2019-05-07 10:21:05 -07:00
Elliott Hughes
a5ff19e7e9 libziparchive: remove now-unused FindEntry overload.
Bug: http://b/129068177
Test: treehugger
Change-Id: I53da90bb61b0299aca545f9a1420f64e3f909657
2019-05-07 09:27:59 -07:00
Treehugger Robot
799ddc9c19 Merge "Enable clang-tidy for libsysutils." 2019-05-07 15:31:22 +00:00
Iris Chang
705fd7f52c Support booting a chained boot-debug.img
boot-debug.img is introduced to allow 'adb root' if the device is
unlocked, and it cannot be release signed. If /boot partition is chained
in AVB signing and boot-debug.img is used, avb_slot_verify() in
userspace will return AVB_SLOT_VERIFY_RESULT_ERROR_PUBLIC_KEY_REJECTED
and fs_mgr will refuse to boot. This CL treats the public key rejection
as non-fatal for chained vbmeta to continue booting, if the device is
unlocked.

Bug: 129508966
Test: can root with user load which /boot chained in AVB signing
Change-Id: Idfa8caffbb96f33702b1749afd2e2a59616ddba7
2019-05-07 09:26:49 +00:00
Treehugger Robot
9243da9008 Merge "Apply initial settings for blkio cgroup" 2019-05-07 08:15:35 +00:00
Martijn Coenen
fc78be2935 Merge "Support for stopping/starting post-data-mount class subsets." 2019-05-07 06:41:01 +00:00
Min Yun
a8eb00720c Add default executable permission in odm/bin
In odm's binary files can't have executable permission.
Add default executable permission in odm/bin and vendor/odm/bin.
Previously partitions that except system, only appeared in
system partition if product haven't separated partition.
After support ODM, vendor/odm should considered.

Bug : 124465978
Test : Check each file's permission.
system/vendor/bin/* -> 0755
system/product/bin/* -> 0755
system/product_services/bin/* -> 0644
system/oem/bin/* -> 0644

vendor/odm/bin/* -> 0755
vendor/product/bin/* -> 0644
vendor/product_services/bin/* -> 0644

Change-Id: I5cee48474fceaf73853b2013d58017bd64953d86
2019-05-07 14:04:23 +09:00
David Anderson
eaf203d301 Merge "Add a liblp test that we can parse the device's super partition." 2019-05-07 04:00:57 +00:00
David Anderson
41d6792dec Merge "Add dm-snapshot targets to libdm and dmctl." 2019-05-07 00:43:19 +00:00
David Anderson
f5de989a55 Add a liblp test that we can parse the device's super partition.
Bug: 132112489
Test: liblp_test gtest
Change-Id: I1c0950dc30f42cd232e0616191d1365cdfc6512d
2019-05-06 17:06:33 -07:00
Elliott Hughes
d62b9ca271 Merge "libziparchive: report errors on over-long names." 2019-05-06 23:45:16 +00:00
Tom Cherry
1cd30df584 Merge "Vboot1.0: remove code to read verity state in userspace" 2019-05-06 23:41:47 +00:00
Jeffrey Vander Stoep
0cd8102bbd Merge "Load selinux compat file if it exists" 2019-05-06 22:26:19 +00:00
David Anderson
29e6bf282f Add dm-snapshot targets to libdm and dmctl.
This adds DmTargetSnapshotOrigin and DmTargetSnapshot. The latter target
can handle both "snapshot" and "snapshot-merge" targets. The syntax for
dmctl is as follows:

    dmctl create <name> snapshot <start> <num_sectors> <base_device> \
          <cow_device> <P|N> <chunk_size>
    dmctl create <name> snapshot-merge <start> <num_sectors> <base_device> \
          <cow_device> <chunk_size>
    dmctl create <name> snapshot-origin <start> <num_sectors> <device>

Bug: N/A
Test: libdm_test gtests
Change-Id: I8eef987cb92121e81bedd37b9a66fad04c7a23a3
2019-05-06 13:59:44 -07:00
Treehugger Robot
be9c2c0310 Merge "adb: enable/disable verity expected overlayfs errors." 2019-05-06 14:36:51 +00:00
dimitry
a808b1150a Enable native_bridge_support
Enable native bridge support for libbase, liblog,
libziparchive and libpropertyinfoparser.

This makes it possible to use them in binaries for translated
architectures.

Bug: http://b/77159578
Test: make
Change-Id: If67ce92288b17a052ea1e79a268e284f7d941439
2019-05-06 14:05:05 +02:00
Elliott Hughes
b17bf521d5 libziparchive: report errors on over-long names.
Switch FindEntry and the ZipString constructor to std::string_view. This
lets us accept an over-long name so that we can reject it as too long.

Also fastboot changes to track the API change.

Bug: http://b/129068177
Test: treehugger
Change-Id: I7df7acd1fe2c46380b789c25f8909e0553e2d55e
2019-05-04 08:41:12 -07:00
Elliott Hughes
7046bcb461 Merge "libbase: add ConsumePrefix/ConsumeSuffix." 2019-05-04 00:03:14 +00:00
Treehugger Robot
19322dddc6 Merge "adbd: move posix_fadvise after open." 2019-05-03 23:23:59 +00:00
Christopher Ferris
b92cd9c8a6 Merge "Ignore memory from elf on /memfd:" 2019-05-03 22:24:42 +00:00
Mark Salyzyn
5828b77a3d adb: enable/disable verity expected overlayfs errors.
Expect EBUSY for overlayfs teardown, and ENOENT for setup.

Test: adb-remount-test.sh
Bug: 131614849
Change-Id: I0fb351d6d5fe758021c9e9043f57863c7a194c12
2019-05-03 14:44:49 -07:00
Elliott Hughes
b4dc7be6c5 libbase: add ConsumePrefix/ConsumeSuffix.
adb was already using ConsumePrefix, and now we have another would-be
user in cutils. (There appears to be one place in adb that should use
ConsumeSuffix, so I'm assuming we'll want that sooner or later.)

I've kept these inline because adb and google3's versions both were, and
I'm easily led.

Test: treehugger
Change-Id: I29d99032f6f6ccbfaefece59725db8afb02a4c87
2019-05-03 12:49:31 -07:00
Treehugger Robot
3c0d7e8d28 Merge "move classes out of native_loader.cpp" 2019-05-03 19:29:09 +00:00
Christopher Ferris
98aaf4cf08 Ignore memory from elf on /memfd:
In ART, some of the maps are /memfd:/jit-cache and it triggers the warning
about unreadable elf files. Do not set the elf from memory not file
flag in this case.

Bug: 131909548

Test: New unit tests pass.
Test: No warnings dumping stacks with this change done.
Change-Id: Ifba5e65da609525ded75430da173c614f6e4801e
2019-05-03 11:13:17 -07:00
Jiyong Park
6291da2936 move classes out of native_loader.cpp
native_loader.cpp is too crowded. Move the classes
NativeLoaderNamespaces and LibraryNamespaces out of native_loader.cpp to
their own source files.

This change does not alter any functionality.

Bug: 130388701
Test: m, presubmit tests
Change-Id: Ibc61ec0dc6727af7cac865b1971ebf1befac6855
2019-05-04 01:10:42 +09:00
Rick Yiu
a8aaf198d5 Apply initial settings for blkio cgroup
Bug: 111422845
Test: values are applied
Change-Id: Id28d9619fc2fd2287fe656b8032025184ae7f631
2019-05-03 11:58:13 +08:00
Treehugger Robot
84235b7137 Merge "Workaround bad markdown parser." 2019-05-03 00:40:29 +00:00
Stephen Hines
f35183daa6 Merge "Fix an unintialized return value." 2019-05-03 00:18:58 +00:00
David Anderson
9187a72175 Merge "fs_mgr: overlay: resize other OTA partitions to zero to make space" 2019-05-02 23:56:12 +00:00
Jeff Vander Stoep
0ac51cfc01 Load selinux compat file if it exists
This addresses Treble backwards compat issues introduced in
aosp/793958 and aosp/783669.

Bug: 122874820
Test: build/flash blueline with pi-dev vendor and generic_ab system
    images.
Test: adb pull /sys/fs/selinux/policy;
    sesearch policy --allowx -s vendordomain -t dev_type

Change-Id: I9123aa02cf4bf07d72d1ea086dde0d1cf1b30db4
2019-05-02 14:25:06 -07:00
Treehugger Robot
5ddd49eeae Merge "adbd: avoid starting multiple worker threads." 2019-05-02 21:09:04 +00:00
Mark Salyzyn
c3fc2aa964 fs_mgr: overlay: resize other OTA partitions to zero to make space
If we do not have at least the minimum space to create a scratch
partition, let's resize the other partitions to zero to make the
space and try again.

Specify additional shared library dependencies for remount command.
margin_size could never be calculated because "scratch" partition
does not exist, so use super partition instead as argument to
GetBlockDeviceInfo.

Add a "Now reboot your device for settings to take effect" message
if the -R argument was not supplied.  Adjust some of the messages
to be clearer.

Manual test: On a full DAP device, resize or flash both a and b side
for system, vendor and product with fastboot to duplicate failure
conditions of limited space and check remount command resizes other
side partitions to mitigate.

Test: manual and adb_remount_test.sh
Bug: 131390072
Change-Id: I34c4a973f88a5e1e06b64af9589a84721dd1bbbd
2019-05-02 13:46:22 -07:00
Stephen Hines
45b11d9035 Fix an unintialized return value.
Bug: http://b/131390872
Test: Built aosp_blueline successfully.
Change-Id: Iea5255be280dfc089a95fc25a0f988e913c18679
2019-05-02 12:54:09 -07:00
Dan Albert
989467d94a Workaround bad markdown parser.
Test: None
Bug: None
Change-Id: I7b2dd6e140aafdf41bfa58516851bfd50eba5e00
2019-05-02 12:25:22 -07:00
Treehugger Robot
6bc132846a Merge "adb: increase adb [un]root timeout." 2019-05-02 15:53:20 +00:00
Martin Stjernholm
2d3becd361 Merge "Reland: Fix libnativeloader to correctly link to the platform namespace." 2019-05-02 10:40:04 +00:00