fix(script): Differentiate between device path with and without /dev prefix
This commit is contained in:
parent
31c415e93f
commit
ad85e5b2d2
@ -15,12 +15,15 @@ if [[ "$(<<<"${boot_fs}" wc -l)" -gt '1' ]]; then
|
||||
exit 1
|
||||
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
|
||||
# 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
|
||||
# partition.
|
||||
boot_disk="${boot_fs}"
|
||||
else
|
||||
boot_disk='/dev/'"${boot_disk}"
|
||||
fi
|
||||
|
||||
find "${boot_dir}" -type f -iname '*.c32' -delete
|
||||
|
Loading…
x
Reference in New Issue
Block a user