Lab Notes

From RCSWiki

Jump to: navigation, search

Notes About the lab... a temporary place to put things until the Wiki becomes more stable.

Contents

RCC Cluster Stuff

Ron's Notes

Installing Beamer Class

For our presentations we use LaTex with the Beamer class. Beamer is installed on Marge (and soon to be installed on Homer). To install Beamer on your own machine follow these steps. I recommend reading the Beamer Installation Manual before you begin.

  1. Download Beamer
  2. You will need to download all three:
    1. latex-beamer
    2. xcolor
    3. pgf
  3. Locate your texmf directory (if you are unsure what this mean, refer to the Installation Manual).
  4. Extract each of the three tar files to the appropriate folder.
  5. Run command mktexls

ModelSim Libraries for Xilinx

In order to get Xilinx libraries to work with ModelSim you need to run the following command:

  • compxlib
    • Source the Latest Version of the Xilinx Tools
  • Choose Default Options
  • Update takes ~5 to 10 minutes

This needs to be run every time there is an update to the Xilinx Tools (either a major / minor release or an IP Update)

AIREN Board Minicom Issues

  • as Root on Marge run: rmmod ehci-hcd
    • This should only be run once, the AIREN Boards will renumerate (slowly, be patient) and then it should work until the next reboot
      • TODO: Verify

USB JTAG Notes

  1. Install libusb-dev package
    • Ubuntu: apt-get install libusb-dev
    • Fedora Core: yum install libusb-devel
  2. Install FXLoad package
    • Ubuntu: apt-get install fxload
    • Fedora Core need to install RPM
  3. Download the JTAG USB Library
  4. Extract archive in /opt/xilinx/usbjtag folder
  5. Run make to create: libusb-driver.so
    • On a 64-bit machine to make a 32-bit driver run make lib32
  6. In order to substitute for windrvr6 you must export the libusb-driver.so
    • One option is to add: export LD_PRELOAD=/opt/xilinx/usbjtag/libusb-driver.so to your .bash_profile
    • Alternatively you could export the library each time you use iMPACT
  7. Add a new rule to UDev Rules Set
    • # sudo emacs /etc/udev/rules.d/50-xilinx-usb-pav.rules
    • Enter: ACTION=="add", BUS=="usb", SYSFS{idVendor}=="03fd", MODE="666" into the newly created file
  8. Copy Xilinx Specific Rule to /etc/udev/rules.d
    • cp /opt/xilinx/9.1i/ise/bin/lin/xusbdfwu.rules /etc/udev/rules.d/.
    • This allows the JTAG Cable to be plugged and unplugged without running FXLOAD
  9. Download Updated Firmware
    • Extract xusbdfwu.hex to /opt/xilinx/9.1i/ise/bin/lin/ and copy to /usr/share/
  10. Unplug JTAG (if already plugged in)
  11. Restart udev:
    • # /etc/init.d/udev restart
    • On Fedora Core: udevcontrol stop_exec_queue & udevcontrol start_exec_queue
  12. Plugin JTAG
  13. Get USB Bus and Device Number for JTAG
    • # lsusb | grep Xilinx
  14. If Device ID Ends in :000F or anything other than :0008
    • Run the following command replacing the 001/002 with the Bus and Device ID from the previous command
    • sudo fxload -v -t fx2 -I /opt/xilinx/9.1i/ise/bin/lin/xusbdfwu.hex -D /proc/bus/usb/001/002
  15. Testing...
    • Make sure you have preloaded the libusb-driver.so
    • Start impact
    • Ignore any error about the wrong directory (if it shows up)
    • Click cancel to any iMPACT project loading
    • Double click Boundary Scan from the list of Modes
    • From the Menu select Output -> Cable Setup and change to Xilinx USB Cable then click OK
    • From the Menu select Output -> Cable Auto Connect
      • It may need to update the firmware - this should only happen once
    • To tell if it worked look in the Lower Right corner it should say Platform Cable USB 6 MHZ

