From eae48f4813f30c6b00033a0427db2f48301d5c4e Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Thu, 2 Sep 2010 16:18:03 -0500 Subject: [PATCH] remove number of partitions limitation on umount --- mk_mmc.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mk_mmc.sh b/mk_mmc.sh index d554dfc..d96e5fd 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -275,8 +275,13 @@ function cleanup_sd { echo "Umounting Partitions" echo "" - sudo umount ${MMC}${PARTITION_PREFIX}1 &> /dev/null || true - sudo umount ${MMC}${PARTITION_PREFIX}2 &> /dev/null || true +NUM_MOUNTS=$(mount | grep -v none | grep "$MMC" | wc -l) + + for (( c=1; c<=$NUM_MOUNTS; c++ )) + do + DRIVE=$(mount | grep -v none | grep "$MMC" | tail -1 | awk '{print $1}') + sudo umount ${DRIVE} &> /dev/null || true + done sudo parted -s ${MMC} mklabel msdos }