mirror of
https://github.com/nix-community/disko.git
synced 2024-09-11 06:25:33 +03:00
make device matching regexes a bit stricter
This commit is contained in:
parent
5cbe8fbb48
commit
d0fd785c93
@ -51,11 +51,11 @@ rec {
|
||||
=> "/dev/disk/by-id/xxx-part2"
|
||||
*/
|
||||
deviceNumbering = dev: index:
|
||||
if match "/dev/[vs]d.*" dev != null then
|
||||
if match "/dev/[vs]d.+" dev != null then
|
||||
dev + toString index # /dev/{s,v}da style
|
||||
else if match "/dev/disk/.*" dev != null then
|
||||
else if match "/dev/disk/.+" dev != null then
|
||||
"${dev}-part${toString index}" # /dev/disk/by-id/xxx style
|
||||
else if match "/dev/(nvme|md/|mmcblk).*" dev != null then
|
||||
else if match "/dev/(nvme|md/|mmcblk).+" dev != null then
|
||||
"${dev}p${toString index}" # /dev/nvme0n1p1 style
|
||||
else
|
||||
abort "${dev} seems not to be a supported disk format";
|
||||
|
Loading…
Reference in New Issue
Block a user