Commit Graph

39108 Commits

Author SHA1 Message Date
Wei Wang 2c4ee75b1e init: print service name when started waiting
Bug: 110479595
Test: Boot
Change-Id: I448a64cec4c1cd5b736f8b9d04cd26429067bb71
2018-06-20 15:55:10 -07:00
Yifan Hong 3c4aa11cab Revert "init: dummy host_init_verifier for mac"
This reverts commit f567367584.

Reason for revert: mac build

Change-Id: Icd5d08206c50854d6645e07c4fb29705222bd226
2018-06-20 22:49:48 +00:00
Elliott Hughes 0310f46e26 shell_and_utilities: update README.md.
Bug: N/A
Test: N/A
Change-Id: I972e6e06b0eedc9a16420ba8360258cfaf2d1c57
2018-06-20 15:48:28 -07:00
David Anderson e1c0744c26 libdm: Implement LoadTableAndActivate.
This change implements DeviceMapper::LoadTableAndActivate by serializing
the given DmTable and issuing DM_TABLE_LOAD and DM_DEV_SUSPEND ioctls.
In addition, this makes the CreateDevice() method private, and
introduces a separate method for creating a device and loading a table
as a single operation. This will obviate the need for separate inactive
device cleanup logic later.

Note that this change does not yet implement DmTable::Serialize().

Bug: 110035986
Test: N/A
Change-Id: Ic8affe591db4930ce672b00db989978b57ca8cbf
2018-06-20 15:16:05 -07:00
David Anderson b1a834ec31 libdm: Move includes to a libdm folder.
This places libdm includes into a libdm folder, to match how many other
library includes are organized.

Bug: 110035986
Test: N/A
Change-Id: I430b0cf749c8d16265481864f1f33927fd740a53
2018-06-20 15:16:04 -07:00
Treehugger Robot 9a2891c84b Merge "libdm: Clean up error messages and dm_ioctl use." 2018-06-20 21:48:13 +00:00
Anton Hansson ca38c79622 Split shell_and_utilities into partition parts.
This allows a product to selectively include binaries for the
partitions relevant to it. For example, mainline will only include
the system copies.

Bug: 80410283
Test: make
Change-Id: I1d1d62a3c8afff19cd45388adc323587f5043243
2018-06-20 22:37:41 +01:00
Treehugger Robot b0e193c609 Merge "init: dummy host_init_verifier for mac" 2018-06-20 21:19:49 +00:00
Treehugger Robot ab8131f18f Merge "init: document what host init verifier checks" 2018-06-20 21:00:42 +00:00
Tom Cherry f567367584 init: dummy host_init_verifier for mac
Let's start by fixing the build, then see how possible this will be to do fully.

Bug: 110477913
Test: n/a
Change-Id: If52e15bd070781a405c5494631ede033c1067903
2018-06-20 12:29:59 -07:00
Treehugger Robot c50fe3dc54 Merge "newfs_msdos: switch to external/newfs_msdos." 2018-06-20 19:06:59 +00:00
Tom Cherry 47111aee40 init: document what host init verifier checks
Bug: 36970783
Test: n/a
Change-Id: Ic42a55d7b5bb4fec364ac3b5d9a67bcd38cbcc8d
2018-06-20 10:21:37 -07:00
Tom Cherry 81101cb216 Merge "Don't check permissions bits on init scripts for host_init_verifier" 2018-06-20 17:06:11 +00:00
Pirama Arumuga Nainar 7982178b7b Update cflags for building Windows modules with Clang
Bug: http://b/69933068

- Add -Wexit-time-destructor globally after fixing one warning
- Enable -Wthread-safety only for non-windows targets.  The version of
libstdc++ we use for Windows doesn't have the correct thread-safety
annotations.

Test: Run Clang-built adb_test.exe under wine
Change-Id: I76a43060342e7d1dc370ce3e117f3563c82b7751
2018-06-19 20:27:37 -07:00
David Anderson b6181e3e46 libdm: Clean up error messages and dm_ioctl use.
This change removes unnecessary malloc() calls for dm_ioctls. It also
simplifies and fixes line endings on some error messages.

Bug: 110035986
Test: N/A
Change-Id: I2f56e5dab7f25cd9b2f80896f80101db56228981
2018-06-19 18:15:14 -07:00
Treehugger Robot 08839ff904 Merge "init: Create logical partitions via liblp." 2018-06-20 01:09:35 +00:00
Treehugger Robot dc0f5bc4f4 Merge "logd: remove failing test." 2018-06-20 00:00:58 +00:00
Treehugger Robot 20480a22a1 Merge "libselinux is dynamically linked from init" 2018-06-20 00:00:38 +00:00
Treehugger Robot c86d3110be Merge "fs_mgr: Add a library for managing logical partitions." 2018-06-19 23:20:16 +00:00
Tom Cherry d72432de93 Don't check permissions bits on init scripts for host_init_verifier
Also get rid of the copy in parser.  There's no incentive to switch to
a tokenizer that doesn't modify the input, nor is there a reason to
waste cycles making a copy of every init script as its processed.

