get partlabel from udev info PARTNAME
Signed-off-by: Huamin Chen <hchen@redhat.com>
This commit is contained in:
1 parent
3888006b58
commit
dc1e827cce
1 file changed
+3
-1
@@ -97,7 +97,6 @@ func GetDevicePartitions(device string, executor exec.Executor) (partitions []Pa
|
||||
if err != nil {
|
||||
return nil, 0, fmt.Errorf("failed to get device %s partitions. %+v", device, err)
|
||||
}
|
||||
|
||||
partInfo := strings.Split(output, "\n")
|
||||
var deviceSize uint64
|
||||
var totalPartitionSize uint64
|
||||
@@ -126,6 +125,9 @@ func GetDevicePartitions(device string, executor exec.Executor) (partitions []Pa
|
||||
if v, ok := info["ID_PART_ENTRY_NAME"]; ok {
|
||||
p.Label = v
|
||||
}
|
||||
if v, ok := info["PARTNAME"]; ok {
|
||||
p.Label = v
|
||||
}
|
||||
if v, ok := info["ID_FS_TYPE"]; ok {
|
||||
p.Filesystem = v
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user