blob: 02a4a232c66587459182965e84d6f529234300ab [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001diff --git a/payload_consumer/delta_performer.cc b/payload_consumer/delta_performer.cc
2index a619d1d9..2abc3baa 100644
3--- a/payload_consumer/delta_performer.cc
4+++ b/payload_consumer/delta_performer.cc
5@@ -367,6 +367,17 @@ bool DeltaPerformer::OpenCurrentPartition() {
6 target_path_ = install_part.target_path;
7 int err;
8
9+ if (install_plan_->is_resume == false)
10+ {
11+ string cmd = "flash_eraseall ";
12+ string p_cmd;
13+
14+ p_cmd = cmd + target_path_;
15+ LOG(INFO) << "Erase partition, erase cmd=" << p_cmd;
16+
17+ system(p_cmd.c_str());
18+ }
19+
20 int flags = O_RDWR;
21 if (!is_interactive_)
22 flags |= O_DSYNC;