Changeset 214


Ignore:
Timestamp:
Oct 18, 2010, 3:53:54 PM (14 years ago)
Author:
rock
Message:

Add: KVM support (load kvm modules when booting)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/drbl_kvm_patch.sh

    r213 r214  
    6464
    6565# = 3. Load KVM module when booting =
     66# for Debian & Ubuntu
    6667if [ -e /etc/modules ]; then
    6768    grep kvm /etc/modules
     
    6970       echo "kvm" >> /etc/modules
    7071    fi
    71 elif [ -e /etc/modules.conf ]
    72     grep kvm /etc/modules.conf
     72# for CentOS & Fedora
     73elif [ -e /etc/sysconfig/modules ]
     74    grep -r "modprobe kvm" /etc/sysconfig/modules/
    7375    if [ $? -eq 1 ]; then
    74         echo "kvm" >> /etc/modules.conf
     76        cat  > /etc/sysconfig/modules/kvm.modules << EOF
     77#!/bin/sh                 
     78echo -n "Loading kvm module..."
     79if $(/sbin/modprobe kvm)
     80    then
     81        echo "[SUCCESS]:"
     82    else
     83        echo "[FAILURE]:"
     84fi
     85EOF
     86
     87    chmod +x /etc/sysconfig/modules/kvm.modules
    7588    fi
    7689fi
Note: See TracChangeset for help on using the changeset viewer.