rmtfs-dir.service: Add systemd service to load EFS data from a directory

The EFS data can either be in a partition or a filesystem path. The rmtfs
allows both, but there is only a systemd service to use the former.

Add another systemd service that does the latter. By default, the EFS path
is /var/lib/rmtfs (which is the directory used by msm-cros-efs-loader.sh
and other tools that extract the EFS data) but this can be changed during
build by setting the RMTFS_EFS_PATH environment variable.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
This commit is contained in:
Javier Martinez Canillas
2024-02-07 14:43:38 +01:00
parent cc5d4df973
commit 0caf528637
2 changed files with 19 additions and 3 deletions

View File

@@ -6,6 +6,8 @@ prefix = /usr/local
bindir := $(prefix)/bin
servicedir := $(prefix)/lib/systemd/system
RMTFS_EFS_PATH ?= /var/lib/rmtfs
SRCS := qmi_rmtfs.c rmtfs.c rproc.c sharedmem.c storage.c util.c
OBJS := $(SRCS:.c=.o)
@@ -15,13 +17,15 @@ $(OUT): $(OBJS)
%.c: %.qmi
qmic -k < $<
rmtfs.service: rmtfs.service.in
@sed 's+RMTFS_PATH+$(bindir)+g' $< > $@
%.service: %.service.in
@sed -e 's+RMTFS_PATH+$(bindir)+g' -e 's+RMTFS_EFS_PATH+$(RMTFS_EFS_PATH)+g' $< > $@
install: $(OUT) rmtfs.service
install: $(OUT) rmtfs.service rmtfs-dir.service
@install -D -m 755 $(OUT) $(DESTDIR)$(prefix)/bin/$(OUT)
@install -D -m 644 rmtfs.service $(DESTDIR)$(servicedir)/rmtfs.service
@install -D -m 644 rmtfs-dir.service $(DESTDIR)$(servicedir)/rmtfs-dir.service
clean:
rm -f $(OUT) $(OBJS) rmtfs.service
rm -f $(OUT) $(OBJS) rmtfs-dir.service

12
rmtfs-dir.service.in Normal file
View File

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