2018-06-07 22:36:09 +00:00
|
|
|
//
|
|
|
|
// Copyright (C) 2018 The Android Open Source Project
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
|
2019-06-14 18:35:53 +00:00
|
|
|
liblp_lib_deps = [
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
|
|
|
"libcrypto_utils",
|
|
|
|
"libsparse",
|
|
|
|
"libext4_utils",
|
|
|
|
"libz",
|
|
|
|
]
|
|
|
|
|
2018-07-27 23:05:31 +00:00
|
|
|
cc_library {
|
2018-06-07 22:36:09 +00:00
|
|
|
name: "liblp",
|
|
|
|
host_supported: true,
|
|
|
|
recovery_available: true,
|
|
|
|
defaults: ["fs_mgr_defaults"],
|
|
|
|
cppflags: [
|
|
|
|
"-D_FILE_OFFSET_BITS=64",
|
|
|
|
],
|
|
|
|
srcs: [
|
|
|
|
"builder.cpp",
|
2018-07-13 21:25:39 +00:00
|
|
|
"images.cpp",
|
2018-10-23 01:05:54 +00:00
|
|
|
"partition_opener.cpp",
|
2019-08-03 00:48:34 +00:00
|
|
|
"property_fetcher.cpp",
|
2018-06-07 22:36:09 +00:00
|
|
|
"reader.cpp",
|
|
|
|
"utility.cpp",
|
|
|
|
"writer.cpp",
|
|
|
|
],
|
2019-09-18 18:04:35 +00:00
|
|
|
shared_libs: [
|
|
|
|
"libcrypto",
|
|
|
|
] + liblp_lib_deps,
|
2018-11-17 00:45:45 +00:00
|
|
|
target: {
|
|
|
|
windows: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2019-03-19 19:08:48 +00:00
|
|
|
android: {
|
|
|
|
shared_libs: [
|
|
|
|
"libcutils",
|
|
|
|
],
|
|
|
|
},
|
2018-11-17 00:45:45 +00:00
|
|
|
},
|
2018-06-07 22:36:09 +00:00
|
|
|
export_include_dirs: ["include"],
|
|
|
|
}
|
2018-06-15 18:13:29 +00:00
|
|
|
|
2019-09-10 09:04:27 +00:00
|
|
|
filegroup {
|
|
|
|
name: "liblp_test_srcs",
|
|
|
|
srcs: [
|
|
|
|
"builder_test.cpp",
|
|
|
|
"device_test.cpp",
|
|
|
|
"io_test.cpp",
|
|
|
|
"test_partition_opener.cpp",
|
|
|
|
"utility_test.cpp",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2019-08-16 20:59:40 +00:00
|
|
|
cc_defaults {
|
|
|
|
name: "liblp_test_defaults",
|
2019-09-27 06:52:44 +00:00
|
|
|
defaults: ["fs_mgr_defaults"],
|
2018-07-11 04:07:23 +00:00
|
|
|
cppflags: [
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
],
|
2018-10-18 22:29:01 +00:00
|
|
|
static_libs: [
|
2019-08-16 20:59:40 +00:00
|
|
|
"libcutils",
|
2018-10-18 22:29:01 +00:00
|
|
|
"libgmock",
|
liblp: Implement support for request queue alignment.
Block devices in the Linux kernel have a "minimum I/O request" size. The
minimum size is usually acquired by the block driver and can change
from device to device. When stacking devices (such as with
device-mapper), the kernel goes through great lengths to make sure this
alignment is respected for optimal I/O. In device-mapper's case,
misalignment can lead to kernel warnings and performance issues.
While this is unlikely to matter with a few targets, it could become
problematic on a large number of targets, and so we would prefer to
align all partition extents to the minimum I/O size.
We now support two new properties in the partition table geometry: an
"alignment", which is the minimum I/O size, and an "alignment offset",
which is an offset that when applied to sector 0, causes the sector to
be properly aligned within its parent device (for example, if a
physical partition is misaligned). All partition extents now begin on a
sector that respects this alignment.
One major caveat is that it is difficult for the initial partition table
to have the correct alignment without build system and/or flash tool
support. To accomodate this, all alignment is optional, and the lpmake
tool will support a default alignment of 1MiB as a failsafe.
Bug: 79173901
Test: liblp_test gtest
Change-Id: I5bc41b90aa085f4f30393951af0d2b37c4ac2a72
2018-07-09 19:12:52 +00:00
|
|
|
"libfs_mgr",
|
2019-06-14 18:35:53 +00:00
|
|
|
"liblp",
|
2019-09-18 18:04:35 +00:00
|
|
|
"libcrypto_static",
|
2019-06-14 18:35:53 +00:00
|
|
|
] + liblp_lib_deps,
|
2019-09-12 20:00:54 +00:00
|
|
|
header_libs: [
|
|
|
|
"libstorage_literals_headers",
|
|
|
|
],
|
2019-06-14 18:35:53 +00:00
|
|
|
stl: "libc++_static",
|
2019-09-10 09:04:27 +00:00
|
|
|
srcs: [":liblp_test_srcs"],
|
2018-06-15 18:13:29 +00:00
|
|
|
}
|
2019-08-16 20:59:40 +00:00
|
|
|
|
|
|
|
cc_test {
|
|
|
|
name: "liblp_test",
|
|
|
|
defaults: ["liblp_test_defaults"],
|
|
|
|
test_config: "liblp_test.xml",
|
2019-09-10 09:04:27 +00:00
|
|
|
test_suites: ["device-tests"],
|
2019-08-16 20:59:40 +00:00
|
|
|
}
|
|
|
|
|
2019-09-27 06:52:44 +00:00
|
|
|
cc_test {
|
|
|
|
name: "vts_core_liblp_test",
|
|
|
|
defaults: ["liblp_test_defaults"],
|
2020-03-26 18:51:48 +00:00
|
|
|
test_suites: ["vts"],
|
2019-09-27 06:52:44 +00:00
|
|
|
auto_gen_config: true,
|
|
|
|
test_min_api_level: 29,
|
2019-10-17 01:26:28 +00:00
|
|
|
require_root: true,
|
2019-09-27 06:52:44 +00:00
|
|
|
}
|
|
|
|
|
2019-08-16 20:59:40 +00:00
|
|
|
cc_test {
|
2019-08-23 20:17:10 +00:00
|
|
|
name: "vts_kernel_liblp_test",
|
2019-08-16 20:59:40 +00:00
|
|
|
defaults: ["liblp_test_defaults"],
|
|
|
|
}
|
|
|
|
|
2020-03-08 05:21:33 +00:00
|
|
|
vts_config {
|
|
|
|
name: "VtsKernelLiblpTest",
|
|
|
|
}
|