sonic-buildimage icon indicating copy to clipboard operation
sonic-buildimage copied to clipboard

[systemd-generator] add support for platform config file

Open Yakiv-Huryk opened this issue 2 years ago • 2 comments

In addition to /etc/sonic/generated_services.conf, the generator now processes the platform config in /usr/share/sonic/device/%platform/services.conf

Why I did it

This is to support platform-specific systemd-sonic-generator config file. It allows loading additional services based on platform (/etc/machine.conf) information on boot.

Work item tracking
  • Microsoft ADO (number only):

How I did it

Added /usr/share/sonic/device/%platform/services.conf processing (if such file exists). The %platform is already available in systemd-sonic-generator (read from /etc/machine.conf) The unit test is updated to cover new functionality.

How to verify it

Run the systemd-sonic-generator unit tests

Which release branch to backport (provide reason below if selected)

  • [ ] 201811
  • [ ] 201911
  • [ ] 202006
  • [ ] 202012
  • [ ] 202106
  • [ ] 202111
  • [ ] 202205
  • [ ] 202211
  • [ ] 202305

Tested branch (Please provide the tested image version)

  • [ ]
  • [ ]

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Yakiv-Huryk avatar Apr 19 '24 17:04 Yakiv-Huryk

Could you provide the HLD link about this scenario or description for service.conf?

Pterosaur avatar Apr 20 '24 18:04 Pterosaur

Could you provide the HLD link about this scenario or description for service.conf?

There is no HLD for this. It’s a small extension to the sonic-system-generator.

The use-case for this change is that on the Smart Switch platform we need to run an additional systemd service. We include and disable it in the sonic-mellanox image and then we can enable it on boot only on the Smart Switch platform (via this change)

Yakiv-Huryk avatar Apr 25 '24 10:04 Yakiv-Huryk