]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
partresize: fix for mmcblk devices.
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 14 Mar 2012 15:46:51 +0000 (16:46 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 14 Mar 2012 15:46:51 +0000 (16:46 +0100)
src/initscripts/init.d/partresize

index 8eddc46c373a456c1661700bd32fad348ba55b26..ae70ff99b85f153e055f2079a6f7acc3009dc8c9 100644 (file)
@@ -24,7 +24,11 @@ case "${1}" in
 
                # Detect device
                ROOT=`mount | grep -m1 " / " | cut -d" " -f1`;
-               DRV=${ROOT::`expr length $ROOT`-1}
+               if [ "${ROOT:`expr length $ROOT`-2:1}" == "p" ]; then
+                       DRV=${ROOT::`expr length $ROOT`-2}
+               else
+                       DRV=${ROOT::`expr length $ROOT`-1}
+               fi
 
                boot_mesg "Change Partition 4 to all free space ..."
                echo -e 'd\n4\nn\np\n4\n\n\nw\nq\n' | fdisk ${DRV}