diff --git a/grub2-once b/grub2-once index 5b8a6a3..5cd60cc 100644 --- a/grub2-once +++ b/grub2-once @@ -23,6 +23,12 @@ sub sh_test($) { my ( $exp ) = @_; dPrint( "?? '$exp' "); + + # Don't test grub command return status from linux shell, this often results + # in command not found error. In such case the expression often has no + # opening bracket and just returning false here to signify -ENOCMD error. + return 0 if ( $exp =~ m{^\s*[^\[]}); + $exp .= " ]" if ( $exp =~ m{^\[.*[^\]]\s*$} ); # gnaaa #my $t = qx{set -x; $exp}; my $t = qx{$exp}; diff --git a/grub2.changes b/grub2.changes index 4d0f4ba..5c61fba 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 4 06:58:12 UTC 2023 - Michael Chang + +- grub2-once: Fix 'sh: terminal_output: command not found' error (bsc#1204563) + ------------------------------------------------------------------- Wed Apr 26 07:22:03 UTC 2023 - Gary Ching-Pang Lin