Reducing size of libqmi

Sai Chaitanya msaichaitanya at gmail.com
Wed Nov 3 13:17:51 UTC 2021


Hey,

This worked like a charm! By adding my own collection, I could bring the
libqmi size from 3.1 MB -> 1.3 MB and still got my stuff working.

Now I am wondering if there is a simple configuration option like this to
remove the QMICLI tool, which is getting added by default, but I don't need
it.

Thanks a lot in advance for your guidance.

Regards,
Sai.
------------------------------
*From:* Aleksander Morgado <aleksander at aleksander.es>
*Sent:* 02 February 2021 09:58
*To:* Sai Mantripragada
*Cc:* libqmi-devel at lists.freedesktop.org; Andre Valentin
*Subject:* Re: Reducing size of libqmi

Hey

>
> I have a QMI device, which I am able to control using libqmi. But looks
like it loads may services that I do not need. Is there a way to disable a
set of APIs that are not required, within libqmi, to reduce the size of the
library loaded into my build?
>

Yes! That can be done in the latest libqmi 1.26.x branch or git
master. The way to do this is by writing your own "collection" of
messages to include in the library. By default we provide 3
collections in the default build:
 * minimal:
https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/blob/master/data/qmi-collection-minimal.json
 * basic:
https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/blob/master/data/qmi-collection-basic.json
 * full: all messages include, the default if nothing specified.

If you need a custom set of messages, you should probably check if
"basic" is enough for you (e.g. "basic" is the minimum set of messages
required by ModemManager) and otherwise check the "minimal"
collection. If none of these suits your needs, you can create your own
collection file, you just need to place it as
/data/qmi-collection-SOMETHING.json in the sources, and then use the
--enable-collection=SOMETHING in the ./configure call.

The available qmicli commands will depend on what messages you have
selected.

--
Aleksander
https://aleksander.es


--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20211103/aa21ce3f/attachment.htm>


More information about the libqmi-devel mailing list