How to add a new addon in muLinux
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10-Dec-99


I will assume you've the mulinux.tgz unpacked in a Linux box,
or in some HD partition, if you plan to use muLinux for this kind
of work. All files below are relative to ../tree directory 

Let me to call the new addon XYZ. We need of a new directory structure,
starting from /usr mounting point.

1) Create the structure 
------------------------

I suggest as minimum, those:

	/usr/XYZ/bin
	/usr/XYZ/etc
	/usr/XYZ/lib
	/usr/XYZ/doc
	/usr/XYZ/modules

but, really, ony "bin" is required.

You will create them in tree/. Usually, your additional package
expects to find reference to its own directories in /etc, or /lib, and
other places. We'll use symlinks for this purpose.


2) Fill it with your stuff
--------------------------

If You wish, you can install a compatible package using tar:

	tar -C tree/usr/XYZ  package.tgz

from your Linux box. Please,, use libc5 binaries.
The better way is to test the addon in a HD-muLinux. 

3) Dinamic Libraries, paths, etc
--------------------------------

o Add /usr/XYZ/lib in /etc/ld.so.conf; 
o add /usr/XYZ/bin in the PATH variables, contained in /etc/path.conf
o add /usr/XYZ/modules in /etc/modules.path 

Steps 2) and 3) are unusual in standard Linux distro.
 

4) Setup Engine configuration
-----------------------------

o add the reference XYZ in /setup/addons
o Go in /setup/cnf and clone SRV.cnf -> XYZ.cnf
o Go in /setup/fun and symlinks ADDON.fun -> XYZ.fun
o Go in /setup/fun/ADDON.fun and add your info_XYZ() entry 

Edit XYZ.cnf and change ramdisk, etc ...

===============================================================
NAME=XYZ
MOUNT_POINT="/usr/XYZ"
LOADING_MESSAGE=' = XYZ, my new muLinux  addon = '
INIT=/usr/XYZ/bin/prolog
===============================================================



5) Mofify the "mu" script
--------------------------

o locate the rebuild() function and change the "usr_list" variable,
adding a filter for your subtree:

		.... | grep -v XYZ


o create a rebuild_xyz() function, cloning for ex. rebuild_vnc()

o add new entry in the install(), cloning with cut&paste similar
code you find aroung

o locate "#Begin Main" and add:

=================================
-xyz)
        rebuild_xyz
        ;;
=================================

in the big "case" structure.


6) Addon prolog script
----------------------------

Create the script

		/usr/XYZ/bin/prolog

If this script exists, it will be called when addon is loaded.
This script will create symlinks, etc, if needed. Example:


		# ln -f -s /usr/XYZ/etc/my  /etc/my

Please, give execution permissions to the script:

		# chmod +x /usr/XYZ/bin/prolog


7) Create the image:
--------------------

		# mu -xyz

It does not works?
It's normal: Computer Science isn't a Exact Science, as Algebra is.
BTW, if it works, send me the web page URL.

						M. Andreoli

# End of the Addon-HowTo
# You can stop reading here.
