mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-11-25 22:28:32 +01:00
Added support for detecting main disk in cloud version
This commit is contained in:
@@ -66,8 +66,6 @@ type Partition struct {
|
|||||||
UsageStat UsageStat `json:"usage_stat"`
|
UsageStat UsageStat `json:"usage_stat"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const mainDiskID = "mmcblk0"
|
|
||||||
|
|
||||||
// GetDevices : Returns a list of all available sotrage devices in structs filled with information
|
// GetDevices : Returns a list of all available sotrage devices in structs filled with information
|
||||||
func GetDevices() []Device {
|
func GetDevices() []Device {
|
||||||
|
|
||||||
@@ -82,6 +80,14 @@ func GetDevices() []Device {
|
|||||||
firstDevice := true
|
firstDevice := true
|
||||||
currentDeviceInUseFlag := false
|
currentDeviceInUseFlag := false
|
||||||
|
|
||||||
|
mainDiskID := "sda"
|
||||||
|
|
||||||
|
if diagnostics.Version == "prod" || diagnostics.Version == "dev" {
|
||||||
|
mainDiskID = "mmcblk0"
|
||||||
|
} else if diagnostics.Version == "cloud" {
|
||||||
|
mainDiskID = "vda"
|
||||||
|
}
|
||||||
|
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
// 1 Device is represented here. Extract words in order for filling a Device struct
|
// 1 Device is represented here. Extract words in order for filling a Device struct
|
||||||
// Example deviceRawInfo: "mmcblk0 179:0 0 29.7G 0 disk"
|
// Example deviceRawInfo: "mmcblk0 179:0 0 29.7G 0 disk"
|
||||||
|
|||||||
Reference in New Issue
Block a user