#!/bin/bash # # Copyright (c) 2024 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # # Factory install system setup triggered during the setup stage # echo "System Setup - Start" echo "Wait - host goenabled" until [ -f /var/run/goenabled ]; do sleep 10 done echo "Ready - host goenabled" system_mode=$(awk -F= '/system_mode/ {print $2}' /etc/platform/platform.conf) echo "Wait - system deployment reconciled" while true; do if [ "$system_mode" = "duplex" ]; then SYSTEM_RECONCILED=true else SYSTEM_RECONCILED=$(kubectl --kubeconfig=/etc/kubernetes/admin.conf -n deployment get system -o jsonpath='{.items[0].status.reconciled}') fi HOST_RECONCILED=$(kubectl --kubeconfig=/etc/kubernetes/admin.conf -n deployment get host controller-0 -o jsonpath='{.status.reconciled}') if [ "$SYSTEM_RECONCILED" = true ] && [ "$HOST_RECONCILED" = true ]; then break fi echo "Not ready - rechecking in 10s..." sleep 10 done echo "Ready - system deployment reconciled" echo "System Setup - Complete" exit 0