You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

37 lines
954 B

#!/bin/bash
function wait_for_finish() {
echo "Waiting for install to finish..."
while sleep 10 ; do
STATUS="$(virsh dominfo linux | grep State | awk -F' ' '{print $2}')"
if [[ "x$STATUS" == "xrunning" ]]; then
date -u
echo "Still waiting for install to finish..."
fi
if [[ "x$STATUS" != "xrunning" ]]; then
date -u
echo "Install done."
return
fi
done
}
function begin_install_os() {
virsh list
virt-install --virt-type qemu --name linux \
--ram 4096 \
--disk path=image.qcow2 \
--os-variant ubuntu18.04 \
--initrd-inject=preseed.cfg \
--initrd-inject=postinst.sh \
--graphics none \
--location 'http://us.archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/' \
--extra-args 'console=ttyS0,115200n8 serial'
#virsh list
#virsh console linux
}
begin_install_os
wait_for_finish
exit 0