* The drive from which the rootfs is mounted is correctly filtered out
  when giving the sd card device options, but this is ignored when
  actually setting up the sd card.
* This can cause the users option to point to the incorrect device.
* This filters out the auto-detected root drive from all operations.

Signed-off-by: Jacob Stiffler <[email protected]>
---
 create-sdcard.sh |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/create-sdcard.sh b/create-sdcard.sh
index ca02ad2..018487a 100644
--- a/create-sdcard.sh
+++ b/create-sdcard.sh
@@ -298,11 +298,11 @@ do
                continue
         fi
 
-       DEVICEDRIVENAME=`cat /proc/partitions | grep -v 'sda' | grep 
'\<sd.\>\|\<mmcblk.\>' | grep -n '' | grep "${DEVICEDRIVENUMBER}:" | awk 
'{print $5}'`
+       DEVICEDRIVENAME=`cat /proc/partitions | grep -v $ROOTDRIVE | grep 
'\<sd.\>\|\<mmcblk.\>' | grep -n '' | grep "${DEVICEDRIVENUMBER}:" | awk 
'{print $5}'`
        if [ -n "$DEVICEDRIVENAME" ]
        then
                DRIVE=/dev/$DEVICEDRIVENAME
-               DEVICESIZE=`cat /proc/partitions | grep -v 'sda' | grep 
'\<sd.\>\|\<mmcblk.\>' | grep -n '' | grep "${DEVICEDRIVENUMBER}:" | awk 
'{print $4}'`
+               DEVICESIZE=`cat /proc/partitions | grep -v $ROOTDRIVE | grep 
'\<sd.\>\|\<mmcblk.\>' | grep -n '' | grep "${DEVICEDRIVENUMBER}:" | awk 
'{print $4}'`
                break
        else
                echo -e "Invalid selection!"
@@ -379,17 +379,17 @@ fi
 
 # Refresh this variable as the device may not be mounted at script 
instantiation time
 # This will always return one more then needed
-NUM_OF_PARTS=`cat /proc/partitions | grep -v 'sda' | grep -c $DEVICEDRIVENAME`
+NUM_OF_PARTS=`cat /proc/partitions | grep -v $ROOTDRIVE | grep -c 
$DEVICEDRIVENAME`
 for ((c=1; c<"$NUM_OF_PARTS"; c++ ))
 do
-        SIZE=`cat /proc/partitions | grep -v 'sda' | grep 
'\<'$DEVICEDRIVENAME$P$c'\>'  | awk '{print $3}'`
+        SIZE=`cat /proc/partitions | grep -v $ROOTDRIVE | grep 
'\<'$DEVICEDRIVENAME$P$c'\>'  | awk '{print $3}'`
         echo "Current size of $DEVICEDRIVENAME$P$c $SIZE bytes"
 done
 
 # check to see if the device is already partitioned
 for ((  c=1; c<5; c++ ))
 do
-       eval "SIZE$c=`cat /proc/partitions | grep -v 'sda' | grep 
'\<'$DEVICEDRIVENAME$P$c'\>'  | awk '{print $3}'`"
+       eval "SIZE$c=`cat /proc/partitions | grep -v $ROOTDRIVE | grep 
'\<'$DEVICEDRIVENAME$P$c'\>'  | awk '{print $3}'`"
 done
 
 PARTITION="0"
-- 
1.7.9.5

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago

Reply via email to