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

Commit e95a90e5 authored by JP Abgrall's avatar JP Abgrall Committed by Android Git Automerger
Browse files

am 1762dbfb: am 2d2fd4cd: Merge changes Ibff1f74e,Ic82595cf,If4e01cab

* commit '1762dbfb':
  fastboot: Added tos as an optional image
  fastboot: Fixed optional entries
  fastboot: allow format on devices with small buffers
parents 08651274 1762dbfb
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -100,10 +100,11 @@ static struct {
    char sig_name[13];
    char part_name[9];
    bool is_optional;
} images[3] = {
} images[4] = {
    {"boot.img", "boot.sig", "boot", false},
    {"recovery.img", "recovery.sig", "recovery", true},
    {"system.img", "system.sig", "system", false},
    {"tos.img", "tos.sig", "tos", true},
};

void get_my_path(char *path);
@@ -120,6 +121,8 @@ char *find_item(const char *item, const char *product)
        fn = "recovery.img";
    } else if(!strcmp(item,"system")) {
        fn = "system.img";
    } else if(!strcmp(item,"tos")) {
        fn = "tos.img";
    } else if(!strcmp(item,"userdata")) {
        fn = "userdata.img";
    } else if(!strcmp(item,"cache")) {
@@ -285,7 +288,7 @@ void usage(void)
            "\n"
            "commands:\n"
            "  update <filename>                        reflash device from update.zip\n"
            "  flashall                                 flash boot + recovery + system\n"
            "  flashall                                 flash boot, system, and if found, recovery, tos\n"
            "  flash <partition> [ <filename> ]         write a file to a flash partition\n"
            "  erase <partition>                        erase a flash partition\n"
            "  format <partition>                       format a flash partition \n"
@@ -657,7 +660,7 @@ static int load_buf(usb_handle *usb, const char *fname,

    fd = open(fname, O_RDONLY | O_BINARY);
    if (fd < 0) {
        die("cannot open '%s'\n", fname);
        return -1;
    }

    return load_buf_fd(usb, fd, buf);