[Replicant] Reply to IRC questions about the GT-I9305 modem

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Fri Oct 15 13:36:39 UTC 2021


Hi,

You asked some interesting questions on IRC but I wasn't there when you
asked them:
> Ok, I'm using postmarketos on the i9305. I can't boot the  modem. I
> think that's what was wrong when I tried porting replicant.
> MDM_DEVICE "/dev/mdm" in
> https://git.replicant.us/contrib/scintill/external_modem-boot/tree/i9305.h?h=replicant-6.0
> does not exist, and the modem won't boot as a result
This is one of the issues I encountered with Replicant >=9.

There is a hack in the kernel and kernel defconfig to make the node
still appear.

In the replicant-11-i9300-modem of my work in progress kernel[1] the
modem firmware loading driver (drivers/usb/misc/xmm6262_boot.c,
written by Simon Shields) has a hack that makes it work for
Android:
> #ifdef CONFIG_USB_DYNAMIC_MINORS
> #define USB_XMM6262_MINOR_BASE 0
> #else
> #define USB_XMM6262_MINOR_BASE 191 /* TODO */
> #endif

And we have:
> $ make replicant_defconfig
> $ grep CONFIG_USB_DYNAMIC_MINORS .config
> # CONFIG_USB_DYNAMIC_MINORS is not set

Another way would be to write a program to create the node. 

I also tried this approach at some point in order to avoid hacks in the
kernel.

I've the code in the history/09-03-2021 branch of my work in progress
device_samsung_i9300 repository[2], but I don't remember exactly why I
didn't keep it.

It was probably because I didn't manage to write proper SELinux rules
and I might have encountered blockers like neverallow in the base
policies. If I recall well, in Replicant 11, init required selinux
policies even if it was not in enforcing mode. The code is in the
xmm6262_boot0 directory, it was pretty simple and it was also
integrated in Replicant (though the init system and so on).

> I had a quick look at some of the partitions, EFS, RADIO and tried to
> mount OTA but couldn't
As I understand OTA is not mountable, it is meant to communicate with
the recovery by adding some binary at the beginning which the recovery
could then parse. The official Android documentation (at
source.android.com) documents that binary format and has also explains
what it can be used for but I don't remember the details.

For RADIO and EFS, I've moved the documentation details to the Quectel
Osmocom project[3] instead of Replicant as internal modem details are
probably not that interesting for Replicant beside understanding the
boot procedure and the communication between the modem and the SOC.

I probably tested the device with LineageOS to make sure that the modem
worked fine before writing that documentation.

Also note that the RADIO partition can also be corrupted very easily, to
do that you only need to flash a recovery image that is bigger than
8MiB[4], so it's a good idea to have backups.

> These didn't look like the right partitions I'm not sure how I can
> find the right partition on the device. The files in the RADIO
> partition don't look like this:
> https://github.com/postmarketOS/pmbootstrap/issues/1054#issuecomment-368801113
I'll try to look at it in more details.

References:
-----------
[1]https://git.replicant.us/contrib/GNUtoo/replicant/kernel_replicant_linux/log/?h=replicant-11-i9300-modem
[2]https://git.replicant.us/contrib/GNUtoo/replicant/device_samsung_i9300
[3]https://osmocom.org/projects/quectel-modems/wiki/Samsung_Midas_4G
[4]https://github.com/Benjamin-Dobell/Heimdall/issues/494

Denis.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osuosl.org/pipermail/replicant/attachments/20211015/7e2839f1/attachment.asc>


More information about the Replicant mailing list