Ocpiremote error

Hello everyone, I have started the linux system on the zynq series development board, using the ocpiremote load command to successfully send the sandbox folder to my FPGA board, but there is an error./ocpiserver.sh: 25:./ocpiserver.sh: Syntax error: " (" unexpected

I opened the ocpiserver.sh on the FPGA board
The content is as follows:


I don’t know what the problem is, it all looks fine.

I replaced’function do_stop () {'on line 25 with ‘do_stop () {
It seems to be working properly


But I’m facing the following problems

./ocpiserver.sh: 53: ./ocpiserver.sh: source: not found
./ocpiserver.sh: 85: ./ocpiserver.sh: ocpidriver: not found
./ocpiserver.sh: 87: ./ocpiserver.sh: ocpidriver: not found
The following is the contents of the sandbox folder in the FPGA development board


Here is my sandbox file structure

│ hwplatform
│ port
│ setup.sh
│ swplatform

├─deploy
│ └─zcu102
│ └─opencpi
│ system.xml

├─etc
│ localtime

├─scripts
│ ocpiserver.sh
│ ocpi_linux_driver

├─xilinx19_2_aarch64
│ ├─bin
│ │ ocpidriver
│ │ ocpihdl
│ │ ocpiserve
│ │ ocpizynq
│ │
│ ├─lib
│ │ 99-opencpi.rules
│ │ libocpi_datagram2_s.so
│ │ libocpi_datagram_s.so
│ │ libocpi_dma_s.so
│ │ libocpi_hdl_s.so
│ │ libocpi_ocl_s.so
│ │ libocpi_ofed_s.so
│ │ libocpi_pio_s.so
│ │ libocpi_rcc_s.so
│ │ libocpi_remote_s.so
│ │ libocpi_socket_s.so
│ │ mdev-opencpi.rules
│ │ opencpi-4.19.0-xilinx-v2019.2-v2019.2.01.ko
│ │
│ └─sdk
│ └─lib
│ ld-2.28.so
│ ld-linux-aarch64.so.1
│ libgcc_s.so
│ libgcc_s.so.1
│ libpthread-2.28.so
│ libpthread.so.0
│ libstdc++.so
│ libstdc++.so.6
│ libstdc++.so.6.0.25
│ libstdc++.so.6.0.25-gdb.py

└─zcu102
ocpi.assets.testbias_zcu102_base.hdl.0.zcu102.bitz

can you tell me how to solve this problem?

I tried adding #!/bin/bash at the beginning of the sh script. It seems to solve the problem of source: not found, but when I re-execute ocpiremote start -b -p root, I get the following error

test@ubuntu:~/han/opencpi-v2.4.7$ ocpiremote start -b -p root
Executing remote configuration command: start -B
Reloading kernel driver:
The driver module is not loaded. No action was taken.
No reserved DMA memory found on the linux boot command line.
insmod: ERROR: could not insert module /root/sandbox/xilinx19_2_aarch64/lib/opencpi-4.19.0-xilinx-v2019.2-v2019.2.01.ko: Invalid module format
Driver loading failed.

The Invalid module format error occurs when the Linux kernel source used to build the OpenCPI loadable kernel module does not match the kernel that is running on the target embedded device.

Are you running this on a zcu102? Since we support a large range of platforms and limited amount of resources things may sit untested across a period of time.

I have personally tested zcu102 hdl platform combined with xilinx24_1_aarch64 rcc platform back in January 2025.

hi,aolivarez
My development board is a third-party development board, but the FPGA chip is the same as ZCU102, both are XCZU9EG-2FFVB1156. I think that running an arm program or FPGA program should be able to use zcu102.

To chime in on the first few errors before the invalid format error.

function name() is a bash extension. POSIX shells require name().

This is also why source doesn’t work. In POSIX, there is no source, you have to do . my_script.sh.

So the default shell on your system is probably /bin/sh, and on that system sh is not just a link to bash.

Taking a further look, that function was added a long time ago, and I can’t see any open issues similar to this, so I’m slightly confused how this hasn’t been seen before.

I think the script either needs:

  • To have a /bin/sh shebang added.
  • To be edited to be POSIX compliant.