[systemd-devel] How to create minimal portable services environments?

Jérémy Rosen jeremy.rosen at smile.fr
Wed Aug 29 11:16:46 UTC 2018


I know that this is not the usual answer to that sort of question but....

you should try buildroot, rather than base yourself on debian.

When you deactivate the kernel and busybox (it's done through a 
menuconfig type interface) you will get the minimal type of system you want.



On 29/08/2018 12:24, Wojtek Swiatek wrote:
> Hello everyone,
>
> v239 brought in portable services (a good description is at
> http://0pointer.net/blog/walkthrough-for-portable-services.html) and while
> I still cannot make it work (I do not have a /usr/lib/systemd/portablectl
> despite having systemd --version reporting 239, but this is going to be a
> separate question) I wanted to understand how to build a minimal portable
> service.
>
> A practical example could be dnsmasq. It is provided as a package and
> depends (apt show dnsmasq) on netbase, dnsmasq-base, init-system-helpers
> (>= 1.18~), lsb-base (>= 3.0-6). These packages may further depend on
> something else.
> It also brings in a set of files into the system:
>
> root at srv ~# dpkg-query -L dnsmasq
> /.
> /etc
> /etc/default
> /etc/default/dnsmasq
> /etc/dnsmasq.conf
> /etc/dnsmasq.d
> /etc/dnsmasq.d/README
> /etc/init.d
> /etc/init.d/dnsmasq
> /etc/insserv.conf.d
> /etc/insserv.conf.d/dnsmasq
> /etc/resolvconf
> /etc/resolvconf/update.d
> /etc/resolvconf/update.d/dnsmasq
> /lib
> /lib/systemd
> /lib/systemd/system
> /lib/systemd/system/dnsmasq.service
> /usr
> /usr/lib
> /usr/lib/resolvconf
> /usr/lib/resolvconf/dpkg-event.d
> /usr/lib/resolvconf/dpkg-event.d/dnsmasq
> /usr/share
> /usr/share/dnsmasq
> /usr/share/dnsmasq/installed-marker
> /usr/share/doc
> /usr/share/doc/dnsmasq
>
> Some of these are existing directories, some new ones and then  there are
> files (new, but possibly existing as well).
>
> *How should I create a filesystem which has only the files required by the
> packages (= the ones it brings in, as well as all the dependencies)?*
>
> I know that I can dbootstrap a new system and install there dnsmasq - and
> then hopefully use this as the tree to be attached via portablectl. This
> however means that I do not have a "dnsmasq" portable service but rather a
> "bionic install with dnsmasq installed on top". The main reason for me to
> use portable service is to create small packages which encompass my
> service, to be mounted on a more or less base core OS install (say, minimal
> bionic). This would allow to get rid of several nspawn containers which do
> exactly this (base OS + a package installed on top).
>
> One of the ideas I had (but which seems very wrong) is to have a copy of
> the core OS, then in another copy install the required packages, and then
> make a diff of the two directories. But this looks horrible and is hardly
> maintainable.
>
> I would very much  appreciate any pointers or hints on how to approach this.
>
> Wojtek
>
>
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- 
SMILE <http://www.smile.eu/>

20 rue des Jardins
92600 Asnières-sur-Seine

	
*Jérémy ROSEN*
Architecte technique
Responsable de l'expertise Smile-ECS

email jeremy.rosen at smile.fr <mailto:jeremy.rosen at smile.fr>
phone +33141402967
url http://www.smile.eu

Twitter <https://twitter.com/GroupeSmile> Facebook 
<https://www.facebook.com/smileopensource> LinkedIn 
<https://www.linkedin.com/company/smile> Github 
<https://github.com/Smile-SA>


Découvrez l’univers Smile, rendez-vous sur smile.eu 
<http://smile.eu/?utm_source=signature&utm_medium=email&utm_campaign=signature>

eco Pour la planète, n'imprimez ce mail que si c'est nécessaire
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180829/7412931d/attachment-0001.html>


More information about the systemd-devel mailing list