Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)

2024-11-28 Thread Mike Looijmans via lists.yoctoproject.org
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.





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#64372): https://lists.yoctoproject.org/g/yocto/message/64372
Mute This Topic: https://lists.yoctoproject.org/mt/109803053/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)

2024-11-27 Thread Alex Kiernan via lists.yoctoproject.org
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
 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"
>
> 
>


-- 
Alex Kiernan

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#64365): https://lists.yoctoproject.org/g/yocto/message/64365
Mute This Topic: https://lists.yoctoproject.org/mt/109803053/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)

2024-11-27 Thread Gyorgy Sarvari via lists.yoctoproject.org

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?

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#64361): https://lists.yoctoproject.org/g/yocto/message/64361
Mute This Topic: https://lists.yoctoproject.org/mt/109803053/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)

2024-11-27 Thread sateesh m via lists.yoctoproject.org
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

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#64359): https://lists.yoctoproject.org/g/yocto/message/64359
Mute This Topic: https://lists.yoctoproject.org/mt/109803053/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)

2024-11-27 Thread sateesh m via lists.yoctoproject.org
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 ?

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#64357): https://lists.yoctoproject.org/g/yocto/message/64357
Mute This Topic: https://lists.yoctoproject.org/mt/109803053/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)

2024-11-26 Thread Markus Volk
On Tue, Nov 26 2024 at 10:25:30 PM -08:00:00, sateesh m via 
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"


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#64355): https://lists.yoctoproject.org/g/yocto/message/64355
Mute This Topic: https://lists.yoctoproject.org/mt/109803053/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [yocto] Disabling unused service to reduce boot time (Krikstone version)

2024-11-26 Thread Gyorgy Sarvari via lists.yoctoproject.org

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"

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#64354): https://lists.yoctoproject.org/g/yocto/message/64354
Mute This Topic: https://lists.yoctoproject.org/mt/109803053/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-