Blame SOURCES/0059-Put-some-EFI-device-paths-into-the-debug-log.patch

b15ea1
From ca85d518ab6063ff07af41672dcb366610f51a20 Mon Sep 17 00:00:00 2001
b15ea1
From: Peter Jones <pjones@redhat.com>
b15ea1
Date: Tue, 15 Oct 2019 16:58:19 -0400
b15ea1
Subject: [PATCH 59/86] Put some EFI device paths into the debug log
b15ea1
b15ea1
Signed-off-by: Peter Jones <pjones@redhat.com>
b15ea1
---
b15ea1
 src/linux.c | 41 +++++++++++++++++++++++++++++++++++++++++
b15ea1
 1 file changed, 41 insertions(+)
b15ea1
b15ea1
diff --git a/src/linux.c b/src/linux.c
b15ea1
index 67fbb1be059..6b88bfb7e9b 100644
b15ea1
--- a/src/linux.c
b15ea1
+++ b/src/linux.c
b15ea1
@@ -336,6 +336,44 @@ device_free(struct device *dev)
b15ea1
 	free(dev);
b15ea1
 }
b15ea1
 
b15ea1
+static void
b15ea1
+print_dev_dp_node(struct device *dev, struct dev_probe *probe)
b15ea1
+{
b15ea1
+	ssize_t dpsz;
b15ea1
+	uint8_t *dp;
b15ea1
+	ssize_t bufsz;
b15ea1
+	uint8_t *buf;
b15ea1
+
b15ea1
+	dpsz = probe->create(dev, NULL, 0, 0);
b15ea1
+	if (dpsz <= 0)
b15ea1
+		return;
b15ea1
+
b15ea1
+	dp = alloca(dpsz + 4);
b15ea1
+	if (!dp)
b15ea1
+		return;
b15ea1
+
b15ea1
+	dpsz = probe->create(dev, dp, dpsz, 0);
b15ea1
+	if (dpsz <= 0)
b15ea1
+		return;
b15ea1
+
b15ea1
+	efidp_make_end_entire(dp + dpsz, 4);
b15ea1
+	bufsz = efidp_format_device_path(NULL, 0,
b15ea1
+					 (const_efidp)dp, dpsz + 4);
b15ea1
+	if (bufsz <= 0)
b15ea1
+		return;
b15ea1
+
b15ea1
+	buf = alloca(bufsz);
b15ea1
+	if (!buf)
b15ea1
+		return;
b15ea1
+
b15ea1
+	bufsz = efidp_format_device_path(buf, bufsz,
b15ea1
+			(const_efidp)dp, dpsz + 4);
b15ea1
+	if (bufsz <= 0)
b15ea1
+		return;
b15ea1
+
b15ea1
+	debug("Device path node is %s", buf);
b15ea1
+}
b15ea1
+
b15ea1
 struct device HIDDEN
b15ea1
 *device_get(int fd, int partition)
b15ea1
 {
b15ea1
@@ -512,6 +550,9 @@ struct device HIDDEN
b15ea1
 	                    probe->flags & DEV_ABBREV_ONLY)
b15ea1
 	                        needs_root = false;
b15ea1
 
b15ea1
+			if (probe->create)
b15ea1
+				print_dev_dp_node(dev, probe);
b15ea1
+
b15ea1
 	                dev->probes[n++] = dev_probes[i];
b15ea1
 	                current += pos;
b15ea1
 			if (current[0] == '\0')
b15ea1
-- 
b15ea1
2.24.1
b15ea1