summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-05-09 00:20:33 +0100
committerLeah Rowe <leah@libreboot.org>2025-05-09 00:20:33 +0100
commit91220ce1833e4980097cff9674e2481cb2b24e07 (patch)
tree4aa40ef3a5910fa22611525ed221bd85da71f6a7
parentff33ec3352babab4c827121099192f014a960c43 (diff)
inject.sh: use subshell to speed up find_me()
the current test allows a further extraction after running mecleaner, even if me.bin was found. further, any recursive calls that exit non-ze don't lot the loop acthually stop, unless we subshell that too, otherwise fx_ is returned to return 0 when a given command it runs returns 1, or more specifically: the for loop in x_ breaks. this is by design, and there's not much that can be done, but this patch should pseed up extraction a little bit, when dealing with intel me files. Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/inject.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/inject.sh b/include/inject.sh
index c0b4409f..135df0c2 100644
--- a/include/inject.sh
+++ b/include/inject.sh
@@ -147,7 +147,9 @@ extract_intel_me()
chkvars ME11delta ME11version ME11sku ME11pch
[ "$ME11bootguard" = "y" ] && x_ ./mk -f deguard
- set +u +e && fx_ find_me x_ find "$xbmkpwd/$appdir" -type f
+ set +u +e
+ x_ rm -Rf "$xbmkpwd/metmp"
+ ( fx_ find_me x_ find "$xbmkpwd/$appdir" -type f ) || :
[ "$ME11bootguard" != "y" ] && x_ mv "$_metmp" "$_me" && return 0
(
@@ -160,7 +162,7 @@ extract_intel_me()
find_me()
{
- e "$_metmp" f && x_ rm -Rf "$xbmklocal/metmp" && return 1
+ e "$_metmp" f && exit 1
[ -L "$1" ] && return 0
_7ztest="${_7ztest}a" && _r="-r" && [ -n "$mfs" ] && _r=""
@@ -169,7 +171,8 @@ find_me()
"$mecleaner" $mfs $_r -t -O "$_metmp" "$1" || "$me7updateparser" \
-O "$_metmp" "$1" || extract_archive "$1" "$_7ztest" || return 0
- fx_ find_me x_ find "$_7ztest" -type f || return 1; :
+ e "$_metmp" f && exit 1
+ ( fx_ find_me x_ find "$_7ztest" -type f ) || exit 1; :
}
extract_archive()