ia64/xen-unstable

view tools/vnet/examples/vnet-insert @ 8740:3d7ea7972b39

Update patches for linux 2.6.15.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Thu Feb 02 17:16:00 2006 +0000 (2006-02-02)
parents 06d84bf87159
children
line source
1 #!/bin/bash
3 # Insert the vnet module if it can be found and
4 # it's not already there.
5 vnet_insert () {
6 local module="vnet_module"
7 local mod_dir=/lib/modules/$(uname -r)
8 local mod_obj=""
10 if lsmod | grep -q ${module} ; then
11 echo "VNET: ${module} loaded"
12 return
13 fi
14 local mods=$(find ${mod_dir} -name "${module}.*o")
15 if [[ ${mods} ]] ; then
16 for mod_obj in ${mods} ; do
17 break
18 done
19 fi
20 if [ -z "${mod_obj}" ] ; then
21 echo "VNET: ${module} not found"
22 exit 1
23 fi
24 echo "VNET: Loading ${module} from ${mod_obj}"
25 insmod ${mod_obj} "$@"
26 }
28 vnet_insert "$@"