source: trunk/packages/xen-3.1/xen-3.1/tools/vnet/examples/vnet-insert @ 34

Last change on this file since 34 was 34, checked in by hartmans, 17 years ago

Add xen and xen-common

File size: 652 bytes
Line 
1#!/bin/bash
2
3# Insert the vnet module if it can be found and
4# it's not already there.
5vnet_insert () {
6    local module="vnet_module"
7    local mod_dir=/lib/modules/$(uname -r)
8    local mod_obj=""
9
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}
27
28vnet_insert "$@"
Note: See TracBrowser for help on using the repository browser.