From ff6f5197c3444e802dde44abb3cf0a1ab64c42de Mon Sep 17 00:00:00 2001 From: BYGX-wcr Date: Tue, 21 Oct 2025 00:32:34 +0000 Subject: [PATCH 1/2] Keep eth1 for multi-asic platforms --- src/sonic-device-data/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sonic-device-data/Makefile b/src/sonic-device-data/Makefile index 50729c3a17e..ac7c17109c3 100644 --- a/src/sonic-device-data/Makefile +++ b/src/sonic-device-data/Makefile @@ -52,6 +52,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : num_columns=$$(echo $$last_line | awk '{print NF}'); \ i=0; \ if [ -f $$(dirname $$d)/chassisdb.conf ] && ! grep -q '^disaggregated_chassis=1' $$(dirname $$d)/platform_env.conf; then \ + echo "Reserve midplane interface for $$(dirname $$d)"; \ i=$$(($$i+1)); \ fi; \ while IFS= read -r line; do \ @@ -70,7 +71,6 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : if [ -f device/x86_64-kvm_x86_64-r0/$$(basename $$d)/context_config.json ]; then \ rm device/x86_64-kvm_x86_64-r0/$$(basename $$d)/context_config.json; \ fi; \ - i=0; \ if [ -f $$(dirname $$d)/chassisdb.conf ]; then \ # Append Cpu0 Port in lanemap.ini if [ -f device/x86_64-kvm_x86_64-r0/$$(basename $$d)/lanemap.ini ]; then \ @@ -79,6 +79,10 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : if [ -f device/x86_64-kvm_x86_64-r0/$$(basename $$d)/coreportindexmap.ini ]; then \ echo "Cpu0:0,0" >> device/x86_64-kvm_x86_64-r0/$$(basename $$d)/coreportindexmap.ini; \ fi; \ + fi; \ + i=0; \ + if [ -f $$(dirname $$d)/chassisdb.conf ] && ! grep -q '^disaggregated_chassis=1' $$(dirname $$d)/platform_env.conf; then \ + echo "Reserve midplane interface for $$(dirname $$d)"; \ i=$$(($$i+1)); \ fi; \ subdirs="0 1 2"; \ From b9add11d965213d63a0580b8ba90fe8deb6b1e11 Mon Sep 17 00:00:00 2001 From: BYGX-wcr Date: Tue, 21 Oct 2025 21:47:25 +0000 Subject: [PATCH 2/2] add special handling for no EOL case --- src/sonic-device-data/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sonic-device-data/Makefile b/src/sonic-device-data/Makefile index ac7c17109c3..f2f8c0fcac4 100644 --- a/src/sonic-device-data/Makefile +++ b/src/sonic-device-data/Makefile @@ -55,7 +55,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : echo "Reserve midplane interface for $$(dirname $$d)"; \ i=$$(($$i+1)); \ fi; \ - while IFS= read -r line; do \ + while IFS= read -r line || [ -n "$$line" ]; do \ if ! grep -q "^#" <<< "$$line"; then \ i=$$(($$i+1)); \ lanes=$$(echo "$$line" | awk '{print $$2}'); \ @@ -97,7 +97,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : if [ -f device/x86_64-kvm_x86_64-r0/$$(basename $$d)/$$(basename $$subdir)/port_config.ini ]; then \ last_line=$$(tail -n 1 device/x86_64-kvm_x86_64-r0/$$(basename $$d)/$$(basename $$subdir)/port_config.ini); \ num_columns=$$(echo $$last_line | awk '{print NF}'); \ - while IFS= read -r line; do \ + while IFS= read -r line || [ -n "$$line" ]; do \ if ! grep -q "^#" <<< "$$line"; then \ i=$$(($$i+1)); \ lanes=$$(echo "$$line" | awk '{print $$2}'); \