Build serial tool fail

root@ubuntu18:/home/ssd_workspace/ftgw/snap/serial_port# ./makeapp.sh
Setting target machine to ‘arm’
DEPRECATED: The ‘build’ keyword has been replaced by ‘override-build’
See http://snapcraft.io/docs/deprecation-notices/dn8 for more information.
Preparing to pull serial-tool
Pulling serial-tool
Preparing to build serial-tool
Building serial-tool
cc -Wall -O2 -c -o serial-tool.o serial-tool.c
serial-tool.c: In function 鈥[01mFantemIR_CodeBaseSend鈥

                                                     serial-tool.c:279:6: warning: unused variable 鈥[01miRet鈥[-Wunused-variable]

int iRet = 1;
^~~~
serial-tool.c: In function 鈥[01mFantemIR_IRLearn鈥

                                                serial-tool.c:391:9: warning: unused variable 鈥[01miRet鈥[-Wunused-variable]
 int iRet = 1;
     ^~~~

serial-tool.c: In function 鈥[01mFantemIR_IRSend鈥

                                               serial-tool.c:468:9: warning: unused variable 鈥[01miRet鈥[-Wunused-variable]
 int iRet = 1;
     ^~~~

serial-tool.c: In function 鈥[01mmain鈥

                                    serial-tool.c:565:17: warning: unused variable 鈥[01mtermios_cur鈥[-Wunused-variable]

struct termios termios_cur;
^~~~~~~~~~~
serial-tool.c:563:16: warning: unused variable 鈥[01mSendLen鈥[-Wunused-variable]
int fdcom, i, SendLen, RecvLen,cmd;
^~~~~~~
cc serial-tool.o -o serial-tool
Staging serial-tool
Priming serial-tool
Failed to generate snap metadata: The specified command ‘serial-tool’ defined in the app ‘serial-tool’ does not exist or is not executable

snapcraft.yaml
name: fantem-serial-port
version: 1.0
summary: fantem gateway
description: |
Bootloader files and partitoning data to create a
bootable Ubuntu Core image for the Orange Pi Zero.
type: app
architectures:

  • armhf
    confinement: strict
    grade: stable
    apps:
    serial-tool:
    command: serial-tool
    parts:
    serial-tool:
    plugin: dump
    source: .
    build: |
    CROSS_COMPILE=arm-linux-gnueabihf- make
    plugs:
    serial-port:
    interface: serial-port

makefileCFLAGS += -Wall -O2
prefix=/usr/local

NOTE: has to be /usr or snapcraft crashes

prefix=/usr
exec_prefix=$(prefix)
bindir=$(exec_prefix)/bin
all: serial-tool
serial-tool: serial-tool.o
serial-tool.o: serial-tool.c serial-tool.h
clean:
rm -f serial-tool.o serial-tool
install: serial-tool
install --directory $(DESTDIR)$(bindir)
install --strip -m 0755 serial-tool $(DESTDIR)$(bindir)

please edit the post and put all pasted data between triple backticks so it gets formatted in a readable shape …

1 Like

Screenshots are a little better but you can not quote them in replies … just add

```

above and below the pasted text you add in a post in this forum … (you can even just copy/paste it from my post now)

1 Like

i find the bug.i did not cp the command.or did not specify the right commang path

compile is ok,when i install the snap, get error

error: cannot find signatures with metadata for snap “fantem-serial.snap”

did you use the --dangerous option for the snap install command ?

add this option is ok to install,but cannot run

/snap/fantem-serial-port/x1/serial-tool: 1: /snap/fantem-serial-port/x1/serial-tool: Syntax error: “(” unexpected

this error imply what kind of error, '(“ offer no help for me

It means that the interpreter of whatever the serial-tool file is encountered illegal token “(” at line 1 of the file.