Skip to content

Commit 0caf528

Browse files
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 <[email protected]>
1 parent cc5d4df commit 0caf528

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ prefix = /usr/local
66
bindir := $(prefix)/bin
77
servicedir := $(prefix)/lib/systemd/system
88

9+
RMTFS_EFS_PATH ?= /var/lib/rmtfs
10+
911
SRCS := qmi_rmtfs.c rmtfs.c rproc.c sharedmem.c storage.c util.c
1012
OBJS := $(SRCS:.c=.o)
1113

@@ -15,13 +17,15 @@ $(OUT): $(OBJS)
1517
%.c: %.qmi
1618
qmic -k < $<
1719

18-
rmtfs.service: rmtfs.service.in
19-
@sed 's+RMTFS_PATH+$(bindir)+g' $< > $@
20+
%.service: %.service.in
21+
@sed -e 's+RMTFS_PATH+$(bindir)+g' -e 's+RMTFS_EFS_PATH+$(RMTFS_EFS_PATH)+g' $< > $@
2022

21-
install: $(OUT) rmtfs.service
23+
install: $(OUT) rmtfs.service rmtfs-dir.service
2224
@install -D -m 755 $(OUT) $(DESTDIR)$(prefix)/bin/$(OUT)
2325
@install -D -m 644 rmtfs.service $(DESTDIR)$(servicedir)/rmtfs.service
26+
@install -D -m 644 rmtfs-dir.service $(DESTDIR)$(servicedir)/rmtfs-dir.service
2427

2528
clean:
2629
rm -f $(OUT) $(OBJS) rmtfs.service
30+
rm -f $(OUT) $(OBJS) rmtfs-dir.service
2731

rmtfs-dir.service.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=Qualcomm remotefs service
3+
Requires=qrtr-ns.service
4+
After=qrtr-ns.service
5+
6+
[Service]
7+
ExecStart=RMTFS_PATH/rmtfs -s -o RMTFS_EFS_PATH
8+
Restart=always
9+
RestartSec=1
10+
11+
[Install]
12+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)