From dc1e827ccedda41b3e87a24aa7ff48fda3263b9d Mon Sep 17 00:00:00 2001 From: Huamin Chen Date: Thu, 28 Jun 2018 21:07:41 -0400 Subject: [PATCH] get partlabel from udev info PARTNAME Signed-off-by: Huamin Chen --- pkg/util/sys/device.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/util/sys/device.go b/pkg/util/sys/device.go index 7bbbaddaf..a2d0421a2 100644 --- a/pkg/util/sys/device.go +++ b/pkg/util/sys/device.go @@ -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 }