Crazy Weirdness...

  1. If you unplug the USB JTAG and plug it back it, it will reassign the Bus and Device ID
    • Before running impact check the Device ID again
      • # lsusb | grep Xilinx
    • If the ID has changed to anything but :0008 then you will need to reload the firmware via FXLOAD
      • See above where FXLoad was explained
  2. Before documenting this and testing it a lot I was finding the cable firmware was always needing updating... even if I just had updated it the previous time I connected. Following these precise steps has for now resolved that problem.
  3. It may be necessary to add the user(s) to the lpr group.
  4. This driver is actually pretending to be /dev/parport0

USB JTAG with FTDI Chip

In order to use the FTDI chip as a JTAG instead of Xilinx's USB JTAG, begin by following the directions above. Once you have the files in place you will need to make a few modifications before being able to use the FTDI Chip as a USB JTAG device. Note: Currently the speed is limited to 300 KHz and is treated as a Platform III cable.

Hardware Setup

In order to use the FTDI module you need to connect the following (on the FTDI module):

  • Pin 1: 3.3v
  • Pin 2 - 11: NC
  • Pin 12: Tx Pin on the FPGA (Use Port B as Serial UART)
  • Pin 13: Rx Pin on the FPGA
  • Pin 14 - 15: GND
  • Pin 16: NC
  • Pin 17 - 18: 3.3v
  • Pin 19 - 20: Together
  • Pin 21: NC
  • Pin 22 - 25: GND
  • Pin 26 - 27: NC
  • Pin 28: 3.3v
  • Pin 29 - 36: NC
  • Pin 37: TMS on FPGA (pull up to 3.3v though 10 K Resistor)
  • Pin 38: TDO on FPGA
  • Pin 39: TDI on FPGA (pull up to 3.3v though 10 K Resistor)
  • Pin 40: TCK on FPGA (pull down to GND though 10 K Resistor)

Software Setup

  1. lsusb to find the Device / Manufactor IDs
    • lsusb -> Bus 001 Device 007: ID 0403:6010 Future Technology Devices International, Ltd
  2. Modify libusb-driverrc:
    • LPT2 = FTDI:0403:6010
  3. Modify config.c
    • From: snprintf(buf, sizeof(buf), "%s/.libusb-driverrc", getenv("HOME"));
    • To: snprintf(buf, sizeof(buf), "/opt/xilinx/usbjtag/libusb-driverrc");
  4. Make Library (libusb-driver.so)
    • make
  5. Install FTDI Library (libftdi-0.10)
    • This creates a lirary file for FTDI that you will need
  6. You might also need to install confus-2.6 / ftdi_eeprom-0.2
  7. LD_PRELOAD Changes to:
    • export LD_PRELOAD=/usr/local/lib/libftdi.so:/opt/xilinx/usbjtag/libusb-driver.so
  8. LD_LIBRARY_PATH:
    • export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib


Setting up a new machine

  1. Install Fedora Core
  2. Set up Firewall with new hostname
  3. Manually add host name to /etc/hosts on homer

Setting up NIS

  1. Edit /etc/yp.conf. add the line: domain rcs server 192.168.1.101
  2. On homer, add the new machine to the file /var/yp/securenets
  3. On homer, cd /var/yp then make
  4. On homer, /etc/init.d/ypserv restart
  5. Now, on the local machine: /etc/init.d/ypbind start

Debain specific notes

  1. add +:::::: to /etc/passwd
  2. add automount: nis to /etc/nsswitch.conf

Setting up NFS and automount

  1. on homer, edit /etc/exports to allow exporting to the new machine
  2. mkdir /build
  3. mkdir /opt
  4. edit /etc/fstab. add line:
    • homer:/export/build /build nfs rw,soft,intr,rsize=32768,wsize=32768 0 0
    • homer:/export/opt.i386 /opt nfs rw,soft,intr,rsize=32768,wsize=32768 0 0

