2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-24 20:20:33 +00:00

Merge pull request #1058 from xuweibj/I1048

Fix issue #1048, Resolve or clean up minor issues on getinstdisk
This commit is contained in:
Victor Hu
2016-06-08 19:46:00 -04:00

View File

@@ -27,7 +27,7 @@ has_awk=$(find /usr/* -name "awk")
utolcmd="sed -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
tmpfile=$tmpdir"/getinstalldisk_"
tmpfile="$tmpdir/getinstalldisk_"
if [ -z "$install_disk" ]; then
@@ -108,7 +108,7 @@ if [ -z "$install_disk" ]; then
break
done
umount $mount_dir || echo "[get_install_disk] $partition umount failed."
umount -l $mount_dir || echo "[get_install_disk] $partition umount failed."
else
echo "[get_install_disk] Partition $partition mount failed or the partition is swap."
fi
@@ -123,8 +123,11 @@ if [ -z "$install_disk" ]; then
fi
rmdir $mount_dir;
rm $tmpfile*;
for file in $tmpfile*; do
rm $file;
done
has_wwn=0
has_path=0
file_pre=""
@@ -195,8 +198,11 @@ if [ -z "$install_disk" ]; then
if [ "$install_file" ] && [ -s $install_file ]; then
install_disk=/dev/$(cat $install_file | grep -v "^$" | sort -k 2 -b | cut -d " " -f1 | head -n 1)
echo "[get_install_disk]The install_disk is $install_disk by sorting $file_pre and DRIVER."
fi
rm $tmpfile*;
fi
for file in $tmpfile*; do
rm $file;
done
fi
rm -rf $tmpdir;