From 5b3cba7f614524a7821e3c3108a531522a14b3d8 Mon Sep 17 00:00:00 2001 From: Sonic Build Admin Date: Wed, 1 Jul 2026 05:35:50 +0000 Subject: [PATCH] [BMC] Align is_bmc_supported check for the new infra #### What I did The BMC support check in `generate_dump` was aligned with the new infrastructure flow (https://github.com/sonic-net/sonic-buildimage/pull/26544). Instead of checking for platform-local `bmc.json` assumptions, the logic now validates host-side role and runtime BMC data from the canonical source used by the system. #### How I did it - Updated `generate_dump` BMC detection to use `device_info.is_switch_host()` together with `device_info.get_bmc_data()`. - Removed reliance on legacy platform-folder `bmc.json` existence behavior for this path. - Kept the `generate_dump` flow behavior intact while aligning detection to runtime `/etc/sonic/bmc.json`-based APIs. #### How to verify it - Run `show techsupport` (or `generate_dump`) on: - a switch-host platform with valid BMC data and verify BMC-related flow executes. - a non-switch-host / missing-BMC-data platform and verify BMC path is skipped. Signed-off-by: Sonic Build Admin #### Previous command output (if the output of a command-line utility has changed) #### New command output (if the output of a command-line utility has changed) --- scripts/generate_dump | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/generate_dump b/scripts/generate_dump index d67aba89f..0b47dcbc2 100755 --- a/scripts/generate_dump +++ b/scripts/generate_dump @@ -2271,13 +2271,7 @@ save_log_files() { # 0 if BMC is supported, 1 otherwise ############################################################################### is_bmc_supported() { - local platform=$(python3 -c "from sonic_py_common import device_info; print(device_info.get_platform())") - # Check if the required file exists - if [ ! -f /usr/share/sonic/device/$platform/bmc.json ]; then - return 1 - else - return 0 - fi + python3 -c "from sonic_py_common import device_info; import sys; sys.exit(0 if (device_info.is_switch_host() and device_info.get_bmc_data()) else 1)" } ###############################################################################