fix(script): Differentiate between device path with and without /dev prefix
This commit is contained in:
		@@ -15,12 +15,15 @@ if [[ "$(<<<"${boot_fs}" wc -l)" -gt '1' ]]; then
 | 
				
			|||||||
    exit 1
 | 
					    exit 1
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
boot_disk="$(lsblk --output 'NAME' --json --tree | jq --raw-output '.[][] | select(.children | length > 0) | select(.children[].name=="'"${boot_fs}"'") | .name')"
 | 
					boot_fs_name="$(basename "${boot_fs}")"
 | 
				
			||||||
 | 
					boot_disk="$(lsblk --output 'NAME' --json --tree | jq --raw-output '.[][] | select(.children | length > 0) | select(.children[].name=="'"${boot_fs_name}"'") | .name')"
 | 
				
			||||||
if [[ ! "${boot_disk}" ]]; then
 | 
					if [[ ! "${boot_disk}" ]]; then
 | 
				
			||||||
    # There's no parent drive over "${boot_fs}" meaning "${boot_fs}" itself
 | 
					    # There's no parent drive over "${boot_fs}" meaning "${boot_fs}" itself
 | 
				
			||||||
    # already is the parent. This is a file system on a drive and not on a
 | 
					    # already is the parent. This is a file system on a drive and not on a
 | 
				
			||||||
    # partition.
 | 
					    # partition.
 | 
				
			||||||
    boot_disk="${boot_fs}"
 | 
					    boot_disk="${boot_fs}"
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					    boot_disk='/dev/'"${boot_disk}"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
find "${boot_dir}" -type f -iname '*.c32' -delete
 | 
					find "${boot_dir}" -type f -iname '*.c32' -delete
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user