Last Steps

  1. On Homer: Add to /etc/exports
  2. On Homer: Run /usr/sbin/exportfs -a
  3. On Homer: Run /etc/init.d/nfs restart
  4. On Machine: mkdir /build
  5. On Machine: mkdir /opt
  6. Mount: mount /build
  7. Mount: mount /opt

Installing Xilinx tools on FC6

  1. you will need to install
    • compat-libstdc++-33
    • libXm.so.3
    • from /usr/lib/ on homer

Installing XFCE

  1. get xfce installer from /build/downloads
  2. install glib2-devel, gtk2-devel, libxml2-devel, vte-devel, libjpeg-devel, startup-notification-devel, hal-devel, dbus-glib-devel, libXcomposite-devel, libXdamage-devel, gcc-c++, alsa-lib-devel, libSM-devel

Adobe Acrobat Reader

  1. it doesnt work out of the box in FC6
  2. to fix, edit the acroread script
  3. replace line 418 with the following
    • echo $mfile| sed 's/libgtk-x11-\([0-9]*\).0.so.0.\([0-9]*\)00.\([0-9]*\)\|\(.*\)/\1\2\3/g'
  4. my source

Printing to Maggie

We have a Common Unix Printing System (CUPS) in the lab. The printer name is Maggie.

  1. On Linux machines:
    1. Open Web Browser
    2. Type http://localhost:631
    3. Click on the Administration Tab
    4. Under New Printers Found there should be the HP Color LaserJet 3800
    5. Click the Add Thie Printer button
    6. It should automatically select the 3800 printer on the next page, if not select it and click the Add Printer button
    7. Type in root and the lab password
    8. Switch to Printers tab at the top
    9. Print Test Page if necessary
  1. On Macs:
    1. This will require you to download the latest printer drivers from HP
    2. Open System Preferenecs and Select Print & Fax
    3. Click the + sign
    4. The HP Color LaserJet 3800 [98BAD3] on the Bonjour connection should appear
    5. Click on it and Add it
      • If you want to Name it something meaningful like say "230A WH Lab Printer" that might be helpful
  1. On Windows:
    1. Why would anyone in our lab use Windows?

To print from the command line I use:

  • lpr -oprettyprint -o sides=one-sided
  • I have configured the printer to by default print duplex (Save us some paper!)

Installing ChipScope

  1. Download ChipScope from Xilinx
  2. Extract into /opt/xilinx/<tools version #>
    • This will create a folder called: chipscope
  3. Add 3 lines to settings.sh in 9.1i folder:
    • CHIPSCOPE=/opt/xilinx/9.1i/chipscope
    • PATH=${PATH}:$CHIPSCOPE/bin/lin
    • export CHIPSCOPE PATH
  4. Register ChipScope:
    • cs_register
  5. Open ChipScope:
    • analyzer.sh
  6. Connect to JTAG
    • JTAG Chain menu Option
      • Set to use correct cable (USB JTAG)
    • Set Server Host Settings
      • Server: localhost:50001 (if local)
      • Server: marge:50001 (if on marge)
  7. Click "Open Cable/Search JTAG Cable" Button
    • Common Errors:
      • Using JTAG make sure to export LD_PRELOAD
      • Board is not turned on


Andy's Notes

  1. Sidebar / Navigation:
    1. MediaWiki:Sidebar
    2. MediaWiki Help


By Adding "__FORCETOC__" I can Force Table of Contents with fewer than 4 headers... otherwise I need more than 3.


To disable Anonymous Edits put this in LocalSettings.php:
$wgGroupPermissions['*']['edit'] = false;

To Allow User's to upload files:
$wgAllowCopyUploads = true;

Warning!

Currently to upload files I had to set wiki/images to 777... need to find why I need execute

Wiki Syntax Notes

Just an FYI:


Setting up the Wiki

Wiki Authentication

