Skip to content

Commit 04ad23a

Browse files
authored
[code sync] Merge code from sonic-net/sonic-buildimage:202511 to 202512 (#2018)
```<br>* e8cc2f0 - (HEAD -> 202512) Merge branch '202511' of https://github.com/sonic-net/sonic-buildimage into 202512 (2026-02-27) [Sonic Automation] * 1b69741 - (head/202511) [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#25595) (2026-02-27) [mssonicbld] * 168228b - [202511] [Mellanox] Update FW/SDK to xx.2016.3412/4.8.3412 and SAI to SAIBuild2511.35.3400.5 (#25702) (2026-02-26) [Volodymyr Samotiy] * 7e6eb64 - Integrate HW-MGMT 7.0050.3002 Changes (#25703) (2026-02-26) [Volodymyr Samotiy] * a81e822 - config-setup: Prefer minigraph.xml over ZTP when config_db.json is absent (#25657) (2026-02-26) [mssonicbld] * 5ecd38f - Update NH PAI version from 3.14.0-2 -> 3.14.0-3 (#25680) (2026-02-25) [mssonicbld]<br>```
2 parents aca247a + e8cc2f0 commit 04ad23a

File tree

8 files changed

+75
-25
lines changed

8 files changed

+75
-25
lines changed

files/image_config/config-setup/config-setup

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,37 @@ copy_config_files_and_directories()
170170
done
171171
}
172172

173-
# Check if SONiC switch has booted after a warm reboot request
173+
# Check if SONiC switch has booted after a warm reboot request.
174+
# Prefers STATE_DB when available (reflects true warm boot state and
175+
# gets cleared after warm boot completes). Falls back to /proc/cmdline
176+
# only during the "boot" command when database services may not be up yet.
174177
check_system_warm_boot()
175178
{
176-
SYSTEM_WARM_START=`sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable`
177-
# SYSTEM_WARM_START could be empty, always make WARM_BOOT meaningful.
178-
if [[ x"$SYSTEM_WARM_START" == x"true" ]]; then
179-
WARM_BOOT="true"
180-
else
181-
WARM_BOOT="false"
179+
WARM_BOOT="false"
180+
181+
# Try STATE_DB first — authoritative source that reflects current
182+
# warm boot state and is cleared after warm boot completes.
183+
SYSTEM_WARM_START=$(sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable)
184+
DB_RC=$?
185+
186+
if [ $DB_RC -eq 0 ]; then
187+
# DB is reachable — use its answer exclusively
188+
if [[ x"$SYSTEM_WARM_START" == x"true" ]]; then
189+
WARM_BOOT="true"
190+
fi
191+
return
192+
fi
193+
194+
# DB not available — fall back to /proc/cmdline only during boot,
195+
# when database services may not have started yet.
196+
# Outside of boot context, /proc/cmdline may contain a stale
197+
# SONIC_BOOT_TYPE=warm from a previous warm reboot.
198+
if [ "$CMD" = "boot" ]; then
199+
case "$(cat /proc/cmdline)" in
200+
*SONIC_BOOT_TYPE=warm*)
201+
WARM_BOOT="true"
202+
;;
203+
esac
182204
fi
183205
}
184206

@@ -256,11 +278,24 @@ generate_config()
256278
}
257279

