Difference between revisions of "MAS OS setup"

From MCEWiki
(Additional packages)
Line 1: Line 1:
= Download kernel patch =
+
= Install additional ubuntu packages =
 +
 
 +
== Disable CDROM seeking ==
 +
 
 +
If you want the package manager to download packages from the internet instead of asking you to insert the Ubuntu disk, then open /etc/apt/sources.list and remove (comment) the line
 +
deb cdrom:[Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)]/ dapper main restricted
 +
 
 +
and then do
 +
apt-get sudo update
 +
 
 +
 
 +
== Install required packages ==
 +
 
 +
sudo apt-get update
 +
sudo apt-get install build-essential subversion emacs21 libreadline5-dev
 +
 
 +
== Try to install packages that don't work properly (impossible) ==
 +
 
 +
sudo apt-get install gnome-gv
 +
 
 +
== Install packages that you shouldn't even want to install (optional) ==
 +
sudo apt-get install tcsh
 +
 
 +
 
 +
= Download and install MAS kernel patch =
 +
 
 +
== Download ==
  
 
If you're not compiling the kernel from scratch, download the binary packages from UBC:
 
If you're not compiling the kernel from scratch, download the binary packages from UBC:
Line 5: Line 31:
 
  wget http://e-mode.phas.ubc.ca/~mhasse/mce/kernel-image-2.6.15.7-bigphys_10.00.Custom_i386.deb
 
  wget http://e-mode.phas.ubc.ca/~mhasse/mce/kernel-image-2.6.15.7-bigphys_10.00.Custom_i386.deb
 
  wget http://e-mode.phas.ubc.ca/~mhasse/mce/extras.patch
 
  wget http://e-mode.phas.ubc.ca/~mhasse/mce/extras.patch
 +
 +
== Install ==
  
 
Then, install the packages using dpkg:
 
Then, install the packages using dpkg:
Line 11: Line 39:
 
The "image" file might complain about symbolic links, no big deal.
 
The "image" file might complain about symbolic links, no big deal.
  
Once you install the "image", the kernel should show up in the boot loader (grub)'s kernel list.  It's probably a good idea to test it first before setting it as the default kernel (see next step).
+
== Patch ==
  
To make things look more like a native kernel compilation, apply the extras.patch to the kernel build tree, like this:
+
This makes it possible to compile against the kernel package as though it had been locally compiled originally.
 
  cd /usr/src/kernel-headers-2.6.15.7-bigphys/
 
  cd /usr/src/kernel-headers-2.6.15.7-bigphys/
 
  sudo patch < ~/extras.patch
 
  sudo patch < ~/extras.patch
 +
 +
== Boot menu ==
 +
 +
Once you install the "image", the kernel should show up in the boot loader (grub)'s kernel list.  It's probably a good idea to test it first before setting it as the default kernel (see next step).  Also *do not issue MCE or DSP commands until the acpi=off boot parameter has been configured!*
 +
  
  
Line 28: Line 61:
 
Go back to the top of the file and set the value of the "default" option to 2 once you're ready to boot this kernel by default.
 
Go back to the top of the file and set the value of the "default" option to 2 once you're ready to boot this kernel by default.
  
= Additional packages =
 
 
sudo apt-get update
 
sudo apt-get install build-essential subversion libreadline5-dev
 
 
Not working:
 
sudo apt-get install gnome-gv
 
 
Not recommended:
 
sudo apt-get installtcsh
 
  
 
= External libraries =
 
= External libraries =

Revision as of 14:15, 5 March 2008

Install additional ubuntu packages

Disable CDROM seeking

If you want the package manager to download packages from the internet instead of asking you to insert the Ubuntu disk, then open /etc/apt/sources.list and remove (comment) the line

deb cdrom:[Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)]/ dapper main restricted

and then do

apt-get sudo update


Install required packages

sudo apt-get update
sudo apt-get install build-essential subversion emacs21 libreadline5-dev 

Try to install packages that don't work properly (impossible)

sudo apt-get install gnome-gv

Install packages that you shouldn't even want to install (optional)

sudo apt-get install tcsh


Download and install MAS kernel patch

Download

If you're not compiling the kernel from scratch, download the binary packages from UBC:

