TT#42457 No longer explicitly check for supported disks

The hardcoded list of accepted drives is never really up2date
and was meant as a safety net in the beginnings of deployment.sh.
Let's drop those checks to avoid failures in automated installations,
interactive installer/deployment mode is supposed to prompt for
before actually executing anything anyway.

Change-Id: Ib6dcaec8a221dc268638a98055219a5ae3c92a00
changes/89/22889/2
Michael Prokop 7 years ago
parent 83197ef669
commit 3392a1c6db

@ -938,93 +938,6 @@ if "$PRO_EDITION" ; then
fi
fi
set_deploy_status "diskverify"
# TODO - hardcoded for now, to avoid data damage
check_for_supported_disk() {
if grep -q 'ServeRAID' "/sys/block/${DISK}/device/model" ; then
return 0
fi
# IBM System x3250 M3
if grep -q 'Logical Volume' "/sys/block/${DISK}/device/model" && \
grep -q "LSILOGIC" "/sys/block/${DISK}/device/vendor" ; then
return 0
fi
# IBM System HS23 LSISAS2004
if grep -q 'Logical Volume' "/sys/block/${DISK}/device/model" && \
grep -q "LSI" "/sys/block/${DISK}/device/vendor" ; then
return 0
fi
# PERC H700, PERC H710,...
if grep -q 'PERC' "/sys/block/${DISK}/device/model" && \
grep -q "DELL" "/sys/block/${DISK}/device/vendor" ; then
return 0
fi
local disk_model
disk_model=$(cat "/sys/block/${DISK}/device/model") || true
local disk_vendor
disk_vendor=$(cat "/sys/block/${DISK}/device/vendor") || true
echo "WARNING: Cannot detect supported device vendor/model." >&2
echo "(Disk: ${DISK} Vendor: ${disk_vendor} Model: ${disk_model})" >&2
echo "Would you like to continue anyway? (yes/NO)" >&2
read -r a
case "${a,,}" in
y|yes)
echo "Continue anyway as requested."
return 0
;;
*)
echo "Aborting installation using disk '${DISK}'" >&2
return 1
;;
esac
unset a
# no match so far?
return 1
}
# run in according environment only
if [ -n "$TARGET_DISK" ] ; then
echo "Skipping check for supported disk as TARGET_DISK variable is set."
else
imvirt_output="$(imvirt 2>/dev/null)"
if [[ "${imvirt_output}" == "Physical" ]] ; then
if ! check_for_supported_disk ; then
die "Error: /dev/${DISK} does not look like a VirtIO, ServeRAID, LSILOGIC or PowerEdge disk/controller. Exiting to avoid possible data damage."
fi
else
if [[ "${DISK}" == "vda" ]] && readlink -f /sys/block/vda/device | grep -q 'virtio' ; then
echo "Looks like a virtio disk, ok."
elif grep -q 'QEMU HARDDISK' "/sys/block/${DISK}/device/model" ; then
echo "Looks like a QEMU harddisk, ok."
elif grep -q 'VBOX HARDDISK' "/sys/block/${DISK}/device/model" ; then
echo "Looks like a VBOX harddisk, ok."
elif grep -q 'Virtual disk' "/sys/block/${DISK}/device/model" && [[ "${imvirt_output}" == "VMware ESX Server" ]] ; then
echo "Looks like a VMware ESX Server harddisk, ok."
elif [[ "${imvirt_output}" == 'Microsoft Hyper-V' ]] ; then
echo "Looks like a Hyper-V harddisk, ok."
else
echo "Looks like running on some virtualized system: '${imvirt_output}'"
if "${INTERACTIVE}" ; then
echo "Run anyway? y/N"
read -r a
if [[ "${a,,}" != "y" ]] ; then
die "Exiting as requested."
fi
unset a
fi
fi
fi
fi
# relevant only while deployment, will be overridden later
if [ -n "$HOSTNAME" ] ; then
cat > /etc/hosts << EOF

Loading…
Cancel
Save