$Header: /cvsroot/sid/sid/INSTALL,v 1.23 2005/01/08 15:46:04 deppeler Exp $

This file describes how to install/remove the kernel and user part of
sid for Solaris and Linux.

The configuration and how to run SID is described in the user's guide
docs/users_guide.txt

Installation Options
--------------------
Binary:
- Solaris package installation for Solaris 2.8 SPARC + i386
- Linux user part package installation for Debian 3.x
- Linux 2.4 kernel part package installation for Debian 3.x with kernel
  2.4.18-bf2.4 #1

From source:
- Solaris package build via supplied shell script
- Solaris manual build
- Linux 2.4 Debian package build via supplied shell script
- Linux 2.4 manual build
- Linux 2.6 manual build


****************************
Solaris package installation
****************************

Download the sidk and sidu packages for your Solaris release and
platform from http://sid.sourceforge.net

Install the packages using 'pkgadd -d $packagename' 
# pkgadd -d ./sidk...
# pkgadd -d ./sidu...

Start and stop SID as follows now
  start the kernel part:
  # /etc/init.d/tswk start
  start the user part:
  # /etc/init.d/tswu start
  stop the kernel part:
  # /etc/init.d/tswk stop
  stop the user part:
  # /etc/init.d/tswu stop

Removal of the packages (also removes configuration files!):
- find the exact package name by running
# pkginfo | grep tsw
Use these names (e.g. tswk036 and tswu036) to remove the packages:
# pkgrm tswk036
# pkgrm tswu036


*********************************
Linux Debian package installation
*********************************

Download the sidk and sidu packages for Debian. The user part should
install without problems. The kernel part will only work if you run the
same kernel as I do (2.4.18-bf2.4 #1). You can package your own kernel
part by following the instructions in the section below 

Install the packages using 'dpkg -i $packagename' 
# dpkg -i ./sidk...
# dpkg -i ./sidu...

Start and stop SID as follows now
  start the kernel part:
  # /etc/init.d/sidk start
  start the user part:
  # /etc/init.d/sidu start
  stop the kernel part:
  # /etc/init.d/sidk stop
  stop the user part:
  # /etc/init.d/sidu stop

Removal of the packages:
# dpkg -r sidk
# dpkg -r sidu

Complete removal of the packages (including configuration files):
# dpkg -P sidk
# dpkg -P sidu


*********************
Solaris package build
*********************

Download source package
Extract via 'gzip -dc sid-x.y.z.tar.gz | tar xf -'
Change into directory 'sid-x.y.z'.
Run 'package.sh':
 bourne shell% chmod +x package.sh
 bourne shell% ./package.sh

This will hopefully create two files starting with sidk and sidu.

Install these as specified in the section 'Solaris package installation'
above.

Start and stop SID as described in the section 'Solaris package
installation' above.

********************************
Debian Linux 2.4 package build
********************************

Install a couple Debian package (see the file debian.packages for details)
You'll need these in order to complete the build process. You may remove
these extra packages after having completed this section.

Download source package
Extract via 'gzip -dc sid-x.y.z.tar.gz | tar xf -' (leave the tar.gz ball 
 in place)
Change into directory 'sid-x.y.z'.
Run 'build_debian_packages.sh':
 bourne shell% chmod +x build_debian_packages.sh
 bourne shell% ./build_debian_packages.sh
Hit the <enter> key when asked to confirm the settings.
Wait for the build process to complete.

This will hopefully create two files in the directory above starting
with sidk and sidu.

Install these with dpkg -i filename.

Start and stop SID as described in the section 'Linux Debian package
installation' above.

*********************************
Linux 2.4/Solaris manual installation
*********************************

Prerequisites
-------------

- C compiler (gcc is used by the author)
- lex/yacc
- make

Linux/Solaris user part
-----------------------

Download source package
Extract via 'gzip -dc sid-x.y.z.tar.gz | tar xf -'
Change into directory 'sid-x.y.z'.
Change into user subdirectory 'user'.

Build the binary:
% make -f Makefile.solaris # on Solaris
% make -f Makefile.linux   # on Linux

Run with a uid priviledged enough to read the syslog kernel log file, e.g.
# ./tsw -c test.in

Solaris kernel part
-------------------

Download source package
Extract via 'gzip -dc sid-x.y.z.tar.gz | tar xf -'
Change into directory 'sid-x.y.z'.
Change into the kernel subdirectory 'kernel'.

Build the STREAM module(s):
on 32-bit platforms:
% make -f Makefile.solaris
on 64-bit platforms:
% make -f Makefile.solaris all64

Install the module(s):
on 32-bit platforms:
# make -f Makefile.solaris install
on 64-bit platforms:
# make -f Makefile.solaris install64

Load the module(s):
# modload tsw

Make sure the module is inserted into the STREAM for new ptys:
# autopush -f iu.ap

Uninstall as follows:
- Quit any remote terminal after having issued the autopush command
- Remove the STREAMS kernel module:
  o get the ID of the loaded kernel module:
  # modinfo | grep tsw
  232 1029b930   395b  27   1  tsw (tsw hardware emulator)
  The id is 232 (column 0).
  o unload the module from the kernel:
  # modunload -i 232
- remove the autopush configuration
  # autopush -r -M 24 -m 0

Linux 2.4 kernel part
---------------------

Download source package
Extract via 'gzip -dc sid-x.y.z.tar.gz | tar xf -'
Change into directory 'sid-x.y.z'.
Change into the kernel subdirectory 'kernel'.

adapt path settings in Makefile.linux24

Build the module
% make -f Makefile.linux24

Load the module
# insmod tsw.o

Remove the kernel module:
# rmmod tsw

Linux 2.6 kernel part
---------------------

Download source package
Extract via 'gzip -dc sid-x.y.z.tar.gz | tar xf -'
Change into directory 'sid-x.y.z'.
Change into the kernel subdirectory 'kernel'.

(gcc kernel-source-2.6.8 make kernel-headers)


Prerequisite:
% cp /boot/config-`uname -r` /usr/src/kernel-source-x.y.z/.config
Build the kernel: (cd /usr/src/kernel-source-x.y.z && make)

Build the module:
% build_l26_x86.sh


Load the module
# modprobe sha1
# insmod sidkl26x86.ko t_sys_call_table=0x`awk '/sys_call_table/ { print $1 }' /boot/System.map-\`uname -r\``

Remove the kernel module:
# rmmod sidkl26x86
# rmmod sha1
