diff -Nru hw-detect-1.117ubuntu6/debian/changelog hw-detect-1.117ubuntu7.18.04.1/debian/changelog --- hw-detect-1.117ubuntu6/debian/changelog 2018-02-15 10:27:37.000000000 -0200 +++ hw-detect-1.117ubuntu7.18.04.1/debian/changelog 2019-03-22 18:24:15.000000000 -0300 @@ -1,3 +1,11 @@ +hw-detect (1.117ubuntu7.18.04.1) bionic; urgency=medium + + * Add iSCSI iBFT support to the installer (LP: #1817321) + - disk-detect.templates: add option 'disk-detect/ibft/enable' for preseeding. + - disk-detect.sh: detect iSCSI iBFT disks with 'disk-detect/ibft/enable=true'. + + -- Mauricio Faria de Oliveira Fri, 22 Mar 2019 18:24:15 -0300 + hw-detect (1.117ubuntu6) bionic; urgency=medium * Drop hw-detect.pre-pkgsel.d/20install-hwpackages, as it installs diff -Nru hw-detect-1.117ubuntu6/debian/disk-detect.templates hw-detect-1.117ubuntu7.18.04.1/debian/disk-detect.templates --- hw-detect-1.117ubuntu6/debian/disk-detect.templates 2016-04-14 10:15:48.000000000 -0300 +++ hw-detect-1.117ubuntu7.18.04.1/debian/disk-detect.templates 2019-03-22 18:15:48.000000000 -0300 @@ -54,3 +54,10 @@ Template: disk-detect/iscsi_choice Type: text _Description: login to iSCSI targets + +Template: disk-detect/ibft/enable +Type: boolean +Default: false +Description: for internal use; can be preseeded + Check for the presence of iSCSI devices with + the iSCSI Boot Firmware Table (iBFT)? diff -Nru hw-detect-1.117ubuntu6/disk-detect.sh hw-detect-1.117ubuntu7.18.04.1/disk-detect.sh --- hw-detect-1.117ubuntu6/disk-detect.sh 2017-03-27 22:22:19.000000000 -0300 +++ hw-detect-1.117ubuntu7.18.04.1/disk-detect.sh 2019-03-22 18:15:48.000000000 -0300 @@ -123,6 +123,34 @@ fi } +iscsi_ibft_probe() { + + if is_not_loaded iscsi_ibft; then + depmod -a >/dev/null 2>&1 || true + module_probe iscsi_ibft || true + fi + + if ! log-output -t disk-detect iscsistart -f; then + logger -t disk-detect "Error: iBFT information not found" + return 1 + fi + + if ! log-output -t disk-detect iscsistart -N; then + logger -t disk-detect "Error: iBFT network configuration failed" + return 1 + fi + + if ! log-output -t disk-detect iscsistart -b; then + logger -t disk-detect "Error: iBFT login failed" + return 1 + fi + + # Done + update-dev --settle + logger -t disk-detect "iBFT disk detection finished." + return 0 +} + # Load SCSI device handlers before SCSI low-level device drivers. # (attached on SCSI scan; handle some I/O errors more gracefully) depmod -a >/dev/null 2>&1 @@ -156,6 +184,12 @@ db_capb fi +# Activate support for iSCSI iBFT +db_get disk-detect/ibft/enable +if [ "$RET" = true ]; then + iscsi_ibft_probe || true +fi + while ! disk_found; do CHOICES_C="" CHOICES=""