mirror of
https://github.com/linux-msm/tqftpserv.git
synced 2026-10-07 06:28:28 -07:00
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>
21 lines
476 B
Bash
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
|