Difference between revisions of "MAS OS setup"
(→Compile and install MAS) |
|||
Line 101: | Line 101: | ||
mkdir /data/cryo/ | mkdir /data/cryo/ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
= Download (checkout) MAS and mce_script = | = Download (checkout) MAS and mce_script = |
Revision as of 15:56, 7 February 2012
Contents
[hide]Supported operating systems
- Ubuntu 10.04, 9.10, 9.04, 8.10, 8.04, 7.10, 6.06.
- 10.04 is an LTS release. Users should not expect support, in the near term, for Ubuntu releases newer than this.
Ubuntu 10.04
The automated installation package is tested, but as Ubuntu tweaks its packages the install script may fall slightly out of sync. It's worth a shot though.
After installing Ubuntu 10.04 (desktop), get the install tarball:
cd ~ wget http://e-mode.phas.ubc.ca/~mhasse/mce/ubuntu_10.04/ubuntu_10.04_install.tar.gz tar -xzf ubuntu_10.04_install.tar.gz cd install/
Install additional ubuntu packages
From that install folder, run
bash install.bash
(Under 10.04, the vanilla kernel 2.6.38.8 is also supported. To use it, copy ./alternatives/sources.2.6.38.8.bash to ./sources.bash before running install.bash and kernel_build.bash .)
Bigphysarea kernel patch
You can either download the compiled kernels or build them from scratch.
From install folder, run EITHER
bash kernel_download.bash
or
bash kernel_build.bash
Then when one or the other of those has succeeded, install them:
bash kernel_install.bash
You can now proceed to the section below titled "Configure the system for MCE users".
Ubuntu 9.10
Starting with Ubuntu 9.10, some effort has been made to automate the installation. After installing Ubuntu 9.10 (desktop), get the install tarball:
cd ~ wget http://e-mode.phas.ubc.ca/~mhasse/mce/ubuntu_09.10/install.tar.gz tar -xzf install.tar.gz cd install/
Install additional ubuntu packages
From that install folder, run
bash install.bash
Bigphysarea kernel patch
You can either download the compiled kernels or build them from scratch.
From install folder, run EITHER
bash kernel_download.bash
or
bash kernel_build.bash
Then when one or the other of those has succeeded, install them:
bash kernel_install.bash
You can now proceed to the section below titled "Configure the system for MCE users".
Ubuntu 6.06 - 9.04
See MAS OS setup (Ubuntu 6.06 to 9.04)
Configure the system for MCE users
Setup environment for MCE user
We tend to assume that a single user and group will have dominion over the MCE software, scripts, and data. We often assume that this user will be called "mce". But it doesn't need to be. Even if multiple users are running things through their own accounts it is likely useful to have a single group that can be used to manage access to the data.
Anyway, to set up a reasonable MCE user, see MAS user setup.
All users using the MCE will need to define some environment variables to use the scripts. See the above link for lines to add to your .bashrc.
System umask
You may want to set the system umask to make for a system where it's easier to share Set the umask for all users to give write access for their group by default.
Edit /etc/profile and change the "umask 022" line to
umask 002
Edit /etc/login.defs and find the line that start "# UMASK" and change it to
UMASK 002
Folders
mce_script assumes that /data/cryo/ exists and can be manipulated. To create something reasonable:
MCE_USER=mce MCE_GROUP=mce sudo mkdir /data sudo chown $MCE_USER:$MCE_GROUP /data sudo chmod g+ws /data mkdir /data/cryo/
Download (checkout) MAS and mce_script
See MAS svn repository.
Compile and install MAS
The following procedure outlines the default situation, where MAS is being installed on a computer containing only one fibre card. For information on running MAS with multiple fibre cards in one computer, see Multicard MAS.
./configure
MAS uses autoconf for some basic configuration stuff. The biggest thing you usually need to tell it is what the basic username and group should be for mce data. Also, there are a few options for the driver and some stupid python stuff.
From the MAS source folder, run
./configure
Some useful options:
--disable-driver suppress driver compilation/installation --disable-bigphysarea compile driver without bigphysarea support --disable-config2 suppress mas.cfg and mce.cfg generation/installation --enable-multicard build a version of MAS which can drive multiple fibre cards. (See Multicard MAS for specifics.) --with-user=USER set default MCE user --with-group=GROUP set default MCE group --with-kernel-dir=DIR set kernel build directory (typically automatically determined)
Run
./configure --help
for a full list. When running, configure will complain if it cannot find something, and even suggest what package you need to install.
mce.cfg
After running configure, but before running make, you must specify a template file (mce.cin) which will be used to generate the hardware configuration file (mce.cfg). Full details of this procedure are given in the mce.cfg page, but briefly:
- copy an appropriate template from
config2/templates
toconfig2/mce.cin
- edit the
config2/mce.cin
file to describe your MCE.
The configuration file will be installed automatically when make install
is run below. This entire step can be skipped if you passed --disable-config2 to configure above, but note that MAS will not function without mce.cfg and mas.cfg installed.
make
This often works.
make clean; make
Test the driver
It is wise to test that the driver does not kill your machine before installing it to load on boot. After compiling do:
cd driver sudo ./reload
This will load the driver, which should then try to talk to the SDSU PCI card if it is installed. 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.
sudo make install
If you're satisfied that the driver works, install the whole thing. Go back up to the MAS base folder and run
sudo make install
This will do the following:
- install the kernel driver,
driver/mce_dsp.ko
, into/lib/modules/$(uname -r)/kernel/drivers/misc/
, and re-scan the module dependencies. - install the MAS binaries from
applications/
and the scripts fromscript/
into/usr/mce/bin
- install the MAS udev ruleset
scripts/91-mas.rules
into/etc/udev/rules.d/
. These udev rules will ensure that the mce_dsp module is loaded and the MAS device nodes are created at boot time. You can get udev to run these rules immediately, which will result in /dev being populated with the mce devices, by running:
sudo udevadm trigger
- or, else, you can make the nodes yourself by running mas_mknodes.
- install the mas logging daemon script
/etc/init.d/mas
init script. The driver can then be started/restarted as desired through this script:
/etc/init.d/mas restart
- The driver will automatically be set to load on boot. To disable this, remove the symbolic link "/etc/rc2.d/S99mas".
- install the hardware configuration file,
config2/mce.cfg
, and the MAS configuration file,config2/mas.cfg
to/etc/mce/
.
Install mce_script
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
cd /usr/mce MY_BRANCH=trunk svn checkout svn://e-mode.phas.ubc.ca/mce_script/$MY_BRANCH mce_script
mas_env.bash
To set up the environment and path to use these scripts and idl codes, a user should do "source mas_env.bash". (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.
Note that MAS/mce_script scripts should *not* source mas_env.bash! The whole point of it is that paths should be flexible.
.bashrc
To have bash start up with the MAS variables defined, and the paths ready, add the following lines to .bashrc :
export MAS_ROOT=/usr/mce/mce_script/ source $MAS_ROOT/template/mas_env.bash export IDL_PATH="<IDL_DEFAULT>:$MAS_IDL/mas"
While you're in there, you may want to define a few aliases. In particular, I always uncomment the alias ll='ls -l' line.