diff -Nru hw-detect-1.117ubuntu7/Makefile hw-detect-1.117ubuntu8/Makefile --- hw-detect-1.117ubuntu7/Makefile 2019-03-22 17:24:15.000000000 -0400 +++ hw-detect-1.117ubuntu8/Makefile 2020-02-25 04:20:32.000000000 -0500 @@ -85,10 +85,14 @@ $(INSTALL) ethdetect.sh $(bindir)/ethdetect $(INSTALL) -m644 devnames-static.gz $(netdir)/ -install-disk-detect: disk-detect.sh +install-disk-detect: disk-detect.sh install-discover-remapped-nvme $(INSTALL) -d $(bindir) $(INSTALL) disk-detect.sh $(bindir)/disk-detect +install-discover-remapped-nvme: discover-remapped-nvme.sh + $(INSTALL) -d $(bindir) + $(INSTALL) discover-remapped-nvme.sh $(bindir)/discover-remapped-nvme + install-driver-injection-disk-detect: driver-injection-disk.sh $(INSTALL) -d $(bindir) $(INSTALL) driver-injection-disk.sh $(bindir)/driver-injection-disk diff -Nru hw-detect-1.117ubuntu7/debian/changelog hw-detect-1.117ubuntu8/debian/changelog --- hw-detect-1.117ubuntu7/debian/changelog 2019-03-22 17:24:15.000000000 -0400 +++ hw-detect-1.117ubuntu8/debian/changelog 2020-02-25 04:20:32.000000000 -0500 @@ -1,3 +1,13 @@ +hw-detect (1.117ubuntu8) focal; urgency=medium + + * Add Intel RAID/RST detection with NVMe devices to the installer + - disk-detect.templates: add option 'disk-detect/activate_remapped_nvme' + for preseeding. + - discover-remapped-nvme.sh: detect NVMe devices with + 'disk-detect/activate_remapped_nvme=true'. + + -- Hsieh-Tseng Shen Tue, 25 Feb 2020 04:20:32 -0500 + hw-detect (1.117ubuntu7) eoan; urgency=medium * Add iSCSI iBFT support to the installer (LP: #1817321) diff -Nru hw-detect-1.117ubuntu7/debian/disk-detect.templates hw-detect-1.117ubuntu8/debian/disk-detect.templates --- hw-detect-1.117ubuntu7/debian/disk-detect.templates 2019-03-22 17:24:15.000000000 -0400 +++ hw-detect-1.117ubuntu8/debian/disk-detect.templates 2020-02-25 04:18:06.000000000 -0500 @@ -61,3 +61,10 @@ Description: for internal use; can be preseeded Check for the presence of iSCSI devices with the iSCSI Boot Firmware Table (iBFT)? + +Template: disk-detect/activate_remapped_nvme +Type: boolean +Default: false +Description: Activate NVMe devices under Intel RAID mode? + Check for the presence of NVMe devices with + Intel RAID mode enabled? diff -Nru hw-detect-1.117ubuntu7/discover-remapped-nvme.sh hw-detect-1.117ubuntu8/discover-remapped-nvme.sh --- hw-detect-1.117ubuntu7/discover-remapped-nvme.sh 1969-12-31 19:00:00.000000000 -0500 +++ hw-detect-1.117ubuntu8/discover-remapped-nvme.sh 2020-02-25 04:20:32.000000000 -0500 @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e +. /usr/share/debconf/confmodule +#set -x + +if [ "$(uname)" != Linux ]; then + exit 0 +fi + +# Detect if Intel RAID/RST mode is activated as NVMe devices are remapped to AHCI +remapped_nvme_probe() { + for ahci_device in /sys/module/ahci/drivers/pci\:ahci/*/remapped_nvme + do + ref_count="$(cat "$ahci_device")" + if [ "$ref_count" -ge 1 ]; then + logger -t detected-detect "Intel RAID/RST mode detected." + db_set disk-detect/activate_remapped_nvme true + break + else + logger -t detected-detect "No Intel RAID/RST mode detected." + fi + done + return 0 +} + +remapped_nvme_probe