aboutsummaryrefslogtreecommitdiff
path: root/scripts/testing/setup-testing-env.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/testing/setup-testing-env.sh')
-rwxr-xr-xscripts/testing/setup-testing-env.sh26
1 files changed, 18 insertions, 8 deletions
diff --git a/scripts/testing/setup-testing-env.sh b/scripts/testing/setup-testing-env.sh
index f0e63aa..fb0628b 100755
--- a/scripts/testing/setup-testing-env.sh
+++ b/scripts/testing/setup-testing-env.sh
@@ -45,25 +45,35 @@ PACKAGES=(
socat
)
+to_install=()
for pkg in "${PACKAGES[@]}"; do
if pacman -Qi "$pkg" &>/dev/null; then
info "$pkg is already installed"
else
- step "Installing $pkg"
- if sudo pacman -S --noconfirm "$pkg" >> "$LOGFILE" 2>&1; then
- success "$pkg installed"
- else
- error "Failed to install $pkg"
- fatal "Package installation failed"
- fi
+ to_install+=("$pkg")
fi
done
+if [ "${#to_install[@]}" -gt 0 ]; then
+ step "Installing in one transaction: ${to_install[*]}"
+ if sudo pacman -S --needed --noconfirm "${to_install[@]}" >> "$LOGFILE" 2>&1; then
+ success "All required packages installed"
+ else
+ fatal "Package installation failed"
+ fi
+fi
+
# Verify KVM support
section "Verifying KVM Support"
if [ -e /dev/kvm ]; then
- success "KVM is available"
+ if [ -r /dev/kvm ] && [ -w /dev/kvm ]; then
+ success "KVM is available and accessible"
+ else
+ warn "KVM exists but is not readable/writable by user $(id -un)"
+ info "Add the user to the kvm group: sudo gpasswd -a $(id -un) kvm"
+ info "Then log out and back in so the new group takes effect"
+ fi
else
error "KVM is not available"
info "Check if virtualization is enabled in BIOS"