84 Commits
Author SHA1 Message Date
Dmitry Baryshkov b30a3eb38f Merge pull request #33 from schabimperle/oneplus-oppo-oem-nv
rmtfs: add OnePlus/Oppo OEM NV partition mappings
v1.3
2026-06-23 02:15:46 +03:00
Dmitry Baryshkov 87974e0363 Merge pull request #36 from Pradeep-pvk/master
rmtfs: start service after qcom_rmtfs_mem* device is available
2026-06-23 02:14:53 +03:00
Dmitry Baryshkov b10bf0e7df Merge pull request #35 from lool/condiionpathexists
rmtfs.service: Only start if dev node present
2026-06-23 02:14:42 +03:00
Pradeep P V K 4fd97e296c rmtfs: start service after qcom_rmtfs_mem* device is available
rmtfs.service fails to run with pull #35 when creation of the
qcom_rmtfs_mem* device is delayed.

Update the startup flow to trigger the service only after the
qcom_rmtfs_mem* node becomes available, using udev rules.

Signed-off-by: Pradeep P V K <pradeep.pragallapati@oss.qualcomm.com>
2026-06-19 16:13:16 +05:30
Loïc Minier a125c5126f rmtfs.service: Only start if dev node present
Allow having the rmtfs service present but not started on devices
which don't have a /dev/qcom_rmtfs_mem1 by starting only if this
node is present. This allows creating generic images, without
reporting an error because the service can't start when the device
node is lacking.

Fixes: #34

Reported-by: Agathe Porte <agathe.porte@oss.qualcomm.com>
Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2026-05-20 15:23:34 +02:00
Malte Schababerle 291e16dbd1 rmtfs: add OnePlus/Oppo OEM NV partition mappings
OnePlus and Oppo devices with Qualcomm modems request OEM NV backup
partitions at /oem/nvbk/static and /oem/nvbk/dynamic. Without these
mappings, the modem crashes approximately 40 seconds after boot when it
fails to access the OEM NV data.

The partitions map to the oem_stanvbk and oem_dycnvbk partlabels which
are present on OnePlus/Oppo devices.

Some OxygenOS firmware versions also request /oppo/oem_partion (note:
the spelling is from the firmware) which maps to the same oem_stanvbk
partition.

Tested on OnePlus 7T (hotdogb) running postmarketOS with Qualcomm
SM8150 and OxygenOS Android 10 modem firmware.

Signed-off-by: Malte Schababerle <m.schababerle@gmail.com>
2026-03-22 19:52:16 +01:00
Maximilian Luz 14cb1ee69f rmtfs: Fix command line argument parsing for '-o' optarg
Commit 2ee01bf ("storage: Try opening the slot-suffixed partition")
introduced a bug where option '-o' is incorrectly specified as having no
argument. Therefore, passing -o with a path incorrectly sets that path
to the default '/boot' one as optarg evaluates to NULL. Fix this by
telling getopt that we expect an argument.

