mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Fix: Uniquely determine the mount point in GetDevice
This commit is contained in:
@@ -1039,13 +1039,10 @@ ShowDeviceWarning() {
|
|||||||
} # ShowDeviceWarning
|
} # ShowDeviceWarning
|
||||||
|
|
||||||
GetDevice() {
|
GetDevice() {
|
||||||
TestPath=$(findmnt "$1" | awk -F" " '/\/dev\// {print $2"\t"$3}')
|
if TestPath=$(findmnt --noheadings --output SOURCE,FSTYPE --target "$1" --uniq); then
|
||||||
if [[ -z ${TestPath} && -n "${1%/*}" ]]; then
|
|
||||||
GetDevice "${1%/*}"
|
|
||||||
elif [[ -z ${TestPath} && -z "${1%/*}" ]]; then
|
|
||||||
findmnt / | awk -F" " '/\/dev\// {print $2"\t"$3}'
|
|
||||||
else
|
|
||||||
echo "${TestPath}"
|
echo "${TestPath}"
|
||||||
|
else
|
||||||
|
echo "Bud Path: $1" >&2; exit 1
|
||||||
fi
|
fi
|
||||||
} # GetDevice
|
} # GetDevice
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user