[m31][t15] Add support for multiple entries per path in fstab
This commit is contained in:
		
							
								
								
									
										17
									
								
								multirom.c
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								multirom.c
									
									
									
									
									
								
							@@ -1291,8 +1291,11 @@ int multirom_process_android_fstab(char *fstab_name, int has_fw, struct fstab_pa
 | 
			
		||||
    if(!tab)
 | 
			
		||||
        goto exit;
 | 
			
		||||
 | 
			
		||||
    const int disable_res = fstab_disable_part(tab, "/system") + fstab_disable_part(tab, "/data") + fstab_disable_part(tab, "/cache");
 | 
			
		||||
    if(disable_res != 0)
 | 
			
		||||
    int disable_sys = fstab_disable_parts(tab, "/system");
 | 
			
		||||
    int disable_data = fstab_disable_parts(tab, "/data");
 | 
			
		||||
    int disable_cache = fstab_disable_parts(tab, "/cache");
 | 
			
		||||
 | 
			
		||||
    if(disable_sys < 0 || disable_data < 0 || disable_cache < 0)
 | 
			
		||||
    {
 | 
			
		||||
#if MR_DEVICE_HOOKS >= 4
 | 
			
		||||
        if(!mrom_hook_allow_incomplete_fstab())
 | 
			
		||||
@@ -1304,7 +1307,7 @@ int multirom_process_android_fstab(char *fstab_name, int has_fw, struct fstab_pa
 | 
			
		||||
 | 
			
		||||
    if(has_fw)
 | 
			
		||||
    {
 | 
			
		||||
        struct fstab_part *p = fstab_find_by_path(tab, "/firmware");
 | 
			
		||||
        struct fstab_part *p = fstab_find_first_by_path(tab, "/firmware");
 | 
			
		||||
        if(p)
 | 
			
		||||
        {
 | 
			
		||||
            *fw_part = fstab_clone_part(p);
 | 
			
		||||
@@ -1545,7 +1548,7 @@ int multirom_get_bootloader_cmdline(struct multirom_status *s, char *str, size_t
 | 
			
		||||
            *c = ' ';
 | 
			
		||||
 | 
			
		||||
    // Remove the part from boot.img
 | 
			
		||||
    boot = fstab_find_by_path(s->fstab, "/boot");
 | 
			
		||||
    boot = fstab_find_first_by_path(s->fstab, "/boot");
 | 
			
		||||
    if(boot && libbootimg_load_header(&hdr, boot->device) >= 0)
 | 
			
		||||
    {
 | 
			
		||||
        l = (char*)hdr.cmdline;
 | 
			
		||||
@@ -2029,7 +2032,11 @@ int multirom_replace_aliases_cmdline(char **s, struct rom_info *i, struct multir
 | 
			
		||||
 | 
			
		||||
    struct fstab_part *data_part = NULL;
 | 
			
		||||
    if(!rom->partition)
 | 
			
		||||
        data_part = fstab_find_by_path(status->fstab, "/data");
 | 
			
		||||
    {
 | 
			
		||||
        // FIXME: might have wrong fs type, because of those "multi-fs" bullshit fstabs
 | 
			
		||||
        // with multiple entries for /data
 | 
			
		||||
        data_part = fstab_find_first_by_path(status->fstab, "/data");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    char *buff = mzalloc(4096);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user