jaypipes / ghw

Go HardWare discovery/inspection library
Apache License 2.0
1.62k stars 174 forks source link

Get partition labels from udev #304

Closed Itxaka closed 2 years ago

Itxaka commented 2 years ago

This mainly reuses the udevInfo method to obtain the udev info for a given partition in a given disk instead of having the label value always empty.

This separates the udevInfo method into 2 distinct methods, one for disk and one for partition.

This also opens the possibility of obtaining more info for partitions, i.e. the FS of an unmounted partition.

Signed-off-by: Itxaka igarcia@suse.com

ffromani commented 2 years ago

thanks @Itxaka , looks good! any chance to add unit tests to cover this change?

Itxaka commented 2 years ago

Sure!

Itxaka commented 2 years ago

@fromanirh tests added :)

jaypipes commented 2 years ago

@Itxaka thanks very much for your contribution! really appreciated! :)