+(define (check-luks-device md)
+ "Ensure the source of MD is valid."
+ (let ((source (mapped-device-source md)))
+ (or (not (uuid? source))
+ (not (zero? (getuid)))
+ (find-partition-by-luks-uuid (uuid-bytevector source))
+ (raise (condition
+ (&message
+ (message (format #f (G_ "no LUKS partition with UUID '~a'")
+ (uuid->string source))))
+ (&error-location
+ (location (source-properties->location
+ (mapped-device-location md)))))))))
+