Fix empty results from S09 because of "grep: Argument list too long" #1461
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug fix
On a firmware that generates a sizable number of files (e.g. 13,000) under
s09_firmware_base_version_check/strings_bin
, S09 module fails to grep data from them and does not return any result overall.Cause: the
grep
command (in the modified line in this PR) has its file pattern extended on the command line with all matching files. This exceeds the system maximum command-line length (2MB on my system, don't know how standard that is). The command does not return anything tostdout
, as if no string matchedlVERSION_IDENTIFIER
.Error was found by logging grep result, including
stderr
, from that location:This logs
DBG /usr/bin/grep: Argument list too long
for everylVERSION_IDENTIFIER
Given that this folder only contains
strings_*
files, we can call grep on the whole folder with the-r
option. Results are now returned as expected from this command.No
None