Revision 5d4d6305

View differences:

util/install.sh
4 4

  
5 5
# Fail on error
6 6
set -e
7

  
7
 
8 8
# Fail on unset var usage
9 9
set -o nounset
10 10

  
......
17 17
#KERNEL_NAME=`uname -r`
18 18
KERNEL_HEADERS=linux-headers-${KERNEL_NAME}_${KERNEL_NAME}-10.00.Custom_i386.deb
19 19
KERNEL_IMAGE=linux-image-${KERNEL_NAME}_${KERNEL_NAME}-10.00.Custom_i386.deb
20
DIST=UBUNTU  # Assume Ubuntu, not debian Lenny
20 21

  
21 22
# Kernel Deb pkg to be removed:
22 23
KERNEL_IMAGE_OLD=linux-image-2.6.26-2-686
......
33 34
	sudo apt-get update
34 35

  
35 36
	# The easy approach: download pre-built linux-image and linux-headers packages:
36
	wget $KERNEL_LOC/$KERNEL_HEADERS
37
	wget $KERNEL_LOC/$KERNEL_IMAGE
37
	wget -c $KERNEL_LOC/$KERNEL_HEADERS
38
	wget -c $KERNEL_LOC/$KERNEL_IMAGE
38 39

  
39 40
	#Install custom linux headers and image:
40 41
	sudo dpkg -i $KERNEL_IMAGE $KERNEL_HEADERS
......
109 110
	sudo apt-get remove -y avahi-daemon
110 111

  
111 112
	# Disable IPv6.  Add to /etc/modprobe.d/blacklist:
112
	sudo sh -c "echo -e 'blacklist net-pf-10\nblacklist ipv6' >> /etc/modprobe.d/blacklist"
113
	sudo sh -c "echo 'blacklist net-pf-10\nblacklist ipv6' >> /etc/modprobe.d/blacklist"
113 114
}
114 115

  
115 116
# Install OpenVSwitch
......
117 118
function ovs {
118 119
	echo "Installing OpenVSwitch..."
119 120

  
121
    if [ "$DIST" = "LENNY" ]; then
120 122
	#Install Autoconf 2.63+ backport from Debian Backports repo:
121 123
	#Instructions from http://backports.org/dokuwiki/doku.php?id=instructions
122 124
	sudo su -c "echo 'deb http://www.backports.org/debian lenny-backports main contrib non-free' >> /etc/apt/sources.list"
123 125
	sudo apt-get update
124 126
	sudo apt-get -y --force-yes install debian-backports-keyring
125 127
	sudo apt-get -y --force-yes -t lenny-backports install autoconf
128
    fi
126 129

  
127 130
	#Install OVS from release
128 131
	cd ~/
......
132 135
	git clone git://openvswitch.org/openvswitch
133 136
	cd $OVS_RELEASE
134 137
	./boot.sh
135
	./configure --with-l26=/lib/modules/${KERNEL_NAME}/build
138
    BUILDDIR=/lib/modules/${KERNEL_NAME}/build
139
    mkdir -p $BUILDDIR
140
    opts="--with-l26=$BUILDDIR"
141
	./configure $opts
136 142
	make
137 143
	sudo make install
138 144
}
......
142 148
	echo "Installing NOX w/tutorial files..."
143 149

  
144 150
	#Install NOX deps:
145
	sudo apt-get -y install autoconf automake g++ libtool python python-twisted swig libboost1.35-dev libxerces-c2-dev libssl-dev make
146

  
151
	sudo apt-get -y install autoconf automake g++ libtool python python-twisted swig  libxerces-c2-dev libssl-dev make
152
    if [ "$DIST" == "LENNY" ]; then
153
        sudo apt-get -y install libboost1.35-dev
154
    else
155
        sudo apt-get -y install libboost1.40-dev
156
    fi
147 157
	#Install NOX optional deps:
148 158
	sudo apt-get install -y libsqlite3-dev python-simplejson
149 159

  
......
288 298
    exit 2
289 299
}
290 300

  
301
function lenny {
302
    echo "Installing for Lenny"
303
    DIST=LENNY
304
}
305

  
291 306
if [ $# -eq 0 ]
292 307
then
293 308
	all
294 309
else
295
	while getopts 'acdfhkmntvx' OPTION
310
	while getopts 'lacdfhkmntvx' OPTION
296 311
	do
297 312
	  case $OPTION in
298
	  a)    all;;
313
      l)    lenny;;
314
      a)    all;;
299 315
	  c)    kernel_clean;;
300 316
	  d)    vm_clean;;
301 317
	  f)    of;;

Also available in: Unified diff