Bug: 36970783
Test: boot
Change-Id: I8aca9c9d6f1961e1ab35dee50691a6791fc6ec66
2018-06-19 15:18:40 -07:00
Elliott Hughes 6427c363df logd: remove failing test.
Bug: N/A
Test: ran tests manually
Change-Id: I3ebb97d757077acaab1b51809a1c2be90ceb1ad9
2018-06-19 15:06:53 -07:00
Treehugger Robot 2bf8328c54 Merge "Determine product partition path on build time" 2018-06-19 21:36:10 +00:00
David Anderson 6590df2763 init: Create logical partitions via liblp.
Currently, init can create logical partitions by hardcoding them in
fs_mgr or by specifying them in device-tree. This change allows init to
also create logical partitions by using liblp, which stores partition
tables in a physical partition. The current name for this partition is
"android".

Two aspects of this code will change long-term. One, the prototype code
using device-tree will be deleted once fastboot supports logical
partitions. Two, libdm will obsolete most of the code in
fs_mgr_dm_linear.cpp. For now however we preserve how the prototype code
functions and we layer liblp on top of the existing dm_linear logic.

Bug: 79173901
Test: N/A
Change-Id: If014a109da78fa12269bf0df0dda39028ac2d1aa
2018-06-19 14:03:58 -07:00
David Anderson ea3b8ac9ff fs_mgr: Add a library for managing logical partitions.
This library has methods to build, read, and modify logical partition tables
based on device-mapper targets. Targets currently supported are
dm-linear and dm-zero.

Note: this is a revert of a revert, with changes to fix Mac build
bustage.

Bug: 79173901
Test: N/A
Change-Id: If89a788d1919ce8ddc6eedaecc9687a92f111dfa
2018-06-19 14:03:57 -07:00
Doheon Lee cccad0bf84 Determine product partition path on build time
Path of product partitoin can be set as /product or /system/product
whether generate extra product partition or not.
Substitute %PRODUCT% to relevant path to know linker which path should
search and permit.

Bug: 110286945
Test: m -j # Check /system/etc/ld.config.$(PLATFORM_VNDK_VERSION).txt
Change-Id: I6ca177d0c9c5af00ad821879fece40848331fc8d
2018-06-19 08:10:14 +00:00
Jiyong Park 012171d3af libselinux is dynamically linked from init
init is now dynamically linked to libselinux. This gives us about 100KB
extra space, which is valuable in the recovery partition.

Bug: 63673171
Test: m -j
Test: adb reboot recovery
Change-Id: I72c4f886cbbb9ce54f8221f05547f5b9f0e1adb0
2018-06-19 16:55:05 +09:00
Treehugger Robot 9674bcbd23 Merge changes Ibfa5e7e6,I706b57a9,I53d21134,I69d4d585
* changes:
  adb: detect some spin loops and abort.
  adb: add an id field to fdevent.
  adb: delete unused members in fdevent.
  adb: add `adb raw` to connect to an arbitrary service.
2018-06-19 02:39:28 +00:00
Josh Gao 3bbc8164b1 adb: detect some spin loops and abort.
Track pending fdevents, and abort if we see an fdevent ready for
read/write for 5 minutes continuously.

Also, add a service that intentionally starts spinning, to test this.

Test: manually changed timeout to a minute, `adb raw spin`
Change-Id: Ibfa5e7e654996587f745887cb04987b982d79bed
2018-06-18 17:46:34 -07:00
Treehugger Robot 812ba6a469 Merge "adb: add nonblocking fd Connection." 2018-06-18 21:59:12 +00:00
Josh Gao ded557fa58 adb: add an id field to fdevent.
Tracking fdevents by pointer is dangerous because an fdevent can be
destroyed and recreated at the same address. Add a monotonically
increasing id field to fdevent for this purpose.

Test: treehugger
Change-Id: I706b57a9e669290ef2db258f85489a5155fc1152
2018-06-18 14:55:27 -07:00
Josh Gao e44d38d680 adb: delete unused members in fdevent.
Forgot to clean this up after removing fdevent_install...

