Commit graph

29296 commits

Author SHA1 Message Date
Treehugger Robot
b26f48f135 Merge "fs_mgr: adding fs_mgr_get_slot_suffix() public API" 2017-04-13 13:26:42 +00:00
Bowgo Tsai
87d0836cda fs_mgr: adding fs_mgr_get_slot_suffix() public API
The function returns "_a" or "_b" based on two possible values in
kernel cmdline:

  - androidboot.slot = a or b OR
  - androidboot.slot_suffix = _a or _b

Bug: 33254008
Bug: 36533366
Test: boot sailfish
Change-Id: Ia0a524e4145ebf61af5821f42ecad212c95ed748
2017-04-13 18:28:48 +08:00
Treehugger Robot
0de940c26d Merge "Force set timezone to UTC in logd." 2017-04-13 07:14:02 +00:00
Treehugger Robot
86c725a4c2 Merge "libutils: mark as vendor_available" 2017-04-13 01:40:56 +00:00
Dmitri Plotnikov
e0ab2557d4 Merge "Passing additional parameter to powerctl" 2017-04-13 00:30:24 +00:00
Vijay Venkatraman
83f50843cb Merge "Moved include/backtrace to libbacktrace/include" 2017-04-13 00:17:13 +00:00
Jaesoo Lee
20b7f78204 Merge "disable module loading after BOOT_COMPLETED broadcast" 2017-04-12 22:59:37 +00:00
Dmitri Plotnikov
00e1c4f330 Passing additional parameter to powerctl
Test: adb reboot recovery,foo and verify that the parameter reaches bootloader
Change-Id: I9690cf96cf9730e5324b9f5310c3d0341fe25fe2
2017-04-12 14:38:23 -07:00
Hidehiko Abe
352476e118 Force set timezone to UTC in logd.
(cherry picked from commit c27f12a3d396f113c5ae09d2f2c8ff7de3f8b551)

logd assumes that it is running in UTC time zone.
However, if persist.sys.timezone is set at some point later,
that affects and confuses logd behavior.
To avoid such a case, this CL sets TZ to UTC, which overrides
the property's behavior.

Test: Ran CtsOsTestCases.
Test: gTest liblog-unit-tests, logd-unit-tests and logcat-unit-tests
Bug: 33566779
Change-Id: Ib9edd4cb06f019a33aaf8d77d33bd82fdbbda480
2017-04-12 14:33:17 -07:00
Elliott Hughes
e4e4777fc7 Merge "libcutils: fix system-background tasks shown in top command" 2017-04-12 18:33:43 +00:00
Steven Moreland
48cdaff063 libutils: mark as vendor_available
By setting vendor_available, the following may become true:

* a prebuilt library from this release may be used at runtime by
  in a later releasse (by vendor code compiled against this release).
  so this library shouldn't depend on runtime state that may change
  in the future.
* this library may be loaded twice into a single process (potentially
  an old version and a newer version). The symbols will be isolated
  using linker namespaces, but this may break assumptions about 1
  library in 1 process (your singletons will run twice).

Background:

This means that these modules may be built and installed twice --
once for the system partition and once for the vendor partition. The
system version will build just like today, and will be used by the
framework components on /system. The vendor version will build
against a reduced set of exports and libraries -- similar to, but
separate from, the NDK. This means that all your dependencies must
also mark vendor_available.

At runtime, /system binaries will load libraries from /system/lib*,
while /vendor binaries will load libraries from /vendor/lib*. There
are some exceptions in both directions -- bionic(libc,etc) and liblog
are always loaded from /system. And SP-HALs (OpenGL, etc) may load
/vendor code into /system processes, but the dependencies of those
libraries will load from /vendor until it reaches a library that's
always on /system. In the SP-HAL case, if both framework and vendor
libraries depend on a library of the same name, both versions will be
loaded, but they will be isolated from each other.

It's possible to compile differently -- reducing your source files,
exporting different include directories, etc. For details see:

https://android-review.googlesource.com/368372

None of this is enabled unless the device opts into the system/vendor
split with BOARD_VNDK_VERSION := current.

