mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Remove empty /proc/device-tree when no openfirmware exists.
@ 2012-05-14 16:41 Dave Jones
  2013-12-17 15:55 ` Josh Boyer
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2012-05-14 16:41 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Fedora Kernel Team, Al Viro, Paul Mackerras

distribution kernels might want to build in support for /proc/device-tree
for kernels that might end up running on hardware that doesn't support openfirmware.
This results in an empty /proc/device-tree existing.
Remove it if the OFW root node doesn't exist.

[This situation actually confuses grub2, resulting in install failures.
 grub2 sees the /proc/device-tree and picks the wrong install target
 cf. http://bzr.savannah.gnu.org/lh/grub/trunk/grub/annotate/4300/util/grub-install.in#L311
 grub should be more robust, but still, leaving an empty proc dir seems pointless. ]

Signed-off-by: Dave Jones <davej@redhat.com>

diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
index 927cbd1..f060f28 100644
--- a/fs/proc/proc_devtree.c
+++ b/fs/proc/proc_devtree.c
@@ -233,6 +233,7 @@ void __init proc_device_tree_init(void)
 		return;
 	root = of_find_node_by_path("/");
 	if (root == NULL) {
+		remove_proc_entry("device-tree", NULL);
 		pr_debug("/proc/device-tree: can't find root\n");
 		return;
 	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-17 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-14 16:41 Remove empty /proc/device-tree when no openfirmware exists Dave Jones
2013-12-17 15:55 ` Josh Boyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome