From a4f4a3e2c555ba0aaafec94ca08500420b0ce511 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Wed, 20 Jan 2021 15:53:29 -0700 Subject: [PATCH 1/2] boot-qemu.sh: Make zstd be quiet Signed-off-by: Nathan Chancellor --- boot-qemu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot-qemu.sh b/boot-qemu.sh index a1d058a..1d85c3b 100755 --- a/boot-qemu.sh +++ b/boot-qemu.sh @@ -242,7 +242,7 @@ function setup_qemu_args() { # Invoke QEMU function invoke_qemu() { rm -rf "${ROOTFS}" - zstd -d "${ROOTFS}".zst -o "${ROOTFS}" + zstd -q -d "${ROOTFS}".zst -o "${ROOTFS}" [[ -z ${QEMU_RAM} ]] && QEMU_RAM=512m if ${GDB:=false}; then From 4fb948509fc5b4ad7f7438b976420eec19fdced8 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Wed, 20 Jan 2021 20:22:41 -0700 Subject: [PATCH 2/2] boot-qemu.sh: Show some information about the QEMU binary Sometimes I need to test different versions of QEMU and it is helpful to know that I am testing the right one. Signed-off-by: Nathan Chancellor --- boot-qemu.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/boot-qemu.sh b/boot-qemu.sh index 1d85c3b..c32732a 100755 --- a/boot-qemu.sh +++ b/boot-qemu.sh @@ -3,17 +3,27 @@ # Root of the repo BASE=$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd) +function pretty_print() { + printf "%b%s\033[0m" "${1}" "${2}" + shift 2 + while ((${#})); do + printf "%b" "${1}" + shift + done + printf '\n' +} + function green() { - printf "\033[01;32m%s\033[0m\n" "${1}" + pretty_print "\033[01;32m" "${@}" } function red() { - printf "\033[01;31m%s\033[0m\n" "${1}" + pretty_print "\033[01;31m" "${@}" } # Prints an error message in bold red then exits function die() { - red "${1}" + red "${@}" exit 1 } @@ -244,6 +254,9 @@ function invoke_qemu() { rm -rf "${ROOTFS}" zstd -q -d "${ROOTFS}".zst -o "${ROOTFS}" + green "QEMU location: " "$(dirname "$(command -v "${QEMU[*]}")")" '\n' + green "QEMU version: " "$("${QEMU[@]}" --version | head -n1)" '\n' + [[ -z ${QEMU_RAM} ]] && QEMU_RAM=512m if ${GDB:=false}; then while true; do