Files
tqftpserv/populate-readwrite.sh
Federico Amedeo Izzo 33e310c141 tqftpserv-populate-readwrite: add unit to copy files from persist part
Some devices (motorola-dubai) need to access readwrite files found in the
persist partition in `rfs/msm/mpss` to have working modem.

Create a new systemd unit that calls a shell script to copy the files
into the readwrite folder (currently /var/lib/tqftpserv).
The units runs only if and after /dev/disk/by-partlabel/persist is available.

Signed-off-by: Federico Amedeo Izzo <federico@izzo.pro>
2026-08-30 10:07:10 +02:00

21 lines
476 B
Bash

#!/usr/bin/sh
# Populate tqftp readwrite data from persist partition
set -eu
PERSIST_DEV="/dev/disk/by-partlabel/persist"
PERSIST_MOUNT="/mnt/persist"
TQFTPSERV_TMP="/var/lib/tqftpserv"
if [ -f $TQFTPSERV_TMP/readwrite_ready ]; then
exit 0
fi
mkdir -p $PERSIST_MOUNT
mount $PERSIST_DEV -o ro,noatime $PERSIST_MOUNT
mkdir -p $TQFTPSERV_TMP
cp -r $PERSIST_MOUNT/rfs/msm/mpss/* $TQFTPSERV_TMP/
touch $TQFTPSERV_TMP/readwrite_ready
umount $PERSIST_MOUNT
rmdir $PERSIST_MOUNT