Merge lp:~dmj726/ubiquity/nvme-fix into lp:ubiquity

Proposed by David Jordan
Status: Merged
Approved by: Mathieu Trudel-Lapierre
Approved revision: 6454
Merged at revision: 6460
Proposed branch: lp:~dmj726/ubiquity/nvme-fix
Merge into: lp:ubiquity
Diff against target: 13 lines (+2/-2)
1 file modified
ubiquity/misc.py (+2/-2)
To merge this branch: bzr merge lp:~dmj726/ubiquity/nvme-fix
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve
Review via email: mp+299596@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

are you using legacy boot with nmve drive, instead of UEFI?

Revision history for this message
David Jordan (dmj726) wrote :

On some models, we use legacy boot, yes. UEFI works fine with or without the patch in our testing.
It's necessary to use legacy boot on certain motherboards and on computers that may have RAID cards installed. We are able to image the systems fine with our internal tooling, but should our customers need to install Ubuntu themselves, it's important that the experience be as hassle-free and easy as possible.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

It's a good idea to properly handle NVMe devices anyway; I'm merging this and ajusting the regex along the way to *add* nvme rather than extend the [a-z]+ part.

NVMe devices may be formatted either as the character device (nvme0) in which case they probably ought not to be touched by ubiquity (and won't be caught by my proposed regex) since this is for the default device for grub;

Or they may be the namespaced device nodes (nvme*n*) which ought to be handled correctly as block devices, on top of which there would be a "p*" for the partitions.

Final regex would now be:

            target = re.sub(r'(/dev/(cciss|ida)/c[0-9]d[0-9]|/dev/[a-z]+|\
                            /dev/nvme[0-9]+n[0-9]+).*', r'\1', target)

review: Approve
Revision history for this message
David Jordan (dmj726) wrote :

I just tested the new code, and your updated regex still breaks the installation in exactly the same way as before.
The portion of the regex that reads '/dev/[a-z]+' truncates the target to '/dev/nvme' before it gets to the bit you added. You should be able to use the following:

            target = re.sub(r'(/dev/(cciss|ida)/c[0-9]d[0-9]|/dev/nvme[0-9]+n[0-9]+\
                            |/dev/[a-z]+).*', r'\1', target)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubiquity/misc.py'
2--- ubiquity/misc.py 2016-04-21 15:10:43 +0000
3+++ ubiquity/misc.py 2016-07-08 18:50:42 +0000
4@@ -374,8 +374,8 @@
5 else:
6 # Try the next disk along (which can't also be the CD source).
7 target = os.path.realpath(devices[1].split('\t')[1])
8- target = re.sub(r'(/dev/(cciss|ida)/c[0-9]d[0-9]|/dev/[a-z]+).*',
9- r'\1', target)
10+ target = re.sub(r'(/dev/(cciss|ida)/c[0-9]d[0-9]|\
11+ /dev/(?!nvme)[a-z]+).*', r'\1', target)
12 except (IndexError, OSError):
13 pass
14

Subscribers

People subscribed via source and target branches

to status/vote changes: