mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Wrong partition name used for devices ending with numbers
On Linux when a block device ends with a number (like my SD card device: **/dev/mmcblk0**) the first partition is called **/dev/mmcblk0p1** (with an added **p**). This snippet makes sure that the correct partition name is used in both cases.
This commit is contained in:
parent
14e958d5a6
commit
ac14d279c3
@ -42,7 +42,12 @@ if [ -z "$1" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
DISK="$1"
|
DISK="$1"
|
||||||
PART="${DISK}1"
|
|
||||||
|
### If DISK ends with a number, add "p1" instead of "1" for the first partition
|
||||||
|
case "${DISK: -1:1}" in
|
||||||
|
([0-9]) PART="${DISK}p1";;
|
||||||
|
(*) PART="${DISK}1";;
|
||||||
|
esac
|
||||||
|
|
||||||
clear
|
clear
|
||||||
echo "#########################################################"
|
echo "#########################################################"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user