msm8916-openwrt/package/tmp/rmtfs/files/rmtfs.init
Nikita Travkin 9c262b2aa4 FIXME: Add rmtfs service required to boot the modem
rmtfs is a system daemon that boots the modem on qualcomm devices.
It allows the modem cpu to access the EFS data on the persistent storage
such as emmc partition.

Signed-off-by: Nikita Travkin <nikita@trvn.ru>
2023-07-05 17:14:41 +05:00

24 lines
543 B
Bash
Executable File

#!/bin/sh /etc/rc.common
USE_PROCD=1
START=25
# FIXME: rmtfs expects these from udev
populate_disk_labels() {
mkdir -p /dev/disk/by-partlabel/
for part in /sys/block/mmcblk*/mmcblk*p*
do
DEVNAME="$(grep DEVNAME "$part"/uevent | sed 's/DEVNAME=//g')"
PARTNAME="$(grep PARTNAME "$part"/uevent | sed 's/PARTNAME=//g')"
ln -s /dev/$DEVNAME /dev/disk/by-partlabel/$PARTNAME
done
}
start_service() {
populate_disk_labels
procd_open_instance
procd_set_param command /usr/sbin/rmtfs -P -r -s
procd_close_instance
}