mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-20 20:53:46 +00:00
SampleApplication: Add the proxy setting for HMI
Add the proxy config file for the HMI VM images, in case install the packages failed. Tracked-On: #7820 Signed-off-by: Liu Long <long.liu@linux.intel.com>
This commit is contained in:
parent
b8c85135d9
commit
a72a2e1795
@ -91,6 +91,16 @@ function copy_and_enlarge_image() {
|
|||||||
growpart ${dest_image} 1
|
growpart ${dest_image} 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dump_proxy() {
|
||||||
|
local temp_file=$(mktemp /tmp/proxy.XXXX)
|
||||||
|
|
||||||
|
sudo apt-config dump | grep -i proxy > ${temp_file} 2>&1
|
||||||
|
sudo mv ${temp_file} proxy.conf
|
||||||
|
|
||||||
|
echo "$(env | grep -Ei _proxy | sed -e 's/^/export /')" > bashrc
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function resizing_guest_root() {
|
function resizing_guest_root() {
|
||||||
local part_file=$1
|
local part_file=$1
|
||||||
|
|
||||||
@ -134,10 +144,12 @@ function setup_hmi_vm_rootfs() {
|
|||||||
local mount_point=$1
|
local mount_point=$1
|
||||||
|
|
||||||
sudo cp setup_hmi_vm.sh logger.sh ${mount_point}/ && \
|
sudo cp setup_hmi_vm.sh logger.sh ${mount_point}/ && \
|
||||||
sudo cp ../build/userApp ${mount_point}/root && \
|
sudo cp ../build/userApp ../build/histapp.py ${mount_point}/root && \
|
||||||
sudo cp ../build/histapp.py ${mount_point}/root && \
|
sudo cp proxy.conf ${mount_point}/etc/apt/apt.conf.d/proxy.conf && \
|
||||||
|
sudo cp bashrc ${mount_point}/root/.bashrc && \
|
||||||
sudo schroot -c acrn-guest bash /setup_hmi_vm.sh && \
|
sudo schroot -c acrn-guest bash /setup_hmi_vm.sh && \
|
||||||
sudo rm ${mount_point}/setup_hmi_vm.sh ${mount_point}/logger.sh
|
sudo rm ${mount_point}/setup_hmi_vm.sh ${mount_point}/logger.sh && \
|
||||||
|
sudo rm bashrc
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup_rt_vm_rootfs() {
|
function setup_rt_vm_rootfs() {
|
||||||
@ -191,6 +203,7 @@ print_info "Guest image loop-mounted at /dev/${loop_dev}"
|
|||||||
try_step "Resizing guest root file system" resizing_guest_root /dev/mapper/${loop_dev}p1
|
try_step "Resizing guest root file system" resizing_guest_root /dev/mapper/${loop_dev}p1
|
||||||
try_step "Mounting guest root file system at ${mount_point}" mount_filesystem /dev/mapper/${loop_dev}p1 ${mount_point}
|
try_step "Mounting guest root file system at ${mount_point}" mount_filesystem /dev/mapper/${loop_dev}p1 ${mount_point}
|
||||||
try_step "Preparing schroot configuration" create_schroot_config ${mount_point}
|
try_step "Preparing schroot configuration" create_schroot_config ${mount_point}
|
||||||
|
try_step "Extracting network proxy configurations" dump_proxy
|
||||||
|
|
||||||
if [[ ${vm_type} == "hmi-vm" ]]; then
|
if [[ ${vm_type} == "hmi-vm" ]]; then
|
||||||
try_step "Initializing guest root file system for HMI VM" setup_hmi_vm_rootfs ${mount_point}
|
try_step "Initializing guest root file system for HMI VM" setup_hmi_vm_rootfs ${mount_point}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
logger_prefix="(hmi-vm-rootfs) "
|
logger_prefix="(hmi-vm-rootfs) "
|
||||||
|
source ~/.bashrc
|
||||||
source logger.sh
|
source logger.sh
|
||||||
|
|
||||||
function umount_directory() {
|
function umount_directory() {
|
||||||
@ -11,8 +12,8 @@ function umount_directory() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function update_package_info() {
|
function update_package_info() {
|
||||||
apt update
|
apt update -y && apt install python3 python3-pip \
|
||||||
apt install python3 python3-pip net-tools python3-matplotlib
|
net-tools python3-matplotlib -y
|
||||||
pip3 install flask numpy pandas posix_ipc
|
pip3 install flask numpy pandas posix_ipc
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user