May I commit binary files into MM project?

Slark Xiao slark_xiao at 163.com
Sat Apr 13 09:28:45 UTC 2024


Hi Aleksander,
Refer to your advice, and the FCC unlock procedure page,we were merging our
binary tool into the Debian test platform(Ubuntu). But we got a failure to
 unlock FCC.
We put the script into the path /usr/lib/x86_64-linux-gnu/ModemManager/
fcc-unlock.d. And this script will call our binary file FccLock in /usr/bin. 

below is the script contents:

#!/bin/sh
# require program name and at least 2 arguments
[ $# -lt 2 ] && exit 1

# first argument is DBus path, not needed here
shift

# second and next arguments are control port names
for PORT in "$@"; do
  # match port type in Linux 5.14 and newer
  grep -q MBIM "/sys/class/wwan/$PORT/type" 2>/dev/null && {
    MBIM_PORT=$PORT
    break
  }
  # match port name in Linux 5.13
  echo "$PORT" | grep -q MBIM && {
    MBIM_PORT=$PORT
    break
  }
done

# fail if no MBIM port exposed
[ -n "$MBIM_PORT" ] || exit 2

UNLOCK_RESULT=1
/usr/bin/FccLock -d /dev/$MBIM_PORT

UNLOCK_RESULT=$?
if [ $UNLOCK_RESULT -ne 0 ]; then
  echo "SDX65 FCC unlock FAILED" >&2
fi

exit $UNLOCK_RESULT


And we set the user and group of this file as root. Permission is 700.
When we restart MM, we can find that device always being locked.
But if we call this script with sudo, fcc lock would be unlocked right now. 
I also checked the log of MM, and it seems no FCC related logs would be
printed. Could you help me with some guidance and assistance?


At 2023-09-22 21:09:45, "Aleksander Morgado" <aleksandermj at chromium.org> wrote:
>Hey
>
>> I have a concern about can we commit binary files into /data/dispatcher-fcc-unlock folder?
>
>All the FCC unlock scripts/programs shipped by ModemManager are
>GPLv2+. If you can distribute your program under the GPLv2+, we could
>set it up to build from source along with the ModemManager project.
>
>If you want to dump a proprietary precompiled binary in the fcc-unlock
>folder, the answer is "no" :)
>
>Cheers!
>
>-- 
>Aleksander


More information about the ModemManager-devel mailing list