Bug: 36426473
Bug: 36079834
Test: m -j libutils
Test: attempt to compile with BOARD_VNDK_VERSION := current
Change-Id: I6c1279a74ef071851401e38bbdd377f13827694c
2017-04-12 08:59:41 -07:00
Johan Torås Halseth
4a36cc7cf6 Merge "Move adb backup/restore helptext to adb shell bu help." 2017-04-12 09:10:29 +00:00
Ganesh Mahendran
6748f24d70 libcutils: fix system-background tasks shown in top command
tasks in system-background cgroup will be shown as below:
 580   580 system   12  -8   1% S 190656K  19408K unk surfaceflinger  /system/bin/surfaceflinger

This patch fix this issue.

Change-Id: Ib39ff892010498548d7fbfb4021df62498acd033
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
2017-04-12 16:25:25 +08:00
Treehugger Robot
120add07ab Merge "ueventd: remove /dev/log" 2017-04-12 07:58:33 +00:00
Treehugger Robot
2e3abe2d05 Merge "use s_max_mnt_count to detect mke2fs generated partition" 2017-04-12 07:45:13 +00:00
Jaesoo Lee
dcf4d19dd9 disable module loading after BOOT_COMPLETED broadcast
This CL disables module loading by writing 1 to
/proc/sys/kernel/modules_disabled when the property sys.boot_completed
is set to 1 by ActivityManagerService (at the broadcast of
PHASE_BOOT_COMPLETED).

Bug: 36515654
Test: tested on sailfish and verified that module loading is disabled in
userdebug and enabled in eng mode
Merged-In: Id38d34a6395966ab21e440614337c0cfca791ad0
(cherry picked from commit 6ed19d1675)

Change-Id: I2faa459b450b3a64f854c832c6b91cbf682bbffa
2017-04-12 10:08:26 +09:00
Treehugger Robot
162118928e Merge "ueventd: replace char** links with std::vector<std::string>" 2017-04-12 00:57:35 +00:00
Keun-young Park
95e233f9ff use s_max_mnt_count to detect mke2fs generated partition
- Old tool will set it to 10 while mke2fs will set it to -1.
- For now, only tag it.
- TODO: possibly add different policy per image tool version.

bug: 32246772
Test: check dmesg after reboot
Change-Id: Ib763f8ba64957412d2b02a9d6e3fc2bfcf55851e
2017-04-11 17:55:14 -07:00
Tom Cherry
d4ff8d83d3 ueventd: remove /dev/log
This was marked deprecated in 2014 and removed in 2015, let's remove
the uevent rule now too.

Test: see that logging still works on bullhead
Change-Id: Idaf3f49a1afe7046eba6c976628b9f1c8b3ec094
2017-04-11 21:35:46 +00:00
Treehugger Robot
a309bc491d Merge "ZipWriter: Keep LFH and CFH in sync" 2017-04-11 19:42:21 +00:00
Vijay Venkatraman
8f2c28d572 Moved include/backtrace to libbacktrace/include
Export libbacktrace_headers

Bug: 33241851
Test: Build sailfish
Change-Id: Iba310ffc21d17ba542bed954a960ab305037061c
2017-04-11 11:22:43 -07:00
Johan Toras Halseth
eca1b3bdcc Move adb backup/restore helptext to adb shell bu help.
Key/value support for adb backup was added in ag/1946677, and help text
for adb shell bu is added in ag/2088937. This CL points the user to this
helptext instead of keeping it here, since it can quickly get out of
sync.

BUG=36170696

Test: adb
Change-Id: Ic40679f421a32e60f292ad20b726a89bfff03349
2017-04-11 19:15:17 +01:00
Jocelyn Bohr
a4b40020ef Merge changes from topic 'trusty_km2_hal'
* changes:
  trusty: keymaster: update device tests to use 2.0 API
  trusty: keymaster: Implement abort
  trusty: keymaster: Implement finish
  trusty: keymaster: Implement update
  trusty: keymaster: Implement begin
  trusty: keymaster: Implement upgrade_key
  trusty: keymaster: Implement attest_key
  trusty: keymaster: Implement export_key
  trusty: keymaster: Implement import_key
  trusty: keymaster: Implement get_key_characteristics
  trusty: keymaster: Implement generate_key
  trusty: keymaster: Implement add_rng_entropy
  trusty: keymaster: Implement configure
  trusty: keymaster: Begin update from Keymaster 0.3 to 2.0
