#!/bin/bash set -e echo "--- Starting NXP DPAA1 Hardware Initialization ---" # Only unbind the SFP ports (MAC 9 and 10) # Leave MAC 3, 4, 5, 6 for Linux (Kubernetes management) SFP_PORTS="9 10" echo "Releasing SFP hardware ports from kernel..." for port in $SFP_PORTS; do if [ -e /sys/bus/platform/drivers/fsl-dpa-ethernet/fm0-port.$port ]; then echo "fm0-port.$port" > /sys/bus/platform/drivers/fsl-dpa-ethernet/unbind 2>/dev/null || true echo "Successfully unbound MAC $port" else echo "MAC $port already released or not found." fi done # Run FMC if [ -f /etc/fmc/config.xml ]; then echo "Applying FMC Configuration..." cd /etc/fmc # Using -l dbg1 helps see exactly why a port fails if it happens again fmc -c /etc/fmc/config.xml -p /etc/fmc/policy.xml -a -l dbg1 echo "FMC Configuration applied successfully." else echo "ERROR: /etc/fmc/config.xml not found!" exit 1 fi echo "--- Starting VPP Forwarder ---" exec vpp -c /etc/vpp/startup.conf