summaryrefslogtreecommitdiff
path: root/include/fw
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-09-14 08:48:16 +0100
committerLeah Rowe <leah@libreboot.org>2026-09-14 08:48:16 +0100
commit2fc37b4b47cc55d86f611d96c6798912441b0eae (patch)
tree4e6892b80123774be3e1bb4ad985b809429548bf /include/fw
parent4ebede5b99270f0770a989392fd935b13010e695 (diff)
use -mindepth alongside -maxdepth in find
use of maxdepth 1 does not exclude the main directory, which is undesired in these contexts, though excluded in practise due to how find is actually used. technically, mindepth should be used, just in case, as a defensive measure. the context here is files and directories within a main directory, used as arguments in other commands. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/fw')
-rw-r--r--include/fw/inject.sh3
-rw-r--r--include/fw/vendor.sh3
2 files changed, 4 insertions, 2 deletions
diff --git a/include/fw/inject.sh b/include/fw/inject.sh
index 0760c1d8..29584e0a 100644
--- a/include/fw/inject.sh
+++ b/include/fw/inject.sh
@@ -175,7 +175,8 @@ modify_mac()
x_ "$nvmutil" "$xbtmp/gbe" setmac "$new_mac"
fi
- fx_ newmac x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
+ fx_ newmac x_ find "$tmpromdir" -mindepth 1 -maxdepth 1 \
+ -type f -name "*.rom"
printf "\nThe following GbE NVM data will be written:\n"
x_ "$nvmutil" "$xbtmp/gbe" dump | grep -v "bytes read from file" || :
diff --git a/include/fw/vendor.sh b/include/fw/vendor.sh
index 10daeca3..7c8f9f2c 100644
--- a/include/fw/vendor.sh
+++ b/include/fw/vendor.sh
@@ -436,7 +436,8 @@ getvfile()
else
# inject vendor files
- fx_ prep x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
+ fx_ prep x_ find "$tmpromdir" -mindepth 1 -maxdepth 1 \
+ -type f -name "*.rom"
( check_vendor_hashes ) || \
err "$archive: Can't verify hashes" "getvfile" "$@"; :
fi