update/software/scripts/shell-utils
Heitor Matsui f88638a374 Include missing data migration steps on deploy start
There are additional steps needed to enable "deploy host"
operation for major release upgrades. This commit adds these
additional steps, which are:

1. Create TO release platform config directory, done during
   upgrade-start on legacy upgrade procedure
2. Create TO release rabbitmq directory, done by upgrade
   manifest after controller-1 reinstall on legacy upgrade

The commit also fixes some issues:

1. shell-utils logging functions logging nowhere after
   being sourced by other scripts
2. sync-controllers-feed script was only syncing the
   ostree_repo directory instead of the full feed content
3. major release deployment scripts ran from different
   places, now all scripts are executed from the TO release
   feed directory, or from checked out TO release ostree
   repo in case of chroot
4. change umount command from chroot_mounts to lazy umount

Note: Since the "deploy host" endpoint for major release
deployment is not yet implemented, the test plan will have
test cases that simulate the "deploy host" operation.

Test Plan
PASS: simulate "deploy host" successfully for AIO-SX
PASS: simulate "deploy host" successfully for AIO-DX

Depends-on: https://review.opendev.org/c/starlingx/config/+/913715

Story: 2010676
Task: 49703

Change-Id: Ib6ae49b3590a1e50acb305ac7482e28bcc4de403
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
2024-03-22 15:12:14 -03:00

36 lines
617 B
Plaintext

# !/bin/bash
#
# Copyright (c) 2024 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# File containing common shell functions that
# can be sourced and used by other shell scripts.
#
# If not specified by the importing
# script defaults to USM main log file
if [ -z $LOG_FILE ]; then
LOG_FILE="/var/log/software.log"
fi
log()
{
script_name=$(basename $0)
log_type=$1
shift
echo "$(date -Iseconds | cut -d'+' -f1): ${script_name}[${$}]: ${log_type}: ${@}" 2>&1 >> $LOG_FILE
}
info() {
log "INFO" $@
}
warning() {
log "WARNING" $@
}
error() {
log "ERROR" $@ >&2
}