All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1] package/busybox: Avoid "can't create /proc/sys/kernel/hotplug" error
@ 2019-05-23 13:14 Andy Shevchenko
  2019-05-23 14:33 ` Peter Korsgaard
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2019-05-23 13:14 UTC (permalink / raw)
  To: buildroot

At runtime on most of the modern kernels [1] S10mdev script produces an error:

/etc/init.d/S10mdev: line 9: can't create /proc/sys/kernel/hotplug: nonexistent directory

since the commit

  caae7fa1d737 ("busybox: register mdev as hotplug helper when selected")

added it unconditionally.

Check the presence of procfs node before writing to it.

[1]: Linux kernels with the commit
       86d56134f1b6 ("kobject: Make support for uevent_helper optional.")
     applied.

Fixes: caae7fa1d737 ("busybox: register mdev as hotplug helper when selected")
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 package/busybox/S10mdev | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/busybox/S10mdev b/package/busybox/S10mdev
index 7075b77016..ddede9a4a6 100644
--- a/package/busybox/S10mdev
+++ b/package/busybox/S10mdev
@@ -6,7 +6,7 @@
 case "$1" in
   start)
 	echo "Starting mdev..."
-	echo /sbin/mdev >/proc/sys/kernel/hotplug
+	test -f /proc/sys/kernel/hotplug && echo /sbin/mdev > /proc/sys/kernel/hotplug
 	/sbin/mdev -s
 	# coldplug modules
 	find /sys/ -name modalias -print0 | xargs -0 sort -u | tr '\n' '\0' | \
-- 
2.20.1

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

end of thread, other threads:[~2019-05-24 21:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-23 13:14 [Buildroot] [PATCH v1] package/busybox: Avoid "can't create /proc/sys/kernel/hotplug" error Andy Shevchenko
2019-05-23 14:33 ` Peter Korsgaard
2019-05-24  7:49   ` Peter Korsgaard
2019-05-24 13:25     ` Andy Shevchenko
2019-05-24 21:12       ` Peter Korsgaard
2019-05-24 21:39         ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.