Fixes: 2ee01bf ("storage: Try opening the slot-suffixed partition")
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
v1.2
2026-01-23 20:11:07 -06:00
Dmitry Baryshkov f9847a777c Merge pull request #27 from quic-kdybcio/topic/slotsuffix
storage: Try opening the slot-suffixed partition
2025-12-23 04:55:11 +02:00
Konrad Dybcio f7566e4c82 Merge pull request #28 from z3ntu/modem_study
storage: Add modem_study into partition_table
2025-09-26 13:41:45 +02:00
Luca Weiss 27b3a6f00f storage: Add modem_study into partition_table
The partition /boot/modem_study needs to be served on the Milos/SM7635
Fairphone (Gen. 6) smartphone.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
2025-07-28 16:35:04 +02:00
Konrad Dybcio 2ee01bf752 storage: Try opening the slot-suffixed partition
Some devices ship 2 copies of remote partitions (see e.g. #22), which
the current code can't cope with.

Add parsing of a slot suffix (via '-S', single character) and if
passed, retry opening partition (via a partlabel) with it.

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
2025-07-02 12:58:29 +02:00
Konrad Dybcio 586372e575 Merge pull request #26 from quic-kdybcio/topic/formatspecifier
sharedmem: Fix build warning on 32-bit arm
2025-06-30 17:39:29 +02:00
Konrad Dybcio 19d1acb728 sharedmem: Fix build warning on 32-bit arm
Format specifiers won't stop biting.

Closes: https://github.com/linux-msm/rmtfs/issues/25
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
2025-06-30 17:35:31 +02:00
Konrad Dybcio 44facf5694 Merge pull request #24 from loicpoulain/rb1
rmtfs.service: Fix start/stop ordering between rmtfs and NetworkManager
v1.1.1
2025-06-30 16:25:23 +02:00
Loic Poulain 5b214f61b9 rmtfs.service: Fix start/stop ordering between rmtfs and NetworkManager
Since rmtfs typically provides resources for wireless and modem-related
processors, it's important to ensure that this service starts before
and stops after NetworkManager.

On platforms like QCOM RB1, this sequencing prevents the Wi-Fi interface(s)
from being left in a dangling state while NetworkManager attempts to tear
down the interface(s):
https://github.com/qualcomm-linux/qcom-deb-images/issues/40#issuecomment-2944265370

The 'Before' dependency directive is ignored if NetworkManager is disabled or absent.

Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
2025-06-10 15:10:15 +02:00
Dmitry Baryshkov b61c22b1cd Merge pull request #23 from lumag/rmtfs-dir-no-qrtr-ns
rmtfs-dir.service.in: Remove dependency on qrtr-ns.service
2025-05-02 03:58:59 +03:00
Luca Weiss b46235296f rmtfs-dir.service.in: Remove dependency on qrtr-ns.service
The QRTR nameserver has been built into the kernel for years now, drop
the dependency since qrtr-ns.service won't do anything anyways.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
2025-04-24 22:10:21 +03:00
Dmitry Baryshkov f24570816b Merge pull request #19 from martinezjavier/add-rmtfs-dir-service
Add systemd service to load EFS data from a directory
2025-02-13 21:43:44 +02:00
Konrad Dybcio 33e1e40615 Merge pull request #18 from ipearworks/fix
sharedmem: Fix incorrect usages of `strerror`
2024-03-18 17:09:52 +01:00
Konrad Dybcio a2df4bd096 Merge pull request #20 from z3ntu/qrtr-ns
rmtfs.service.in: Remove dependency on qrtr-ns.service
2024-03-18 17:09:02 +01:00
Konrad Dybcio e4e6212c86 Tag stable release
This is the last commit before repository transfer.

It may be useful for some distros which have been shipping this package
for some time already
v1.1
2024-03-18 17:07:59 +01:00
Luca Weiss 44fcb2ec64 rmtfs.service.in: Remove dependency on qrtr-ns.service
The QRTR nameserver has been built into the kernel for years now, drop
the dependency since qrtr-ns.service won't do anything anyways.
2024-03-11 11:02:29 +01:00
Javier Martinez Canillas 0caf528637 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>
2024-02-07 15:03:20 +01:00
Javier Martinez Canillas cc5d4df973 rmtfs: Fix a couple of possible uninitialized variables usage
GCC version 13.2.1 20231205 complains about the following:

  cc -Wall -g -O2   -c -o storage.o storage.c
  In function ‘rmtfs_iovec’,
      inlined from ‘handle_rmtfs’ at rmtfs.c:403:4:
  rmtfs.c:224:12: warning: ‘is_write’ may be used uninitialized [-Wmaybe-uninitialized]
    224 |         if (is_write)
        |            ^
  rmtfs.c: In function ‘handle_rmtfs’:
  rmtfs.c:158:17: note: ‘is_write’ was declared here
    158 |         uint8_t is_write;
        |                 ^
  In function ‘rmtfs_iovec’,
      inlined from ‘handle_rmtfs’ at rmtfs.c:403:4:
  rmtfs.c:225:17: warning: ‘rmtfd’ may be used uninitialized [-Wmaybe-uninitialized]
    225 |                 storage_sync(rmtfd);
        |                 ^~~~~~~~~~~~~~~~~~~
  rmtfs.c: In function ‘handle_rmtfs’:
  rmtfs.c:154:23: note: ‘rmtfd’ was declared here
    154 |         struct rmtfd *rmtfd;
        |                       ^~~~~

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2024-02-07 15:03:20 +01:00
Tianyi Liu 75cb81d197 sharedmem: Fix incorrect usages of strerror
`strerror` takes the `errno` directly as its argument,
negating it will result in an "Unknown error".

Signed-off-by: Tianyi Liu <i.pear@outlook.com>
2024-02-06 15:03:46 +08:00