Files
xen/tools/vnet/examples/vnet-insert
T
kaf24@firebug.cl.cam.ac.uk 999ef6d9c5 The last vnet patch was missing some files that had been added
to my tree but did not appear in 'hg diff'. This patch adds them.

Signed-off-by: Mike Wray <mike.wray@hp.com>
2005-09-12 14:11:59 +00:00

29 lines
652 B
Bash

#!/bin/bash
# Insert the vnet module if it can be found and
# it's not already there.
vnet_insert () {
local module="vnet_module"
local mod_dir=/lib/modules/$(uname -r)
local mod_obj=""
if lsmod | grep -q ${module} ; then
echo "VNET: ${module} loaded"
return
fi
local mods=$(find ${mod_dir} -name "${module}.*o")
if [[ ${mods} ]] ; then
for mod_obj in ${mods} ; do
break
done
fi
if [ -z "${mod_obj}" ] ; then
echo "VNET: ${module} not found"
exit 1
fi
echo "VNET: Loading ${module} from ${mod_obj}"
insmod ${mod_obj} "$@"
}
vnet_insert "$@"