From 91220ce1833e4980097cff9674e2481cb2b24e07 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 9 May 2025 00:20:33 +0100 Subject: 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 --- include/inject.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include') 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() -- cgit v1.2.1