258280
# Create SONiC configuration for first time bootup
259-
# - If ZTP is enabled, ZTP configuraion is created
260-
# - If ZTP is disabled, factory default configuration
281+
# - If minigraph.xml is available, use it to generate configuration
282+
# - If ZTP is enabled and no minigraph, ZTP configuration is created
283+
# - If ZTP is disabled and no minigraph, factory default configuration
261284
# is created
262285
do_config_initialization()
263286
{
287+
# If minigraph.xml is available, prefer it over ZTP/factory default.
288+
# This avoids ZTP triggering a config reload that removes management IP
289+
# when the device has a valid minigraph but no config_db.json
290+
# (e.g., during upgrade path tests).
291+
if [ -r ${MINGRAPH_FILE} ]; then
292+
echo "No config_db.json found but minigraph.xml is available, using minigraph..."
293+
reload_minigraph
294+
rm -f /tmp/pending_config_initialization
295+
sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"
296+
return 0
297+
fi
298+
264299
if ! ztp_is_enabled ; then
265300
echo "No configuration detected, generating factory default configuration..."
266301
generate_config factory ${CONFIG_DB_JSON}
@@ -412,6 +447,18 @@ boot_config()
412447
do_config_migration
413448
fi
414449

450+
# During warm boot the existing configuration must be preserved.
451+
# Never run config initialization or ZTP — doing so would generate
452+
# a new config and trigger config reload, wiping management IP.
453+
if [ x"${WARM_BOOT}" == x"true" ]; then
454+
echo "Warm boot detected, skipping config initialization and ZTP."
455+
# Mark config as initialized so subsequent boots don't re-trigger
456+
# initialization unnecessarily (warm-reboot to new image scenario).
457+
sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"
458+
rm -f /tmp/pending_config_initialization
459+
return 0
460+
fi
461+
415462
# For multi-npu platfrom we don't support config initialization. Assumption
416463
# is there should be existing minigraph or config_db from previous image
417464
# file system to trigger. pending_config_initialization will remain set
@@ -424,11 +471,14 @@ boot_config()
424471
do_config_initialization
425472
fi
426473

427-
# If no startup configuration is found, create a configuration to be used
474+
# If no startup configuration is found, create a configuration to be used.
475+
# do_config_initialization() will prefer minigraph.xml if available,
476+
# falling back to ZTP or factory default only when no minigraph exists.
428477
if [ ! -e ${CONFIG_DB_JSON} ]; then
429478
do_config_initialization
430-
# force ZTP to restart
431-
if ztp_is_enabled ; then
479+
# force ZTP to restart (only relevant when ZTP was actually used,
480+
# i.e., when minigraph.xml was not available)
481+
if [ ! -e ${MINGRAPH_FILE} ] && ztp_is_enabled ; then
432482
ztp_status=$(ztp status -c)
433483
if [ "$ztp_status" = "5:SUCCESS" ] || \
434484
[ "$ztp_status" = "6:FAILED" ]; then

platform/components/docker-gbsyncd-agera2.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Agera2 PAI Library Package - URL-based download similar to broncos
2-
LIBSAI_AGERA2_VERSION = 3.14.0-2
2+
LIBSAI_AGERA2_VERSION = 3.14.0-3
33
LIBSAI_AGERA2_BRANCH_NAME = REL_3.14
44

55
LIBSAI_AGERA2_URL_PREFIX = "https://packages.trafficmanager.net/public/sai/bcmpai/$(LIBSAI_AGERA2_BRANCH_NAME)/$(LIBSAI_AGERA2_VERSION)"

platform/mellanox/fw.mk

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,38 @@ MLNX_FW_BASE_PATH = $(MLNX_SDK_BASE_PATH)
2121
# Place an URL here to FW if you want to download FW instead
2222
MLNX_FW_BASE_URL =
2323

24-
SIMX_VERSION = 25.10-1153
24+
SIMX_VERSION = 26.1-1158
2525

2626
FW_FROM_URL = y
2727

28-
MLNX_FW_ASSETS_RELEASE_TAG = fw-2016.3404
28+
MLNX_FW_ASSETS_RELEASE_TAG = fw-2016.3412
2929
MLNX_FW_ASSETS_URL = $(MLNX_ASSETS_GITHUB_URL)/releases/download/$(MLNX_FW_ASSETS_RELEASE_TAG)
3030

3131
ifeq ($(MLNX_FW_BASE_URL), )
3232
MLNX_FW_BASE_URL = $(MLNX_FW_ASSETS_URL)
3333
endif
3434

35-
MLNX_SPC_FW_VERSION = 13.2016.3404
35+
MLNX_SPC_FW_VERSION = 13.2016.3412
3636
MLNX_SPC_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_SPC_FW_VERSION))-EVB.mfa
3737
$(MLNX_SPC_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
3838
$(MLNX_SPC_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC_FW_FILE)
3939

40-
MLNX_SPC2_FW_VERSION = 29.2016.3404
40+
MLNX_SPC2_FW_VERSION = 29.2016.3412
4141
MLNX_SPC2_FW_FILE = fw-SPC2-rel-$(subst .,_,$(MLNX_SPC2_FW_VERSION))-EVB.mfa
4242
$(MLNX_SPC2_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
4343
$(MLNX_SPC2_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC2_FW_FILE)
4444

45-
MLNX_SPC3_FW_VERSION = 30.2016.3404
45+
MLNX_SPC3_FW_VERSION = 30.2016.3412
4646
MLNX_SPC3_FW_FILE = fw-SPC3-rel-$(subst .,_,$(MLNX_SPC3_FW_VERSION))-EVB.mfa
4747
$(MLNX_SPC3_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
4848
$(MLNX_SPC3_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC3_FW_FILE)
4949

50-
MLNX_SPC4_FW_VERSION = 34.2016.3404
50+
MLNX_SPC4_FW_VERSION = 34.2016.3412
5151
MLNX_SPC4_FW_FILE = fw-SPC4-rel-$(subst .,_,$(MLNX_SPC4_FW_VERSION))-EVB.mfa
5252
$(MLNX_SPC4_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
5353
$(MLNX_SPC4_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC4_FW_FILE)
5454

55-
MLNX_SPC5_FW_VERSION = 37.2016.3404
55+
MLNX_SPC5_FW_VERSION = 37.2016.3412
5656
MLNX_SPC5_FW_FILE = fw-SPC5-rel-$(subst .,_,$(MLNX_SPC5_FW_VERSION))-EVB.mfa
5757
$(MLNX_SPC5_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
5858
$(MLNX_SPC5_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC5_FW_FILE)

platform/mellanox/hw-management.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#
1818
# Mellanox HW Management
1919

20-
MLNX_HW_MANAGEMENT_VERSION = 7.0050.3001
20+
MLNX_HW_MANAGEMENT_VERSION = 7.0050.3002
2121

2222
export MLNX_HW_MANAGEMENT_VERSION
2323

Submodule hw-mgmt updated 29 files

platform/mellanox/mlnx-sai.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Mellanox SAI
22

3-
MLNX_SAI_VERSION = SAIBuild2511.35.3400.0
3+
MLNX_SAI_VERSION = SAIBuild2511.35.3400.5
44
MLNX_SAI_ASSETS_GITHUB_URL = https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins
55
MLNX_SAI_ASSETS_RELEASE_TAG = sai-$(MLNX_SAI_VERSION)-$(BLDENV)-$(CONFIGURED_ARCH)
66
MLNX_SAI_ASSETS_URL = $(MLNX_SAI_ASSETS_GITHUB_URL)/releases/download/$(MLNX_SAI_ASSETS_RELEASE_TAG)

platform/mellanox/sdk.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18-
MLNX_SDK_VERSION = 4.8.3404
18+
MLNX_SDK_VERSION = 4.8.3412
1919
MLNX_SDK_ISSU_VERSION = 101
2020

2121
MLNX_SDK_DRIVERS_GITHUB_URL = https://github.com/Mellanox/Spectrum-SDK-Drivers

0 commit comments

Comments
 (0)