Skip to main content
Jzhua
Associate III
December 4, 2019
Question

How to remove unused services

  • December 4, 2019
  • 2 replies
  • 1938 views

how do i remove service at the build time,such like avahi-daemon,systemd-timesyncd

I don't need them,I hope the system can start as soon as possible by removing unnecessary startup items

This topic has been closed for replies.

2 replies

PatrickF
ST Employee
December 4, 2019
In order to give better visibility on the answered topics, please click on 'Best Answer' on the reply which solved your issue or answered your question.Tip of the day: Try Sidekick STM32 AI agent
Jzhua
JzhuaAuthor
Associate III
December 4, 2019

I have read that page.

I mean how to disable a service at build time so that it does not load automatically at system startup.

For example, how to edit the .bb file so that systemd-timesyncd is not loaded at system startup, but is started by my app when needed.

Jzhua
JzhuaAuthor
Associate III
December 4, 2019

The default configuration loads many services, some of which can be disabled or started when needed, such as Bluetooth, wifi

Bernard PUEL
ST Technical Moderator
December 4, 2019

Hello,

Difficult to answer your question as there are many ways to do it and it is really depending on your background + target.

1/ you could use another build system as Yocto: buildroot is very convenient is you want to build a small and manageable system (in term of component count)

2/ you can build your own distribution with yocto: see: poky/meta-poky/conf/distro/poky-tiny.conf  for example

3/ you can choose from ST distribution minimal core image: in envsetup.sh, no distro then build core-image-minimal

4/ you can remove features from ST distribution: From your image.bb, remove the features you don't need (also in the sub packages) so that you keep only what you need. If the feature is removed, Yocto will also remove the services associated to this feature from systemd launch.