s2pexec(1) General Commands Manual s2pexec(1)

s2pexec - SCSI2Pi SCSI/SASI command executor

s2pexec [--binary-input-file/-f FILE] [--binary-output-file/-F FILE] [--board-id/-B BOARD_ID] [--buffer-size/-b BUFFER_SIZE] [--cdb/-c CDB[:CDB:...]] [--data/-d DATA] [--help/-H] [--hex-only/-x] [--hex-output-file/-T FILE] [--log-level/-L LEVEL] [--log-limit/-l LIMIT] [--request-sense/-R] [--reset-bus/-r] [--sasi-target/-h ID[:LUN]] [--scsi-target/-i ID[:LUN]] [--scsi-generic/-g DEVICE_FILE] [--timeout/-t TIMEOUT] [--version/-v]

s2pexec sends SCSI or SASI commands to a device and displays the results.

When launched without arguments, s2pexec enters interactive mode, where you can enter commands on the command line. Like with the bash shell, "!!" repeats the last command. In interactive mode, the target, initiator and log level settings are preserved between command invocations. When using devices managed by the Linux SG 3 driver, s2pexec can be used on any Linux system, not just on a Pi.

s2pexec helps with advanced testing. The board on which s2pexec is running must be a FULLSPEC board, because s2pexec requires SCSI initiator support.

Optional file with binary data to send in the DATA OUT phase.
Optional file for binary data received in the DATA IN phase.
Initiator ID used by s2pexec. If not specified, s2pexec will use the board (initiator) ID 7. Not relevant for SASI.
Buffer size for received data, the default is 131072 bytes. When sending data, the buffer is automatically sized to match the size of data to be sent.
Command blocks to send in hexadecimal format. Hexadecimal numbers may be separated by a colon. s2pexec also accepts linked commands.
Data to send with the command in hexadecimal format. This data is sent in the DATA OUT phase. If DATA starts with @, the remaining string is the name of a file in hexadecimal format to read the data from.
Display this help.
Do not display/save the offsets and the ASCII representation of the received data.
Optional file for data received in the DATA IN phase. The data in this file is coded in hexadecimal (human-readable) format.
Set the log level (trace, debug, info, warning, error, critical, off). The default log level is 'info'.
Limits the number of data bytes being logged, where 0 means no limit. The default is 128.
Automatically send REQUEST SENSE after an error in order to get the sense data.
Reset the bus.
ID and optional LUN (0-1) of the SASI target device.
Use the Linux SG driver with the specified device file instead of a RaSCSI/PiSCSI board.
ID and optional LUN (0-31) of the SCSI target device.
The command timeout in seconds, default is 3 seconds. Operations like formatting may take much longer. s2pexec remembers the last timeout setting.
Display the s2pexec version.

0: No error. -1: There was a general error and the command could not be sent. Any other value means the command could be sent but the target device reported an error. In this case, the return status contains the additional sense code (ASC).

s2pexec -i 0 -c 12:00:00:00:20:00
Send an INQUIRY command to the device with SCSI ID 0 and display the results.

s2pexec -i 5 -c 15:11:00:04:0c:00 -d @data.dat
Send a MODE SELECT command to the device with SCSI ID 5, with the hexadecimally coded data in data.dat as parameters.

s2pexec -i 5:1 -c 15:11:00:04:0c:00 -d 00:00:00:08:00:00:00:00:00:00:02:00
Send a MODE SELECT command to the device with SCSI ID 5 and LUN 1, with explicit parameter data.

s2p(1), s2pctl(1), s2pdump(1), s2pformat(1), s2pproto(1), s2psimh(1), s2ptool(1)

Also see <https://www.scsi2pi.net> and <https://github.com/uweseimet/scsi2pi>.