INSTALLATION
============

First of all, remember to remove the old man pages in section 1!
They are (usually) stored in the /usr/man/man1 directory.
The new man pages for the utilities are now located in section 8:

	depmod.8	genksyms.8	insmod.8	kerneld.8
	ksyms.8		lsmod.8		modinfo.8	modprobe.8
	rmmod.8

The next step is to run the configure script by entering the command:

	./configure

The build process uses the configure script to figure out a few things
about your system before actually compiling anything. Configure takes
several command line options which can modify the installation
paths. Try './configure --help' for more information. (Minor note:
--exec-prefix defaults to / not /usr if not specified.)


Cross compilation and unusual compilation requirements
------------------------------------------------------

You can compile modutils on one system to run on another.  The Makefiles
generated by configure contain several variables which can be tweaked for
unusual compilation environments, including cross compilation.  Do not edit the
generated Makefiles, set the variables in the environment before invoking
configure.  The default is to compile for the current system type using standard
utilities and flags.  If you change any of these values after running configure,
you should erase config.cache before running configure again.

CC              C compiler for host system, default "gcc".
CFLAGS          C flags for host system, default "-O2 -Wall".
BUILDCC         C compiler for build system, default $(CC).  Some of the
		modutils programs are run on the build system so they must be
		compiled with the build compiler and flags.
BUILDCFLAGS     C flags for build system, default $(CFLAGS).
LDFLAGS         Linker flags for host system, default "".
AR              ar program for host system, default "ar".
RANLIB          ranlib program for host system, default "ranlib".
INSTALL         install program for host system, default "install".
PARSERCFLAGS    The parser programs generated by lex and yacc have spurious
		warnings about uninitialized variables when the default -Wall is
		used.  This option is included on the compilation of those
		programs to suppress the warnings, default is
		"-Wno-uninitialized".
MKDIR           The command to create a directory, including all its parents.
		Default is "mkdir -p".
TAINT_URL	The URL to read for more information about tainted modules.  The
		default is 'http://www.tux.org/lkml/\#s1-18'.  If the URL
		contains # it must be escaped with \ to get past make.  The URL
		must be enclosed in single quotes and must not contain quotes
		(' or ""), unless you want to fight your way through multiple
		layers of quoting rules.  An example,
		TAINT_URL='http://www.some_vendor.com/linux/support/\#taint'

configure takes ten modutils specific options, as well as the standard
configure options.

--enable-combined               Create insmod and rmmod/modprobe/lsmod/ksyms as
				one executable.  Default is one combined module,
				if you --disable-combined you can still combine
				individual modules into insmod with
				--enable-combined-X.
--enable-combined-rmmod         Create insmod and rmmod as one executable,
				default is taken from --enable-combined.
--enable-combined-modprobe      Create insmod and modprobe as one executable,
				default is taken from --enable-combined.
--enable-combined-lsmod         Create insmod and lsmod as one executable,
				default is taken from --enable-combined.
--enable-combined-ksyms         Create insmod and ksyms as one executable,
				default is taken from --enable-combined.
--disable-compat-2-0            Do not create utilities runnable on a Linux 2.0
				system, default is no backwards compatibility.
--disable-kerneld               The default is not to compile kerneld, this
				utility has not been used since kernel 2.1.91.
--enable-common-sparc           Make all the utilities work on both sparc32 and
				sparc64 as one executable.  Default is yes for
				sparc, no for other architectures.
--enable-common-ppc             Make all the utilities work on both ppc32 and
				ppc64 as one executable.  Default is yes for
				ppc, no for other architectures.
--enable-common-hppa            Make all the utilities work on both hppa32 and
				hppa64 as one executable.  Default is yes for
				hppa, no for other architectures.
--disable-insmod-static         The default is not to build insmod.static.  You
				probably only need this if you are building your
				own initrd boot system.
--enable-strip                  Are binaries to be stripped during install?
				Default is yes.
--disable-zlib                  Handle gzipped objects?  Default is no.
				You probably only need this if you are booting
				a small root filesystem and the filesystem is
				not compressed itself.
--disable-use-syscall           Use _syscall() functions?  Default is no.
				Any current libc should have definitions for the
				modutils to kernel system calls.  If you get
				missing sys_xxx functions, use --enable-use-syscall.
				Note that the glibc maintainers want to remove
				_syscall() from the library ABI.

To disable any of these, specify --disable-<option>.


Example: To compile with all the default values for the current system.

./configure
make

Example: To compile on the current system using gcc with a host of alpha using
gcc_beta, ar, ranlib and test_install, without kernel 2.0 compatibility and
installing into the /host/alpha hierarchy.

BUILDCC=gcc CC=gcc_beta INSTALL=test_install \
	./configure \
		--build=`./config.guess` \
		--host=alpha \
		--disable-compat-2-0 \
		--exec_prefix=/host/alpha \
		--prefix=/host/alpha/usr
make


Compiling in a different directory
----------------------------------

modutils supports the VPATH option of make.  This lets you have the source in
one directory and the generated files in another, you can even compile from read
only media.

mkdir /var/tmp/modutils
cd /var/tmp/modutils
/path/to/master/modutils/configure
make


Backwards Compatibility
-----------------------

modutils supports several options for backwards compatibility down to 2.0
kernels.  Starting with modutils 2.3.13 the default is no backwards
compatibility, you need to enable options if you really want the old code.

--enable-compat-2-0 for 2.0 compatibility.  You will probably need
--enable-use-syscall for this to work.

--enable-kerneld to get the old module kernel daemon.  The code to support this
was removed from the kernel in 2.1.91, being replaced by kmod.

--enable-use-syscall if your version of libc does not have entries for
create_module(), query_module() etc.


Install
-------

The second step is to actually install the utilities. Do 'make install'
in this directory to get the following tools:

insmod/
	insmod		install a loadable module
	rmmod		remove module(s)
	ksyms		show symbols
	lsmod		show modules
	modinfo		display information about module
	modprobe	load (a stack of) modules, controlled by a "makefile"
			and a configuration file.
	insmod_ksymoops_clean	a shell script be run daily to clean out older
			saved ksyms and lsmod data.  man insmod for details.

genksyms/
	genksyms	version generator for module symbols,
			to be run automatically during kernel make
			if CONFIG_MODVERSIONS was selected in "make config"

depmod/
	depmod		generate dependencies for modprobe.


kerneld/
	kerneld		A "user level kernel extension" that allows
			the kernel to perform some tasks in user space.
			Suitable tasks are e.g. loading of modules.
			Obsolete since kernel 2.1.91 but included to support
			kernel 2.0.


Keith Owens <kaos@ocs.com.au> (current maintainer)
Richard Henderson <rth@cygnus.com> (previous maintainer)
Björn Ekwall <bj0rn@blox.se> (previous maintainer)
