* Disabling unused service to reduce boot time (Krikstone version)
@ 2024-11-27 6:25 sateesh m
2024-11-27 7:01 ` [yocto] " Gyorgy Sarvari
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: sateesh m @ 2024-11-27 6:25 UTC (permalink / raw)
To: yocto
[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]
Hi Team,
I want to improve my boot time so for that I want to disable few services which is running during boot up. I want to disable below mentioned services.
avahi,iptables6,iptable, zeroconf,polkit,drm,
services
6.242s user@0.service
2.01s ldconfig.service
2.359s iptables.service
2.293s ip6tables.service
1.434s systemd-userdbd.service
1.463s avahi-daemon.service
1.231s modprobe@drm.service
1.170s sys-kernel-debug.mount
1.163s sys-kernel-tracing.mount
1.161s modprobe@configfs.service
1.160s tmp.mount
1.157s kmod-static-nodes.servic
I have followed below steps but not working this
SYSTEMD_AUTO_ENABLE_avahi = "disable"
SYSTEMD_SERVICE:avahi = "avahi-daemon.service"
IMAGE_INSTALL:remove = "avahi"
SYSTEMD_AUTO_ENABLE_tx-powermon = "disable"
SYSTEMD_SERVICE:tx-powermon = "tx-powermon.service"
SYSTEMD_AUTO_ENABLE_polkit = "disable"
PACKAGECONFIG:remove = "polkit"
SYSTEMD_AUTO_ENABLE_ip6tables = "disable"
PACKAGECONFIG:remove = "ip6tables"
SYSTEMD_SERVICE:ip6tables = "ip6tables.service"
IMAGE_INSTALL:remove = "ip6tables drm"
DISTRO_FEATURES:remove = "zeroconf"
[-- Attachment #2: Type: text/html, Size: 1549 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)
2024-11-27 6:25 Disabling unused service to reduce boot time (Krikstone version) sateesh m
@ 2024-11-27 7:01 ` Gyorgy Sarvari
2024-11-27 7:25 ` Markus Volk
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Gyorgy Sarvari @ 2024-11-27 7:01 UTC (permalink / raw)
To: yocto, sateesh0457
When adding this to a global config file (local.conf, etc), make sure to
1. Use the override syntax with ":"
2. Prefix the package name with "pn-"
E.g.
SYSTEMD_AUTO_ENABLE:pn-avahi="disable"
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)
2024-11-27 6:25 Disabling unused service to reduce boot time (Krikstone version) sateesh m
2024-11-27 7:01 ` [yocto] " Gyorgy Sarvari
@ 2024-11-27 7:25 ` Markus Volk
2024-11-27 8:48 ` sateesh m
2024-11-27 12:30 ` Alex Kiernan
2024-11-28 13:38 ` Mike Looijmans
3 siblings, 1 reply; 8+ messages in thread
From: Markus Volk @ 2024-11-27 7:25 UTC (permalink / raw)
To: yocto, sateesh0457; +Cc: sateesh m via lists.yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 527 bytes --]
On Tue, Nov 26 2024 at 10:25:30 PM -08:00:00, sateesh m via
lists.yoctoproject.org <sateesh0457=gmail.com@lists.yoctoproject.org>
wrote:
> DISTRO_FEATURES:remove = "zeroconf"
This should usually avoid installing avahi. I would check what else
installs avahi to your image by temporarily renaming avahi.bb so that
it can't be found, then rebuild your image and see where it fails.
Additionally removing 'polkit' from DISTRO_FEATURES should also
globally disable polkit support
DISTRO_FEATURES:remove = "zeroconf polkit"
[-- Attachment #2: Type: text/html, Size: 685 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)
2024-11-27 7:25 ` Markus Volk
@ 2024-11-27 8:48 ` sateesh m
2024-11-27 9:39 ` sateesh m
0 siblings, 1 reply; 8+ messages in thread
From: sateesh m @ 2024-11-27 8:48 UTC (permalink / raw)
To: Markus Volk, yocto
[-- Attachment #1: Type: text/plain, Size: 190 bytes --]
Hi Have tried.
DISTRO_FEATURES:remove = "zeroconf polkit"
SYSTEMD_AUTO_ENABLE:pn-avahi = "disable"
SYSTEMD_AUTO_ENABLE:pn-ip6tables = "disable"
Even not worked.Any other method ?
[-- Attachment #2: Type: text/html, Size: 293 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)
2024-11-27 8:48 ` sateesh m
@ 2024-11-27 9:39 ` sateesh m
2024-11-27 10:39 ` Gyorgy Sarvari
0 siblings, 1 reply; 8+ messages in thread
From: sateesh m @ 2024-11-27 9:39 UTC (permalink / raw)
To: sateesh m, yocto
[-- Attachment #1: Type: text/plain, Size: 273 bytes --]
Hi Team,
I have tried below method
SYSTEMD_SERVICE:${PN}-avahi = "avahi-daemon.service"
SYSTEMD_AUTO_ENABLE:${PN}-avahi = "disable"
But I am unable to disable service during boot up time. I want to disable it to improve my boot performance.
Regards,
Sateesh
[-- Attachment #2: Type: text/html, Size: 436 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)
2024-11-27 9:39 ` sateesh m
@ 2024-11-27 10:39 ` Gyorgy Sarvari
0 siblings, 0 replies; 8+ messages in thread
From: Gyorgy Sarvari @ 2024-11-27 10:39 UTC (permalink / raw)
To: yocto, sateesh0457
On 11/27/24 10:39, sateesh m via lists.yoctoproject.org wrote:
> Hi Team,
> I have tried below method
> SYSTEMD_SERVICE:${PN}-avahi = "avahi-daemon.service"
> SYSTEMD_AUTO_ENABLE:${PN}-avahi = "disable"
Don't use "...${PN}-avahi", keep it "...pn-avahi".
Couple of questions:
1. Where and how do you set these configs?
2. After setting SYSTEMD_AUTO_ENABLE:pn-avahi = "disable" for example,
what is the output of "bitbake -e avahi | grep ^SYSTEMD_AUTO"? (This
supposed to output the history of the variable, how it got its final
value for this recipe)
3. What happens if you try Markus' advice, and rename avahi recipe? What
package is complaining when you try to build your image?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)
2024-11-27 6:25 Disabling unused service to reduce boot time (Krikstone version) sateesh m
2024-11-27 7:01 ` [yocto] " Gyorgy Sarvari
2024-11-27 7:25 ` Markus Volk
@ 2024-11-27 12:30 ` Alex Kiernan
2024-11-28 13:38 ` Mike Looijmans
3 siblings, 0 replies; 8+ messages in thread
From: Alex Kiernan @ 2024-11-27 12:30 UTC (permalink / raw)
To: yocto, sateesh0457
Leave the recipes as they are and install a preset for your image
which disables those services in /usr/lib/systemd/system-preset/
(called something like 00-myimage.preset - files are read
alphabetically, first match takes effect), then list the things you
want to disable in there;
disable avahi.service
disable iptables6.service
etc.
See https://systemd.io/PRESET/
On Wed, Nov 27, 2024 at 6:25 AM sateesh m via lists.yoctoproject.org
<sateesh0457=gmail.com@lists.yoctoproject.org> wrote:
>
> Hi Team,
>
> I want to improve my boot time so for that I want to disable few services which is running during boot up. I want to disable below mentioned services.
>
> avahi,iptables6,iptable, zeroconf,polkit,drm,
>
> services
>
> 6.242s user@0.service
> 2.01s ldconfig.service
> 2.359s iptables.service
> 2.293s ip6tables.service
> 1.434s systemd-userdbd.service
> 1.463s avahi-daemon.service
> 1.231s modprobe@drm.service
> 1.170s sys-kernel-debug.mount
> 1.163s sys-kernel-tracing.mount
> 1.161s modprobe@configfs.service
> 1.160s tmp.mount
> 1.157s kmod-static-nodes.servic
>
> I have followed below steps but not working this
>
> SYSTEMD_AUTO_ENABLE_avahi = "disable"
> SYSTEMD_SERVICE:avahi = "avahi-daemon.service"
> IMAGE_INSTALL:remove = "avahi"
> SYSTEMD_AUTO_ENABLE_tx-powermon = "disable"
> SYSTEMD_SERVICE:tx-powermon = "tx-powermon.service"
> SYSTEMD_AUTO_ENABLE_polkit = "disable"
> PACKAGECONFIG:remove = "polkit"
> SYSTEMD_AUTO_ENABLE_ip6tables = "disable"
> PACKAGECONFIG:remove = "ip6tables"
> SYSTEMD_SERVICE:ip6tables = "ip6tables.service"
> IMAGE_INSTALL:remove = "ip6tables drm"
> DISTRO_FEATURES:remove = "zeroconf"
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#64353): https://lists.yoctoproject.org/g/yocto/message/64353
> Mute This Topic: https://lists.yoctoproject.org/mt/109803053/3618097
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [alex.kiernan@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
--
Alex Kiernan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)
2024-11-27 6:25 Disabling unused service to reduce boot time (Krikstone version) sateesh m
` (2 preceding siblings ...)
2024-11-27 12:30 ` Alex Kiernan
@ 2024-11-28 13:38 ` Mike Looijmans
3 siblings, 0 replies; 8+ messages in thread
From: Mike Looijmans @ 2024-11-28 13:38 UTC (permalink / raw)
To: yocto, sateesh0457
If you're serious about boot time (and image size) reduction, your first step
should be to create your own DISTRO and your own image recipe. Scrap those
first words actually, I think this should be the first step in anything that's
to become a real product.
It's much more efficient to start empty en add what you need, then to start
with an everything-but-the-kitchen-sink image and then try to remove things
without breaking other things.
Putting things in ":remove" overrides is not going to work as you expect. If
package X has a run-time dependency on package Y, then package Y will be
installed regardless of whether you added a bunch of ZZZ:remove += "Y" in some
places. To get rid of Y, you'll have to remove or alter X.
Also start with analyzing your boot time. I've seen projects where people
spent weeks on removing services and gaining less than a second, while they
left a "bootdelay" active in U-boot. Of total 10 seconds boot time, three
seconds were spent twidling thumbs in U-boot. That's a 30% boot time
improvement in less than an hour's work.
A raspberrypi 4 for example will spend about 5 seconds in its closed-source
firmware at boot. Some things are just beyond your control.
On many embedded devices boot time is dominated by the IO speed of the boot
device. Just changing your rootfs type from ext4 into LZ4-compressed squashfs
often reduces the boot time noticably.
When using systemd, "systemd-analyze criticalpath" should be your starting point.
M.
On 27-11-2024 07:25, sateesh m via lists.yoctoproject.org wrote:
> Hi Team,
> I want to improve my boot time so for that I want to disable few services
> which is running during boot up. I want to disable below mentioned services.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-11-28 13:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-27 6:25 Disabling unused service to reduce boot time (Krikstone version) sateesh m
2024-11-27 7:01 ` [yocto] " Gyorgy Sarvari
2024-11-27 7:25 ` Markus Volk
2024-11-27 8:48 ` sateesh m
2024-11-27 9:39 ` sateesh m
2024-11-27 10:39 ` Gyorgy Sarvari
2024-11-27 12:30 ` Alex Kiernan
2024-11-28 13:38 ` Mike Looijmans
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.