Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions platform/mellanox/sonic-bfb-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,15 @@ bfb_install_call() {
fi
remove_cx_pci_device "$rshim" "$dpu"

# Construct bfb-install command
local cmd="timeout ${timeout_secs}s bfb-install -b $bfb -r $rshim"
# Create config file with NPU time for DPU time synchronization
local config_file=$(mktemp "${WORK_DIR}/bf_cfg.XXXXX")
if [ -n "$appendix" ]; then
cmd="$cmd -c $appendix"
cat "$appendix" > "$config_file"
fi
echo "NPU_TIME=$(date +%s)" >> "$config_file"

# Construct bfb-install command
local cmd="timeout ${timeout_secs}s bfb-install -b $bfb -r $rshim -c $config_file"
log_info "Installing bfb image on DPU connected to $rshim using $cmd"

# Run installation with progress monitoring
Expand All @@ -307,6 +311,8 @@ bfb_install_call() {
cat "$result_file"
fi

rm -f "$config_file"

# Stop rshim application and reset DPU
stop_rshim_daemon "$rid"
log_info "$rid: Resetting DPU $dpu"
Expand Down
9 changes: 9 additions & 0 deletions platform/nvidia-bluefield/installer/install.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ if [ -e /etc/bf.cfg ]; then
. /etc/bf.cfg
fi

if [ -n "$NPU_TIME" ]; then
log "Setting system time from NPU: $NPU_TIME"
date -s "@$NPU_TIME"
log "System time set to: $(date)"
if [ -e /dev/rtc0 ]; then
hwclock --systohc --utc
log "Hardware clock synced from system time"
fi

# Flags that can be overwritten by the bf.cfg
declare -r SKIP_FIRMWARE_UPGRADE="${SKIP_FIRMWARE_UPGRADE:-false}"
declare -r FORCE_FW_CONFIG_RESET="${FORCE_FW_CONFIG_RESET:-false}"
Expand Down