From patchwork Thu May 23 13:14:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 1104121 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 458qjV6Szwz9s1c for ; Thu, 23 May 2019 23:14:53 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5345787E76; Thu, 23 May 2019 13:14:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cBD-QwfKl7l3; Thu, 23 May 2019 13:14:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id A13FA85FFD; Thu, 23 May 2019 13:14:50 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 369091BF291 for ; Thu, 23 May 2019 13:14:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 33C1631467 for ; Thu, 23 May 2019 13:14:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vkMC5dggqDjG for ; Thu, 23 May 2019 13:14:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by silver.osuosl.org (Postfix) with ESMTPS id 904DF31429 for ; Thu, 23 May 2019 13:14:48 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 May 2019 06:14:48 -0700 X-ExtLoop1: 1 Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 23 May 2019 06:14:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3BB0F7B5; Thu, 23 May 2019 16:14:45 +0300 (EEST) From: Andy Shevchenko To: Adam Duskett , Carlos Santos , buildroot@buildroot.org, Peter Korsgaard , Thomas Petazzoni Date: Thu, 23 May 2019 16:14:44 +0300 Message-Id: <20190523131444.36058-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v1] package/busybox: Avoid "can't create /proc/sys/kernel/hotplug" error X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andy Shevchenko Errors-To: buildroot-bounces@busybox.net Sender: "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 Signed-off-by: Andy Shevchenko --- 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' | \