Message "collection" support

Aleksander Morgado aleksander at aleksander.es
Thu Apr 16 07:36:43 UTC 2020


Hey!

> > I've prepared a branch that allows building "tailored" libqmi
> > libraries, i.e. selecting just a subset of all the available
> > commands.
> > See:
> >
> > https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/merge_requests/109
> >
> > By default it would have 3 different collections: "minimal", with
> > just
> > a few messages required for basic functionality (e.g. if you're going
> > to use qmi-network), "basic" if you need further functionalities like
> > qmi-firmware-update or integration with ModemManager, and "full" with
> > all current supported messages.
> >
> > Users building their own systems can patch libqmi by adding a new
> > custom collection file under e.g. /data/qmi-collection-vendor.json,
> > and will then be able to configure using --enable-collection=vendor.
> >
> > When a collection is selected, only the messages in the collection
> > are
> > included in the library *and* in qmicli, this is, qmicli also gets
> > tailored for the custom message subset.
> >
> > These are the minimal and basic collections included:
> > https://gitlab.freedesktop.org/aleksm/libqmi/-/blob/aleksander/collections/data/qmi-collection-minimal.json
> > https://gitlab.freedesktop.org/aleksm/libqmi/-/blob/aleksander/collections/data/qmi-collection-basic.json
> >
> > The code in qmicli gets a bit polluted with #ifdefs but I believe
> > that
> > the benefit is bigger than the maintenance burden it carries.
> >
> > The main reasoning for this is that there are systems with limited
> > available memory or disk space, and libqmi is not really optimized in
> > that regard right now. In the build tests I've done in different
> > systems, I've seen a reduction of file size of up to 50% when using
> > the basic collection w.r.t. the full collection.
> >
> > Standard distributions should definitely pick the "full" collection,
> > though.
> >
> > What do you all think?
>
> Works for me, if size is really a blocker in some systems.
>

It is in some, yes. A lot of people and companies are starting to use
MM in openwrt, and some struggle to have everything properly in low
RAM systems. This is not the final solution to the problem, but it
helps, same as e.g. installing ModemManager just with the plugin you
expect to use, and such.

I'll add some additional CI build tests to include testing the
built-in collections, and then will get it merged.
Cheers!

-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list