2017-04-11 16:52:45 +00:00
Treehugger Robot
b37312a794 Merge "Remove .(ll)ndk suffix from (ll)ndk_library" 2017-04-11 16:19:16 +00:00
Elliott Hughes
ca3de5562b Merge "Add a reasonably full implementation of gzip/gunzip/zcat." 2017-04-11 15:40:32 +00:00
Dan Willemsen
ab89b34b6f Remove .(ll)ndk suffix from (ll)ndk_library
Soong handles these automatically now.

Bug: 33241851
Test: Android-aosp_arm.mk is the same before/after
Test: build.ninja is the same before/after
Test: build-aosp_arm.ninja is the same before/after
Merged-In: Ica4eedda51bb34db2f39d2c64ea436e1f633bfc3
Change-Id: Ica4eedda51bb34db2f39d2c64ea436e1f633bfc3
2017-04-11 15:14:28 +00:00
Adam Lesinski
d987c9dd9e ZipWriter: Keep LFH and CFH in sync
We change the GPB in the LocalFileHeader if the entry can not
have a trailing DataDescriptor. Make sure to patch the
CentralFileHeader to have the same bits set.

Modify ZipArchive to check that the data descriptor bit is consistent
between Central and Local file headers.

(cherry-pick of commit e0eca55fe6)

Test: make ziparchive-tests
Bug: 36686974
Change-Id: Ied167570abcf6426b1c678cd40123e5ad65909db
2017-04-11 01:45:25 +00:00
Keun-young Park
625a098573 Merge "poll umount completion from /proc/mounts" 2017-04-11 00:34:00 +00:00
Jocelyn Bohr
5020603116 trusty: keymaster: update device tests to use 2.0 API
Test: builds, ran trusty_keymaster_tipc on imx6ul
Change-Id: Ie9e8ee35ec31aead12adb348e6542a648b41fd7a
2017-04-10 17:33:49 -07:00
Jocelyn Bohr
465615e538 trusty: keymaster: Implement abort
Test: builds
Change-Id: I8dfef740a75ff76aebd3ee63aa747e319193aaed
2017-04-10 17:33:49 -07:00
Jocelyn Bohr
e57f3ce2bf trusty: keymaster: Implement finish
Test: builds
Change-Id: I8505f428613176eea5373a459bbce0de17406c55
2017-04-10 17:33:49 -07:00
Jocelyn Bohr
86eb966106 trusty: keymaster: Implement update
Test: builds
Change-Id: Ie411a4e7ae3b5242814777f2781e1d2508917bfa
2017-04-10 17:33:49 -07:00
Jocelyn Bohr
d7da42c0fa trusty: keymaster: Implement begin
Test: builds
Change-Id: Icb5470a8c95131ee3d68ab2ce41423302b9ed531
2017-04-10 17:33:49 -07:00
Jocelyn Bohr
22812e9a30 trusty: keymaster: Implement upgrade_key
Test: builds
Change-Id: I2ce86be1cd2c2c35ded371b21cb6546c31e0014e
2017-04-10 17:33:49 -07:00
Jocelyn Bohr
a256198b92 trusty: keymaster: Implement attest_key
Test: builds
Change-Id: Ic5bf59db43b4301cbc2fa216470b9f07de8336b0
2017-04-10 17:33:49 -07:00
Jocelyn Bohr
4cbfa7f2f0 trusty: keymaster: Implement export_key
Test: builds
Change-Id: I47d1ed4144014fca47fdf67f9f4d2eb0d9b1eb8f
2017-04-10 17:33:49 -07:00
Jocelyn Bohr
2d768669fa trusty: keymaster: Implement import_key
Test: builds
Change-Id: Ie130df9958d0a75fdedb463a38ea2625e88940db
2017-04-10 17:33:49 -07:00
Jocelyn Bohr
a02270fdd9 trusty: keymaster: Implement get_key_characteristics
Test: builds
Change-Id: I6e6a28d8eec5ff91a9e8c82597593857732407f3
2017-04-10 17:33:45 -07:00
Jocelyn Bohr
e514dd8ad4 trusty: keymaster: Implement generate_key
Test: builds
Change-Id: Ib77e29709eed2e5f0cd16ed214db61f4257fcebd
2017-04-10 17:21:10 -07:00
Jocelyn Bohr
126402aae7 trusty: keymaster: Implement add_rng_entropy
Test: builds
Change-Id: Iec5f61777f9b39136028d61acaf724b9fafb4492
2017-04-10 17:19:49 -07:00
Jocelyn Bohr
dccc76cd0b trusty: keymaster: Implement configure
This patch also forces the underlying structure of enum keymaster_command
to be uint32_t.

