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

Commit d7446c8e authored by Tao Bao's avatar Tao Bao Committed by Gerrit Code Review
Browse files

Merge "recovery: Skip "/" in setup_install_mounts()."

parents 106ca8e9 57130c45
Loading
Loading
Loading
Loading
+22 −19
Original line number Original line Diff line number Diff line
@@ -260,20 +260,23 @@ int format_volume(const char* volume) {
}
}


int setup_install_mounts() {
int setup_install_mounts() {
    if (fstab == NULL) {
  if (fstab == nullptr) {
    LOG(ERROR) << "can't set up install mounts: no fstab loaded";
    LOG(ERROR) << "can't set up install mounts: no fstab loaded";
    return -1;
    return -1;
  }
  }
  for (int i = 0; i < fstab->num_entries; ++i) {
  for (int i = 0; i < fstab->num_entries; ++i) {
        Volume* v = fstab->recs + i;
    const Volume* v = fstab->recs + i;


        if (strcmp(v->mount_point, "/tmp") == 0 ||
    // We don't want to do anything with "/".
            strcmp(v->mount_point, "/cache") == 0) {
    if (strcmp(v->mount_point, "/") == 0) {
      continue;
    }

    if (strcmp(v->mount_point, "/tmp") == 0 || strcmp(v->mount_point, "/cache") == 0) {
      if (ensure_path_mounted(v->mount_point) != 0) {
      if (ensure_path_mounted(v->mount_point) != 0) {
        LOG(ERROR) << "failed to mount " << v->mount_point;
        LOG(ERROR) << "failed to mount " << v->mount_point;
        return -1;
        return -1;
      }
      }

    } else {
    } else {
      if (ensure_path_unmounted(v->mount_point) != 0) {
      if (ensure_path_unmounted(v->mount_point) != 0) {
        LOG(ERROR) << "failed to unmount " << v->mount_point;
        LOG(ERROR) << "failed to unmount " << v->mount_point;