FC4-build.txt 7.29 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
#
# Stuff to do in order to make a fresh FC4 testbed ready
#

#
# NOTE: Not meant to be run as a script.
#       SO DON'T!
# Copy and past into bash
#

##
##

export testbed_src=/z/testbed
export etc_patches=${testbed_src}/doc/updating-RHL/etc-patches
export tarbars=/proj/utahstud/users/kevina/FC4/tarbars

expoort tz=MST7MDT

## Mount /share to make some things easier.
##
cd /
mkdir -p "/share"
mount -o hard,intr,udp "fs:/share" "/share"

## Disable kudzu at boot-time.

/sbin/chkconfig kudzu off

## Kill off CUPS.

/sbin/chkconfig cups off

## Enable ssh 1
##
patch /etc/ssh/sshd_config < $etc_patches/sshd_config.patch

## run `ntp' at run levels 2--5.  (`/etc/inittab' described the levels.)
##
/sbin/chkconfig --level 2345 ntpd on

## Install an appropriate /etc/inittab:
## - Run a getty in ttyS0
## - Do not run getty's for most virtual consoles (tty1, ...)
##
patch /etc/inittab < $etc_patches/inittab.patch

## Enable root logins on ttyS0.
##
patch /etc/securetty  < $etc_patches/securetty.patch

## Enable all wheel members to `sudo'.
##
...

## Log `ssh' logins to `users.emulab.net'.
##
patch /etc/syslog.conf < $etc_patches/syslog.conf.patch

# * /etc/localtime
#   Copy the correct file over from /usr/share/zoneinfo
# 
rm -f /etc/localtime
install -o root -g root -m 644 "/usr/share/zoneinfo/${tz}" /etc/localtime

####

# Make the default locale "C"
patch /etc/sysconfig/i18n < $etc_patches/sysconfig-i18n.patch

## Add sbin to path for all users not just root
##
patch /etc/profile < $etc_patches/profile
patch /etc/csh.login < $etc_patches/csh.login.patch

###############################################################################

## Install Keys 
## emulab-keys.tar.gz created by running 
##   sh ${testbed_src}/doc/updating-RHL/tar-keys
## on an exiting node

tar xfvz $tarbars/emulab-keys.tar.gz

# * /etc/emulab/shadow
#   Change the root password, this file will get installed by prepare.
#
#install -o root -g root -m 600 {"${image_root}",}/etc/emulab/shadow
#
#NOTE: I just had Kirk reset it manually

###############################################################################

# We must look in /usr/local/lib.
#
patch /etc/ld.so.conf < $etc_patches/ld.so.conf.patch

###############################################################################

## Install "our version of the elvin libraries."
##
cd "${local_build_root}"
wget "http://www.emulab.net/downloads/libelvin-4.0.3.tar.gz"
tar zxf libelvin-4.0.3.tar.gz
wget "http://www.emulab.net/downloads/libelvin-4.0.3.patch"
patch -p0 < libelvin-4.0.3.patch
cd libelvin-4.0.3
#
# Ancient software.  Without `-fno-strict-aliasing', the `configure' script
# dies.  It's not at all clear to me if `-fno-strict-aliasing' is required for
# elvin itself.
export CC=gcc32
export CFLAGS="-g -O2 -fno-strict-aliasing"
#
# Need these to find the Kerberos support, for SSL stuff.
export CPPFLAGS="`/usr/kerberos/bin/krb5-config --cflags`"
export LIBS="`/usr/kerberos/bin/krb5-config --libs`"
./configure
gmake
gmake install
unset CC CFLAGS CPPFLAGS LIBS

## We now also require the actual `elvind'.
##
cd "${local_build_root}"
export CC=gcc32
wget "http://www.emulab.net/downloads/elvind-4.0.3.tar.gz"
tar zxf elvind-4.0.3.tar.gz
wget "http://www.emulab.net/downloads/elvind-4.0.3.patch"
patch -p0 < elvind-4.0.3.patch
cd elvind-4.0.3
./configure
gmake
gmake install
unset CC

