Commit Graph

34402 Commits

Author SHA1 Message Date
Josh Gao e4509da961 base: work around thread safety analysis bug.
Clang's assert_capability and assert_shared_capability annotations are
nonfunctional until https://reviews.llvm.org/rL309725 is relanded and
makes its way into our toolchain. Work around this by using the
equivalent assert_lock and assert_shared_lock.

Bug: http://b/64226736
Test: manual
Change-Id: I40711f162ea1d492f1e0b3eff88bf6ae6d995e2f
2017-08-02 14:44:58 -07:00
George Burgess IV 87533581be libappfuse: use an explicit buffer size
This patch makes lookup_name use an explicit buffer size, rather than
"whatever the union happens to give me." I don't know if it's the
correct size, but having a 0-length array in this sort of configuration
seems fragile, and will be a compilation error when
https://android-review.googlesource.com/#/c/platform/bionic/+/449363/
goes in.

Bug: 12231437
Test: Builds with the mentioned patch applied to Bionic
Change-Id: I5793c906b7c2417e9a58aa907ef11c282027edb2
2017-08-02 14:11:25 -07:00
Elliott Hughes 972d078b3e Stop asking for old versions of C++ in system/core.
Bug: http://b/32019064
Test: builds
Change-Id: I1befc647b581bd293f98010e816b6413caab5e6c
2017-08-02 14:06:28 -07:00
Steven Moreland 7170d5bf24 Merge "Remove TODOs for std::string removal."
am: ceb7814c86

Change-Id: Iab64291aec5edd44ebf8856fb2d24c6d0e779bed
2017-08-02 20:49:46 +00:00
Treehugger Robot ceb7814c86 Merge "Remove TODOs for std::string removal." 2017-08-02 20:35:45 +00:00
Elliott Hughes 7462f1858c Fix reference to out of scope local in adb_thread_setname.
Bug: https://android-review.googlesource.com/#/c/168725/5/adb/sysdeps.h@639
Test: boots, adbd thread names look sane
Signed-off-by: Ivan Maidanski <i.maidanski@samsung.com>
Change-Id: Ib3bdf53658f3903de8f0a5688f7d77745e677c77
2017-08-02 20:34:06 +00:00
Elliott Hughes 3ff453aaa0 Make sure freeaddrinfo is always called on failure.
Bug: https://android-review.googlesource.com/#/c/platform/system/core/+/268797/2/libcutils/socket_network_client_unix.c
Test: builds
Signed-off-by: Ivan Maidanski <i.maidanski@samsung.com>
Change-Id: I2d93c8359c3398769d408284f77d56e09713a7f3
2017-08-02 20:32:27 +00:00
Elliott Hughes 601e5ac55b Merge "Add comments to "public.libraries.*.txt"."
am: e7b8fc22af

Change-Id: I8519a128238758433d194f35f6090633aeb85f0a
2017-08-02 19:43:01 +00:00
Christopher Ferris 3b6bbb8178 Merge "Allow mips to build."
am: 7009a3ccf7

Change-Id: I4564b2298e16258ccfe49f6651b751af35139f5f
2017-08-02 19:42:41 +00:00
Treehugger Robot e7b8fc22af Merge "Add comments to "public.libraries.*.txt"." 2017-08-02 19:34:26 +00:00
Christopher Ferris 7009a3ccf7 Merge "Allow mips to build." 2017-08-02 19:30:16 +00:00
Christopher Ferris 32766f1f52 Allow mips to build.
Test: Build mips.
Change-Id: Ice2fe1d11b7c628b325ea2ad1fd1252ad8e10668
2017-08-02 10:45:46 -07:00
Tom Cherry 76756aa1dd Merge "init: use unique_fd in builtins.cpp"
am: c34afb1cd5

Change-Id: I9f1fef77ab4d3f873180f305177e586d44a22c49
2017-08-02 17:18:33 +00:00
Tom Cherry c34afb1cd5 Merge "init: use unique_fd in builtins.cpp" 2017-08-02 17:09:31 +00:00
Christopher Ferris ce7c7c04d9 Merge "Revert "Add support for the new unwind method.""
am: 0d2cac9ea8

