Commit graph

41878 commits

Author SHA1 Message Date
Tom Cherry
689d86a029 Merge "ueventd: let scripts provide firmware directories"
am: b504f38d7e

Change-Id: I6dd9cfe20b733fad5afb066b07484c33eb599c02
2018-07-16 17:15:18 -07:00
Tom Cherry
b504f38d7e Merge "ueventd: let scripts provide firmware directories" 2018-07-16 23:00:53 +00:00
Yifan Hong
5e389e354f [automerger skipped] Merge "libbatterymonitor: vendor_available"
am: 895acebe94  -s ours

Change-Id: If9cbc457e901f94318daf414d9cc3377e929f2e1
2018-07-16 13:37:58 -07:00
Treehugger Robot
895acebe94 Merge "libbatterymonitor: vendor_available" 2018-07-16 20:16:02 +00:00
Yifan Hong
3da9f08903 libbatterymonitor: vendor_available
libbatterymonitor is a static library.
Also removed unused libbinder dependency.

Test: pass
Bug: 111454508
Merged-In: I1f17ee643e6ed1bb2c11a6f3189a448dba2927ac
Change-Id: I1f17ee643e6ed1bb2c11a6f3189a448dba2927ac
(cherry picked from commit ffff9aae02)
2018-07-16 11:26:04 -07:00
David Anderson
1a2b2c4203 Merge "liblp: Add a method to create sparse images of the super partition."
am: 97d3fd8fb0

Change-Id: Ib9ff2dca5d1b4e5c5c714773f111076950996f12
2018-07-16 10:24:32 -07:00
Treehugger Robot
97d3fd8fb0 Merge "liblp: Add a method to create sparse images of the super partition." 2018-07-16 17:17:54 +00:00
David Anderson
87ccc12583 Merge "liblp: Move image reading/writing functions to a new cpp file."
am: fcb0ef9c98

Change-Id: I68aa4054ccb6bd3754a30a91313c4ef3cde20734
2018-07-16 10:17:54 -07:00
David Anderson
d22e078795 Merge "liblp: Force more sizes to be a multiple of the sector size."
am: 474990089a

Change-Id: Id92b7a1a907069b882ca60a27cdf9f458b5fb2cf
2018-07-16 10:17:17 -07:00
David Anderson
c00aad1820 Merge "liblp: Add block device size to LpMetadataGeometry."
am: f78c9643e0

Change-Id: Ifceb7a145c437549232efe786397512e1d07a974
2018-07-16 10:16:44 -07:00
Treehugger Robot
fcb0ef9c98 Merge "liblp: Move image reading/writing functions to a new cpp file." 2018-07-16 17:11:03 +00:00
Treehugger Robot
474990089a Merge "liblp: Force more sizes to be a multiple of the sector size." 2018-07-16 17:08:49 +00:00
Treehugger Robot
f78c9643e0 Merge "liblp: Add block device size to LpMetadataGeometry." 2018-07-16 17:07:58 +00:00
Yi Kong
f2b4259b93 Merge "libcutils: remove rather than fix the mutex."
am: 39e7a1c981

Change-Id: Ie1084574143f2d1e4b4995f7682948b77b5334b6
2018-07-14 14:27:25 -07:00
Yi Kong
39e7a1c981 Merge "libcutils: remove rather than fix the mutex." 2018-07-14 21:18:54 +00:00
Yi Kong
6259c5f204 Merge "[logd] Modernize codebase by replacing NULL with nullptr"
am: 2a989cf525

Change-Id: Ic608288e6a055e7d7236be22b7c564a565a86987
2018-07-13 21:40:27 -07:00
Yi Kong
86f7a3c1c1 Merge "Remove execute bit for source files"
am: dc8483cc04

Change-Id: Ie60e02dedca7f002e33a47eb786ac8bca18b6c0f
2018-07-13 21:39:48 -07:00
Yi Kong
0f45e589ef Merge "Modernize codebase by replacing NULL with nullptr"
am: 9154fbc8df

