Optimise systemd service in root file system

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Optimise systemd service in root file system

4,629 次查看
vinothkumars
Senior Contributor IV

Hi All,

I am working on imx6solo + orion linux. I want to disable the systemd services for reduce the boot time and I analyse following systemd service by using the systemd-analyze blame command.

48.909s systemd-journald.service
36.501s dev-mmcblk0p1.device
16.426s systemd-journal-flush.service
10.382s udev-trigger.service
9.470s systemd-tmpfiles-setup.service
9.398s systemd-timesyncd.service
8.495s systemd-udevd.service
6.603s systemd-update-utmp.service
3.911s systemd-logind.service
3.527s remount-rfs-rw.service
3.448s systemd-tmpfiles-setup-dev.service
3.303s sys-fs-fuse-connections.mount
3.139s systemd-sysctl.service
2.358s systemd-remount-fs.service
2.175s udev.service
1.590s sys-kernel-debug.mount
1.369s systemd-random-seed.service
1.210s tmp.mount
1.113s systemd-update-utmp-runlevel.service
193ms systemd-networkd.service
191ms systemd-resolved.service

These services takes almost 1 minute 30 seconds to complete. 

Is there any possible way to disable these service when boot ? and I really want to disable in code side. 

Or I want to reduce the time.

Regards,

VinothS

Regards,
Vinothkumar Sekar
标签 (4)
标记 (2)
0 项奖励
回复
8 回复数

4,195 次查看
b36401
NXP Employee
NXP Employee

There is nothing special regarding to i.MX. I can provide you some common recommendations.

You can remove all unnecessary options and modules from the kernel.
For example if you do not need ethernet you can compile the kernel without its support.

And you need to remove all unnecessary packages and disable all unnecessary services.

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

4,195 次查看
vinothkumars
Senior Contributor IV

Hi Victor,

Thank you for you reply.

Do you know how to disable the systemd services?

Regards, VinothS

Regards,
Vinothkumar Sekar
0 项奖励
回复

4,195 次查看
turker
Contributor IV

You can disable a service using "systemctl disable servicename" command or remove the related symlink under /etc/systemd/system/

4,195 次查看
vinothkumars
Senior Contributor IV

Thank you for your reply..

Regards,
Vinothkumar Sekar
0 项奖励
回复

4,195 次查看
vinothkumars
Senior Contributor IV

I removed the systemd packages and now the boot take with in 10 seconds. I closed this thread now.

Regards,

VinothS

Regards,
Vinothkumar Sekar
0 项奖励
回复

4,195 次查看
Raana
Contributor III

Hi Vinoth,

May I know, How you removed ? and where ?

Because, I'm trying to reduce the rootfs size. At the same time, do you know how to disable hwdb files ?

Thank You.

Best Regards,

J.P.Raja

0 项奖励
回复

4,195 次查看
vinothkumars
Senior Contributor IV

Hi,

I removed the whole systemd packages from the build.

Thanks,

VinotS,

Regards,
Vinothkumar Sekar
0 项奖励
回复

2,550 次查看
charanguda
Contributor I

Hi,

how did you removed whole systemd could you please explain briefly.

Thanks,

Regards, 

charan

0 项奖励
回复