summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-04-04 23:16:06 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-04-04 23:16:06 +0000
commitd04d021ffc54d7bc50311d57bac1a0bb40587c53 (patch)
tree77177dd271b8bd008f35c7cd4a2cd9a9c367529b
parenta81cf2e34181cf2bfb0e43ca726e4159157bbc16 (diff)
parent456e9a7c67c6feb06f6ebbcff347a61ad82bd7b2 (diff)
downloadextras-d04d021ffc54d7bc50311d57bac1a0bb40587c53.tar.gz
Merge "lpmake: allow to build non-sparse super image."
-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;
}
}