<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Mar 18, 2015 at 6:07 PM, Alison Chaiken <span dir="ltr"><<a href="mailto:alison@she-devel.com" target="_blank">alison@she-devel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":1ar" class="" style="overflow:hidden">1. With ./configure --disable-gtk-doc --disable-seccomp<br>
--disable-selinux --disable-apparmor --disable-xz --disable-zlib<br>
--disable-pam --disable-acl --disable-smack --disable-gcrypt<br>
--disable-audit --disable-elfutils --disable-libcryptsetup<br>
--disable-qrencode --disable-microhttpd --disable-gnutls<br>
--disable-libcurl --disable-libidn  --disable-quotacheck<br>
--disable-vconsole --disable-logind --disable-machined<br>
--disable-importd --disable-hostnamed --disable-timedated<br>
--disable-localed --disable-polkit --disable-resolved<br>
--disable-networkd --disable-efi --disable-manpages<br>
--disable-hibernate --disable-tests<br>
<br>
[achaiken@localhost systemd (master)]$ ./systemd --version<br>
systemd 219<br>
-PAM -AUDIT -SELINUX +IMA -APPARMOR -SMACK +SYSVINIT +UTMP<br>
-LIBCRYPTSETUP -GCRYPT -GNUTLS -ACL -XZ -LZ4 -SECCOMP +BLKID -ELFUTILS<br>
+KMOD -IDN<br></div></blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra">I'm interested in minimal builds too, as I've been learning the ins and outs of systemd on a 32MB MIPS system about the size of a US quarter. (I learn best by repeatedly punching myself in the face.)</div><div class="gmail_extra"><br></div><div class="gmail_extra">Mantas clarified the memory measurement issue. It's one of those confusing things about Linux that hasn't improved in 20 years. Here's a 10 year old Perl script that occasionally comes in handy for more accurate memory management:</div><div class="gmail_extra"><br></div><div class="gmail_extra">  <a href="http://lists.freedesktop.org/archives/gstreamer-devel/2004-April/007545.html">http://lists.freedesktop.org/archives/gstreamer-devel/2004-April/007545.html</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">But usually, RSS is a good enough indicator.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Here's my build:<br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra"># /usr/lib/systemd/systemd --version</div><div class="gmail_extra">systemd 219</div><div class="gmail_extra">-PAM -AUDIT -SELINUX -IMA -APPARMOR -SMACK +SYSVINIT -UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS -ACL -XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN</div><div class="gmail_extra"><br></div><div class="gmail_extra">And because my tooling is somewhat limited on this device, here's the RSS straight from the source:</div><br># grep ^VmRSS /proc/1/status # systemd/init<br>VmRSS:      2584 kB<br><br><div class="gmail_extra"># grep ^VmRSS /proc/199/status # journald</div><div class="gmail_extra">VmRSS:      1452 kB</div><div><br></div><div><div># grep ^VmRSS /proc/349/status # udevd</div><div>VmRSS:      1372 kB</div></div><div><br></div><div><div># grep ^VmRSS /proc/356/status # dbus-daemon</div><div>VmRSS:      1528 kB</div></div><div><br></div><div><br></div><div>Even for my use case, booting directly into a squashfs filesystem, booting failed when I disabled blkid. That doesn't worry me too much, because ultimately systemd has to detect my flash (mtd) block devices, so it'll probably be needed anyway. (The on-disk footprint of libblkid on my system is 245.6K.)</div><div><br></div><div>I haven't disabled kmod, but could. That will mean the systemd binary won't try to load unix, ipv6, and autofs4 modules when it starts, but I can build those modules into the kernel (or load them prior to starting systemd). The only trouble is that disabling kmod will disable systemd-modules-load. Not sure if I really need that, but it's something to keep in mind. It may be possible to patch out kmod use from systemd, such that only systemd-modules-load would bring it in, but I'm not sure it's worth it. (The on-disk footprint of libkmod on my system is 71.8K.)</div><div><br></div><div>The last + is +SYSVINIT, but there doesn't appear to be a configure option to disable sysvinit compatibility anymore. From what I can tell, there's a bit of sysvinit-related logic in the systemd binary itself, but most of the icky bits are farmed off to helper binaries, such as the short-lived systemd-sysv-generator.</div><div><br></div><div><br></div><div>The other part of minimal builds is on-disk footprint and avoiding implicit work. So, I've aggressively split up my OpenWrt packages to let builders choose what they need for their use case. This doesn't make a lot of sense in beefy desktop or server land, but it's measurably important for "embedded" deployments.</div><div><br></div><div>For example, by splitting out (and not installing) the sysvinit compatibility support binaries, I save about 184K on-disk, plus a little bit of time during boot. :-)</div><div><br></div><div><br></div><div>Here's my systemd packaging work for OpenWrt if anyone's interested (which reminds me, I really need to push my latest changes):</div><div><br></div><div><a href="https://github.com/jdub/openwrt-systemd">https://github.com/jdub/openwrt-systemd</a><br></div><br>Thanks,<br>Jeff</div></div></div>