Change-Id: I68903c1641ee0d439dc5f839b968cff4b739dd84
2017-08-02 02:06:06 +00:00
Christopher Ferris 0d2cac9ea8 Merge "Revert "Add support for the new unwind method."" 2017-08-02 01:49:03 +00:00
Christopher Ferris bd625efbca Revert "Add support for the new unwind method."
This reverts commit 5b460d13a4.

Reason for revert: Strange sailfish boot problem.

Change-Id: Ibde9375405cca4343c262335647dac120aab4d73
2017-08-02 01:47:31 +00:00
Christopher Ferris 61ef596862 Merge "Add support for the new unwind method."
am: 9ccf627e78

Change-Id: Ie03fea9039dba17957a47edbc6d79e9c0727c86c
2017-08-01 23:29:59 +00:00
Chih-Hung Hsieh dfaa20c069 Merge "Fix misc-macro-parentheses warnings in system/core."
am: e4bd153e55

Change-Id: I6b38149a0fa15874eff68cbf7ee62e4acd41c595
2017-08-01 23:26:06 +00:00
Christopher Ferris 9ccf627e78 Merge "Add support for the new unwind method." 2017-08-01 23:22:42 +00:00
Treehugger Robot e4bd153e55 Merge "Fix misc-macro-parentheses warnings in system/core." 2017-08-01 23:08:18 +00:00
Chih-Hung Hsieh 85244e8bc2 Fix misc-macro-parentheses warnings in system/core.
Add NOLINT comment to work around clang-tidy
error in checking macro arguments used in
type expressions.

Bug: 28705665
Test: make with WITH_TIDY=1 WITH_TIDY_CHECKS=-*,misc-macro-* \
      WITH_TIDY_FLAGS=-header-filter=system/core/.*

Change-Id: I7619978c1804e151a11a8b0477e80076bcf21cab
2017-08-01 22:12:57 +00:00
Tom Cherry 7037991f04 init: use unique_fd in builtins.cpp
Test: boot

Change-Id: I09295856dbd0de9436a95a2fe99ab6be156b995f
2017-08-01 14:22:44 -07:00
Tom Cherry b1c18af247 Merge changes Ibd57c103,I81f1e8ac,Ia6e546fe
am: 2a2a8d9ec0

Change-Id: Id39de0d3d62c1e0f3585ae7817940dbbebfa6ae3
2017-08-01 20:25:57 +00:00
Tom Cherry 2a2a8d9ec0 Merge changes Ibd57c103,I81f1e8ac,Ia6e546fe
* changes:
  init: rename ServiceManager to ServiceList and clean it up
  init: move reaping from ServiceManager to signal_handler.cpp
  init: move exec operations out of ServiceManager
2017-08-01 20:15:02 +00:00
Tom Cherry 911b9b1d6e init: rename ServiceManager to ServiceList and clean it up
ServiceManager is essentially just a list now that the rest of its
functionality has been moved elsewhere, so the class is renamed
appropriately.

The ServiceList::Find* functions have been cleaned up into a single
smaller interface.
The ServiceList::ForEach functions have been removed in favor of
ServiceList itself being directly iterable.

Test: boot bullhead
Change-Id: Ibd57c103338f03b83d81e8b48ea0e46cd48fd8f0
2017-08-01 11:06:17 -07:00
Tom Cherry eeee83106b init: move reaping from ServiceManager to signal_handler.cpp
signal_handler.cpp itself needs to be cleaned up, but this is a step
to clean up ServiceManager.

Test: boot bullhead
Change-Id: I81f1e8ac4d09692cfb364bc702cbd3deb61aa55a
2017-08-01 11:06:17 -07:00
Tom Cherry 3b81f2d623 init: move exec operations out of ServiceManager
These can be implemented without ServiceManager, so we remove them and
make ServiceManager slightly less of a God class.

