ia64/xen-unstable

view tools/vnet/examples/vnet-insert @ 6766:219d96d545fc

merge?
author cl349@firebug.cl.cam.ac.uk
date Mon Sep 12 20:00:41 2005 +0000 (2005-09-12)
parents 7ae8090e5f67
children b35215021b32 9af349b055e5 3233e7ecfa9f
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 "$@"