Skip to content

Commit

Permalink
probe: Add check for Software RAID root device
Browse files Browse the repository at this point in the history
Software RAID does not see PARTUUID, so only use UUID.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
  • Loading branch information
mdhorn authored and Leandro Dorileo committed Apr 22, 2020
1 parent e5c4fad commit 453ecff
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/lib/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,18 @@ CbmDeviceProbe *cbm_probe_path(const char *path)
LOG_ERROR("Unable to find UUID for %s: %s", devnode, strerror(errno));
}

/* Lastly check if its a device-mapper device */
/* Check if its a software raid device */
basenom = basename(devnode);
if (strncmp(basenom, "md", 2) == 0) {
LOG_DEBUG("Root device exists on Linux software RAID configuration");
/* Need to use the UUID only */
if (probe.part_uuid) {
free(probe.part_uuid);
probe.part_uuid = NULL;
}
}

/* Lastly check if its a device-mapper device */
if (strncmp(basenom, "dm-", 3) == 0) {
LOG_DEBUG("Root device exists on device-mapper configuration");
probe.luks_uuid = cbm_get_luks_uuid(basenom);
Expand Down

0 comments on commit 453ecff

Please sign in to comment.