Alright, I appear to be the first person to really document "HOW" to do this...

  1. Create extensions/PwAuthPlugin.php from MediaWiki
    • Copy and Paste the code from MediaWiki into PwAuthPlugin.php
    • Modify function strict() to return false; (allows wikiadmin to login)
  2. Add to or Modify LocalSettings.php
    • $wgGroupPermissions['*']['edit'] = false; # Disable Anonymous Edits
    • require_once("./extensions/PwAuthPlugin.php");
    • $wgAuth = new PwAuthPlugin();
    • $wgGroupPermissions['*']['createaccount'] = false;
    • $wgGroupPermissions['*']['read'] = true;
    • $wgGroupPermissions['*']['edit'] = false;
    • $wgGroupPermissions['*']['createpage'] = true;
    • $wgGroupPermissions['*']['createtalk'] = false;
    • $wgShowIPinHeader = false; # For non-logged in users
  1. Download pwauth
    1. Extract to /usr/local/libexec/pwauth
    2. Open Makefile
      • Comment out: LIB= -lcrypt
      • Uncomment: LIB=-lpam -ldl
    3. Open config.h
      • Uncomment: #define PAM (comment whatever other one, you can only have one defined)
      • Uncomment: #define UNIX_LASTLOG and HAVE_LASTLOG_H
      • Uncomment: #define CHECK_LOGIN_EXPIRATION and CHECK_PASSWORD_EXPIRATION
      • Set: #define SERVER_UIDS 48 /* apache user id */
      • Uncomment: #define SLEEP_LOCK "/var/run/pwauth.lock"
      • Otherwise comment out all other #defines
    4. Run make - will create pwauth
  2. Download Mod_Authnz_External
    1. Extract to temporary directory (only need to build .so)
    2. Run: apxs -c mod_authnz_external.c
    3. apxs -i -a mod_authnz_external.la
      1. This requires apxs to be installed: yum install httpd-devel.i386
      2. It should install to /usr/sbin/apxs
  3. Modify /etc/httpd/config/httpd.conf
    1. Verify: LoadModule authnz_external_module modules/mod_authnz_external.so added
    2. Add before Virtual Host Section:
      • # For External Authentication
      • AddExternalAuth pwauth /usr/local/libexec/pwauth/pwauth
      • SetExternalAuthMethod pwauth pipe
    3. Restart httpd - /etc/init.d/httpd restart
  4. Create a file called: /etc/pam.d/pwauth and add
    • auth sufficient pam_pwdfile.so pwdfile $passwordfile
    • auth sufficient pam_stack.so service=system-auth
    • account sufficient pam_pwdfile.so pwdfile $passwordfile
    • account sufficient pam_stack.so service=system-auth
      • where $passwordfile is the location to your /lib/security/*.so files
  5. Test pwauth works (be careful, it displays your password to the terminal so use a dummy account)
    • from /usr/local/libexec/pwauth
    • ./pwauth enter username enter password
    • then do echo $? if it is 0 you have setup pwauth correctly, if it is 1 you need to configure the PAM stuff
  6. If that works then you can try logging into the Wiki
  7. If it fails check out the logs in /etc/httpd/logs/ and /var/log/secure using tail -f


User Access

TEST: test.bsb

Deprecated Wiki Pages

Important information for classes taught by Dr. Sass

LVM Howto

Remove old disk

  1. determine number of blocks allocated to the old disk
    1. pvdisplay
    2. Allocated PE * PE Size = bytes to reduce filesystem by
    3. If PE Size = 4096 KByte and filesystem block size is 4 KByte
    4. Then blocks to remove = Allocated PE * 1024 * 2
  2. umount /media/backup/
  3. e2fsck -f /dev/mapper/backup_vg-backup_lv
  4. resize2fs -p /dev/mapper/backup_vg-backup_lv 244189184
  5. lvreduce -l -7328 /dev/backup_vg/backup_lv
  6. pvmove /dev/sda1
  7. vgreduce backup_vg /dev/sda1
Personal tools