[PATCH 2/2] efi: payload: env: don't execute unmatched network driver glob

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Aug 26 02:30:52 PDT 2026


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 at gmail.com>
Signed-off-by: Ahmad Fatoum <a.fatoum at 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




More information about the barebox mailing list