11

I want to use my raspberry in an embedded application.

I am using already minibian and destroyed (accidentally) the network manager. This got me downto a boot time of 13s.

I need : Gpio pin access, audio out, Python, moc (music on console)

Ideas what and how I can remove from the system? (Example: SSH, user login, networking) It should decrease boot time.

See Answers: We got it down to ~7 seconds.

thi gg
  • 403
  • 1
  • 3
  • 12

2 Answers2

15

If you want to know what's responsible for boot time with systemd, run
systemd-analyze blame or systemd-analyze critical-chain
and then decide whether there are things you can live without and/or research the items which you think may be sped up.

Diederik de Haas
  • 809
  • 8
  • 12
  • 1
    Didn't know that thing existed at all. Nice one! – Aloha Jan 09 '16 at 13:18
  • It is cool, but beware it has an interesting definition of "running". For example, `blame` makes no mention of `ssh.service` on a fresh jessie install, even though `systemctl status ssh` refers to it as "loaded active running". So you might want to also check the more inclusive `systemctl list-units`. – goldilocks Jan 09 '16 at 16:30
  • When should I run it? after the boot finishes, or put it in /etc/rc.local or a similar file? When running it after the boot finishes for some reason it says Bootup has not finished yet (weird huh?). – Tooniis Feb 26 '18 at 09:05
12

Things I did so far:

  • Remove networking (boot stalled until network is connected): ~5sec

    update-rc.d -f networking remove

    Reenable temporary with:

    /etc/init.d/networking start && ifdown eth0 && ifup eth0

  • Removed boot messages during boot (yes printing messages eats time): ~2s

    Just add a quiet to /boot/cmdline.txt

  • Following this guide shaved also a few seconds of: ~2s

    The performance got especially better after moving to busybox and removing ntp. Additionally it is useful for me that the system is read only now, because I get better sd card lifetime on the one hand and no corruption because of power loss on the other hand.

  • Ugly, don't do this. (Or do it and blame yourself) Then I removed logging facilities: ~0.5s

    update-rc.d -f busybox-syslogd remove; update-rc.d -f busybox-klogd remove

    (Yes I just added it....)

I am currently down to 6.934 (1.226+5.708) seconds. (6.78 seconds without hdmi plugged in)

I tried my luck with systemd-readahead but this added almost one second to my boot time.

thi gg
  • 403
  • 1
  • 3
  • 12