Test: boot bullhead
Test: init unit tests
Change-Id: Ia6e546fe5292255412245256f7d230af4ece135f
2017-08-01 11:06:04 -07:00
Tom Cherry 25422816d4 Merge "init: fix process restarting"
am: eb3fa92191

Change-Id: Ic03cf607631c49c1d37584f7641d9300a79f5457
2017-08-01 17:04:44 +00:00
Tom Cherry eb3fa92191 Merge "init: fix process restarting" 2017-08-01 16:53:52 +00:00
Jin Qian 1cb98847d5 Merge "fastboot: call mke2fs to format ext4 filesystem on windows"
am: c7ba2bb5a3

Change-Id: Ic35a2eef4a8ce79e8c3d8cc3f4e1016cef5871bc
2017-08-01 02:44:48 +00:00
Treehugger Robot c7ba2bb5a3 Merge "fastboot: call mke2fs to format ext4 filesystem on windows" 2017-08-01 02:35:31 +00:00
Jin Qian 73b1567f54 Merge "fastboot: enable uninit_bg for ext4"
am: be4eec05e8

Change-Id: I1773de0cce8bdde4b58c02902d9466f896ccee00
2017-08-01 02:01:28 +00:00
Treehugger Robot be4eec05e8 Merge "fastboot: enable uninit_bg for ext4" 2017-08-01 01:55:26 +00:00
Steven Moreland c8ddc2bad0 Remove TODOs for std::string removal.
This is baked into too many prebuilts. Perhaps
eventually it can be removed, but this is very
unlikely.

Change-Id: Ie3f0095a7b48c8b60e548cf2d32d2d95c108b5fb
Fixes: 35363681
2017-07-31 17:53:13 -07:00
Jin Qian 29fc859a6d fastboot: call mke2fs to format ext4 filesystem on windows
Bug: 35219933
Change-Id: I0cc8c165176e8dc9cbe4b6a52679937bc872e2d0
2017-08-01 00:19:56 +00:00
Jin Qian 99e3964e0d fastboot: enable uninit_bg for ext4
This speeds up mke2fs as well as e2fsck.

Bug: 23686092
Bug: 64032335
Change-Id: I9f2d4c15e431647bb845d50a2361b2a9a091fba6
2017-07-31 23:57:39 +00:00
Tom Cherry d269e3a795 init: fix process restarting
The time data types associated with restarting processes halfway moved
to std::chrono and halfway didn't.  In this intermediate state, the
times would get converted from nanoseconds to seconds then to
milliseconds.  The precision lost when converting to seconds would
cause the main loop of init to spin whenever a process was within a
second of being restarted.

This patch cleans up this logic and uses nanoseconds and milliseconds
explicitly, with a ceiling to milliseconds to prevent unneeded
spinning.

Test: boot bullhead, kill processes, see that they restart sanely.

Change-Id: I0b017ba0e50c09704b0c5cdfcde1dba461804593
2017-07-31 16:00:18 -07:00
Christopher Ferris 5b460d13a4 Add support for the new unwind method.
Also add a comment to the GetElf function to indicate that it never returns
nullptr.

Bug: 23762183

Test: Built, nothing uses the new code.
Test: However, I did run backtrace_test using this code, and all tests pass.

Change-Id: I252b9c2497e2d3d94347dd6e506170bf50cbfe16
2017-07-31 13:00:35 -07:00
Bo Hu 8b2e0e03d4 Merge "Allow the use of a custom Android DT directory"
am: 6fa0884188

Change-Id: I1c37cb0c809b2ed51d61e6b1e8ea87830e48eda5
2017-07-29 07:05:18 +00:00
Bo Hu 6fa0884188 Merge "Allow the use of a custom Android DT directory" 2017-07-29 06:58:07 +00:00
Elliott Hughes bd0ad88202 Add comments to "public.libraries.*.txt".
Folks don't know how to add public native API. Point them in the right
direction.

