Defer to fstype2 if found. Use auto fs if two fstypes are specified
Change-Id: Id6ee1fed1eebbaa6d3a9e6117910f00a56378da4
This commit is contained in:
		| @@ -974,7 +974,7 @@ void write_fstab_root(char *path, FILE *file) | ||||
|  | ||||
|     fprintf(file, "%s ", device); | ||||
|     fprintf(file, "%s ", path); | ||||
|     fprintf(file, "%s rw\n", vol->fs_type); | ||||
|     fprintf(file, "%s rw\n", vol->fs_type2 != NULL ? "auto" : vol->fs_type); | ||||
| } | ||||
|  | ||||
| void create_fstab() | ||||
|   | ||||
							
								
								
									
										25
									
								
								roots.c
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								roots.c
									
									
									
									
									
								
							| @@ -159,31 +159,16 @@ int ensure_path_mounted(const char* path) { | ||||
|     } else if (strcmp(v->fs_type, "ext4") == 0 || | ||||
|                strcmp(v->fs_type, "ext3") == 0 || | ||||
|                strcmp(v->fs_type, "vfat") == 0) { | ||||
|         if ((result = try_mount(v->device, v->mount_point, v->fs_type)) == 0) | ||||
|             return 0; | ||||
|         if ((result = try_mount(v->device2, v->mount_point, v->fs_type)) == 0) | ||||
|             return 0; | ||||
|         // try fs type 2 first | ||||
|         if ((result = try_mount(v->device, v->mount_point, v->fs_type2)) == 0) | ||||
|             return 0; | ||||
|         if ((result = try_mount(v->device2, v->mount_point, v->fs_type2)) == 0) | ||||
|             return 0; | ||||
|         if ((result = try_mount(v->device, v->mount_point, v->fs_type)) == 0) | ||||
|             return 0; | ||||
|         if ((result = try_mount(v->device2, v->mount_point, v->fs_type)) == 0) | ||||
|             return 0; | ||||
|         return result; | ||||
|         /* | ||||
|         result = mount(v->device, v->mount_point, v->fs_type, | ||||
|                        MS_NOATIME | MS_NODEV | MS_NODIRATIME, ""); | ||||
|         if (result == 0) return 0; | ||||
|  | ||||
|         if (v->device2) { | ||||
|             LOGW("failed to mount %s (%s); trying %s\n", | ||||
|                  v->device, strerror(errno), v->device2); | ||||
|             result = mount(v->device2, v->mount_point, v->fs_type, | ||||
|                            MS_NOATIME | MS_NODEV | MS_NODIRATIME, ""); | ||||
|             if (result == 0) return 0; | ||||
|         } | ||||
|  | ||||
|         LOGE("failed to mount %s (%s)\n", v->mount_point, strerror(errno)); | ||||
|         return -1; | ||||
|         */ | ||||
|     } else { | ||||
|         // let's try mounting with the mount binary and hope for the best. | ||||
|         char mount_cmd[PATH_MAX]; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user