Reducing size of libqmi

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


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

Thanks a lot in advance for your guidance.

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


> 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:
 * basic:
 * 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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the libqmi-devel mailing list