[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#785149: grub-installer: NVMe boot drives not supported



Package: debian-installer
Version: 20150422
Severity: critical
Tags: d-i patch
Justification: breaks the whole system

Dear Maintainer,

I used the Jessie DVD installer on a system with an NVMe SSD add-in-card (PCIe) that I wanted to make bootable, but there were two problems that halted the process:

1. In the install-the-base-system step, the initial ram disk creation step failed because it couldn't translate the nvme device name (nvme0n1p3) to the base name (nvme0n1).
2. In the boot loader installation step, the boot loader installation script again couldn't translate nvme0n1p3 to nvme0n1.

I reported #1, with a patch, at <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=785147>.

When I modified grub-installer to work with my NVMe disk, I missed the fact that it wasn't installed on permanent media, so I lost those changes.  The attached patch is my attempt at reconstructing what worked for me, so *please bear in mind that I have not tested it*.  One additional note: since I use the Linux kernel, my patch does not change the "hurd_convert" function, and looking at it, I'm guessing it should be modified too.

Steve Rowe

-- System Information:
Debian Release: 8.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.0.2 (SMP w/16 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
--- grub-installer-1.117/grub-installer	2015-01-12 23:01:14.000000000 -0500
+++ grub-installer-1.117/grub-installer.fixed	2015-05-12 15:13:49.002358498 -0400
@@ -134,7 +134,7 @@
 # This should probably be rewritten using udevadm or similar.
 device_to_disk () {
 	echo "$1" | \
-		sed 's:\(/dev/\(cciss\|ida\|rs\)/c[0-9]d[0-9][0-9]*\|/dev/mmcblk[0-9]\|/dev/\(ad\|ada\|da\)[0-9]\+\|/dev/[hs]d[0-9]\+\|/dev/[a-z]\+\).*:\1:'
+		sed 's:\(/dev/nvme[0-9]n[0-9]\|/dev/\(cciss\|ida\|rs\)/c[0-9]d[0-9][0-9]*\|/dev/mmcblk[0-9]\|/dev/\(ad\|ada\|da\)[0-9]\+\|/dev/[hs]d[0-9]\+\|/dev/[a-z]\+\).*:\1:'
 }
 
 # Run update-grub in $ROOT
@@ -252,7 +252,7 @@
     /dev/mapper)
 	disc_offered_devfs="$bootfs"
 	;;
-    /dev/[hsv]d[a-z0-9]|/dev/xvd[a-z]|/dev/cciss/c[0-9]d[0-9]*|/dev/ida/c[0-9]d[0-9]*|/dev/rs/c[0-9]d[0-9]*|/dev/mmcblk[0-9]|/dev/ad[0-9]*|/dev/da[0-9]*)
+    /dev/nvme[0-9]n[0-9]|/dev/[hsv]d[a-z0-9]|/dev/xvd[a-z]|/dev/cciss/c[0-9]d[0-9]*|/dev/ida/c[0-9]d[0-9]*|/dev/rs/c[0-9]d[0-9]*|/dev/mmcblk[0-9]|/dev/ad[0-9]*|/dev/da[0-9]*)
 	disc_offered_devfs="$prefix"
 	;;
     *)
@@ -895,6 +895,10 @@
 	disk=
 	part=
 	case $1 in
+                /dev/nvme*n*p*)
+			disk="$(echo "$1" | sed 's,\(/dev/nvme[0-9]n[0-9]\).*,\1,')"
+			part="$(echo "$1" | sed 's,/dev/nvme[0-9]n[0-9]\(.*\),\1,')"
+			;;
 		/dev/[vhs]d[a-z]*)
 			disk="$(echo "$1" | sed 's,\(/dev/[a-z]\+\).*,\1,')"
 			part="$(echo "$1" | sed 's,/dev/[a-z]\+\(.*\),\1,')"

Reply to: