Skip to content

Commit

Permalink
feat: add quickreport; gather information for bug reports. close #1163
Browse files Browse the repository at this point in the history
  • Loading branch information
flexiondotorg committed May 9, 2024
1 parent 65f065a commit 3270181
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 2 deletions.
1 change: 1 addition & 0 deletions debian/install
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
chunkcheck usr/bin
quickemu usr/bin
quickget usr/bin
quickreport usr/bin

This comment has been minimized.

Copy link
@philclifford

philclifford May 9, 2024

Contributor

Needs adding to Makefile too

windowskey usr/bin
4 changes: 2 additions & 2 deletions package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ stdenv.mkDerivation rec {
runHook preInstall
installManPage docs/quickget.1 docs/quickemu.1 docs/quickemu_conf.1
install -Dm755 -t "$out/bin" chunkcheck quickemu quickget windowskey
install -Dm755 -t "$out/bin" chunkcheck quickemu quickget quickreport windowskey
# spice-gtk needs to be put in suffix so that when virtualisation.spiceUSBRedirection
# is enabled, the wrapped spice-client-glib-usb-acl-helper is used
for f in chunkcheck quickget quickemu windowskey; do
for f in chunkcheck quickget quickemu quickreport windowskey; do
wrapProgram $out/bin/$f \
--prefix PATH : "${lib.makeBinPath runtimePaths}" \
--suffix PATH : "${lib.makeBinPath [ spice-gtk ]}"
Expand Down
80 changes: 80 additions & 0 deletions quickreport
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/usr/bin/env bash

quick_report() {
local GPUS
local PRETTY_NAME
local VERSION
if [ -e /etc/os-release ]; then
PRETTY_NAME="$(grep PRETTY_NAME /etc/os-release | cut -d'"' -f2)"
else
PRETTY_NAME="Unknown OS"
fi

if command -v quickemu &> /dev/null; then
VERSION=$(quickemu --version)
echo \
"----------------------------------
Quickemu ${VERSION}
----------------------------------"
echo -e "Distro:\t${PRETTY_NAME}"
echo -e "Kernel:\t$(uname -s -r -m)"
echo -e "Memory:\t$(free --si -h | awk '/Mem:/{print $2}')"
# Break IFS on new line
IFS=$'\n'
GPUS=$(lspci | grep -i vga | cut -d':' -f3)

This comment has been minimized.

Copy link
@philclifford

philclifford May 9, 2024

Contributor

@flexiondotorg this Adds dependency on pciutils
(and maybe some other package name for the non-Ubuntu folks)


if [ "$(echo "${GPUS}" | wc -l)" -eq 1 ]; then
echo "GPU:"
else
echo "GPUs:"
fi
for GPU in ${GPUS}; do
echo " -${GPU}"
done
else
echo \
"----------------------------------
Quickemu missing!
----------------------------------"
exit 1
fi

if command -v curl &> /dev/null; then
VERSION=$(curl --version)
echo \
"----------------------------------
curl $(echo "${VERSION}" | head -1 | cut -d' ' -f2)
----------------------------------"
echo -e "Libraries:$(echo "${VERSION}" | head -1 | cut -d')' -f2-)"
echo -e "Protocols:$(echo "${VERSION}" | tail +3 | head -1 | cut -d':' -f2-)"
echo -e "Features: $(echo "${VERSION}" | tail +4 | head -1 | cut -d':' -f2-)"
else
echo \
"----------------------------------
curl missing
----------------------------------"
fi

if command -v qemu-system-"$(uname -m)" &> /dev/null; then
VERSION=$(qemu-system-"$(uname -m)" -version | head -1 | cut -d' ' -f4)
echo \
"----------------------------------
QEMU ${VERSION}
----------------------------------"
qemu-system-"$(uname -m)" -cpu help
else
echo \
"----------------------------------
QEMU missing
----------------------------------"
fi

echo \
"----------------------------------
CPU
----------------------------------"
lscpu
}

clear
quick_report | tee quickreport.txt

0 comments on commit 3270181

Please sign in to comment.