<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://cmbr.phas.ubc.ca/mcewiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=128.189.201.83</id>
	<title>MCEWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://cmbr.phas.ubc.ca/mcewiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=128.189.201.83"/>
	<link rel="alternate" type="text/html" href="https://cmbr.phas.ubc.ca/mcewiki/index.php/Special:Contributions/128.189.201.83"/>
	<updated>2026-09-17T04:12:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://cmbr.phas.ubc.ca/mcewiki/index.php?title=MAS_OS_setup&amp;diff=2508</id>
		<title>MAS OS setup</title>
		<link rel="alternate" type="text/html" href="https://cmbr.phas.ubc.ca/mcewiki/index.php?title=MAS_OS_setup&amp;diff=2508"/>
		<updated>2008-11-19T23:43:23Z</updated>

		<summary type="html">&lt;p&gt;128.189.201.83: /* Boot menu */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Ubuntu 6.06 LTS server''':  This is the most supported OS.  The instructions below are mostly for 6.06.&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 7.10 server''':  We can support this now.  Patched kernels are available.  In the text below, major deviations from the 6.06 installation procedure are identified.&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 8.04 LTS server''':  This version is new enough that the kernel build system isn't producing portable kernel packages.  MAS works with 8.04 but I don't want to install too many 8.04 systems until they clean up the build system.&lt;br /&gt;
&lt;br /&gt;
= Install additional ubuntu packages =&lt;br /&gt;
&lt;br /&gt;
== Disable CDROM seeking ==&lt;br /&gt;
&lt;br /&gt;
The package manager knows that you have the Ubuntu disk and will say things like&lt;br /&gt;
 Media change: please insert the disc labeled&lt;br /&gt;
 'Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)'&lt;br /&gt;
&lt;br /&gt;
To disable this (and download packages from the internet instead), open /etc/apt/sources.list &lt;br /&gt;
 sudo pico /etc/apt/sources.list&lt;br /&gt;
and remove (comment) the line &lt;br /&gt;
 deb cdrom:[Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)]/ dapper main restricted&lt;br /&gt;
&lt;br /&gt;
== Install required packages ==&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install build-essential subversion emacs21 libreadline5-dev &lt;br /&gt;
&lt;br /&gt;
== Enable universe repository and install GGV ==&lt;br /&gt;
&lt;br /&gt;
Uncomment the line in /etc/apt/sources.list so it says &lt;br /&gt;
 deb http://us.archive.ubuntu.com/ubuntu/ dapper universe&lt;br /&gt;
&lt;br /&gt;
Then run&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install gnome-gv&lt;br /&gt;
&lt;br /&gt;
gnome-gv doesn't exist on 7.10, you'll have to settle for&lt;br /&gt;
 sudo apt-get install gv&lt;br /&gt;
&lt;br /&gt;
== Install packages that you shouldn't even want to install (soon to be optional) ==&lt;br /&gt;
 sudo apt-get install tcsh&lt;br /&gt;
&lt;br /&gt;
== Install desktop manager (optional) ==&lt;br /&gt;
 sudo apt-get install ubuntu-desktop gdm&lt;br /&gt;
&lt;br /&gt;
== Install python stuff ==&lt;br /&gt;
&lt;br /&gt;
The 'pyth' branch MAS has experimental support for python using wx and matplotlib:&lt;br /&gt;
 sudo apt-get install python-dev python-wxglade python-matplotlib python-numarray-ext swig&lt;br /&gt;
&lt;br /&gt;
== Install unpackaged libraries ==&lt;br /&gt;
&lt;br /&gt;
MAS uses libconfig to manage its configuration files.  The webpage is here: [ http://www.hyperrealm.com/libconfig/ ].  To install libconfig run the following:&lt;br /&gt;
&lt;br /&gt;
  wget http://www.hyperrealm.com/libconfig/libconfig-1.3.tar.gz&lt;br /&gt;
  tar -xzf libconfig-1.3.tar.gz&lt;br /&gt;
  cd libconfig-1.3&lt;br /&gt;
  ./configure&lt;br /&gt;
  make&lt;br /&gt;
  sudo make install&lt;br /&gt;
&lt;br /&gt;
To make the system aware of this library, add &amp;quot;/usr/local/lib&amp;quot; to /etc/ld.so.conf and run &amp;quot;sudo ldconfig&amp;quot;.  i.e.&lt;br /&gt;
  echo /usr/local/lib | sudo tee -a /etc/ld.so.conf&lt;br /&gt;
  sudo ldconfig&lt;br /&gt;
&lt;br /&gt;
On newer systems (Ubuntu 7.10) you can do this instead:&lt;br /&gt;
  echo /usr/local/include | sudo tee /etc/ld.so.conf.d/libconfig.conf&lt;br /&gt;
  sudo ldconfig&lt;br /&gt;
&lt;br /&gt;
= Download and install MAS kernel patch =&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
If you're not compiling the kernel from scratch, download the binary packages from UBC:&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/kernel-headers-2.6.15.7-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/kernel-image-2.6.15.7-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/extras.patch&lt;br /&gt;
&lt;br /&gt;
For '''Ubuntu 7.10''', get these instead:&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/linux-headers-2.6.22.9-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/linux-image-2.6.22.9-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On '''Ubuntu 7.10''' machines '''without PAE''' hardware (i.e. a maximum of 4G of system memory) use:&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/linux-headers-2.6.22.14-bigphys_2.6.22.14-bigphys-10.00.Custom_i386.deb&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/linux-image-2.6.22.14-bigphys_2.6.22.14-bigphys-10.00.Custom_i386.deb&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
Then, install the packages using dpkg:&lt;br /&gt;
 sudo dpkg -i kernel-headers-2.6.15.7-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
 sudo dpkg -i kernel-image-2.6.15.7-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
The &amp;quot;image&amp;quot; file might complain about symbolic links, no big deal.&lt;br /&gt;
&lt;br /&gt;
On '''Ubuntu 7.10''', instead install these:&lt;br /&gt;
 sudo dpkg -i linux-headers-2.6.22.9-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
 sudo dpkg -i linux-image-2.6.22.9-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
&lt;br /&gt;
Why are these ones called &amp;quot;linux&amp;quot; instead of &amp;quot;kernel&amp;quot;?  I think it's because I got them from Ubuntu repositories instead of kernel.org.&lt;br /&gt;
&lt;br /&gt;
On '''Ubuntu 7.10''' machines '''without PAE''' install these:&lt;br /&gt;
 sudo dpkg -i linux-headers-2.6.22.14-bigphys_2.6.22.14-bigphys-10.00.Custom_i386.deb&lt;br /&gt;
 sudo dpkg -i linux-image-2.6.22.14-bigphys_2.6.22.14-bigphys-10.00.Custom_i386.deb&lt;br /&gt;
&lt;br /&gt;
== Patch ==&lt;br /&gt;
&lt;br /&gt;
This makes it possible to compile against the kernel package as though it had been locally compiled originally.&lt;br /&gt;
 cd /usr/src/kernel-headers-2.6.15.7-bigphys/&lt;br /&gt;
 sudo patch -p1 &amp;lt; ~/extras.patch&lt;br /&gt;
&lt;br /&gt;
This step is not necessary for Ubuntu 7.10.  It may be necessary to link the kernel headers into /lib/modules:&lt;br /&gt;
  sudo ln -s /usr/src/linux-headers-2.6.22.9-bigphys/ /lib/modules/2.6.22.9-bigphys/build&lt;br /&gt;
&lt;br /&gt;
== Boot menu ==&lt;br /&gt;
&lt;br /&gt;
We need to add the kernel option that causes bigphys to allocate boot memory for our driver.  In older versions of MAS (especially ACT's stable release) we also need to disable &amp;quot;acpi&amp;quot;.  It's a good idea to not run any DSP/MCE commands until all of your kernel options are in place. &lt;br /&gt;
&lt;br /&gt;
Having installed the kernel &amp;quot;image&amp;quot; package, the kernel should show up in the boot loader (grub)'s kernel list.&lt;br /&gt;
&lt;br /&gt;
=== Editing the kernel list ===&lt;br /&gt;
As root (or using sudo), edit the file /boot/grub/menu.lst .  &lt;br /&gt;
 sudo pico /boot/grub/menu.lst&lt;br /&gt;
Go to the list of kernels, below the line &amp;quot;## ## End Default Options ##&amp;quot;, and find the new kernel entry.  On Ubuntu 6.06, it should be the third block (index 2), and look like this:&lt;br /&gt;
&lt;br /&gt;
 title           Ubuntu, kernel 2.6.15.7-bigphys&lt;br /&gt;
 root            (hd0,0)&lt;br /&gt;
 kernel          /vmlinuz-2.6.15.7-bigphys root=/dev/sda3 ro quiet splash&lt;br /&gt;
 initrd          /initrd.img-2.6.15.7-bigphys&lt;br /&gt;
 savedefault&lt;br /&gt;
 boot&lt;br /&gt;
&lt;br /&gt;
Add the kernel options to the &amp;quot;kernel&amp;quot; line, producing either this (recent MAS):&lt;br /&gt;
 kernel          /vmlinuz-2.6.15.7-bigphys root=/dev/sda3 ro quiet splash bigphysarea=8192&lt;br /&gt;
or this (old MAS, esp. ACT):&lt;br /&gt;
 kernel          /vmlinuz-2.6.15.7-bigphys root=/dev/sda3 ro quiet splash bigphysarea=8192 acpi=off&lt;br /&gt;
&lt;br /&gt;
Save and close the file, and reboot to test this kernel.  If the kernel &amp;quot;works&amp;quot;, you can edit menu.lst again and change the value of the &amp;quot;default&amp;quot; option to point to this kernel:&lt;br /&gt;
 default    2&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 7.10 and later''': the kernel packages install a bit differently so the block will likely be the first one in the list.  The 'kernel' line  must change from something like&lt;br /&gt;
 kernel          /boot/vmlinuz-2.6.22.9-bigphys root=UUID=1b6e7b54-894d-4571-9f0a-527fe0103975 ro quiet splash&lt;br /&gt;
