[systemd-devel] Optimizing systemd binaries for small deployments
lennart at poettering.net
Fri Mar 29 10:01:51 PDT 2013
On Wed, 27.03.13 11:49, Tino Breddin (tbreddin at tpip.net) wrote:
> Hi there,
> We are in the process of creating a very small image for devices with
> a maximum of 4MB flash. Compared to a SysV variant which clocks in at
> ~1MB using Systemd we are currently getting images sizes of ~10MB. At
> first glance the systemd binaries seem quite large. Before diving into
> lots of optimization I wanted to ask whether anybody has pointers we
> should follow or even experience using systemd for bare minimum
Well, a few notes:
There are tons of configure options for optional featutres, make sure
you enable exactly what you need, and not more. Also, we could make even
more stuff optional, if it's sufficiently peripheral.
Also note that we ship a couple of databases with generic device info,
such as hwdb, keymaps and the rules set. They tend to be quite small,
but if dunno, you could minimize this too. Probably not worth it though.
We currently compile a lot of code into each binary,
and rely on gc-sections to clean this up for us. If minimal disk
footprint is key, then you could split this shared code into a private
.so or so.
Then, there's a ton of stuff we more or less replaced with systemd, so
you can drop cron, pm-utils, acpid, at, rsyslog, inetd, ckit,
initscripts, watched, cgrulesd, and more, because you don't really need
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel