avatar
keleg has added 7b53bfe5b4
add NvmeSSD support
view file @ 7b53bfe5b4
... ... --- a/perl-install/check_min_sys_requirements.pm
... ... +++ b/perl-install/check_min_sys_requirements.pm
... ... @@ -30,7 +30,7 @@ sub total_mem_size() {
30 30
}
31 31
32 32
sub total_hdds_size {
33
    my @output = `fdisk -l| grep "/dev/sd.:\\|/dev/hd.:\\|/dev/vd.:\\|/dev/mmcblk.:"`;
33
    my @output = `fdisk -l| grep "/dev/sd.:\\|/dev/hd.:\\|/dev/vd.:\\|/dev/mmcblk.:\\|/dev/nvme.n.:"`;
34 34
    my $hdds;
35 35
    my $rounded;
36 36
    my $str;
view file @ 7b53bfe5b4
... ... --- a/perl-install/detect_devices.pm
... ... +++ b/perl-install/detect_devices.pm
... ... @@ -33,7 +33,8 @@ sub get() {
33 33
    #- 2. The first SCSI device if SCSI exists. Or
34 34
    #- 3. The first RAID device if RAID exists.
35 35
36
    getIDE(), getSCSI(), getMmcBlk(), getXenBlk(), getVirtIO(), getDAC960(), getCompaqSmartArray(), getATARAID();
36
    getIDE(), getSCSI(), getNvme(), getMmcBlk(), getXenBlk(), getVirtIO(), getDAC960(), getCompaqSmartArray(), getATARAID();
37
 }
37 38
}
38 39
sub hds()         { grep { may_be_a_hd($_) } get() }
39 40
sub tapes()       { grep { $_->{media_type} eq 'tape' } get() }
... ... @@ -409,6 +410,14 @@ sub getMmcBlk() {
410 410
    } glob("/sys/bus/mmc/devices/*/block/*");
411 411
}
412 412
413
sub getNvme() {
414
    -d '/sys/bus/pci/drivers/nvme' or return;
415
    map {
416
        my $d = basename($_);
417
        { device => $d, info => "NVM Express [$d]", media_type => 'hd', bus => 'nvme' };
418
    } glob("/sys/block/nvme*n*");
419
}
420
413 421
# cpu_name : arch() =~ /^alpha/ ? "cpu	" :
414 422
# arch() =~ /^ppc/ ? "processor" : "vendor_id"
415 423

Comments