mfgtools icon indicating copy to clipboard operation
mfgtools copied to clipboard

FB:< with multi-line output script

Open vlahan opened this issue 1 year ago • 2 comments

Hi all,

it seems that at the moment the "PROTOCOL:<" construct (for using stdout as command source) works only with single-line output.

e.g. for test.sh

#!/bin/bash
echo "ucmd setenv env1 value1"
echo "ucmd setenv env2 value2"

FB:< sh -c "test.sh"

would only process the first command.

Adding multi-line / multi-command support for < (in which each output line is interpreted as separate command) would be extremely beneficial for production-time customization tasks.

Alternatively, it would be beneficial if the command line buffer is increased so one can use longer command concatenation chains like:

echo "ucmd setenv env1 value1 && setenv env2 value2 && ...

vlahan avatar Feb 01 '24 00:02 vlahan

multi-line is good idea. let me check. command length limited by uboot fastboot. Standard fastboot define is 64byte

https://android.googlesource.com/platform/system/core/+/2ec418a4c98f6e8f95395456e1ad4c2956cac007/fastboot/fastboot_protocol.txt

  1. Host sends a command, which is an ascii string in a single   | packet no greater than 64 bytes.

nxpfrankli avatar Feb 01 '24 03:02 nxpfrankli

Thanks for the quick feedback!

Yes, it seems that the buffer extension is not possible, thus the support for multiple lines seems like the way to go here.

vlahan avatar Feb 01 '24 14:02 vlahan