[Replicant] libsamsung-ipc on xmm6160 and ste m5730

Jonathan Bakker xc-racer2 at live.ca
Thu Apr 9 20:44:35 UTC 2020


On 2020-04-09 10:19 a.m., Denis 'GNUtoo' Carikli wrote:
> I found BUSE (block device in userspace[1]) but it's very experimental
> and seem to abuse the NBD interface.
> 

Hmm, sounds like going there probably wouldn't be the best long-term decision.

>> Do note that all custom roms (Replicant included) overwrite the area
>> that it is stored in on the flash, so a return to stock is required
>> for this to work properly.
> Right, or we would need to detect if the partition still uses BML which
> might be complicated to do.
> 
> The idea behind FUSE for this part was to make the code as generic as
> possible and potentially benefit other projects as well, as this way
> BML block devices could be read even if there was no modem firmware
> inside that block layer.
> 

The more I look into this and think about it from an XMM6160 point of view, the more I think we should just rely on the /radio/modem.bin file.

1) none of my devices have a bad block in the modem partition, so I won't be able to properly test any solution.  There's no way I know of to force a bad block in Samsung BML
2) There needs to be some migration of the efs partition (in stock, its stored in a Samsung proprietary layer called stl that can't be accessed) regardless, so it makes more sense (IMO) to simply copy the modem from its block device when doing that as well.
3) Only some of the modem may be overwritten on the flash, and we'd never really know.

I think the best way to go for XMM6160 would be to search for /radio/modem.bin,samsung,<codename>, then /radio/modem.bin, then /dev/mtd5 (Nexus S location, last because other devices may not have same layout and mtd5 may be used for something else).


> In Replicant 6 I have the following for instance:
>> /dev/fuse on /mnt/runtime/read/emulated type fuse
> 
> I didn't have the time yet to look from where it comes from or how
> it was implemented.

IIRC in 4.x Android versions this is from system/core/sdcard, I don't know if newer Android version have changed it.

> 
> The question was mainly if there as a way to use arbitrary FUSE
> programs and if so how they are integrated in Android as if we go this
> route we would still need to integrate it somehow.

Ah, got it.

> 
> I just didn't have the time yet to look into it, but would be important
> to do it before starting to actually implement such scheme as we would
> need to make sure that Replicant can also use it.
> 
> As for the metadata:
> - The permissions could simply be reused from the block device.
> - The file names could be generated from the header and/or static
>   information. We now know the modem partition names more precisely
>   than before thank to that header. It also gives some more information
>   on the modem side as we can suppose that SECPACK is implementing a
>   part specific to Samsung, which probably includes the samsung-ipc
>   protocol.
> 
> References:
> -----------
> [1]https://github.com/acozzette/BUSE
> 
> Denis.
> 

Thanks,
Jonathan


More information about the Replicant mailing list