to&lt;br /&gt;
 kernel          /boot/vmlinuz-2.6.22.9-bigphys root=UUID=1b6e7b54-894d-4571-9f0a-527fe0103975 ro quiet splash bigphysarea=8192&lt;br /&gt;
Note that the long hexadecimal serial numbers are system specifc and yours are probably different than these ones.  Leave them as they are and just add the new kernel options.  The &amp;quot;default&amp;quot; option will probably be&lt;br /&gt;
 default    0&lt;br /&gt;
but it's a good idea to count these things out for yourself.&lt;br /&gt;
&lt;br /&gt;
= Configure the system for mce users = &lt;br /&gt;
&lt;br /&gt;
== Permissions and umask ==&lt;br /&gt;
&lt;br /&gt;
Set the umask for all users to give write access for their group by default.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/profile and change the &amp;quot;umask 022&amp;quot; line to&lt;br /&gt;
 umask 002&lt;br /&gt;
&lt;br /&gt;
Edit /etc/login.defs and find the line that start &amp;quot;# UMASK&amp;quot; and change it to&lt;br /&gt;
 UMASK           002&lt;br /&gt;
&lt;br /&gt;
Any users wishing to use MCE under their own accounts should be added to the &amp;quot;mce&amp;quot; group and should have &amp;quot;mce&amp;quot; as their primary group.  Their umask must be set properly, or other users will not be free to manipulate shared files.&lt;br /&gt;
&lt;br /&gt;
To setup additional system users, see the page on [[MAS user setup]].&lt;br /&gt;
&lt;br /&gt;
== Folders ==&lt;br /&gt;
&lt;br /&gt;
This is the sort of thing that should be done by an install script...&lt;br /&gt;
&lt;br /&gt;
Data directory:&lt;br /&gt;
 sudo mkdir /data&lt;br /&gt;
 sudo chown mce:mce /data&lt;br /&gt;
 sudo chmod g+ws /data&lt;br /&gt;
 mkdir /data/cryo/&lt;br /&gt;
