Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
vm-manager (0.7.1) stable; urgency=medium

* Bump version to 0.7.1

-- Qi, Yadong <[email protected]> Thu, 28 Jul 2022 14:10:52 +0800

vm-manager (0.6.1) stable; urgency=medium

* Bum version to 0.6.1
Expand Down
27 changes: 21 additions & 6 deletions scripts/setup_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -eE

#--------- Global variable -------------------
reboot_required=0
QEMU_REL="qemu-6.0.0"
QEMU_REL="qemu-7.0.0"
CIV_WORK_DIR=$(pwd)
CIV_GOP_DIR=$CIV_WORK_DIR/GOP_PKG
CIV_VERTICAl_DIR=$CIV_WORK_DIR/vertical_patches/host
Expand Down Expand Up @@ -187,8 +187,12 @@ function ubu_install_qemu_gvt(){
}

function ubu_build_ovmf_gvt(){
[ -d $CIV_WORK_DIR/edk2 ] && rm -rf $CIV_WORK_DIR/edk2

sudo apt install -y uuid-dev nasm acpidump iasl
cd $CIV_WORK_DIR/$QEMU_REL/roms/edk2
git clone https://github.com/tianocore/edk2.git
cd $CIV_WORK_DIR/edk2
git checkout -b stable202111 edk2-stable202111

patch -p1 < $CIV_WORK_DIR/patches/ovmf/0001-OvmfPkg-add-IgdAssignmentDxe.patch
if [ -d $CIV_GOP_DIR ]; then
Expand All @@ -204,10 +208,12 @@ function ubu_build_ovmf_gvt(){
done
fi

git submodule update --init

source ./edksetup.sh
make -C BaseTools/
build -b DEBUG -t GCC5 -a X64 -p OvmfPkg/OvmfPkgX64.dsc -D NETWORK_IP4_ENABLE -D NETWORK_ENABLE -D SECURE_BOOT_ENABLE -D TPM_ENABLE
cp Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd ../../../OVMF.fd
cp Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd ../OVMF.fd

if [ -d $CIV_GOP_DIR ]; then
local gpu_device_id=$(cat /sys/bus/pci/devices/0000:00:02.0/device)
Expand All @@ -222,11 +228,14 @@ function install_vm_manager_deb(){
local os_ver=$(lsb_release -rs)
local vm_repo="https://github.com/projectceladon/vm_manager/"
local rtag=$(git ls-remote -t --refs ${vm_repo} | cut --delimiter='/' --fields=3 | tr '-' '~' | sort --version-sort | tail --lines=1)
if [ ! -z $VM_MANAGER_VERSION ]; then
rtag=$VM_MANAGER_VERSION
fi
local rdeb=vm-manager_${rtag}_ubuntu-${os_ver}.deb

[ -f ${rdeb} ] && rm -f ${rdeb}

local rurl=https://github.com/projectceladon/vm_manager/releases/latest/download/${rdeb}
local rurl=https://github.com/projectceladon/vm_manager/releases/download/${rtag}/${rdeb}

if wget ${rurl} ; then
sudo dpkg -i ${rdeb} || return -1
Expand All @@ -239,7 +248,13 @@ function install_vm_manager_deb(){
function install_vm_manager_src() {
#Try to build from source code
sudo apt-get install --yes make gcc
git clone https://github.com/projectceladon/vm_manager.git || return -1

if [ ! -z $VM_MANAGER_VERSION ]; then
git clone -b $VM_MANAGER_VERSION --single-branch https://github.com/projectceladon/vm_manager.git
else
git clone https://github.com/projectceladon/vm_manager.git || return -1
fi

cd vm_manager/
make || return -1
sudo make install || return -1
Expand All @@ -253,7 +268,7 @@ function install_vm_manager() {
install_vm_manager_deb || install_vm_manager_src
if [ "$?" -ne 0 ]; then
echo "Failed to install vm-manager!"
echo "Please download and install mannually from: https://github.com/projectceladon/vm_manager/releases/latest"
echo "Please download and install mannually from: https://github.com/projectceladon/vm_manager/releases/"
fi
}

Expand Down
47 changes: 28 additions & 19 deletions scripts/start_flash_usb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

WORK_DIR=$PWD

[ $# -lt 1 ] && echo "Usage: $0 caas-flashfiles-eng-<user>.zip" && exit -1
[ $# -lt 1 ] && echo "Usage: $0 [caas-flashfiles-<variant>.zip] [caas-flashfile-<variant>.iso] [caas-flashfile-<variant>.iso.zip]" && exit -1

if [ -f android.qcow2 ]
then
Expand Down Expand Up @@ -41,25 +41,34 @@ else
qemu-img create -f qcow2 android.qcow2 32G
fi

[ -d "./flashfiles_decompress" ] && rm -rf "./flashfiles_decompress"
mkdir ./flashfiles_decompress
unzip $1 -d ./flashfiles_decompress
decompress=flashfiles_decompress
zip_file=$(file $1 | grep -i "Zip archive data")
if [[ $zip_file != "" ]]; then
rm -rf "$decompress" && mkdir $decompress
unzip $1 -d $decompress

G_size=$((1<<32))
for i in `ls ./flashfiles_decompress`;do
if [ -f "./flashfiles_decompress/"$i ] && [ "`grep $i ./flashfiles_decompress/installer.cmd`" ]; then
size=$(stat -c %s "./flashfiles_decompress/"$i)
if [[ $size -gt $G_size ]]; then
echo "Split $i due to its size bigger than 4G\n"
split --bytes=$((G_size-1)) --numeric-suffixes "./flashfiles_decompress/"$i "./flashfiles_decompress/"$i.part
rm "./flashfiles_decompress/"$i
fi
fi
done
if [[ -f $decompress/boot.img ]]; then
G_size=$((1<<32))
for i in `ls $decompress`; do
size=$(stat -c %s "$decompress/"$i)
if [[ $size -gt $G_size ]]; then
echo "Split $i due to its size bigger than 4G"
split --bytes=$((G_size-1)) --numeric-suffixes "$decompress/"$i "$decompress/"$i.part
rm "$decompress/"$i
fi
done

dd if=/dev/zero of=./flash.vfat bs=63M count=160
mkfs.vfat ./flash.vfat
mcopy -i flash.vfat flashfiles_decompress/* ::
dd if=/dev/zero of=./flash.vfat bs=63M count=160
mkfs.vfat ./flash.vfat
mcopy -i flash.vfat $decompress/* ::

virt_disk=flash.vfat
else
virt_disk=$decompress/`ls $decompress`
fi
else
virt_disk=$1
fi

if [ "$support_dedicated_data" = true ]
then
Expand Down Expand Up @@ -90,7 +99,7 @@ qemu-system-x86_64 \
-chardev socket,id=charserial0,path=./kernel-console,server=on,wait=off \
-device isa-serial,chardev=charserial0,id=serial0 \
-device qemu-xhci,id=xhci,addr=0x5 \
-drive file=./flash.vfat,id=udisk1,format=raw,if=none \
-drive file=$virt_disk,id=udisk1,format=raw,if=none \
-device usb-storage,drive=udisk1,bus=xhci.0 \
-device virtio-scsi-pci,id=scsi0,addr=0x8 \
-drive file=./android.qcow2,if=none,format=qcow2,id=scsidisk1 \
Expand Down
2 changes: 1 addition & 1 deletion src/vm_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "vm_manager.h"

#define VERSION_MAJOR 0
#define VERSION_MINOR 6
#define VERSION_MINOR 7
#define VERSION_MICRO 1

#define VERSION xstr(VERSION_MAJOR)"."xstr(VERSION_MINOR)"."xstr(VERSION_MICRO)
Expand Down