wget http://e-mode.phas.ubc.ca/~mhasse/mce/kernel-headers-2.6.15.7-bigphys_10.00.Custom_i386.deb
wget http://e-mode.phas.ubc.ca/~mhasse/mce/kernel-image-2.6.15.7-bigphys_10.00.Custom_i386.deb
wget http://e-mode.phas.ubc.ca/~mhasse/mce/extras.patch

Install

Then, install the packages using dpkg:

sudo dpkg -i kernel-headers-2.6.15.7-bigphys_10.00.Custom_i386.deb
sudo dpkg -i kernel-image-2.6.15.7-bigphys_10.00.Custom_i386.deb

The "image" file might complain about symbolic links, no big deal.

Patch

This makes it possible to compile against the kernel package as though it had been locally compiled originally.

cd /usr/src/kernel-headers-2.6.15.7-bigphys/
sudo patch < ~/extras.patch

Boot menu

Once you install the "image", the kernel should show up in the boot loader (grub)'s kernel list. It's probably a good idea to test it first before setting it as the default kernel (see next step). Also *do not issue MCE or DSP commands until the acpi=off boot parameter has been configured!*


Configure GRUB boot menu

As root (or using sudo), edit the file /boot/grub/menu.lst . Go to the list of kernels, below the line "## ## End Default Options ##", and find the kernel block with title "Ubuntu, kernel 2.6.15.7-bigphys". It should be the third block in the list, i.e. index 2.

You must change the kernel line to turn "acpi=off". Almost all systems crash hard if you don't do this.

kernel          /vmlinuz-2.6.15.7-bigphys root=/dev/sda3 ro quiet splash acpi=off bigphysarea=8192

Go back to the top of the file and set the value of the "default" option to 2 once you're ready to boot this kernel by default.


External libraries

MAS uses libconfig to manage its configuration files. The webpage is here: [ http://www.hyperrealm.com/libconfig/ ]. To install libconfig run the following:

 wget http://www.hyperrealm.com/libconfig/libconfig-1.2.1.tar.gz
 tar -xzf libconfig-1.2.1.tar.gz
 cd libconfig-1.2.1
 ./configure
 make
 sudo make install

To make the system aware of this library, add "/usr/local/lib" to /etc/ld.so.conf and run "sudo ldconfig". i.e.

 echo /usr/local/lib | sudo tee /etc/ld.so.conf
 sudo ldconfig

Branching of MAS and mce_script

From a complete (or somewhat complete) mas source tree (i.e. the repository root) do:

 svn copy trunk branch/new_project
 svn commit branch/new_project

Then check out the appropriate branch (or the whole tree) on the new machine.

Download MAS

See the page on MAS svn repository

Build the driver

There are some compilation options that must be enabled before compiling the driver. This is achieved by putting the definitions into a file Makefile.local in the "driver" folder.

For a normal MAS install, with bigphysarea enabled, Makefile.local should contain only the line

BIGPHYS = 1    # use bigphysarea for frame buffering

Other options one can put in Makefile.local are

FAKEMCE = 1    # enable software MCE emulator in driver

and

REALTIME = 1   # use rtai interrupt handling

Um, you probably shouldn't use these. Just use BIGPHYS.

Anyway, once Makefile.local is setup, type

make clean; make

From the driver folder we can test the driver:

./reload
./mknodes

Note that since "reload" first unloads the driver if it is present, and then loads the driver from the current folder, it may report an "ERROR" message if the first step fails, even though the driver is successfully loaded. The definitive way to check that the driver is loaded is

 cat /proc/mce_dsp

If this file does not exist, the driver isn't loaded. If the cat prints out a bunch of low-level driver information, you're in good shape.

If you're satisfied that the driver works, install the driver with the command

sudo make install

This should put mce_dsp.ko into /lib/modules/2.6.15.7-bigphys/kernel/drivers/misc/, and re-scan the module dependencies. To get the driver to load on boot you must add manually the following lines to /etc/rc.local:

modprobe mce_dsp
/home/mce/mas/driver/mknodes
sudo -u mce /usr/mce/bin/maslog_server

Install MAS (double check)

cd /home/mce/mas and type
make install 
(would this include servo programs??)

Folders

sudo mkdir /data
sudo chown mce:mce /data
sudo chmod g+ws /data
mkdir /home/mce/tmp
chmod g+ws /home/mce/tmp

Folder permissions are annoying. Basically, any place you're going to be creating files has to have the g+s bit set. svn folders are particularly bad...

chmod g+ws /home/mce
chmod g+ws /home/mce/script
chmod g+ws /home