&lt;br /&gt;
Configuration directory:&lt;br /&gt;
 sudo mkdir /etc/mce&lt;br /&gt;
 sudo chgrp mce /etc/mce&lt;br /&gt;
 sudo chmod g+ws /etc/mce&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= If necessary, branch MAS and mce_script =&lt;br /&gt;
&lt;br /&gt;
You can work with a complete checked-out tree, or not.&lt;br /&gt;
&lt;br /&gt;
In the first case:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn://e-mode.phas.ubc.ca/mas&lt;br /&gt;
 svn copy mas/trunk mas/branch/{your_project_name}&lt;br /&gt;
 svn commit mas&lt;br /&gt;
&lt;br /&gt;
Alternately, do the copy directly on the svn server (it is automatically committed):&lt;br /&gt;
 svn copy svn://e-mode.phas.ubc.ca/mas/trunk svn://e-mode.phas.ubc.ca/mas/branch/{your_project_name}&lt;br /&gt;
&lt;br /&gt;
For mce_script, replace &amp;quot;mas&amp;quot; with &amp;quot;mce_script&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Then check out the appropriate branch (or the whole tree) on the new machine.&lt;br /&gt;
&lt;br /&gt;
= Download (checkout) MAS and mce_script =&lt;br /&gt;
&lt;br /&gt;
See the page on [[ MAS svn repository ]]&lt;br /&gt;
&lt;br /&gt;
= Compile and install MAS =&lt;br /&gt;
&lt;br /&gt;
== Build the driver ==&lt;br /&gt;
&lt;br /&gt;
By default, the driver will build with bigphysarea support enabled.  To override build options, create a file Makefile.local in the &amp;quot;driver&amp;quot; folder, and add lines like:&lt;br /&gt;
&lt;br /&gt;
 # BIGPHYS=0 disables bigphysarea frame-buffering&lt;br /&gt;
 BIGPHYS = 0&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 # FAKEMCE=1 provides simple emulation of a PCI card/MCE for testing&lt;br /&gt;
 FAKEMCE = 1&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 # REALTIME=1 makes use of realtime interrupt routines&lt;br /&gt;
 REALTIME = 1&lt;br /&gt;
