From ac14d279c30a4456d18c3f8a92d6b3d76af49a62 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Sun, 21 Apr 2013 22:28:41 +0200 Subject: [PATCH] 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. --- packages/tools/syslinux/files/create_livestick | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/tools/syslinux/files/create_livestick b/packages/tools/syslinux/files/create_livestick index 6029d601fb..84b19c1fe8 100755 --- a/packages/tools/syslinux/files/create_livestick +++ b/packages/tools/syslinux/files/create_livestick @@ -42,7 +42,12 @@ if [ -z "$1" ]; then fi 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 echo "#########################################################"