rmtfs.service: Add systemd service

Add rmtfs.service and install this.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Bjorn Andersson 2019-07-25 11:15:03 -07:00
parent 976aa0ddbe
commit 6d2cfcddfc
3 changed files with 21 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
rmtfs
*.o
rmtfs.service

View File

@ -3,6 +3,8 @@ OUT := rmtfs
CFLAGS += -Wall -g -O2
LDFLAGS += -lqrtr -ludev -lpthread
prefix = /usr/local
bindir := $(prefix)/bin
servicedir := $(prefix)/lib/systemd/system
SRCS := qmi_rmtfs.c rmtfs.c rproc.c sharedmem.c storage.c util.c
OBJS := $(SRCS:.c=.o)
@ -13,9 +15,13 @@ $(OUT): $(OBJS)
%.c: %.qmi
qmic -k < $<
install: $(OUT)
install -D -m 755 $< $(DESTDIR)$(prefix)/bin/$<
rmtfs.service: rmtfs.service.in
@sed 's+RMTFS_PATH+$(bindir)+g' $< > $@
install: $(OUT) rmtfs.service
@install -D -m 755 $(OUT) $(DESTDIR)$(prefix)/bin/$(OUT)
@install -D -m 644 rmtfs.service $(DESTDIR)$(servicedir)/rmtfs.service
clean:
rm -f $(OUT) $(OBJS)
rm -f $(OUT) $(OBJS) rmtfs.service

11
rmtfs.service.in Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=Qualcomm remotefs service
Requires=qrtr-ns.service
After=qrtr-ns.service
[Service]
ExecStart=RMTFS_PATH/rmtfs -r -P -s
Restart=always
[Install]
WantedBy=multi-user.target