&lt;br /&gt;
In Makefiles, there should not be comments on the same line as the variable definitions.  On a system running the bigphys kernel with the correct PCI card, Makefile.local will be created at compile time if it does not already exist.  It can be left empty.&lt;br /&gt;
&lt;br /&gt;
Anyway, once Makefile.local is setup, type&lt;br /&gt;
 cd mas&lt;br /&gt;
 make clean; make&lt;br /&gt;
&lt;br /&gt;
From the driver folder we can test the driver:&lt;br /&gt;
 cd driver&lt;br /&gt;
 ./reload&lt;br /&gt;
 ./mknodes&lt;br /&gt;
&lt;br /&gt;
Note that since &amp;quot;reload&amp;quot; first unloads the driver if it is present, and then loads the driver from the current folder, it may report an &amp;quot;ERROR&amp;quot; message if the first step fails, even though the driver is successfully loaded.  The definitive way to check that the driver is loaded is&lt;br /&gt;
  cat /proc/mce_dsp&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
If you're satisfied that the driver works, install the driver with the command&lt;br /&gt;
&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 modprobe mce_dsp&lt;br /&gt;
 /home/mce/mas/driver/mknodes&lt;br /&gt;
 sudo -u mce /usr/mce/bin/maslog_server&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Install MAS config files ==&lt;br /&gt;
&lt;br /&gt;
Hardware and binary config files live in /etc/mce/ (created above).&lt;br /&gt;
&lt;br /&gt;
Make sure you use the hardware config (mce_*.cfg) file appropriate for your system.  Racks with 4 readout cards should use mce_v1.cfg; small sub-racks with readout card slots should use mce_v2.cfg.   &lt;br /&gt;
&lt;br /&gt;
 cd ~/mas/config&lt;br /&gt;
 cp mce_v1.cfg /etc/mce/mce.cfg&lt;br /&gt;
 cp mas.cfg /etc/mce/mas.cfg&lt;br /&gt;
&lt;br /&gt;
= Install mce_script =&lt;br /&gt;
&lt;br /&gt;
The mce_script files are designed so that users can fairly easily run a different set of scripts.  We will install a system default set in /usr/mce/mce_script&lt;br /&gt;
&lt;br /&gt;
 cd /usr/mce&lt;br /&gt;
 svn checkout svn://e-mode.phas.ubc.ca/mce_script/branch/{your_experiment} mce_script&lt;br /&gt;
&lt;br /&gt;
Current experiments include ACT and SPIDER.&lt;br /&gt;
&lt;br /&gt;
== mas_env.bash ==&lt;br /&gt;
&lt;br /&gt;
To set up the environment and path to use these scripts and idl codes, a user should do &amp;quot;source mas_env.bash&amp;quot;.  (This file used to live in mas/config, but has been moved into mce_script/template.)  Non-developer users can source /usr/mce/mce_script/template/mas_env.bash directly; advanced users may want to keep their own copy (or several different copies) in their home folder.&lt;br /&gt;
&lt;br /&gt;
Note that MAS/mce_script scripts should *not* source mas_env.bash!  The whole point of it is that paths should be flexible.&lt;br /&gt;
&lt;br /&gt;
== .bashrc ==&lt;br /&gt;
&lt;br /&gt;
To have bash start up with the MAS variables defined, and the paths ready, add the following lines to .bashrc :&lt;br /&gt;
&lt;br /&gt;
 export MAS_ROOT=/usr/mce/mce_script/&lt;br /&gt;
 source $MAS_ROOT/template/mas_env.bash&lt;br /&gt;
 export IDL_PATH=&amp;quot;&amp;lt;IDL_DEFAULT&amp;gt;:$MAS_IDL/mas&amp;quot;&lt;br /&gt;
&lt;br /&gt;
While you're in there, you may want to define a few aliases.  In particular, I always uncomment the alias ll='ls-l' line.&lt;/div&gt;</summary>
		<author><name>128.189.201.83</name></author>
		
	</entry>
</feed>