Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1a473cd authored by Daniel Zheng's avatar Daniel Zheng Committed by Gerrit Code Review
Browse files

Merge "Asserting flashing plan is used in do_flash" into main

parents 460631c0 59589d47
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1489,10 +1489,13 @@ static std::string repack_ramdisk(const char* pname, struct fastboot_buffer* buf

void do_flash(const char* pname, const char* fname, const bool apply_vbmeta,
              const FlashingPlan* fp) {
    if (!fp) {
        die("do flash was called without a valid flashing plan");
    }
    verbose("Do flash %s %s", pname, fname);
    struct fastboot_buffer buf;

    if (fp && fp->source) {
    if (fp->source) {
        unique_fd fd = fp->source->OpenFile(fname);
        if (fd < 0 || !load_buf_fd(std::move(fd), &buf, fp)) {
            die("could not load '%s': %s", fname, strerror(errno));