This commit is contained in:
D4rk4 2020-07-31 15:00:11 +02:00
parent 6caa6e01af
commit d07d61f7bf

View file

@ -7,14 +7,15 @@ vcpu=`cat /proc/cpuinfo|grep proc|tail -1|awk '{print $NF}'`
k8sdsk="${apptmp}/k8s-demo.raw"
httpboot='http://ftp.debian.org/debian/dists/stretch/main/installer-amd64/current/images/netboot/debian-installer/amd64'
seed='https://git.ix.gs/public/coins-demo/raw/branch/master/contrib/k8s-seed.txt'
qemu="${appdir}/contrib/qemu-system-x86_64 -L ${appdir}/contrib/share/qemu -net nic -net user,net=100.100.100.0/24,,hostfwd=tcp::8888-:8888 -m ${vmmem} -smp ${vcpu} -localtime -enable-kvm -cpu host,+nx -M pc -vga std -usbdevice tablet -k en-us -hda ${k8sdsk} -boot once=d -nographic"
qemu="${appdir}/contrib/qemu-system-x86_64 -L ${appdir}/contrib/share/qemu -net nic -net user,net=100.100.100.0/24,hostfwd=tcp::8888-:8888 -m ${vmmem} -smp ${vcpu} -localtime -enable-kvm -cpu host,+nx -M pc -vga std -usbdevice tablet -k en-us -hda ${k8sdsk} -boot once=d -nographic"
wget='wget -cq4O'
###
installvm() {
fallocate -l ${vmsize} ${k8sdsk}
echo "Preparing K8S VM..."
echo "Downloading Debian installer..."
${wget} ${apptmp}/kernel ${httpboot}/linux
${wget} ${apptmp}/initrd ${httpboot}/initrd.gz
echo "Preparing K8S VM..."
${qemu} -kernel ${apptmp}/kernel -initrd ${apptmp}/initrd -append "console=ttyS0,115200n8 apt-setup/proposed=true nomodeset fb=false priority=critical locale=en_US url=${seed}"
rm -f ${apptmp}/kernel ${apptmp}/initrd
}