2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-12-10 19:19:56 +00:00

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.
This commit is contained in:
Jarrod Johnson
2018-02-01 13:52:15 -05:00
parent f0c881820d
commit ce311f0ab6

View File

@@ -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