From 08c29357bff4a6078d258b34da831b277c1be0d8 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 2 Mar 2018 15:42:15 -0500 Subject: [PATCH] Update getinstdisk to better handle M.2/ahci devices --- xCAT-server/share/xcat/install/scripts/getinstdisk | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index 615d316e2..2e3ab1061 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -149,14 +149,22 @@ if [ -z "$install_disk" ]; then 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) - + disk_model=$(udevadm info --attribute-walk --name=$disk | grep {model}|sed -e 's/[^"]*"//' -e 's/"//' -e 's/ *$//'| $utolcmd) echo "[get_install_disk]The disk $disk information: " echo "[get_install_disk] disk_wwn=$disk_wwn" echo "[get_install_disk] disk_path=$disk_path" echo "[get_install_disk] disk_driver=$disk_driver" # Check whether there is WWN, PATH information - if [ "$disk_wwn" ]; then + if [ "$disk_model" == "thinksystem m.2" ]; then + echo "$disk $disk_data" > "$tmpfile""$file_pre""firstchoicedisks" + echo "[get_install_disk] Add disk: $disk $disk_data into $file_pre firstchoicedisks" + break # M.2 raid modules are the OS install targets + elif [ "$disk_driver" == "ahci" ]; then + echo "$disk $disk_data" >> "$tmpfile""$file_pre""firstchoicedisks" + echo "[get_install_disk] Add disk: $disk $disk_data into $file_pre firstchoicedisks" + continue + elif [ "$disk_wwn" ]; then has_wwn=1 file_pre="wwn" disk_data=$disk_wwn