mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-27 06:54:00 +00:00
RockPro64: allow PCIe NVMe internal SSD (#185)
The RockPro64 board has a PCIe slot that can be used with a slim NVMe M.2 SSD drive. This makes attaching an external drive unnecessary and can allow for a nice compact form factor. The partition naming scheme is a bit different. While on regular USB drives partitions are called e.g. /dev/sda1, on an NVMe drive the partition is called /dev/nvme0n1p1 (note the appendix 'p1' instead of '1') This commit extends the script 'mount_drive.tcl' to * recognize blockdevices starting with 'nvme' in findBlockDevices() * use the variable $blockPartition in createMyNodeFsOnBlockDevice() to allow for the different partition naming scheme
This commit is contained in:
parent
5b3a4037ac
commit
bb3a9714a7
|
@ -40,7 +40,7 @@ proc findBlockDevices {hardDrivesName} {
|
||||||
set hardDrives {}
|
set hardDrives {}
|
||||||
|
|
||||||
foreach dev $devs {
|
foreach dev $devs {
|
||||||
if [regexp "sd.*|hd.*|vd.*" $dev] {
|
if [regexp "sd.*|hd.*|vd.*|nvme.*" $dev] {
|
||||||
lappend hardDrives $dev
|
lappend hardDrives $dev
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,12 +71,18 @@ proc createMyNodeFsOnBlockDevice {blockDevice} {
|
||||||
runCommand /usr/bin/format_drive.sh ${blockDevice}
|
runCommand /usr/bin/format_drive.sh ${blockDevice}
|
||||||
after 5000
|
after 5000
|
||||||
|
|
||||||
puts "Formatting new partition ${blockDevice}1"
|
if [regexp "nvme.*" $blockDevice] {
|
||||||
runCommand mkfs.ext4 -F -L myNode /dev/${blockDevice}1
|
set blockPartition ${blockDevice}p1
|
||||||
|
} else {
|
||||||
|
set blockPartition ${blockDevice}1
|
||||||
|
}
|
||||||
|
|
||||||
runCommand mount /dev/${blockDevice}1 /mnt/hdd -o errors=continue
|
puts "Formatting new partition ${blockPartition}"
|
||||||
|
runCommand mkfs.ext4 -F -L myNode /dev/${blockPartition}
|
||||||
|
|
||||||
|
runCommand mount /dev/${blockPartition} /mnt/hdd -o errors=continue
|
||||||
runCommand date >/mnt/hdd/.mynode
|
runCommand date >/mnt/hdd/.mynode
|
||||||
runCommand echo /dev/${blockDevice}1 > /tmp/.mynode_drive
|
runCommand echo /dev/${blockPartition} > /tmp/.mynode_drive
|
||||||
}] {
|
}] {
|
||||||
puts "Formatting on ${blockDevice} failed: $::errorInfo"
|
puts "Formatting on ${blockDevice} failed: $::errorInfo"
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user