summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-04-06 23:18:37 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-04-06 23:18:37 +0000
commit08a785b5297c4d6757ee046d154decd701678e64 (patch)
treeb0b951108fc7ae5c844de49402a9dffc3f26f152
parenta2c006529ab015a735c78b25a61c99a10fac9552 (diff)
parent70179fc3c4ec0d9858f04e829f4aead709a77b98 (diff)
downloadextras-08a785b5297c4d6757ee046d154decd701678e64.tar.gz
Snap for 5443223 from 70179fc3c4ec0d9858f04e829f4aead709a77b98 to qt-release
Change-Id: I2d9c1ebc5e1d98ab5c96f25543665ebe7cf51037
-rw-r--r--partition_tools/lpmake.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/partition_tools/lpmake.cc b/partition_tools/lpmake.cc
index 1c11c4d2..c9333bca 100644
--- a/partition_tools/lpmake.cc
+++ b/partition_tools/lpmake.cc
@@ -253,10 +253,6 @@ int main(int argc, char* argv[]) {
fprintf(stderr, "Partition table must have at least one entry.\n");
return EX_USAGE;
}
- if (!images.empty() && !output_sparse) {
- fprintf(stderr, "Cannot write partition data for non-sparse images.\n");
- return EX_USAGE;
- }
// Note that we take the block_size to mean both the logical block size and
// the block size for libsparse.
@@ -351,13 +347,15 @@ int main(int argc, char* argv[]) {
}
std::unique_ptr<LpMetadata> metadata = builder->Export();
- if (output_sparse) {
+ if (!images.empty()) {
if (block_devices.size() == 1) {
- if (!WriteToSparseFile(output_path.c_str(), *metadata.get(), block_size, images)) {
+ if (!WriteToImageFile(output_path.c_str(), *metadata.get(), block_size, images,
+ output_sparse)) {
return EX_CANTCREAT;
}
} else {
- if (!WriteSplitSparseFiles(output_path, *metadata.get(), block_size, images)) {
+ if (!WriteSplitImageFiles(output_path, *metadata.get(), block_size, images,
+ output_sparse)) {
return EX_CANTCREAT;
}
}