Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion files/build_scripts/aspeed_bmc_filter_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
# Console - not needed if no local display
'getty@tty1.service', # Local console - only if VGA/HDMI available

# Route counter for SNMP MIB - no FRR/vtysh and SNMP disabled on BMC
'route-counter.service',
'route-counter.timer',
}

# Services to ENSURE are included for BMC
Expand Down Expand Up @@ -274,4 +277,3 @@ def filter_services(input_file, output_file, filesystem_root=None):

filesystem_root = sys.argv[3] if len(sys.argv) > 3 else None
filter_services(sys.argv[1], sys.argv[2], filesystem_root)

20 changes: 20 additions & 0 deletions files/build_templates/init_cfg.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,30 @@
{%- endif %}
"FEATURE": {
{# delayed field if set, will start the feature systemd .timer unit instead of .service unit #}

{# List of BMC features. #}
{%- set is_bmc = sonic_asic_platform == "aspeed" %}
{# Services not applicable on BMC - force disabled. #}
{%- set bmc_disabled_features = ["eventd", "restapi", "mgmt-framework", "snmp", "swss", "syncd", "bgp", "teamd", "dhcp_relay", "nat", "sflow", "macsec", "radv"] %}
{# Services required on BMC. #}
{%- set bmc_enabled_features = ["gnmi", "telemetry"] %}
{# Services that must start without delay on BMC. #}
{%- set bmc_no_delay_features = ["database", "pmon", "lldp", "gnmi", "snmp", "telemetry", "redfish"] %}

{%- for feature, state, delayed, autorestart in features %}
"{{feature}}": {
{%- if is_bmc and feature in bmc_disabled_features %}
"state": "disabled",
{%- elif is_bmc and feature in bmc_enabled_features %}
"state": "enabled",
{%- else %}
"state": "{{state}}",
{%- endif %}
{%- if is_bmc and feature in bmc_no_delay_features %}
"delayed" : "false",
{%- else %}
"delayed" : "{{delayed}}",
{%- endif %}
{%- if feature in ["lldp"] %}
"has_global_scope": {% raw %}"{% if ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['linecard']) %}False{% else %}True{% endif %}"{% endraw %},
"has_per_asic_scope": {% raw %}"{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}False{% else %}True{% endif %}"{% endraw %},
Expand Down
Loading