diff --git a/files/image_config/config-setup/config-setup b/files/image_config/config-setup/config-setup index 3369b0ec86e7..a70c6c92cae5 100755 --- a/files/image_config/config-setup/config-setup +++ b/files/image_config/config-setup/config-setup @@ -429,7 +429,12 @@ boot_config() # file system to trigger. pending_config_initialization will remain set # for multi-npu platforms if we reach this case. if [[ ($NUM_ASIC -gt 1) ]]; then - return 0 + # For otn platform, do config initialization here + if [[ $PALTFROM_ASIC = ot-* ]]; then + echo "init otn configuration" + else + return 0 + fi fi if [ -e /tmp/pending_config_initialization ] || [ -e ${CONFIG_SETUP_INITIALIZATION_FLAG} ]; then @@ -466,6 +471,7 @@ ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf if [[ -f "$ASIC_CONF" ]]; then source $ASIC_CONF fi +PALTFROM_ASIC=`cat /usr/share/sonic/device/$PLATFORM/platform_asic` CMD=$1 diff --git a/files/scripts/otss.sh b/files/scripts/otss.sh old mode 100644 new mode 100755 diff --git a/src/sonic-device-data/Makefile b/src/sonic-device-data/Makefile index 7993564ea309..d04604fcedfd 100644 --- a/src/sonic-device-data/Makefile +++ b/src/sonic-device-data/Makefile @@ -3,6 +3,7 @@ SHELL = /bin/bash .SHELLFLAGS += -e MAIN_TARGET = sonic-device-data_$(SONIC_DEVICE_DATA_VERSION_FULL)_all.deb +DEVICE_ROOT := $(if $(shell cat ../../.platform | grep 'ot-'),ot-device,device) $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : pushd ./src @@ -12,8 +13,9 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Create a new dir and copy all ONIE-platform-string-named dirs into it mkdir ./device - cp -r -L ../../../device/*/* ./device/ + cp -r -L ../../../${DEVICE_ROOT}/*/* ./device/ +ifeq ($(DEVICE_ROOT), device) # Create hwsku for virtual switch for d in `find -L ../../../device -maxdepth 3 -mindepth 3 -type d | grep -vE "(plugins|led-code)"`; do \ cp -Lr $$d device/x86_64-kvm_x86_64-r0/ ; \ @@ -24,6 +26,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : grep -v ^# device/x86_64-kvm_x86_64-r0/$$(basename $$d)/port_config.ini | awk '{i=i+1;print "eth"i":"$$2}' > device/x86_64-kvm_x86_64-r0/$$(basename $$d)/lanemap.ini done; +endif # Build the package ifeq ($(CROSS_BUILD_ENVIRON), y)