2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-07-21 11:51:10 +00:00

Merge pull request #1037 from xuweibj/WWNC

Get correct WWN and PATH values in getinstdisk
This commit is contained in:
Victor Hu
2016-05-05 10:52:22 -04:00

View File

@@ -18,11 +18,11 @@
#-----------------------------------------------------------
install_disk=""
rm /tmp/install_disk
rm -f /tmp/install_disk
tmpdir="/tmp/xcat.getinstalldisk"
mkdir -p $tmpdir
has_awk=$(find / -name "awk")
has_awk=$(find /usr/* -name "awk")
utolcmd="sed -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
@@ -133,10 +133,10 @@ if [ -z "$install_disk" ]; then
for disk in $disks; do
# Get disk's information: WWN, PATH and DRIVER
disk_info=$(udevadm info --query=property --name=$disk)
output_for_wwn=$(echo $disk_info | grep '\<ID_WWN\>' | cut -d "=" -f2 | $utolcmd)
disk_wwn=$(IFS= ;echo $output_for_wwn)
output_for_path=$(echo $disk_info | grep DEVPATH | cut -d "=" -f2 | $utolcmd)
disk_path=$(IFS= ;echo $output_for_path)
output_for_wwn=$(IFS= ;echo $disk_info | grep '\<ID_WWN\>' | cut -d "=" -f2)
disk_wwn=$(echo $output_for_wwn | $utolcmd)
output_for_path=$(IFS= ;echo $disk_info | grep DEVPATH | cut -d "=" -f2)
disk_path=$(echo $output_for_path | $utolcmd)
disk_driver=$(udevadm info --attribute-walk --name=$disk | grep DRIVERS| grep -v '""'| grep -v '"sd"'|
\head -n 1| sed -e 's/[^"]*"//' -e 's/"//' | $utolcmd)