summaryrefslogtreecommitdiffstats
path: root/fastboot
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-11-28 23:34:29 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-11-28 23:34:29 +0000
commit4055587ddd117dd9851e47ad056425604bb3afed (patch)
tree8e1c2a1b80c168a804bc7eb9451655ae0ba51a28 /fastboot
parenta7b0b3ba276b5297a225c09dad8d69023fce3918 (diff)
parenta30b6964d69886a2f8786a760eea962e90c10f79 (diff)
downloadsystem_core-4055587ddd117dd9851e47ad056425604bb3afed.tar.gz
system_core-4055587ddd117dd9851e47ad056425604bb3afed.tar.bz2
system_core-4055587ddd117dd9851e47ad056425604bb3afed.zip
Merge changes Ic4e1a1de,Icfceaa46
* changes: fastboot: propagate error for format command fs_mgr: overlayfs: resize scratch should it be too small
Diffstat (limited to 'fastboot')
-rw-r--r--fastboot/fastboot.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index d5e88a792..0978ec13e 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -1474,15 +1474,13 @@ static void fb_perform_format(
fprintf(stderr, "File system type %s not supported.\n", partition_type.c_str());
return;
}
- fprintf(stderr, "Formatting is not supported for file system with type '%s'.\n",
- partition_type.c_str());
- return;
+ die("Formatting is not supported for file system with type '%s'.",
+ partition_type.c_str());
}
int64_t size;
if (!android::base::ParseInt(partition_size, &size)) {
- fprintf(stderr, "Couldn't parse partition size '%s'.\n", partition_size.c_str());
- return;
+ die("Couldn't parse partition size '%s'.", partition_size.c_str());
}
unsigned eraseBlkSize, logicalBlkSize;
@@ -1492,17 +1490,14 @@ static void fb_perform_format(
if (fs_generator_generate(gen, output.path, size, initial_dir,
eraseBlkSize, logicalBlkSize)) {
die("Cannot generate image for %s", partition.c_str());
- return;
}
fd.reset(open(output.path, O_RDONLY));
if (fd == -1) {
- fprintf(stderr, "Cannot open generated image: %s\n", strerror(errno));
- return;
+ die("Cannot open generated image: %s", strerror(errno));
}
if (!load_buf_fd(fd.release(), &buf)) {
- fprintf(stderr, "Cannot read image: %s\n", strerror(errno));
- return;
+ die("Cannot read image: %s", strerror(errno));
}
flash_buf(partition, &buf);
return;
@@ -1513,6 +1508,9 @@ failed:
if (errMsg) fprintf(stderr, "%s", errMsg);
}
fprintf(stderr, "FAILED (%s)\n", fb->Error().c_str());
+ if (!skip_if_not_supported) {
+ die("Command failed");
+ }
}
static bool should_flash_in_userspace(const std::string& partition_name) {