bug: give up when drive comes up ro

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
pull/8/head
Robert Nelson 13 years ago
parent 7d60627776
commit 75bf195497

@ -990,20 +990,31 @@ function create_custom_netinstall_image {
extract_zimage extract_zimage
} }
function drive_error_ro {
echo "-----------------------------"
echo "Error: for some reason your SD card is not writable..."
echo "Check: is the write protect lever set the locked position?"
echo "Check: do you have another SD card reader?"
echo "-----------------------------"
echo "Script gave up..."
exit
}
function unmount_all_drive_partitions { function unmount_all_drive_partitions {
echo "" echo ""
echo "Unmounting Partitions" echo "Unmounting Partitions"
echo "-----------------------------" echo "-----------------------------"
NUM_MOUNTS=$(mount | grep -v none | grep "$MMC" | wc -l) NUM_MOUNTS=$(mount | grep -v none | grep "$MMC" | wc -l)
for (( c=1; c<=$NUM_MOUNTS; c++ )) for (( c=1; c<=$NUM_MOUNTS; c++ ))
do do
DRIVE=$(mount | grep -v none | grep "$MMC" | tail -1 | awk '{print $1}') DRIVE=$(mount | grep -v none | grep "$MMC" | tail -1 | awk '{print $1}')
umount ${DRIVE} &> /dev/null || true umount ${DRIVE} &> /dev/null || true
done done
parted --script ${MMC} mklabel msdos LC_ALL=C parted --script ${MMC} mklabel msdos | grep "Error:" && drive_error_ro
} }
function uboot_in_boot_partition { function uboot_in_boot_partition {

Loading…
Cancel
Save