android: Ensure partitions are at least 1 block in size

Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Idc1aeb7d6a5e2ed539c129a53b732435218a1a65
master
hmz007 10 months ago
parent b7a4d32ad6
commit 5409adf782

@ -465,7 +465,7 @@ void RoundDownPartitions(const ImageConfig& config) {
if (part.path.empty()) {
continue;
}
const auto size = utils::FileSize(part.path);
const auto size = std::max<size_t>(utils::FileSize(part.path), kBlockSize);
if (size % kBlockSize != 0) {
const auto err =
truncate(part.path.c_str(), size / kBlockSize * kBlockSize);

Loading…
Cancel
Save