Chameleon

Chameleon Svn Source Tree

Root/branches/blackosx/package/Scripts/Install/UnMountEFIvolumes.sh

  • Property svn:executable set to *
1#!/bin/bash
2
3echo "==============================================="
4echo "Unmount all volumes named EFI"
5echo "*****************************"
6
7# loop through and un-mount ALL mounted EFI system partitions - Thanks kizwan
8
9# Receives scriptDir: The location of the main script dir.
10# Receives targetVolumeTemp: Stores original target if EFI install selected.
11
12if [ "$#" -eq 2 ]; then
13targetVolumeTemp="$1"
14scriptDir="$2"
15echo "DEBUG: passed argument for targetVolumeTemp = $targetVolumeTemp"
16echo "DEBUG: passed argument for scriptDir = $scriptDir"
17else
18echo "Error - wrong number of values passed"
19exit 9
20fi
21
22
23attempts=1
24while [ "$( df | grep EFI )" ] && [ "${attempts}" -lt 5 ]; do
25echo "Unmounting $( df | grep EFI | awk '{print $1}' )"
26umount -f $( df | grep EFI | awk '{print $1}' )
27attempts=$(( ${attempts} + 1 ))
28done
29if [ ${attempts} = 5 ]; then
30echo "failed to unmount EFI System Partition."
31echo "-----------------------------------------------"
32"$scriptDir"InstallLog.sh "${targetVolumeTemp}" "Failed to unmount EFI System Partition."
33echo ""
34echo ""
35echo ""
36exit 1
37fi
38
39echo "-----------------------------------------------"
40echo ""
41echo ""
42echo ""
43
44exit 0
45
46
47
48

Archive Download this file

Revision: 1542