Change-Id: I439ffa4df2e5672ed2b66d88abbb61ed67355926
2018-07-13 21:38:41 -07:00
Yi Kong
2a989cf525 Merge "[logd] Modernize codebase by replacing NULL with nullptr" 2018-07-14 02:48:17 +00:00
David Anderson
b36db4ba0e liblp: Add a method to create sparse images of the super partition.
This change enables flashing of the super partition without using
lpflash or adding explicit fastboot support for the liblp image format.

Bug: 79173901
Test: image can be flashed to device and read by liblp
Change-Id: Id6c5e595ba831644364b7335b58cf6a43d5833c3
2018-07-13 18:17:56 -07:00
David Anderson
62cd1e06ab liblp: Move image reading/writing functions to a new cpp file.
This is in preparation for adding sparse image support, to avoid
cluttering the more critical reading and writing logic.

Bug: 79173901
Test: N/A
Change-Id: Icdddb849aebba4adf18a3e63ffbd3f36adda812d
2018-07-13 18:17:56 -07:00
David Anderson
8cf1e38b21 liblp: Force more sizes to be a multiple of the sector size.
This makes offset calculations and library interactions much easier.

Bug: 79173901
Test: liblp_test gtest
Change-Id: I595c5435bd6bc166693a434ecdcd2d098185f963
2018-07-13 18:17:56 -07:00
David Anderson
4813823e73 liblp: Add block device size to LpMetadataGeometry.
This makes it easier to validate the device and make assumptions about
the device layout without having actual access.

Bug: 79173901
Test: liblp_test gtest
Change-Id: I53d24684020ec9210c8a17d155e738b3b2405806
2018-07-13 18:17:55 -07:00
Yi Kong
c8d09ddceb [logd] Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning.

Test: m
Bug: 68236239
Change-Id: I15ccb9cfc9967dae4320d9690f5097bc2f7d5bfe
2018-07-13 17:50:55 -07:00
Yi Kong
dc8483cc04 Merge "Remove execute bit for source files" 2018-07-14 00:50:32 +00:00
Yi Kong
760a35a91c Remove execute bit for source files
Test: ls -l
Change-Id: Id09514a03f82c89e6350a5f9e34b9ef8bfe27b7e
2018-07-13 17:45:39 -07:00
Yi Kong
9154fbc8df Merge "Modernize codebase by replacing NULL with nullptr" 2018-07-14 00:20:38 +00:00
Tom Cherry
7421fa1aed ueventd: let scripts provide firmware directories
Since some vendors will have firmware in mount points in
/mnt/vendor/..., we extend the ueventd script language to allow
specifying the firmware directories.

Also, move the existing 4 directories to ueventd.rc as a primary user
of this mechanism.

Bug: 111337229
Test: boot sailfish; firmwares load
Change-Id: I0854b0b786ad761e40d2332312c637610432fce2
2018-07-13 15:34:25 -07:00
Yi Kong
c1a1562548 Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning for binder.

Test: m
Bug: 68236239
Change-Id: I8184bd6aa4ebff1bd8c88dad16886e98df853b03
2018-07-13 15:28:59 -07:00
Elliott Hughes
51a2cacbb9 libcutils: remove rather than fix the mutex.
Bug: 68236239
Test: ran tests
Change-Id: I53e47f99e6963bedcb0be30cf10c9187da8a047d
2018-07-13 14:53:51 -07:00
Elliott Hughes
1ecedeb0c1 Merge "cutils: move hashmap to <pthread.h>."
am: dda5fe46ac

Change-Id: I925212825eb6b91074bf519e532125953c5eb1f1
2018-07-13 13:10:57 -07:00
Tom Cherry
f4657d4b80 Merge "init: actually remount /sys when changing network namespaces"
am: a8df2b95cb

Change-Id: I00330bacd9fd7bcb825298ef72ca54d134206c99
2018-07-13 13:09:53 -07:00
Elliott Hughes
dda5fe46ac Merge "cutils: move hashmap to <pthread.h>." 2018-07-13 19:58:45 +00:00
Tom Cherry
a8df2b95cb Merge "init: actually remount /sys when changing network namespaces" 2018-07-13 19:57:52 +00:00
Tom Cherry
9bb0a4de46 init: actually remount /sys when changing network namespaces
Fix a typo from before.