## Install Boost.
## See <http://www.boost.org/more/getting_started.html>
##
cd "${local_build_root}"
cp -p $tarbars/boost_1_31_0.tar.bz2 .
# wget "http://unc.dl.sourceforge.net/sourceforge/boost/boost_1_31_0.tar.bz2"
tar jxf boost_1_31_0.tar.bz2
# First, one must build their builder, `bjam'.
cd boost_1_31_0/tools/build/jam_src
sh ./build.sh
install -m 755 bin.linuxx86/bjam /usr/local/bin
ln /usr/local/bin/bjam /usr/local/bin/jam
cd "${local_build_root}"/boost_1_31_0
bjam -sTOOLS=gcc --with-python-root=/usr install
# I'm not sure if this is standard, but it is needed for the Emulab client
# stuff:
#
ln -s boost-1_31/boost /usr/local/include/boost

## Install the Emulab client stuff.  XXX --- the current way of getting the
## source is icky.
##
export CVS_RSH=ssh
cd "${local_build_root}"
# cvs -d ... co testbed
#
cd testbed
./configure
gmake client
gmake client-install

## Install `gated'.
## XXX --- compile w/o debugging?
##

#cd "${local_build_root}"
## wget http://ftp.rge.com/pub/networking/gated/gated-3-6.tar.gz
#wget http://www.funet.fi/pub/unix/tcpip/gated/gated-3-6.tar.gz
#tar zxf gated-3-6.tar.gz
#cd gated-public-3_6
#./configure
#gmake depend
#gmake
#gmake install
## Installs just `/usr/local/sbin/gated'.

# Version built from source doesn't work, install RHL7.3 RPM instead
rpm -i /share/redhat/7.3/RPMS/gated-3.6-14.i386.rpm


###############################################################################

##
## Add/remove rpms.
##

# Done manually, see FC4-rpm-remove.sh and FC4-yum-install.txt

###############################################################################

##
## Update to latest version.  Note this may also update the kernel, in
## which case you should recompile it.  See below
##

yum update

###############################################################################

##
## Install Lilo
##

cd /
tar xfz $tarbars/lilo-emulab.tar.gz
cp /z/testbed/doc/updating-RHL/FC4-lilo.conf /etc/lilo.conf
/sbin/lilo
# if lilo fails then edit /etc/lilo.conf lilo.conf and try again

#
# NOW REBOOT TO MAKE SURE IT WORKS
#

# Remove all traces of grub, but backup "/boot/grub" incase we want
# to reinstall grub at a latter date
rpm -e grub
cd /boot
tar cfvz grub.tar.gz grub/*
rm -r grub

###############################################################################

## Install pathrate.
##
cd "${local_build_root}"
wget http://www.cc.gatech.edu/fac/Constantinos.Dovrolis/pathrate.tar.gz
tar zxf pathrate.tar.gz
cd pathrate_2.4.0
./configure
# XXX Build w/o -g?
gmake
# No install target
install -o root -g root -m 755 pathrate_rcv pathrate_snd /usr/local/bin
install -d -o root -g root -m 755 /usr/local/share/doc/pathrate
install -o root -g root -m 644 CHANGES README /usr/local/share/doc/pathrate

## Install rude/crude.
##
cd "${local_build_root}"
wget http://unc.dl.sourceforge.net/sourceforge/rude/rude-0.70.tar.gz
tar zxf rude-0.70.tar.gz 
cd rude
./configure
gmake
gmake install

###############################################################################

## Install kernel

# Redhat no longer ships a seperate RPM for the kernel source.  You
# have to use the source RPM:
# Edit $testbed_src/doc/updating-RHL/fetch-kernel-source.sh
# than: "bash $testbed_src/doc/updating-RHL/"

# Now go through $testbed_src/doc/FC4-build-kernel.txt

# Once it works remove old kernel??
#   but since that is provided via the kernel rpm that might brake
#   some things
#
# It takes about 49 megs
#
# rm -r /lib/modules/2.6.11-1.1369_FC4
# rm /boot/*2.6.11-1.1369_FC4*

###############################################################################

When all done testing create a final image. 

# Drop into single user mode

init 1

# Prep the image

yum clean all
find /var/cache/man -name -type f | xargs rm
/usr/local/etc/emulab/prepare

# Create an image via the web interface.  A few seconds after
# confirming the image creation reboot the machine.  Since the machine
# is in single user mode the emulab scripts won't be able to ssh in
# to reboot.  Don't give it a change to ipod or power cycle the
# machine as the disk may get corrupted.