Test: treehugger
Change-Id: I53d21134a4bc8bf7b16210318c6fac5075445b39
2018-06-18 14:54:40 -07:00
Josh Gao 172d0d44bc adb: add `adb raw` to connect to an arbitrary service.
Add a command to connect to an arbitrary service, for debugging
purposes.

Test: `adb raw shell:ls`
Change-Id: I69d4d585e5ecfa7cb8c7a543a2a27df7033b26c7
2018-06-18 14:51:56 -07:00
David Anderson b9a2243eb3 Merge "Revert "fs_mgr: Add a library for managing logical partitions."" 2018-06-18 21:25:21 +00:00
David Anderson 89a1dca721 Revert "fs_mgr: Add a library for managing logical partitions."
This reverts commit e238358b76.

Reason for revert: Broke mac build.

Change-Id: I93390aa839d4471f328529fe5b86a498b3583d8a
2018-06-18 21:13:24 +00:00
Treehugger Robot 9040b888a6 Merge "logcat: tidy "logcat.h"." 2018-06-18 18:58:16 +00:00
Treehugger Robot 169aa989e3 Merge "fs_mgr: Add a library for managing logical partitions." 2018-06-18 18:31:30 +00:00
Elliott Hughes 66680bd8a8 logcat: tidy "logcat.h".
Bug: N/A
Test: builds
Change-Id: Ibe434221060b2e1fb0973d1c840d943ad3a4ee8d
2018-06-18 10:16:46 -07:00
Elliott Hughes 28a3160c07 Merge "Remove liblogcat." 2018-06-18 16:51:41 +00:00
Tom Cherry fe80d069a0 Merge "Support oem_#### users/groups for host_init_verifier" 2018-06-18 15:50:52 +00:00
Treehugger Robot c733e5af3c Merge "Add /system/product/* paths to permitted paths" 2018-06-18 07:18:59 +00:00
Inseob Kim 3918936b9e Add /system/product/* paths to permitted paths
As linker doesn't resolve paths in permitted paths, /system/product
variants should be added to support devices having product partition
under /system.

Bug: 110286945
Test: m -j succeeds on taimen and libraries under /system can dlopen
libraries under /system/product/apps

Change-Id: Icd102d44511702e4ec66c07a367b59c3d9700a44
2018-06-18 14:16:49 +09:00
Kihyung Lee d9ad02e3e0 Fix memory leak when GateKeeperProxy.verify() returns
After verify() calls verifyChallenge(), the caller acquires the ownership of
returned memory block pointed by *auth_token.
However, the current implementation directly returns and lost the reference
of auth_token without freeing it from heap memory.

This patch solves this problem by explicitly deleting the auth_token array.

Change-Id: I6cfe8427174aa36fbb208e2fff8904095f468ec6
2018-06-18 11:05:42 +09:00
Elliott Hughes 61b580e15e Remove liblogcat.
Parsing logs isn't an API, and even if you want to do that, popen(3)
already exists.

Bug: N/A
Test: ran tests
Change-Id: I53c40be49141483da0a844a7af47da0b38d29781
2018-06-15 15:32:52 -07:00
Elliott Hughes 8c6f7ec060 Merge "bootstat: remove the only caller of liblogcat." 2018-06-15 21:44:23 +00:00
Elliott Hughes 50a24eb3bc bootstat: remove the only caller of liblogcat.
We need to make progress both on adding the real interface for battery
level and cleaning up logging. This stands in the way of both.

Bug: http://b/77725702
Test: builds
Change-Id: Ia457e497606c2c7965d6895baebb26eef17857c9
Merged-In: Ia457e497606c2c7965d6895baebb26eef17857c9
2018-06-15 12:36:46 -07:00
Tom Cherry 4632f4e868 Merge "Relax host init parser to work with the build system" 2018-06-15 17:03:42 +00:00
Elliott Hughes 9d9c91acdc Merge "libsync: add __INTRODUCED_IN annotations." 2018-06-15 16:08:51 +00:00
Treehugger Robot 60e9dad71e Merge "debuggerd: add support for Java traces." 2018-06-15 00:40:41 +00:00
David Anderson e238358b76 fs_mgr: Add a library for managing logical partitions.
This library has methods to build, read, and modify logical partition tables
based on device-mapper targets. Targets currently supported are
dm-linear and dm-zero.

Bug: 79173901
Test: N/A
Change-Id: I194c6832cb53f781c396016d961386d3ca833f87
2018-06-14 17:17:23 -07:00
Josh Gao 24113ae641 debuggerd: add support for Java traces.
Test: `debuggerd -j $(pidof com.android.settings)`
Change-Id: I051c9b6d313e5350416b3d0743c3fc75f43fbd0c
2018-06-14 15:40:06 -07:00