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

Commit f9fd1660 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Otadexopt: Attempt to mount product partition" into pi-dev

parents 7e959e42 fbab0c6e
Loading
Loading
Loading
Loading
+23 −8
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ static int otapreopt_chroot(const int argc, char **arg) {
        LOG(ERROR) << "Target slot suffix not legal: " << arg[2];
        exit(207);
    }
    {
      std::string vendor_partition = StringPrintf("/dev/block/bootdevice/by-name/vendor%s",
                                                  arg[2]);
      int vendor_result = mount(vendor_partition.c_str(),
@@ -122,6 +123,20 @@ static int otapreopt_chroot(const int argc, char **arg) {
                                MS_RDONLY,
                                /* data */ nullptr);
      UNUSED(vendor_result);
    }

    // Try to mount the product partition. update_engine doesn't do this for us, but we
    // want it for product APKs. Same notes as vendor above.
    {
      std::string product_partition = StringPrintf("/dev/block/bootdevice/by-name/product%s",
                                                   arg[2]);
      int product_result = mount(product_partition.c_str(),
                                 "/postinstall/product",
                                 "ext4",
                                 MS_RDONLY,
                                 /* data */ nullptr);
      UNUSED(product_result);
    }

    // Chdir into /postinstall.
    if (chdir("/postinstall") != 0) {