Revision cf9c9687 util/install.sh

View differences:

util/install.sh
11 11
# Location of CONFIG_NET_NS-enabled kernel(s)
12 12
KERNEL_LOC=http://www.stanford.edu/~brandonh
13 13

  
14
DIST=`lsb_release -is`
15

  
14 16
# Kernel params
15 17
# These kernels have been tried:
16
KERNEL_NAME=2.6.33.1-mininet
17
#KERNEL_NAME=`uname -r`
18
KERNEL_HEADERS=linux-headers-${KERNEL_NAME}_${KERNEL_NAME}-10.00.Custom_i386.deb
19
KERNEL_IMAGE=linux-image-${KERNEL_NAME}_${KERNEL_NAME}-10.00.Custom_i386.deb
20
DIST=`lsb_release -is`
18
if [ "$DIST" = "Debian" ]; then
19
    KERNEL_NAME=2.6.33.1-mininet
20
    KERNEL_HEADERS=linux-headers-${KERNEL_NAME}_${KERNEL_NAME}-10.00.Custom_i386.deb
21
    KERNEL_IMAGE=linux-image-${KERNEL_NAME}_${KERNEL_NAME}-10.00.Custom_i386.deb
22
elif [ "$DIST" = "Ubuntu" ]; then
23
    KERNEL_NAME=`uname -r`
24
    KERNEL_HEADERS=linux-headers-${KERNEL_NAME}
25
else
26
    echo "Install.sh currently only supports Ubuntu and Debian."
27
    exit 1
28
fi
21 29

  
22 30
# Kernel Deb pkg to be removed:
23 31
KERNEL_IMAGE_OLD=linux-image-2.6.26-2-686
......
30 38
OVS_KMOD=openvswitch_mod.ko
31 39

  
32 40
function kernel {
33
	echo "Install new kernel..."
41
	echo "Install Mininet-compatible kernel"
34 42
	sudo apt-get update
35

  
36
    # Until we build ext4 into our kernel image
37
    ext2=`mount | head -1 | egrep 'ext2|ext3'`
38
    if [ "$ext2" == "" ]; then
39
        echo "Kernel package requires ext2 or ext3 root filesystem"
40
        exit 1
41
    fi
43
    
44
    if [ "$DIST" = "Debian" ]; then
42 45
    
43 46
	# The easy approach: download pre-built linux-image and linux-headers packages:
44 47
	wget -c $KERNEL_LOC/$KERNEL_HEADERS
......
59 62
	sudo update-grub
60 63

  
61 64
	# The default should be the new kernel. Otherwise, you may need to modify /boot/grub/menu.lst to set the default to the entry corresponding to the kernel you just installed.
65
    fi
66

  
62 67
}
63 68

  
64 69
function kernel_clean {
......
134 139
        sudo apt-get -y --force-yes -t lenny-backports install autoconf
135 140
    fi
136 141

  
142
    if [ "$DIST" == "Ubuntu" ]; then
143
        sudo apt-get -y install $KERNEL_HEADERS
144
    fi
145

  
137 146
	#Install OVS from release
138 147
	cd ~/
139 148
	#wget http://openvswitch.org/releases/${OVS_RELEASE}.tar.gz

Also available in: Unified diff