mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>,
	Chali Anis <chalianis1@gmail.com>
Subject: [PATCH 2/2] efi: payload: env: don't execute unmatched network driver glob
Date: Wed, 26 Aug 2026 11:30:52 +0200	[thread overview]
Message-ID: <20260826093059.2370477-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260826093059.2370477-1-a.fatoum@pengutronix.de>

When /boot/network-drivers/ doesn't exist, the glob remains unexpanded
and the script tries to execute the literal pattern, so every ifup
without a firmware provided network device printed:

  /boot/network-drivers/*: No such file or directory
  ERROR: ifup: Running '/env/network/eth0-discover' failed with 127

Skip non-existent entries.

Assisted-by: Claude:fable-5
Reported-by: Chali Anis <chalianis1@gmail.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 efi/payload/env-efi/network/eth0-discover | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/efi/payload/env-efi/network/eth0-discover b/efi/payload/env-efi/network/eth0-discover
index 62c31a553c2b..0d865a5c5528 100644
--- a/efi/payload/env-efi/network/eth0-discover
+++ b/efi/payload/env-efi/network/eth0-discover
@@ -1,5 +1,7 @@
 #!/bin/sh
 
 for i in /boot/network-drivers/*; do
-	$i;
+	if [ -e "$i" ]; then
+		$i
+	fi
 done
-- 
2.47.3




  reply	other threads:[~2026-08-26  9:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26  9:30 [PATCH 1/2] efi: payload: iomem: use efi_uintn_t for the memory map key Ahmad Fatoum
2026-08-26  9:30 ` Ahmad Fatoum [this message]
2026-08-28 12:26 ` Sascha Hauer

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=20260826093059.2370477-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=chalianis1@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox