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>
This commit is contained in:
Leah Rowe
2025-05-09 00:20:33 +01:00
parent ff33ec3352
commit 91220ce183
+6 -3
View File
@@ -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()