label: move more I/O to device.ml

Signed-off-by: David Scott <dave.scott@eu.citrix.com>