Files
acrn-hypervisor/misc/sample_application/image_builder/setup_hmi_vm.sh
Liu Long c59dcc0042 ACRN:SampleApplication: Update the image build scripts
1. Add the generic extra kernel modules for HMI VM, in case the
uio_pci_generic modules is missed.
2. Add ssh server for HMI VM.
3. Add specific version for python numy modules.

Tracked-On: #7820
Signed-off-by: Liu Long <long.liu@linux.intel.com>
2022-08-15 09:19:15 +08:00

46 lines
1.1 KiB
Bash

#!/bin/bash
# Copyright (C) 2020-2022 Intel Corporation.
# SPDX-License-Identifier: BSD-3-Clause
logger_prefix="(hmi-vm-rootfs) "
source /root/.bashrc
source logger.sh
function umount_directory() {
target_dir=$1
umount -q ${target_dir} || true
}
function update_package_info() {
apt update -y && apt install python3 python3-pip \
net-tools python3-matplotlib \
linux-modules-extra-$(uname -r) \
openssh-server -y
pip3 install flask 'numpy==1.18.5' pandas posix_ipc
}
function install_desktop() {
apt install ubuntu-gnome-desktop
}
function change_root_password() {
passwd root
}
function add_normal_user() {
useradd -s /bin/bash -d /home/acrn/ -m -G sudo acrn && \
passwd acrn
}
# Change current working directory to the root to avoid "target is busy" errors
# on unmounting.
cd /
try_step "Unmounting /root" umount_directory /root
try_step "Unmounting /home" umount_directory /home
try_step "Updating package information" update_package_info
try_step "Installing GNOME desktop" install_desktop
try_step "Changing the password of the root user" change_root_password
try_step "Adding the normal user acrn" add_normal_user