ReferencePlatforms/Test/FedoraLinux

From MozillaWiki
Jump to: navigation, search

unless noted, 32bit steps are the same as 64bit steps

Download Fedora

download and check isos:

http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/12/Fedora/i386/iso/Fedora-12-i386-DVD.iso
http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/12/Fedora/x86_64/iso/Fedora-12-x86_64-DVD.iso
https://fedoraproject.org/en/verify

Install Fedora

  • hold option
  • boot from 'Windows' dvd
  • Select "install or upgrade an existing system"
  • select OK then test when asked to test disc
  • ackknowledge test success
  • select continue for additional discs
  • reinsert dvd and select OK
  • X + anaconda start
  • next, next, next
  • set hostname "talos-r3-fed-ref", "talos-r3-fed64-ref"
  • next
  • select "America/Los Angeles"
  • tick "System clock uses UTC"
  • next
  • set root password, next
  • change "Replace existing Linux system" to "Use entire drive", next
  • click "Write changes to disk"
  • untick "office and productivity", next
  • reboot
  • forcefully shutdown
  • turn on and hold option
  • insert refit cd
  • boot refit
  • press down 2 times to 'Start Partition Tool' press enter
  • Yes to "may i update the MBR ..."
  • hit any key
  • select restart computer (up arrow)
  • hold option then eject cd and select windows hard disk
  • first run will begin on this boot
  • forward, forward
  • username: cltbld, password: ..., full name, Full Name: Client Builder, forward
  • set date/time, forward
  • finish
  • No, do not send
  • log in
  • add reboot=pci and nomodeset and remove rhgb and quiet on the kernel line in /etc/grub.conf
  • reboot

Configure Fedora

Disable Fedora Updates Repos

Because it is easier to stay at the release versions of everything, we only want to pull the release repository.

su -
find /etc/yum.repos.d -name "*fedora*updates*.repo" -exec sed -i -e 's/^enabled=1$/enabled=0/' '{}' \;

Show Grub Prompt

su -
sed -i -e 's/^timeout=0$/timeout=5/' /boot/grub/menu.lst
sed -i -e 's/^hiddenmenu$//' /boot/grub/menu.lst

Remove Development Libraries/Tools

su -
yum remove "*-devel"

Install nvidia Driver

rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm 
rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
#rpmfusion nonfree and free updates repos need to be enabled
yum install kmod-nvidia-`uname -r`
livna-config-display --active off
#if that stacktraces,
# sed -i -e 's/active = True/active = False/' /etc/sysconfig/livna-config-display
mv /usr/sbin/livna-config-display /usr/sbin/livna-config-display.old
ln -s /bin/true /usr/sbin/livna-config-display
chkconfig nvidia off #Seems counter intuitive, but it is for the best
dracut -f /boot/initramfs-$(uname -r).img $(uname -r)

Copy this xorg.conf to /etc/X11/xorg.conf

/etc/X11/xorg.conf

This xorg.conf file is also available from [1]

Note that on 64bit there is a different 'Files' section. This might not be necessary if /usr/lib64 is a symlink to /usr/lib (or vice-versa) on 64bit fedora

Section "ServerLayout"
    Identifier     "Default Layout"
    Screen         "Default Screen" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
    ModulePath      "/usr/lib/xorg/modules/extensions/nvidia"
    ModulePath      "/usr/lib/xorg/modules"
EndSection

#Section "Files"
#    ModulePath      "/usr/lib64/xorg/modules/extensions/nvidia"
#    ModulePath      "/usr/lib64/xorg/modules"
#EndSection

Section "ServerFlags"
    Option         "AIGLX" "on"
    #x11vnc doesn't like xkb
    Option         "XkbDisable" "True"
EndSection

Section "InputDevice"
    # generated from data in "/etc/sysconfig/keyboard"
    Identifier     "Keyboard0"
    Driver         "keyboard"
    #Option         "XkbLayout" "us"
    #Option         "XkbModel" "pc105"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 100.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
    # This mode line is for 1280x1024@60Hz
    Modeline    "1280x1024" 114.98 1280 1312 1744 1776 1024 1045 1055 1076
EndSection

Section "Device"
    Identifier     "Videocard0"
    Driver         "nvidia"
EndSection

Section "Screen"
    Identifier     "Default Screen"
    Device         "Videocard0"
    Monitor        "Monitor0"
    Option         "AddARGBGLXVisuals" "True"
    #Use MiniDVI->VGA adapter only
    Option         "UseDisplayDevice" "CRT-0"
    #Don't try to use any of the DVI or MiniDP+VGA Options
    Option         "IgnoreDisplayDevices" "DFP-0, DFP-1, DFP-2"
    #Make sure that only our custom modeline is used
    Option         "ModeValidation" "CRT-0: NoVesaModes, NoEdidModes, NoXServerModes, NoPredefinedModes"
    #Disable EDID retrieval/parsing so we can set resolution with no monitor
    Option         "UseEDID" "False"
    #Spew a lot of info about modesetting.  We are going to leave this enabled
    #in case we find that the wrong resolution is being set
    Option         "ModeDebug" "True"
    #Keep a constant GPU/Video Ram clock
    Option         "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerDefault=0x1; PowerMizerDefaultAC=0x1"
    SubSection     "Display"
        Modes      "1280x1024"
    EndSubSection
EndSection

Section "Extensions"
    Option         "Composite" "Enable"
EndSection

Display Notes

