From 4e799a22428a131dbf28dac3d59e5c454b9e403f Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Thu, 9 Oct 2014 15:14:30 -0500 Subject: [PATCH] bugfix: for some reason Debian Jessie failes to mount on first try.. give it 5 seconds and try again... Signed-off-by: Robert Nelson --- mk_mmc.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/mk_mmc.sh b/mk_mmc.sh index 3dd207c..fa431ef 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -988,13 +988,22 @@ populate_boot () { mkdir -p ${TEMPDIR}/disk fi + #FIXME for some reason debian jessie, this failes now... partprobe ${media} if ! mount -t ${mount_partition_format} ${media_prefix}${media_boot_partition} ${TEMPDIR}/disk; then - echo "-----------------------------" - echo "Unable to mount ${media_prefix}${media_boot_partition} at ${TEMPDIR}/disk to complete populating Boot Partition" - echo "Please retry running the script, sometimes rebooting your system helps." - echo "-----------------------------" - exit + + echo "Mount Failure, trying 2nd time in 5 seconds..." + partprobe ${media} + sync + sleep 5 + + if ! mount -t ${mount_partition_format} ${media_prefix}${media_boot_partition} ${TEMPDIR}/disk; then + echo "-----------------------------" + echo "Unable to mount ${media_prefix}${media_boot_partition} at ${TEMPDIR}/disk to complete populating Boot Partition" + echo "Please retry running the script, sometimes rebooting your system helps." + echo "-----------------------------" + exit + fi fi mkdir -p ${TEMPDIR}/disk/backup || true