qemu-boot.sh now checks for required packages.

This commit is contained in:
Storm Dragon
2026-06-01 19:37:53 -04:00
parent eb36d6d976
commit f1dfe1737b
+22
View File
@@ -21,6 +21,26 @@
set -e
checkDependencies() {
local missingCommands=()
local command
for command in qemu-system-x86_64 qemu-img date dirname find sort head cut mkdir; do
if ! command -v "$command" &> /dev/null; then
missingCommands+=("$command")
fi
done
if (( ${#missingCommands[@]} > 0 )); then
echo "Error: Missing required commands:"
printf ' %s\n' "${missingCommands[@]}"
echo
echo "On Arch Linux, install the required packages with:"
echo " sudo pacman -S qemu-system-x86 qemu-img qemu-ui-gtk qemu-audio-pa coreutils findutils"
exit 1
fi
}
# Parse command line arguments
bootInstalled=false
while getopts "ih" opt; do
@@ -44,6 +64,8 @@ while getopts "ih" opt; do
esac
done
checkDependencies
# Get the directory where this script is located
scriptDir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
outDir="${scriptDir}/out"