# install kernel modules
local kinstalldir="${INSTALL_ROOT}/lib/modules/$(get_kernel_version)/kernel/drivers/kvm"
mkdir -p "$kinstalldir" &&

case $(uname -m) in
  i*86) local KVM_ARCH=x86;;
  x86_64) local KVM_ARCH=x86;;
  ia64) local KVM_ARCH=ia64;;
esac &&

for kmod in kvm/kernel/$KVM_ARCH/*.ko; do
  install -v -o root -g root -m 644 $kmod $kinstalldir
done &&

depmod -a $(get_kernel_version) &&
make install DESTDIR=${INSTALL_ROOT}