Preferences

  • Right click network Manager->edit connections
    • click "system eth0" then click edit, tick connect automatically, apply
    • enter root password, ok
    • click close
  • System->Preferences->Screen Saver
    • Disable "activate screensaver when computer is idle"
    • Click Power Management
      • Never put computer to sleep
      • Never put display to sleep
      • Click 'Make Default', enter root password and click authenticate
  • System->Preferences->Startup Programs
    • Note: This control panel thing is highly broken. If you want to edit an entry you have to remove and recreate it
    • click add
    • name: talos slave
    • command: gnome-terminal -x buildbot start talos-slave"
      • Needs to be wrapped in bash to make sure the python alias is setup
    • click add
    • name: x11vnc
    • command: 'x11vnc -shared -forever -bg -usepw -xkb'
  • Disable update notification
    • System->Preferences->Software Updates
    • Check for updates: Never
    • Automatically install: Nothing
    • Check for Major Upgrades: Never
  • Configure Terminal
    • open terminal->edit menu->profiles->default->title and command tab->
      • change 'when command exits' to 'hold the terminal open'

Enable sudo

$ su -
# visudo

uncomment the following line:

# %wheel	  ALL=(ALL)	ALL -> %wheel	  ALL=(ALL)	ALL

then add user to wheel

# gpasswd -a cltbld wheel

Install Packages

su -
yum install xrestop cvs tigervnc-server x11vnc #tigervnc for vncpasswd

Modify services

chkconfig cpuspeed off
chkconfig iptables off
chkconfig ip6tables off
chkconfig httpd on

Enable autologin

Add the following to /etc/gdm/custom.conf

[daemon]
AutomaticLoginEnable=true
AutomaticLogin=cltbld

Startup processes

edit /etc/rc.local and add:

rm /dev/random
mknod /dev/random c 1 9
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo 1 > /sys/devices/platform/applesmc.768/fan1_manual
echo 5500 > /sys/devices/platform/applesmc.768/fan1_output

Disable SELinux

sudo sed -i -e 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

Set up httpd (Apache2)

mkdir -p /home/cltbld/talos-slave/talos-data/talos ~/pages
chmod a+x /home/cltbld
sudo rm /etc/httpd/conf.d/welcome.conf

Open /etc/httpd/conf/httpd.conf and Change the DocumentRoot and second <Directory> tag to

'/home/cltbld/talos-slave/talos-data/talos'. 

Comment out

AddDefaultCharset UTF-8 -> #AddDefaultCharset UTF-8

Remove CustomLog lines

sed -i -e 's/^CustomLog/#CustomLog/' /etc/httpd/conf/httpd.conf

Set up alias for pageset

Alias /page_load_test/pages /home/cltbld/pages
<Directory /home/cltbld/pages>
   Options Indexes
   Order allow,deny
   Allow from all
</Directory>

Install python and twisted

On another fedora 12 computer of the same arch: a wget http://www.python.org/ftp/python/2.5.4/Python-2.5.4.tgz

tar zxf Python-2.5.4.tgz
mkdir python2.5-<ARCH>
PYDIR=`pwd`/python-2.5-<ARCH>
cd Python-2.5.4
./configure --prefix=/home/cltbld
make -j4
make altinstall DESTDIR=$PYDIR
cd ..
tar jcf python-2.5-32bit.tar.bz2 $PYDIR
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-2.4.0.tar.bz2
tar xfvj TwistedCore-2.4.0.tar.bz2 
tar xfvj Twisted-2.4.0.tar.bz2 
cd Twisted-2.4.0/ZopeInterface-3.1.0c1/
$PYDIR/home/cltbld/bin/python2.5 setup.py build_ext
$PYDIR/home/cltbld/bin/python2.5 setup.py install #twisted needs zope-int. to build
cd ..
tar jcf zope-py25-<ARCH>.tar.bz2 ZopeInterface-3.1.0c1
mv zope-py25-<ARCH>.tar.bz2 ..
cd ../TwistedCore-2.4.0
tar jcf twisted-py25-<ARCH>.tar.bz2 TwistedCore-2.4.0
$PYDIR/home/cltbld/bin/python2.5 setup.py build_ext
# put files on talos machine in home dir
rsync -a python-2.5-<ARCH>.tar.bz2 twisted-py25-<ARCH>.tar.bz2 zope-py25-<ARCH>.tar.bz2 <target>

On talos computer:

sed -i -e "s|^PATH=\$PATH:\$HOME/bin$|PATH=\$HOME/bin:\$PATH|" ~/.bash_profile
python --version # verify it is python 2.5.4
cd bin
ln -s python2.5 python 
ln -s python2.5-config python-config 
tar jxf python2.5-<ARCH>.tar.bz2 twisted-py25-<ARCH>.tar.bz2 zope-py25-<ARCH>.tar.bz2
rsync -a python2.5-<ARCH>/home/cltbld/. ~/.
cd ZopeInterface-3.1.0c1
python2.5 setup.py install
cd ..
cd Twisted-2.4.0
python2.5 setup.py install
wget http://pyyaml.org/download/pyyaml/PyYAML-3.09.tar.gz
tar zxf PyYAML-3.09.tar.gz
cd PyYAML-3.09
python2.5 setup.py install
cvs -d:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -d buildbot mozilla/tools/buildbot
cd buildbot
python2.5 setup.py install

Ref machine info

32bit - 10.250.3.217 - 00:26:B0:F3:AE:E8
32bit - 10.250.3.168 - 00:26:B0:F4:10:6E
64bit - 10.250.2.200 - 60:FB:42:F4:D6:5C

Post-imaging steps

Set hostname:

hostname 

Change hostname in /etc/sysconfig/network

vi /etc/sysconfig/network

Fedora is no longer covered by puppet. Run the script that performs the same steps:

https://hg.mozilla.org/build/braindump/file/a6eee2f099b0/linux-related/fedora_setup_no_puppet.sh

There are some basic params at the top of the script that need to be set prior to running the script.