|
|
6d1f264 |
From ecb74a38bc511924c7cb17d64b500fade7f1ed23 Mon Sep 17 00:00:00 2001
|
|
|
89d86ed |
From: Richard W.M. Jones <rjones@redhat.com>
|
|
|
89d86ed |
Date: Fri, 22 Jun 2012 10:06:47 +0100
|
|
|
89d86ed |
Subject: [PATCH 15/19] EPEL 5: Fix blkid to return "LVM2_member" for PVs.
|
|
|
89d86ed |
|
|
|
89d86ed |
Old blkid in RHEL 5 didn't return the right thing for PVs.
|
|
|
89d86ed |
---
|
|
|
89d86ed |
daemon/blkid.c | 20 ++++++++++++++++++++
|
|
|
89d86ed |
1 files changed, 20 insertions(+), 0 deletions(-)
|
|
|
89d86ed |
|
|
|
89d86ed |
diff --git a/daemon/blkid.c b/daemon/blkid.c
|
|
|
89d86ed |
index 7cc7889..32168a3 100644
|
|
|
89d86ed |
--- a/daemon/blkid.c
|
|
|
89d86ed |
+++ b/daemon/blkid.c
|
|
|
89d86ed |
@@ -51,6 +51,26 @@ get_blkid_tag (const char *device, const char *tag)
|
|
|
89d86ed |
free (err);
|
|
|
89d86ed |
|
|
|
89d86ed |
if (r == 2) { /* means UUID etc not found */
|
|
|
89d86ed |
+ if (STREQ (tag, "TYPE") && STREQ (out, "")) {
|
|
|
89d86ed |
+ /* RHEL 5 blkid doesn't return "LVM2_member" for PVs. Instead we
|
|
|
89d86ed |
+ * get to this point. Detect if the device is really a PV and return
|
|
|
89d86ed |
+ * the right thing instead.
|
|
|
89d86ed |
+ */
|
|
|
89d86ed |
+ free (out);
|
|
|
89d86ed |
+ if (command (&out, &err, "file", "-bsL", device, NULL) == -1) {
|
|
|
89d86ed |
+ reply_with_error ("file: %s", err);
|
|
|
89d86ed |
+ free (out);
|
|
|
89d86ed |
+ free (err);
|
|
|
89d86ed |
+ return NULL;
|
|
|
89d86ed |
+ }
|
|
|
89d86ed |
+ free (err);
|
|
|
89d86ed |
+ if (STRPREFIX (out, "LVM2 (Linux Logical Volume Manager)")) {
|
|
|
89d86ed |
+ strcpy (out, "LVM2_member");
|
|
|
89d86ed |
+ return out;
|
|
|
89d86ed |
+ }
|
|
|
89d86ed |
+ /*FALLTHROUGH*/
|
|
|
89d86ed |
+ }
|
|
|
89d86ed |
+
|
|
|
89d86ed |
free (out);
|
|
|
89d86ed |
out = strdup ("");
|
|
|
89d86ed |
if (out == NULL)
|
|
|
89d86ed |
--
|
|
|
89d86ed |
1.7.4.1
|
|
|
89d86ed |
|