mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-04-29 12:14:13 +00:00
Creating VM images is always a pain to users, and it is especially the case for those who want to set up the ACRN sample application which needs two different VM images, one with graphical desktop and the other optimized for real-time. This patch introduces the so-called "image builder" utility which is a set of scripts that can automate the creation of those VM images. The scripts will take care of: - Forking image files based on Ubuntu cloud images and enlarge the root file system per needs. - Setting up users and passwords. - Installing necessary packages to run either the graphical desktop or real-time applications. - Specific to the RT VM image, disabling services and tweaking kernel command line for optimized real-time performance. - Copying the sample applications into the images so that users can start them directly, after they launch the VMs. Tracked-On: #7820 Signed-off-by: Junjie Mao <junjie.mao@intel.com>
41 lines
978 B
Bash
41 lines
978 B
Bash
# Copyright (C) 2020-2022 Intel Corporation.
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
RED="\033[0;31m"
|
|
YELLOW="\033[1;33m"
|
|
GREEN="\033[0;32m"
|
|
NO_COLOR="\033[0m"
|
|
|
|
has_error=0
|
|
|
|
function do_step() {
|
|
local prompt=$1
|
|
local func=$2
|
|
shift 2
|
|
|
|
echo -e "$(date -Iseconds) ${logger_prefix}${YELLOW}[ Starting ]${NO_COLOR} ${prompt}"
|
|
if $func $*; then
|
|
echo -e "$(date -Iseconds) ${logger_prefix}${GREEN}[ Done ]${NO_COLOR} ${prompt}"
|
|
else
|
|
echo -e "$(date -Iseconds) ${logger_prefix}${RED}[ Failed ]${NO_COLOR} ${prompt}"
|
|
has_error=1
|
|
fi
|
|
}
|
|
|
|
function try_step() {
|
|
local prompt=$1
|
|
shift 1
|
|
|
|
if [[ ${has_error} != 0 ]]; then
|
|
echo -e "$(date -Iseconds) ${logger_prefix}${YELLOW}[ Skipped ]${NO_COLOR} ${prompt}"
|
|
else
|
|
do_step "$prompt" $*
|
|
fi
|
|
}
|
|
|
|
function print_info() {
|
|
if [[ ${has_error} == 0 ]]; then
|
|
echo -e "$(date -Iseconds) ${logger_prefix}${YELLOW}[ Info ]${NO_COLOR} $*"
|
|
fi
|
|
}
|