All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v1] package/busybox: Avoid "can't create /proc/sys/kernel/hotplug" error
Date: Thu, 23 May 2019 16:14:44 +0300	[thread overview]
Message-ID: <20190523131444.36058-1-andriy.shevchenko@linux.intel.com> (raw)

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

             reply	other threads:[~2019-05-23 13:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 13:14 Andy Shevchenko [this message]
2019-05-23 14:33 ` [Buildroot] [PATCH v1] package/busybox: Avoid "can't create /proc/sys/kernel/hotplug" error 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190523131444.36058-1-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.