From ce311f0ab67aed186c5b2551cdf162e5811bb88e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 1 Feb 2018 13:52:15 -0500 Subject: [PATCH] Add boot nvme support and filter small devices nvme devices were not autosensed as install candidates. Also, devices smaller than 128 MB are filtered out, as they are likely to be some media or similar. --- xCAT-server/share/xcat/install/scripts/getinstdisk | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index fcc517565..20c64f426 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -37,13 +37,19 @@ if [ -z "$install_disk" ]; then # Get all partitions and disks from /proc/partitions file if [ -z "$has_awk" ]; then - entries=$(cat /proc/partitions | sed 's/ */ /g' | cut -d " " -f5 | grep -v "name" | grep -e "[s|h|v]d.*$") + entries=$(cat /proc/partitions | sed 's/ */ /g' | cut -d " " -f5 | grep -v "name" | grep -E '^[s|h|v]d|nvme') else - entries=$(awk -F ' ' '{print $4}' /proc/partitions | grep -v "name" | grep -e "[s|h|v]d.*$") + entries=$(awk -F ' ' '{print $4}' /proc/partitions | grep -v "name" | grep -E '^[s|h|v]d|nvme') fi # Classify entries by DEVTYPE for entry in $entries; do + DEVSIZE=$(udevadm info --attribute-walk --name=$entry|grep size| sed -e 's/[^"]*"//' -e 's/"//'|tail -n 1) + if [ -z "$DEVSIZE" -o $DEVSIZE -lt 262144 ]; then + # ignore small devices, that are likely remote media or similar + continue + fi + if [ -z "$has_awk" ]; then dev_type=$(udevadm info --query=property --name=/dev/$entry | grep -i "DEVTYPE" | cut -d "=" -f2 | $utolcmd) else