NOTES FOR INSTALLING/SETTING UP LINUX FOR HBETA IMAGER WORKTATIONS



Linux version used: RedHat 7.1. Kernel 2.4.2.
H-Beta Imager POLARIS description located at www.phys.ucalgary.ca/Polaris/
----------------------------------------------------------------------------

* Boot from RH71 CDROM (change BIOS settings to boot from CD, reverse the
  setting when install is complete).
  Also set AutomaticPowerOn, WakeUpOnLAN, and PowerManagement all to OFF.

* Press ENTER to select GUI installation

* It now successfully detects the aic7xxx and loads its SCSI driver - then runs anaconda

* The X GUI is launched automatically

* Select ENGLISH language

* Select Keyboard "GENERIC 101-KEY PC"
  	 Layout "US ENGLISH W/ISO9995-3"
  	 Dead Keys "DISABLED"

* Select Mouse "Generic, 2-Button PS/2" (automatically checks "emulate 3 buttons")
  If a mistake is made here, it can be fixed later using /usr/sbin/mouseconfigurator

* Select CUSTOM SYSTEM install type

* Select DISK DRUID partitioning method.

* Polaris has two 20 GB IDE harddrives (hda, hdb)

* Create partitions on hda
	/boot	16 MB
	swap	96 MB
	/	the rest

  This results in:
	/boot	hda1	23 MB	
	swap	hda5	101 MB	
	/	hda6	19445 MB

* Do the same for hdb later, and install Linux on hdb in the same manner, make dual boot in lilo

* Select formatting for new partitions

* Check for bad blocks if it's the first time an O/S is put onto the disk

* Lilo settings:
	- No boot disk
	- Lilo on MBR /dev/hda
	- Not Linear Mode
	- Boot label Linux, default boot image /dev/hda6
	  (/dev/hdb6 is linux_alt,  /dev/hda6 is linux (default))

* Select No Firewall

* Languages to install: Select only English

* During the Polaris install (as opposed to Aqsaniq/Taqqiila RH62 install), it will/may
  not actually ask for the following network configuration info at this point.
  It depends on the hardware actually detected.
  The info is retained here, however, as it is needed when running "netcfg" manually 
  post-install.

  Network eth0
	- No DHCP
	- Activate on Boot
	- Settings:
		IP: 136.159.51.45 
		Mask: 255.255.255.0
		Network: use default
		Broadcast: use default
		Hostname: aqsaniq
		Gateway: 136.159.51.254
		Primary nameserver: 136.159.51.24
		Secondary nameserver: 136.159.51.33

* Time Zone 
	- Select "System Clock uses UTC"
	- Select "America/Rankin Inlet Central Nunavut Time" (Ok for Gillam too!)

* Accounts: Create "root" account and make note of password. [Used the same pw as before.]

* Authentication
	- Enable MD5 passwords
	- Enable shadow passwords
	- Disable NIS

* Select package groups

	- X-Windows System
	- GNOME
	- Graphics Manipulation
	- Networked Workstation
	- Dialup Workstation
	- Development
	- Kernel Development
	- Utilities
	- Anon FTP Server

  Total install size on th eorder of 933 MB.

       (Install logfile: /tmp/install.log)

* Polaris' monitor type SONY CPD-E100 was at this time autodetected (how?)

