#
# modkernel
#
# An InstallGuide for dynamic kernel loaded libraries
# For SGI systems running IRIX 6.x
#

sub modkernel {
my($chip, $nfs, $libafs);
&ErrorsAreFatal(1);

# Find out what kind of chip the machine has (Rx000)
$chip = `hinv -t cpu`;
$chip =~ /R[51]0*/;
$chip = $&;
&ErrorMsg("Could not determine chip type with", "hinv") unless ($chip =~ /^R/);

# NFS support
if ($Configuration{"NFSEXTENSIONS"}) {
  $nfs = ""; }
else {
  $nfs = ".nonfs"; };

# From the above, put together the name of the kernel library to use
$libafs = "libafs.SP.$chip$nfs.o";

&CreateDir("/usr/vice/etc/sgiload");
&ErrorsAreFatal(0);

&Copy("root.client/usr/vice/etc/sgiload/$libafs", "/usr/vice/etc/sgiload");
&Copy("root.client/usr/vice/etc/sgiload/afs",     "/usr/vice/etc/sgiload");
&Copy("root.client/usr/vice/etc/sgiload/afs.rc",  "/usr/vice/etc/sgiload");
&Copy("root.client/usr/vice/etc/sgiload/afs.sm",  "/usr/vice/etc/sgiload");

&Copy("root.client/usr/vice/etc/afsd", "/usr/vice/etc");
&Chmod(0744, "/usr/vice/etc/afsd");
system("/etc/chkconfig -f afsml on");
&Copy("bin/fs", "/usr/vice/etc/fs");
}
