Add tools directory

Add 2 scripts to help bring up vm
for testing quickly:

- kill-vm.sh - kills VM called apt-ostree
- run-vm.sh - Creates and starts a vm called apt-ostree.
              You must specify the full path to the VM.

Libvirt is required to run and kill the VM.

Change-Id: Ia6b1c3ccaebdf9fcef644e986304049a29c8ebf5
Signed-off-by: Charles Short <charles.short@windriver.com>
This commit is contained in:
Charles Short 2023-09-12 12:36:54 -04:00 committed by Chuck Short
parent 7b0fc0096b
commit 3c153db48e
2 changed files with 31 additions and 0 deletions

11
tools/kill-vm.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
name=$1
if [ -z $name ]; then
name="apt-ostree"
fi
sudo virsh destroy $name && sudo virsh undefine $name

20
tools/run-vm.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
dir=$1
name=apt-ostree
virt-install \
--connect qemu:///system \
--boot loader=/usr/share/ovmf/OVMF.fd \
--machine q35 \
--name apt-ostree \
--ram 8096 \
--vcpus 4 \
--os-variant debiantesting \
--disk path=$dir/debian-ostree-qemu-uefi-amd64.img \
--noautoconsole \
--check path_in_use=off \
--import