* Video Setup:
	- Select Mach 64 (default)
	- 8 MB RAM
	- Select `Customize X'
	- Select graphical login 
	- leave rest as-is...
	
* Custom X Config: Select default settings for now (16 bpp, ...).

* INSTALLATION starts: Formats filesystem (takes a long time, esp. if checking
		       for bad blocks) and loads packages.

* Installation should end successfully.

* Remove CD from machine, and reboot, change BIOS settings to boot from harddisk

* Log in as root. Must be root for all of the below actions.

* Create any new users (adduser, passwd)

* Install the mt-st-0.5b package 

* Install xv (xv-3.10a-23 RPM for i386 from http://rpmfind.net/linux/RPM/ ) 

* install lesstif-0.88.1-3.i386.rpm lesstif-2.0-devel-0.88.1-3.i386.rpm (for Roper camtest)

* Create a "/mnt/super" mount point for the LS-120 superdrive (mkdir)

* Test superdrive:
	mount -t vfat /dev/hdd /mnt/super 

  Note: Had to set BIOS drive entry from NONE to AUTO (secondary #1). And it works.
	Got error "secondary hard disk 1 not found" and boot halted. This was due to
	faulty superdrive power cable.

* If it works, add the following line to "/etc/fstab":
       /dev/hdd        /mnt/super      vfat    defaults,user,noauto 0 0
  After reboot the superdrive can thus be mounted simply with "mount /mnt/super"

* Procedure for making an ext2 filesystem on superdisk, if desired:
	+	fdisk /dev/hdd - delete partition 4, create a new hdd 4 (or delete all, add 1)
	+	make2fs /dev/hdd4
	+	mount -t ext2 /dev/hdd4 /mnt/super

* Check DAT drive. Put a tape with tar'ed data on it in the drive and
  run "tar tvf /dev/nst0" 

* Check that a /usr/local/src /usr/local/bin /usr/local/lib /usr/local/include exists 
  mkdir if not.

* Deleted unnecessary icons on desktop

* Run "updatedb" 

* Run "/usr/sbin/ntsysv" and KEEP only these
  daemon services. MUST RUN FROM RUNLEVEL 5 to make it take effect at that runlevel.

	- atd
	- crond
	- gpm
	- keytable
	- linuxconf
	- random
	- sendmail
 	- sshd
	- syslog
	- xfs
	- portmap
	- network
	- identd
	- inet
	- kudzu
	- xinetd
	- rawdvices

	Removed: anacron, apmd, autofs, ipchains, iptables, isdn, lpd, netfs, nfslock, ppoe

 (Try "man chkconfig", "man ntsysv")

--------------------------------
** CYCLADES SERIAL-CARD SUPPORT 
--------------------------------


- Current kernel (Red Hat 7.1 standard issue) is 2.4.2.
  uname -a yields: "Linux polaris 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown"

- Version of Cyclades support inluded as LKM is Revision 2.3.2.8

- Lastest version off Cyclades' Website is: Revision 2.3.2.9 
  Dropped it into /usr/local/src/cyc_async-6.5.9/

- The diff is:
	* $Log: cyclades.c,v $
	* Revision 2.3.2.9   2000/08/10 16:00:00 ivan
	* Prevent users from opening non-existing Z ports.

- The diff is not significant. It is not worth the trouble to recompile 
  the kernel.  So, do NOT run the Revision 2.3.2.9 Cyclades install script.

- MUST however run the supplied "mkcyc" script (/usr/local/src/cyc_async-6.5.9/mkcyc)
  This creates the eight /dev files for the Cyclades ports (specify "8" when asked).

- Will thus use the RH71-supplied cyclades.o LKM. Must remember to insmod or modprobe
  it in bootup script (see later).
  [Reference: http://www.linuxdoc.org/HOWTO/Module-HOWTO/index.html]


-----------------------------------------------------------
** INSTALL PHOTOMETRICS SERIES 300 HCK LINUX DRIVER
-----------------------------------------------------------

- New Red Hat 7.1 Roper driver was received from Roper, via Espen in Oslo.
  Filename: pvcam2.5.8.tar

- "mkdir /usr/src/local/roper" and "mv pvcam2.5.8.tar /usr/src/local/roper" and unpack tar file.
  Important: this is a very dangerous TAR file: in unpacks all files into the "current directory" - Boom!!
  This was not well thought-out by Roper! Bad!  So, remember to make a subdir for it, move it there, and upack 
  it there.  Resulting files:

	-rw-r--r--    1 root     root           28 Jul 10 13:24 alias177
	-rw-r--r--    1 root     root           27 Jul 10 13:24 alias61
	-rw-r--r--    1 root     root        11450 Jul 10 13:24 err_list
	drwxr-xr-x    2 root     root         4096 Jul 10 15:13 example
	-rwxr-xr-x    1 root     root         1818 Jul 10 15:37 install_ppk
	-rwxr-xr-x    1 root     root       936150 Jul 10 13:37 libpvcam.so.2.5.8
	-rw-r--r--    1 root     root         2312 Jul 10 13:24 pi133b5.dat
	-rw-r--r--    1 root     root         9654 Jul 10 13:24 pi133b.dat
	-rw-r--r--    1 root     root         9288 Jul 10 13:38 pipci.o
	-rw-r--r--    1 root     root        10272 Jul 10 13:38 pvpci.o

  *** IMPORTANT: Do NOT run the install_ppk script yet - wait until AFTER installing PCI card (below).
	
- Insert Photometrics controller card into a spare PCI slot (MUST be done first!)
  (Now, 4 out of 5 PCI slots are occupied. There are also 4 ISA bus slots, none used).

- Upon reboot, kudzu doesn't appear to see the new hardware at all - but that's ok!

- Check if we're talking to the card:
  Run "grep 81e6 /proc/pci | wc -l" - It MUST return "1" [Do NOT proceed if the result is "0"].
  Or, run "cat /proc/pci" to verify that the card was detected. Output attached as an appendix below.
  The Roper card shows up as:
  "Multimedia video controller: PCI device 10e8:81e6 (Applied Micro Circuits Corporation) (rev 0)."

- We have a plain vanilla out-of-the-box Red Hat 7.1 system, and a Roper driver that has
  been confirmed to work with Red Hat 7.1. This is one of those rare circumstances where 
  there is simply nothing that can go wrong! So, lets try to install the driver!

- Run "./install_ppk" when in /usr/local/src/roper

- Cough, cough. It bombs completely, of course, but it DOES say "Have a Nice Day!". Transcript follows:

	root@polaris roper]# ./install_ppk 
	Pvcam installation 1 Roper Scientific Photmetrics type cameras found
	Pvcam installation 0 Roper Scientific Princeton type cameras found
	: command not found
	./install_ppk: insmod: command not found
	: command not found
	./install_ppk: ldconfig: command not found
	Enter The Directory to Put the example source..
	Note Program will make subdirectory example.
	: command not found
	Pvcam Release Version 2.5.8 for Linux installation complete.
	Please Reboot, before running the examples.
	Have A Nice Day!
	: command not found
	: command not found
	: command not found

- What went wrong?
  Well, it didn't find insmod and ldconfig. Simply because these are not in the PATH for Red Hat 7.1 root! 
  The path to these is /sbin so we could do it manually now:
	- "/sbin/insmod pvpci"
	- "ldconfig /usr/lib"
  But this is not critical. The ldconfig will be performed automatically on next reboot anyway, 
  and we want to do the insmod in a startup script anyway. So, no hurry with these.

- Otherwise, did it do what it was supposed to do?
  a) Did it drop pvpci.o into /lib/modules/misc? Answer: YES!
	"-rwxr-xr-x    1 root     root        10272 Sep 26 12:32 pvpci.o"
  b) Did it append the aliases to /etc/modules.conf? Answer: YES!
	"alias char-major-61 pvpci"
	"alias char-major-177 pipci"
     ...remove the annoying ^M appended at the end of both lines.
  c) Did it mknod the device file? Answer: YES!
	"crw-rw-r--    1 root     root      61,   0 Sep 26 12:32 pvcam0"
  d) Did it copy "err_list" to /bin? Answer: YES!
  e) Did it copy "libpvcam.so.2.5.8" to /usr/lib and create symlink? Answer: YES!
	"lrwxrwxrwx    1 root     root           26 Sep 26 12:32 /usr/lib/libpvcam.so -> /usr/lib/libpvcam.so.2.5.8"
	"-rwxr-xr-x    1 root     root       936150 Sep 26 12:32 /usr/lib/libpvcam.so.2.5.8"
  f) Did it mkdir /var/pvcam and /var/pvcam/example and copy files in there? Answer: YES!
  g) Did it copy alias61 and alias177 to /etc? Answer: YES!

- Conclusion: All seems ok. Just need to do a manual insmod and ldconfig, if we want to.
	/sbin/ldconfig /usr/lib   (works ok)
	/sbin/insmod pvpci  results in:
		--
		[root@polaris /etc]# /sbin/insmod pvpci
		Using /lib/modules/misc/pvpci.o
		[root@polaris /etc]# 
		Message from syslogd@polaris at Wed Sep 26 12:59:27 2001 ...
		polaris kernel: Base Address 0 0xdc41
		
		Message from syslogd@polaris at Wed Sep 26 12:59:27 2001 ...
		polaris kernel: Base Address 1 0xd8c1
		
		Message from syslogd@polaris at Wed Sep 26 12:59:27 2001 ...
		polaris kernel: Base Address 2 0xd841
		
		Message from syslogd@polaris at Wed Sep 26 12:59:27 2001 ...
		polaris kernel: Base Address 3 0xd4c1
		
		Message from syslogd@polaris at Wed Sep 26 12:59:27 2001 ...
		polaris kernel: Using Irq 0x5
		--

	No cause for concern, I guess...
	It seems to have "taken" - cat /proc/modules shows:

		pvpci                   7968   0 (unused)
		3c59x                  25344   1 (autoclean)
		st                     26016   0 (unused)
		usb-uhci               20720   0 (unused)
		usbcore                49664   1 [usb-uhci]
		aic7xxx               136080   0 (unused)
		sd_mod                 11680   0 (unused)
		scsi_mod               95072   3 [st aic7xxx sd_mod]
	
	(Note, we have not yet inserted the cyclades LKM).

	"dmesg" yields:

		before register 61 pvpci
		after find device
		Base Address 0 0xdc41
		Base Address 1 0xd8c1
		Base Address 2 0xd841
		Base Address 3 0xd4c1
		Using Irq 0x5
		Pvpci driver loaded. The major device # is 61.
		We suggest you use:
 		mknod pvcam0 c 61 0
	
	... sounds OK to me...
	[Haha, I like the "We suggest..." in the syslog of all places! - wasn't the mknod done already??
	How about: "We suggest Omelette du Fromage!"]


-  We still get the old booterror:
	[root@polaris /etc]# /sbin/depmod -a
	depmod: *** Unresolved symbols in /lib/modules/misc/pvpci.o
   But, we remember Roper developer Bolkus says there is no cause for concern - he gets the same error!
   And he couldn't get rid of it.

- Test the driver.... use LaBelle's click.c (standalone executable version):

       /usr/local/src/click/click | pnmdepth 255 | xv -

	WORKS!!

-----------------------------------------------------------
** INSTALL ALL-SKY CAMERA  CONTROL SOFTWARE
-----------------------------------------------------------
  (All files located on Aqsaniq CDROM under /ASCD)

- Install all-sky imaging software to...
       /etc/ascd
       /usr/local/bin
       /usr/local/lib
       /usr/local/include
       /usr/local/src 

  The POLARIS camera_id is "12652.A01G2201.A01F9101.278849" /* LensSN.CamHdSN.CtrlBoxSN.UofCTagNo */

- Create these symlinks:
	/dev/asc to /dev/ttyC0   [filter wheel, gain, etc]
	/dev/athena to /dev/ttyC1 [filter wheel temperature control]

- Modify /etc/syslog.conf: Add:
       # ascd specific
       local7.*        /etc/ascd/ascd_messages
       local7.*        /dev/console
       add to /var/log/messages-line:
	 ;local7.none

	See "man syslogd" and "man syslog.conf"
       

- Make and Install ntp-4.1.0 (GPS time) and assoc config files... [http://www.eecis.udel.edu/~ntp/]

- Install /etc/ntp.conf  and touch /etc/ntp.drift

- Make symlink for Trimble Palisade GPS:  ln -s /dev/ttyC2 /dev/palisade0

- Append to /etc/rc.d/rc.local
	/usr/local/bin/ntpd
	/sbin/insmod /lib/modules/2.4.2-2/kernel/drivers/char/cyclades.o
	/sbin/insmod  /lib/modules/misc/pvpci.o

- Insert temperature sensors (Dallas 1820) on adapter (Dallas 9097-U) an plug adapter into /dev/ttyS1 (COM1)
  and initialize them using digitemp v2 (see digitemp README). Use digitemp that was customized
  for NORSTAR (/usr/local/bin/digitemp). The .digitemprc file is dropped into /etc/ascd when initializing.
  Initialize digitemp by: digitemp -s/dev/ttyS1 -i
  Results in 
	DigiTemp v2.0 Copyright 1997-2000 by Brian C. Lane
	GNU Public License v2.0
	ROM #0 : 10C4C529000000AB
	ROM #1 : 103C6528000000C4
	ROM #2 : 105AA12900000007
  These are the ROM IDs for the three Dallas thermometer chips used by Polaris.

- Install crontab for temperature/ntp readings (crontab -e), currently:

		*/5  * * * *  /usr/local/bin/parse_ntp
		0,30 * * * *  /usr/local/bin/parse_temps

	(See /var/spool/cron/root)

- Make sure BIOS clock (hardware clock) _is_ set to UTC as specified during Linux installation

- Install in /usr/local/src: RRDtool and PNGcrush; libpng already comes as part of RH71.

- /usr/sbin/adduser camops, passwd  (camops = camera operations. Since user "operator" is taken).

- chmod ugo+rw /dev/st0 to let operator write to tape
  chmod ugo+rw /dev/nst0 to let operator write to tape

- set /data permissions  

- Crontab for doing file erasing cleanup_cronjob
  Data backup script

- ascd inittab entry
  # All-sky camera daemon 
  # as:2345:respawn:/usr/local/bin/ascd

- Note that ascd console output may be viewed during runlevel 5 by starting `xconsole'.

