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 <[email protected]>
Signed-off-by: Ahmad Fatoum <[email protected]>
---
 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 via email to