Bug: 73334854
Test: build
Change-Id: I66631a6f251960be0e02d8a119fa0ff7a00fb24c
2018-07-13 11:07:11 -07:00
Elliott Hughes
9d12725cad cutils: move hashmap to <pthread.h>.
Bug: N/A
Test: builds
Change-Id: I16a470265a17ea5bd47ef76ec234907cf7ec3e4f
2018-07-13 10:54:49 -07:00
Elliott Hughes
c427a82e0c Merge "libbase: return different result depend on the errno"
am: 40ad8e2ade

Change-Id: I3b80b922c58a91c59e8654644d79b8a7c2296983
2018-07-13 08:11:49 -07:00
Elliott Hughes
40ad8e2ade Merge "libbase: return different result depend on the errno" 2018-07-13 15:02:49 +00:00
David Anderson
bcc74d446a Merge "liblp: Rename the metadata partition name to "super"."
am: a73ea65c5a

Change-Id: Ic02ab4794b7e9070a42f875e49fb1180b573fa41
2018-07-12 21:11:20 -07:00
Treehugger Robot
a73ea65c5a Merge "liblp: Rename the metadata partition name to "super"." 2018-07-13 02:07:35 +00:00
liwugang
c63cb07063 libbase: return different result depend on the errno
In the RemoveFileIfExists it always return true even if error appeared
when using stat function.

It should distinguish different error. Such as ENOENT and ENOTDIR
we exactly know the file does not exist. But EACCES(current user has not
all search permission in the file path) and other errors appeared
we can't know whether file exits. So we should return false indicate
there are some error appeared.

Test: ran unit tests
Change-Id: I75788bf0621040812413d52596b5effb628fd0b1
Signed-off-by: liwugang <liwugang@xiaomi.com>
2018-07-12 17:35:17 -07:00
David Anderson
94c94ffc31 Merge "liblp: Clean up public headers."
am: b399456303

Change-Id: Ifc841146a44654490f57b67242d7a44944220a92
2018-07-12 16:06:51 -07:00
Treehugger Robot
b399456303 Merge "liblp: Clean up public headers." 2018-07-12 22:55:35 +00:00
Christopher Ferris
66ed3fa24a Merge "Remove Memory::ReadField."
am: 5dce8ce747

Change-Id: Iac64c37d7430b2d890d3fa9ad3f47f72179815ec
2018-07-12 15:50:41 -07:00
Christopher Ferris
5dce8ce747 Merge "Remove Memory::ReadField." 2018-07-12 22:37:18 +00:00
David Anderson
b2d54e5108 Merge "liblp: Improve reliability of UpdatePartitionTable."
am: d73414c5e8

Change-Id: Icfaa6e3986d0c08a78a1a0d015d6cb28387c850a
2018-07-12 15:29:59 -07:00
David Anderson
b3fc16c5f3 liblp: Rename the metadata partition name to "super".
Bug: 79173901
Test: N/A
Change-Id: I99ccb095030c82cbc4bb89b40bff333decd35532
2018-07-12 14:08:42 -07:00
David Anderson
9c3c29466a liblp: Clean up public headers.
This changes reader.h and writer.h to be private includes. A new liblp.h
header now contains the public API surface of those two files, as well
as some miscellanious functions previously in metadata_format.h.

Bug: 79173901
Test: N/A
Change-Id: I40c5dda0c8e5765f8bccfd5c17b4c800b41be77b
2018-07-12 14:08:42 -07:00
Treehugger Robot
d73414c5e8 Merge "liblp: Improve reliability of UpdatePartitionTable." 2018-07-12 20:13:43 +00:00
Christopher Ferris
5afddb0637 Remove Memory::ReadField.
In almost all cases, it is faster to read the entire structure rather
than do multiple reads using ReadField. The only case where it would be
slower is if doing a remote unwind and ptrace is the only way to read. In
all other cases, it's a single system call. In the ptrace call, it will be
multiple calls. Given that it is unusual to be forced to use ptrace,
it's better to avoid it.

It also reduces the code complexity to do a single read, and avoids
issues where the code forgets to read the field it needs.

Test: Unit tests pass on host and target.
Change-Id: I7b3875b2c85d0d88115b1776e1be28521dc0b932
2018-07-12 12:45:31 -07:00