Update core/tabs/system-setup/arch/virtualization.sh

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
This commit is contained in:
JEEVITHA KANNAN K S 2024-10-14 22:49:16 +05:30 committed by GitHub
parent 8e400f726b
commit 41ff081ee0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,10 +31,7 @@ installVirtManager() {
} }
checkKVM() { checkKVM() {
hardware_avail="$(grep -E 'vmx|svm|0xc0f' /proc/cpuinfo)" if [ ! -e "/dev/kvm" ]; then
kernel_avail="$(zgrep CONFIG_KVM= /proc/config.gz | cut -d '=' -f 2)"
modules_avail="$(lsmod | grep kvm)"
if [ -z "$hardware_avail" ] || [ -z "$modules_avail" ] || { [ "$kernel_avail" != "m" ] && [ "$kernel_avail" != "y" ]; }; then
printf "%b\n" "${RED}KVM is not available. Make sure you have CPU virtualization support enabled in your BIOS/UEFI settings. Please refer https://wiki.archlinux.org/title/KVM for more information.${RC}" printf "%b\n" "${RED}KVM is not available. Make sure you have CPU virtualization support enabled in your BIOS/UEFI settings. Please refer https://wiki.archlinux.org/title/KVM for more information.${RC}"
else else
"$ESCALATION_TOOL" usermod "$USER" -aG kvm "$ESCALATION_TOOL" usermod "$USER" -aG kvm