Bug: 63905942
Test: boots
Change-Id: I5e1f04fb852348255a2f7f87aa961948c41c47fd
2017-07-28 18:07:44 -07:00
Tom Cherry bf4afbb288 Merge "init: remove Parser singleton and related cleanup"
am: 379123f9ab

Change-Id: I3ef698fb1f18bcaf7dd5e1c01f1fb01bead2aa0a
2017-07-28 16:36:54 +00:00
Tom Cherry 379123f9ab Merge "init: remove Parser singleton and related cleanup" 2017-07-28 16:29:36 +00:00
Joel Galenson c4f2163954 Merge "Move chmod of /sys/kernel/debug/tracing to fix tracing."
am: 13c3a582de

Change-Id: I63ca85ffce7aead567c34069135fb066c5a026de
2017-07-28 16:12:23 +00:00
Treehugger Robot 13c3a582de Merge "Move chmod of /sys/kernel/debug/tracing to fix tracing." 2017-07-28 16:07:48 +00:00
Yu Ning c01022a62e Allow the use of a custom Android DT directory
On platforms that use ACPI instead of Device Tree (DT), such as
Ranchu x86/x86_64, /proc/device-tree/firmware/android/ does not
exist. As a result, Android O is unable to mount /system, etc.
at the first stage of init:

 init: First stage mount skipped (missing/incompatible fstab in
 device tree)

Those platforms may create another directory that mimics the layout
of the standard DT directory in procfs, and store early mount
configuration there. E.g., Ranchu x86/x86_64 creates one in sysfs
using information encoded in the ACPI tables:

 https://android-review.googlesource.com/442472
 https://android-review.googlesource.com/443432
 https://android-review.googlesource.com/442393
 https://android-review.googlesource.com/442395

Therefore, instead of hardcoding the Android DT path, load it from
the kernel command line using a new Android-specific property key
("androidboot.android_dt_dir"). If no such property exists, fall
back to the standard procfs path (so no change is needed for DT-
aware platforms).

Note that init/ and fs_mgr/ each have their own copy of the Android
DT path, because they do not share any global state. A future CL
should remove the duplication by refactoring.

With this CL as well as the above ones, the said warning is gone,
but early mount fails. That is a separate bug, though, and will be
addressed by another CL.

Test: Boot patched sdk_phone_x86-userdebug system image with patched
      Goldfish 3.18 x86 kernel in patched Android Emulator, verify
      the "init: First stage mount skipped" warning no longer shows
      in dmesg.

Change-Id: Ib6df577319503ec1ca778de2b5458cc72ce07415
Signed-off-by: Yu Ning <yu.ning@intel.com>
2017-07-28 11:10:48 +08:00
Joel Galenson d48c4cf234 Move chmod of /sys/kernel/debug/tracing to fix tracing.
This is a temporary fix, since we're still not sure exactly what the
bug is.

Bug: 62547086
Test: Built, flashed, and booted Sailfish.  Verified that the file has
the correct permission and that wifi and atrace work.

Change-Id: I43275e974a11754eca274f1b77d15cdd03a3b365
(cherry picked from commit 62962dd5b7)
2017-07-27 18:06:40 -07:00
Tom Cherry 67dee626e0 init: remove Parser singleton and related cleanup
* Remove the Parser singleton (Hooray!)
* Rename parser.* to tokenizer.* as this is actually a tokenizer
* Rename init_parser.* to parser.* as this is a generic parser
* Move contents of init_parser_test.cpp to service_test.cpp as this
  actually is a test of the parsing in MakeExecOneshotService() and
  nothing related to (init_)parser.cpp

Test: boot bullhead
Test: bool sailfish
Test: init unit tests
Change-Id: I4fe39e6483f58ebd3ce5ee715a45dbba0acf5d91
2017-07-27 13:23:32 -07:00
Tom Cherry 9f030d89dc Merge "init: shutdown services in the opposite order that they started"
am: 8e7942cbd1

Change-Id: Ibd6b25f77dc3f4033902ec25323ff4e6cab024a2
2017-07-27 17:48:12 +00:00