Test: builds
Change-Id: Ie8969beb9d6a15313456fbe54ef3806f6778ade2
2017-04-10 17:19:26 -07:00
Jocelyn Bohr
e194e272f3 trusty: keymaster: Begin update from Keymaster 0.3 to 2.0
Replaces all Keymaster 0.3 methods with Keymaster 2.0 methods.
Stub out implementations.

Change-Id: Ie92110eb9da77ead98f65ed53d9a9c9457b8ac3c
Test: builds
2017-04-10 17:18:00 -07:00
Keun-young Park
2ba5c8103d poll umount completion from /proc/mounts
- umount operation is asynchronous except for root partition.
  Returning from umount does not guarantee completion of
  umount. Poll /proc/mounts to confirm completion of umount.
- Treat all devices mounting to /data as emulated devices. This is
  future proof when fs other than sdcardfs is used.
- Drop quota sync from sync step. There is no differences in
  frequencies of quota error.
- Run umount in reverse order from mounting order so that any
  hidden dependency can be auto-resolved.
- Add dump of lsof and /proc/mounts when umount fails. lsof only runs
  when selinux is toggled into permissive mode. The dump is enabled
  only for non-user build.
- Keep logcat until vold shutdown in case vold has any error to report.

bug: 36551218
Test: python packages/services/Car/tools/bootanalyze/bootanalyze.py -r -c packages/services/Car/tools/bootanalyze/config.yaml -n 1000 -f -e 20 -w 30

Change-Id: I87b17b966d7004c205452d81460b02c6acf50d45
2017-04-10 15:41:15 -07:00
Josh Gao
72ca48e5cb Merge "crash_dump: during early boot, output to kmsg on userdebug." 2017-04-10 20:51:59 +00:00
Elliott Hughes
455567f78c Add a reasonably full implementation of gzip/gunzip/zcat.
Bug: http://b/36653902
Test: ran tests
Change-Id: Ibda577ba1d2aea5c4796eb632edd4c6d5e50592e
2017-04-10 10:56:40 -07:00
Steven Moreland
9ef4417c8e Merge "Move early_hal start to late-fs trigger action" 2017-04-08 04:46:58 +00:00
Tom Cherry
2e344f9d22 ueventd: replace char** links with std::vector<std::string>
Additionally replace the associated C string parsing with C++ and write
unit tests.

Bug: 33785894
Bug: 36250207
Test: Boot bullhead + unit tests
Change-Id: Iee1f72d248bca3bd2e1227045628935b3dd6195a
2017-04-08 00:05:50 +00:00
Treehugger Robot
4f6feec25b Merge "init: clean up more headers" 2017-04-07 22:56:32 +00:00
Janis Danisevskis
ec0ab6524e Move early_hal start to late-fs trigger action
The class early_hal is essentially for the keymaster hal which needs
to be up before vold tries to unlock a storage encryption key (FDE or
FBE). The current position is too early in the boot process, because
on devices with legacy HAL the wrapper service uses system properties
to find the legacy HAL.

This patch moves the start of the early_hal class to the late-fs trigger
action which runs right after the system property action.

Test: Manually tested and update tested on bullhead, sailfish, and
      another device.
Bug: 35764921

Change-Id: I34b45b85f8450e9ef18861535fdb2ee963df8c9b
(cherry picked from commit 1ad8d21947)
2017-04-07 15:28:56 -07:00
Treehugger Robot
1238292db5 Merge "NativeBridge: add "linked namespace" semantic corresponding to linker" 2017-04-07 21:46:18 +00:00