- Install mgetty-1.1.25-5.i386.rpm
  Add inittab entry below. Modify config file /etc/mgetty+sendfax/mgetty.conf
  # modem getty. Modem on Cyclades port #7, i.e., /dev/ttyC6
  # C6:2345:respawn:/usr/sbin/mgetty /dev/ttyC6

- If PPP is desired
  also modify /etc/ppp/options and /etc/ppp/options.ttyC7
  set pppd permissions: "chmod 4555 /usr/sbin/pppd" or "chmod 4755 /usr/sbin/pppd"
  Next, add this line to /etc/profile: `alias ppp="exec /usr/sbin/pppd -detach'

- BEFORE LEAVING SITE: make sure rrd databases are initialized, crontabs are uncommented, inittab entries for mgetty and ascd
  are uncommented, and that the machine is brought to RUNLEVEL 3 
  (In /etc/inittab: set `id:3:initdefault:', reboot).


********* TBD:

***Setup athena temperature scheme
***setup Telemetry scheme
***ntp causes clock drift when run with Roper camera. SO, only run ntp to acquire time
	during daytime?? Yes!








_________________________________________________________________________________
APPENDIX:

/proc/pci output:
-----------------

PCI devices found:
  Bus  0, device   0, function  0:
    Host bridge: Intel Corporation 440BX/ZX - 82443BX/ZX Host bridge (rev 2).
      Master Capable.  Latency=64.  
      Prefetchable 32 bit memory at 0xf0000000 [0xf3ffffff].
  Bus  0, device   1, function  0:
    PCI bridge: Intel Corporation 440BX/ZX - 82443BX/ZX AGP bridge (rev 2).
      Master Capable.  Latency=64.  Min Gnt=136.
  Bus  0, device   7, function  0:
    ISA bridge: Intel Corporation 82371AB PIIX4 ISA (rev 2).
  Bus  0, device   7, function  1:
    IDE interface: Intel Corporation 82371AB PIIX4 IDE (rev 1).
      Master Capable.  Latency=32.  
      I/O at 0xffa0 [0xffaf].
  Bus  0, device   7, function  2:
    USB Controller: Intel Corporation 82371AB PIIX4 USB (rev 1).
      IRQ 11.
      Master Capable.  Latency=64.  
      I/O at 0xcce0 [0xccff].
  Bus  0, device   7, function  3:
    Bridge: Intel Corporation 82371AB PIIX4 ACPI (rev 2).
      IRQ 9.
  Bus  0, device  13, function  0:
    Communication controller: Cyclades Corporation Cyclom_Y below first megabyte (rev 1).
      IRQ 10.
      Non-prefetchable 32 bit memory at 0xff002000 [0xff00207f].
      I/O at 0xcc00 [0xcc7f].
      Non-prefetchable 20 bit memory at 0xc8000 [0xcbfff].
  Bus  0, device  14, function  0:
    SCSI storage controller: Adaptec AHA-2940U/UW / AHA-39xx / AIC-7895 (rev 3).
      IRQ 7.
      Master Capable.  Latency=64.  Min Gnt=8.Max Lat=8.
      I/O at 0xc800 [0xc8ff].
      Non-prefetchable 32 bit memory at 0xff001000 [0xff001fff].
  Bus  0, device  14, function  1:
    SCSI storage controller: Adaptec AHA-2940U/UW / AHA-39xx / AIC-7895 (#2) (rev 3).
      IRQ 11.
      Master Capable.  Latency=64.  Min Gnt=8.Max Lat=8.
      I/O at 0xc400 [0xc4ff].
      Non-prefetchable 32 bit memory at 0xff000000 [0xff000fff].
  Bus  0, device  15, function  0:
    PCI bridge: Digital Equipment Corporation DECchip 21152 (rev 3).
      Master Capable.  Latency=64.  Min Gnt=2.
  Bus  1, device   0, function  0:
    VGA compatible controller: ATI Technologies Inc 3D Rage Pro AGP 1X/2X (rev 92).
      IRQ 11.
      Master Capable.  Latency=64.  Min Gnt=8.
      Non-prefetchable 32 bit memory at 0xfd000000 [0xfdffffff].
      I/O at 0xec00 [0xecff].
      Non-prefetchable 32 bit memory at 0xfcfff000 [0xfcffffff].
  Bus  2, device   9, function  0:
    Ethernet controller: 3Com Corporation 3c905C-TX [Fast Etherlink] (rev 116).
      IRQ 5.
      Master Capable.  Latency=64.  Min Gnt=10.Max Lat=10.
      I/O at 0xdc80 [0xdcff].
      Non-prefetchable 32 bit memory at 0xfafffc00 [0xfafffc7f].
  Bus  2, device  11, function  0:
    Multimedia video controller: PCI device 10e8:81e6 (Applied Micro Circuits Corporation) (rev 0).
      IRQ 5.
      Master Capable.  Latency=64.  Min Gnt=255.Max Lat=240.
      I/O at 0xdc40 [0xdc7f].
      I/O at 0xd8c0 [0xd8ff].
      I/O at 0xd840 [0xd87f].
      I/O at 0xd4c0 [0xd4ff].
      I/O at 0xd440 [0xd47f].


_________________________________________________________________________________
APPENDIX

DOBACKUP script, used by Trond during development/integration:

cd /mnt/super
\mv home.tar.gz prev-home.tgz
\mv local.tar.gz prev-local.tgz
\mv etc.tar.gz prev-etc.tgz
\mv varlog.tar.gz prev-varlog.tgz
\mv config.tar.gz prev-config.tgz
\mv rpm.tar.gz prev-rpm.tgz
tar zcvf local.tar.gz /usr/local
tar zcvf home.tar.gz /home
tar zcvf etc.tar.gz /etc
tar zcvf varlog.tar.gz /var/log
tar zcvf config.tar.gz /usr/src/linux/.config
tar zcvf rpm.tar.gz /var/lib/rpm
/sbin/fdisk -l >| fdisk.out
df >| df.out
dmesg >| dmesg.out
echo done.





TS Trondsen - October 2001