ReferencePlatforms/Linux-Hardware
Contents
Setting up CentOS 5 on a Mac Mini
This procedure will re-create the CentOS 5.0-based reference VM image on a Mac Mini's hardware.
Download the ISOs for CentOS 5 and burn to bootable CD. At the time of writing this the downloads were CentOS-5.2-i386 (6 ISOs of which I only burned 1 - 4)
Setup on a Mac Mini
First you need to partition the mini's hard drive so that it allows you to boot from another OS.
Intel Mac Mini installation instructions for CentOS 5
- Boot from the Mac OS X install CD by holding "C" on a restart.
- Click on "Utilities" in the upper left corner and select disk utilities
- Click on the "Entire" disk, select partition tab, then select 1 partition. Choose MS-DOS (I set the size to 1GB to get it smaller than the 8.XX it wants to leave it at). Then click "Options" and select "Master Boot Record" to support booting other OS (3rd option down).
- I selected the remaining space and selected "Free Space" from the pulldown, then Apply - the disk will get formatted and then you should quit the disk utility, restart the computer holding down "t" to start it in Target Mode, this will allow you to eject the Mac OS X install disk and insert the CentOS install disc (1 of 6) - then reboot again with the power button.
- Go through the install - select "build with defaults on free space", select how you want to build the system. After the reboot, it should just start up properly into CentOS.
Package Selection
While installing, select a the GNOME Desktop and then select Custom package development; the following categories were selected:
- Desktop Environments
- Gnome Desktop Environment
- Applications
- Editors
- Test-based internet
- Add lynx
- Development
- Development Tools
- Development Libraries
- X Software Development
- GNOME Software Development
- Legacy Software Development
- Servers
- Turn all off, except for "Printing Support
- Base System
- Turn off Dialup Networking
- Turn on System Tools
On first boot, CentOS will ask some questions:
- Turn the firewall off (we run our build machines on their own network, behind a firewall)
- Disable SELinux
- Enable NTP
Some Sys-prepping
We have some scripts that do some of this: root, cltbld -- Those scripts needed much editing to compensate for not having the sysprep CD. Also I used the install scripts here to do most of the install since they use wget instead of sysprep. It's pretty clear in the root script from above what is for VM and what is not. Just comment out what you don't need. (On the desktop of the image there is a folder called "sysprep" that will have all the rpms used, as well as the modified script)
What is in Version 1
Set up VNC Server
mkdir /home/cltbld/.vnc/ vncpasswd
Set the cltbld password.
vim /home/testuser/.vnc/xstartup
And make sure it looks like this:
#!/bin/sh # Uncomment the following two lines for normal desktop: unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” & startx & gnome-session &
Make it executable:
chmod u+x /home/testuser/.vnc/xstartup
As root, you need to check
vim /etc/sysconfig/vncservers
And make sure that there is the following:
VNCSERVERS="0:cltbld" VNCSERVERARGS[0]=”-geometry 1027×768″
Alter .bash_profile
Add the following lines to ~/.bash_profile
export CVS_RSH=ssh export JAVA_HOME=/builds/jdk export TBOX_CLIENT_CVS_DIR="/builds/tinderbox/mozilla/tools"
Make directories
mkdir -p /tools/dist/logs mkdir -p /builds/logs
Install Sun Java JDK
Note: we should archive this binary somewhere
- Go to http://java.sun.com/javase/downloads/
- Click through to JDK 5.0 Update 10
- Download the "Linux self-extracting file"... not the RPM
d916c24bed9eef7aebc2626115e14a11 jdk-1_5_0_10-linux-i586.bin
- Save to /tools
cd /tools chmod 0755 ./dist/jdk-1_5_0_10-linux-i586.bin ./dist/jdk-1_5_0_10-linux-i586.bin # type 'yes' to accept the license ln -s jdk1.5.0_10/ jdk
Make GCC 4.1 (redhat branch)
md5sum gcc-4.1.1-30.src.rpm # 555b8cb95d3d7d851b2ebd5c3cec7837 rpm2cpio gcc-4.1.1-30.src.rpm | cpio -i gcc-4.1.1-20061011.tar.bz2 tar xfvj gcc-4.1.1-20061011.tar.bz2 mkdir gcc-obj-release cd gcc-obj-release/ ../gcc-4.1.1-20061011/configure --enable-long-long --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++ --with-system-zlib --prefix=/tools/gcc-4.1.1 2>&1 | tee ../gcc-4.1.1-configure.log make 2>&1 | tee ../gcc-4.1.1-make.log make install 2>&1 | tee ../gcc-4.1.1-make_install.log
Build Python 2.5.2
(Some VMs use Python 2.5 or Python 2.4.4 but this is what is on the ref platform.)
wget http://python.org/ftp/python/2.5.2/Python-2.5.2.tar.bz2 tar xfvj dist/Python-2.5.2.tar.bz2 cd Python-2.5.2/ ./configure --prefix=/tools/python-2.5.2 2>&1 | tee /tools/dist/logs/python2.5.1-configure.log make 2>&1 | tee /tools/dist/logs/python2.5.2-make.log make install 2>&1 | tee /tools/dist/logs/python2.5.2-make_install.log cd /tools/ ln -s python2.5.2 python
Installing Zope Interface
cd /tools/dist/ wget http://www.zope.org/Products/ZopeInterface/3.4.1/zope.interface-3.4.1.tar.gz tar xfvz zope.interface-3.4.1.tar.gz cd zope.interface-3.4.1/ python setup.py install --prefix=/tools/zope-interface-3.4.1 cd /tools; ln -s zope-interface-3.4.1 zope-interface export PYTHONPATH="/tools/zope-interface/lib/python2.5/site-packages:$PYTHONPATH"
Installing Twisted
cd /tools/dist/ wget http://tmrc.mit.edu/mirror/twisted/Twisted/2.4/TwistedCore-2.4.0.tar.bz2 wget http://tmrc.mit.edu/mirror/twisted/Twisted/2.4/Twisted-8.0.1.tar.bz2 tar xfvj TwistedCore-2.4.0.tar.bz2 tar xfvj Twisted-8.0.1.tar.bz2 cd TwistedCore-2.4.0 python setup.py install --prefix=/tools/twisted-core-2.4.0 pushd /tools/; ln -s twisted-core-2.4.0 twisted-core; popd export PYTHONPATH="/tools/twisted-core/lib/python2.5/site-packages:$PYTHONPATH" cd /tools/dist/Twisted-8.0.1/ python setup.py install --prefix=/tools/twisted-8.0.1 cd /tools; ln -s twisted-8.0.1 twisted export PYTHONPATH="/tools/twisted/lib/python2.5/site-packages/:$PYTHONPATH"
Installing Mercurial
wget http://www.selenic.com/mercurial/release/mercurial-0.9.5.tar.gz tar -zvxf mercurial-0.9.5.tar.gz cd mercurial-0.9.5 export PYTHONHOME="/tools/python" export PATH="/tools/python/bin:$PATH" python setup.py install
Installing Nagios NRPE Daemon
wget http://dag.wieers.com/rpm/packages/nagios-plugins/nagios-plugins-1.4.9-1.el5.rf.i386.rpm wget http://dag.wieers.com/rpm/packages/nagios-nrpe/nagios-nrpe-2.5.2-1.el5.rf.i386.rpm wget http://dag.wieers.com/rpm/packages/nagios-nrpe/nagios-plugins-nrpe-2.5.2-1.el5.rf.i386.rpm rpm --nodeps -i *.rpm chkconfig --level 235 nrpe on # todo: make sure this is right after configs get checked in cvs co -d nagios mozilla/tools/nagios mv nagios/nrpe-linux.cfg /etc/nagios/nrpe.cfg
To Do for a new machine
The mozconfig for building mozilla should contain the following settings:
CC=/tools/gcc/bin/gcc CXX=/tools/gcc/bin/g++
- ssh keys are not installed, so depending on what network the machine is put on, copy from another machine on the network.
- You need to install autoconf 2.13
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz tar -xvzf autoconf-2.13.tar.gz cd autoconf-2.13/ ./configure --program-suffix=-2.13 make make install
- Turn off sleep/hibernation
System -> Preferences -> More Preferences -> Power Management (set all to never) -- then go to the "General" tab and select "do nothing" in the pull down about system idle
- Finally
- chown -R cltbld:cltbld /builds
(otherwise you will not be able to create a slave in /builds as cltbld)
Scratchbox is not installed either - so follow the Instructions if you need that.