Add serial output to QEmu

Hopefully this will give a little more information on what is happening
in the builds on QEmu servers. Tell builds to output to ttyS0 and then
capture that and output to the console.
This commit is contained in:
Greg Hellings
2024-06-29 22:03:55 -05:00
parent 5f84855e5e
commit 4f4fac29c7
19 changed files with 20 additions and 9 deletions
+1
View File
@@ -8,6 +8,7 @@ boot_command = [
"<up>e<wait>", "<up>e<wait>",
"<down><down><end><wait>", "<down><down><end><wait>",
" inst.text inst.ks=cdrom:/ks.cfg", " inst.text inst.ks=cdrom:/ks.cfg",
" console=ttyS0 inst.notmux",
"<leftCtrlOn>x<leftCtrlOff>" "<leftCtrlOn>x<leftCtrlOff>"
] ]
cd_files = [ "distros/almalinux/9/disc/*" ] cd_files = [ "distros/almalinux/9/disc/*" ]
+1 -1
View File
@@ -16,4 +16,4 @@ boot_command = [
] ]
http_directory = "distros/alpine/3.19.0/http/" http_directory = "distros/alpine/3.19.0/http/"
boot_wait = "20s" boot_wait = "20s"
shutdown_command = "sudo poweroff" shutdown_command = "sudo poweroff"
+1 -1
View File
@@ -5,7 +5,7 @@ iso = {
checksum = "52aea58f88c9a80afe64f0536da868251ef4878de5a5e0227fcada9f132bd7ab" checksum = "52aea58f88c9a80afe64f0536da868251ef4878de5a5e0227fcada9f132bd7ab"
} }
boot_command = [ boot_command = [
"e<down><down><down><end> net.ifnames=0 biosdevnames=0<f10>", "e<down><down><down><end> net.ifnames=0 biosdevnames=0 console=ttyS0<f10>",
"<wait60>", # Wait for system to come up? "<wait60>", # Wait for system to come up?
"curl -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/install.sh<enter>", "curl -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/install.sh<enter>",
"<wait5>", "<wait5>",
@@ -24,6 +24,7 @@ boot_command = [
"<up>e<wait>", "<up>e<wait>",
"<down><down><end><wait>", "<down><down><end><wait>",
" inst.text inst.ks=cdrom:/ks.cfg", " inst.text inst.ks=cdrom:/ks.cfg",
" inst.notmux console=ttyS0",
"<leftCtrlOn>x<leftCtrlOff>" "<leftCtrlOn>x<leftCtrlOff>"
] ]
cd_files = [ "distros/centos-stream/9/disc/*" ] cd_files = [ "distros/centos-stream/9/disc/*" ]
+1
View File
@@ -8,6 +8,7 @@ boot_command = [
"<up>e<wait>", "<up>e<wait>",
"<down><down><end><wait>", "<down><down><end><wait>",
" inst.ks=cdrom:/ks.cfg<wait>", " inst.ks=cdrom:/ks.cfg<wait>",
" inst.notmux console=ttyS0",
"<leftCtrlOn>x<leftCtrlOff>" "<leftCtrlOn>x<leftCtrlOff>"
] ]
cd_files = ["distros/centos/7/disc/*"] cd_files = ["distros/centos/7/disc/*"]
+1
View File
@@ -16,6 +16,7 @@ boot_command = [
"debconf/frontend=noninteractive ", "debconf/frontend=noninteractive ",
"hostname={{.Name}} ", "hostname={{.Name}} ",
"domain=vagrant ", "domain=vagrant ",
"console=ttyS0 ",
"<f10>" "<f10>"
] ]
http_directory = "distros/debian/10/http/" http_directory = "distros/debian/10/http/"
+1
View File
@@ -16,6 +16,7 @@ boot_command = [
"debconf/frontend=noninteractive ", "debconf/frontend=noninteractive ",
"hostname={{.Name}} ", "hostname={{.Name}} ",
"domain=vagrant ", "domain=vagrant ",
"console=ttyS0 ",
"<f10>" "<f10>"
] ]
http_directory = "distros/debian/11/http/" http_directory = "distros/debian/11/http/"
+1
View File
@@ -16,6 +16,7 @@ boot_command = [
"debconf/frontend=noninteractive ", "debconf/frontend=noninteractive ",
"hostname={{.Name}} ", "hostname={{.Name}} ",
"domain=vagrant ", "domain=vagrant ",
"console=ttyS0 ",
"<f10>" "<f10>"
] ]
http_directory = "distros/debian/12/http/" http_directory = "distros/debian/12/http/"
+1 -1
View File
@@ -6,7 +6,7 @@ iso = {
} }
boot_command = [ boot_command = [
"<up>e<down><down><end> ", "<up>e<down><down><end> ",
"net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/amd64-ks.cfg console=tty0<f10>" "net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/amd64-ks.cfg inst.notmux console=ttyS0<f10>"
] ]
cd_files = [ cd_files = [
"distros/fedora/39/*.cfg" "distros/fedora/39/*.cfg"
+1 -1
View File
@@ -6,7 +6,7 @@ iso = {
} }
boot_command = [ boot_command = [
"<up>e<down><down><end> ", "<up>e<down><down><end> ",
"net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/amd64-ks.cfg console=tty0<f10>" "net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/amd64-ks.cfg inst.notmux console=ttyS0<f10>"
] ]
cd_files = [ cd_files = [
"distros/fedora/40/*.cfg" "distros/fedora/40/*.cfg"
+1 -1
View File
@@ -35,7 +35,7 @@ iso = {
} }
boot_command = [ boot_command = [
"<up>e<down><down><end><bs><bs><bs><bs><bs>", "<up>e<down><down><end><bs><bs><bs><bs><bs>",
"net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/amd64-ks.cfg console=tty0 console=ttyS0<f10>" "net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/amd64-ks.cfg inst.notmux console=ttyS0<f10>"
] ]
cd_files = [ cd_files = [
"distros/fedora/rawhide/*.cfg" "distros/fedora/rawhide/*.cfg"
+1
View File
@@ -9,6 +9,7 @@ boot_command = [
"<down><down><down><down><end><wait>", "<down><down><down><down><end><wait>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
" autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/autoinst.xml textmode=1<wait>", " autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/autoinst.xml textmode=1<wait>",
" console=ttyS0",
"<leftCtrlOn>x<leftCtrlOff>" "<leftCtrlOn>x<leftCtrlOff>"
] ]
http_directory = "distros/opensuse/15.5/http/" http_directory = "distros/opensuse/15.5/http/"
+1
View File
@@ -9,6 +9,7 @@ boot_command = [
"<down><down><down><down><end><wait>", "<down><down><down><down><end><wait>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
" autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/autoinst.xml textmode=1<wait>", " autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/autoinst.xml textmode=1<wait>",
" console=ttyS0",
"<leftCtrlOn>x<leftCtrlOff>" "<leftCtrlOn>x<leftCtrlOff>"
] ]
http_directory = "distros/opensuse/15.6/http/" http_directory = "distros/opensuse/15.6/http/"
@@ -26,6 +26,7 @@ boot_command = [
"e<wait>", "e<wait>",
"<down><down><down><down><end><wait>", "<down><down><down><down><end><wait>",
" autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/autoinst.xml textmode=1<wait>", " autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/autoinst.xml textmode=1<wait>",
" console=ttyS0",
"<leftCtrlOn>x<leftCtrlOff>" "<leftCtrlOn>x<leftCtrlOff>"
] ]
http_directory = "distros/opensuse/tumbleweed/http/" http_directory = "distros/opensuse/tumbleweed/http/"
+1
View File
@@ -8,6 +8,7 @@ boot_command = [
"<up>e<wait>", "<up>e<wait>",
"<down><down><end><wait>", "<down><down><end><wait>",
" inst.text inst.ks=cdrom:/ks.cfg", " inst.text inst.ks=cdrom:/ks.cfg",
" inst.notmux console=ttyS0",
"<leftCtrlOn>x<leftCtrlOff>" "<leftCtrlOn>x<leftCtrlOff>"
] ]
cd_files = [ "distros/rockylinux/9/disc/*" ] cd_files = [ "distros/rockylinux/9/disc/*" ]
+1 -1
View File
@@ -7,7 +7,7 @@ iso = {
boot_wait = "3s" boot_wait = "3s"
boot_command = [ boot_command = [
"e<wait><down><down><down><end><bs><bs><bs>", "e<wait><down><down><down><end><bs><bs><bs>",
"console=tty0 ", "console=ttyS0 ",
"fsck.mode=skip ", "fsck.mode=skip ",
"locale=en_US ", "locale=en_US ",
"auto=true ", "auto=true ",
+1 -1
View File
@@ -6,7 +6,7 @@ iso = {
} }
boot_command = [ boot_command = [
"e<down><down><down><end><bs><bs><bs>", "e<down><down><down><end><bs><bs><bs>",
"console=tty0 ", "console=ttyS0 ",
"fsck.mode=skip ", "fsck.mode=skip ",
"locale=en_US ", "locale=en_US ",
"auto=true ", "auto=true ",
+1 -1
View File
@@ -6,7 +6,7 @@ iso = {
} }
boot_command = [ boot_command = [
"e<down><down><down><end><bs><bs><bs>", "e<down><down><down><end><bs><bs><bs>",
"console=tty0 ", "console=ttyS0 ",
"fsck.mode=skip ", "fsck.mode=skip ",
"locale=en_US ", "locale=en_US ",
"auto=true ", "auto=true ",
+2 -1
View File
@@ -31,10 +31,11 @@ source "qemu" "amd64" {
efi_firmware_vars = "${var.efi_dir}OVMF_VARS.fd" efi_firmware_vars = "${var.efi_dir}OVMF_VARS.fd"
qemuargs = [ qemuargs = [
["-chardev", "stdio,id=char0,logfile=serial-output-qemu-${var.arch}-${var.distro}-${var.version},signal=off"], #["-chardev", "stdio,id=char0,logfile=serial-output-qemu-${var.arch}-${var.distro}-${var.version},signal=off"],
["-chardev", "socket,path=${local.name}.qga.sock,server=on,wait=off,id=qga0"], ["-chardev", "socket,path=${local.name}.qga.sock,server=on,wait=off,id=qga0"],
["-device", "virtio-serial"], ["-device", "virtio-serial"],
["-device", "virtserialport,chardev=qga0,name=org.qemu.guest_agent.0"], ["-device", "virtserialport,chardev=qga0,name=org.qemu.guest_agent.0"],
["-serial", "stdio"]
] ]
accelerator = var.qemu_accelerator accelerator = var.qemu_accelerator