[systemd-devel] how to make the systemd init faster

Paul Menzel pmenzel+systemd-devel at molgen.mpg.de
Sat Jun 5 06:37:27 UTC 2021


Dear Dino,


Am 05.06.21 um 00:08 schrieb Dino Joseph Mycle:

> I am trying t improve my embedded system boot time which uses systemd.
> debugging understood that it spends lot time around ~1.3 second in my iMX6
> board running @800MHz on initialization of the systemd
> 
> plotting  the graph using “systemd-analyze plot > /tmp/bootime.svg “ i am
> seeing that, it spend around 1 second reading config file and generating
> dynamic file at /run/systemd. And then it start executing unit files

What does `systemd-analyze` output?

Please share that file, and read up a little about analyzing the boot 
time. As far as I know, that command is not very suitable for that and 
more or less plots the unit, which I would not consider “systemd init”. 
Please look into systemd-bootchart for example.

What distribution and systemd version do you use?

> My questions are, since its an embedded system where the hardware and
> configuration are always constant once you build the image so all these
> dynamic stuff reading from files are not required
> 
> 1)      what all i should be doing to make the boot faster

These questions (with the ones below) are too general and not suitable 
to discuss in one thread. Please start separate threads for each of 
them, and provide more data. For a general introduction into the topic I 
recommend to read the slides of the course *embedded Linux boot time 
optimization* by Bootlin [1]. (It only has one slide for systemd though, 
but – as written – please look into systemd-bootchart.)

> 2)      is there a way I can configure the files statically at compile
> time, which will reduce the time of reading each file from eMMC.

(What files?)

> 3)      How can I disable the mounting of the root partition from the
> systemd-generators as I see the kernel mounts it in my systemd and gets
> remounted, even though I commented the line in fstab

(Add `systemd.log_level=debug`, and analyze what generators are run, 
read the manual of the generator, and find out how to disable it, or 
just delete it.)


Kind regards,

Paul


[1]: 
https://bootlin.com/blog/new-training-course-embedded-linux-boot-time-optimization/


More information about the systemd-devel mailing list