Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afsinstall / lib / InstallGuides / SUN4x_4x / build
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3 #
4 # This software has been released under the terms of the IBM Public
5 # License. For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7
8 # An InstallGuide for compiling a new kernel
9 # For SUN systems running SunOS 4.x
10 #
11
12 sub build {
13 my ($arch, $hostname);
14 $arch = `/bin/uname -m`;
15 chop $arch;
16 $hostname = `/bin/uname -n`;
17 chop $hostname;
18 $hostname =~ tr/a-z/A-Z/;
19
20 &Print("Starting compile with command \"/etc/config $hostname\"");
21 &Print("in directory /usr/sys/$arch/conf");
22
23 &ErrorsAreFatal(1);
24 $rc = chdir("/usr/sys/$arch/conf");
25 &ErrorMsg("Could not change to dir", "/usr/sys/$arch/conf") if (!$rc);
26
27 $rc = system("/etc/config $hostname");
28 $rc = $rc >> 8;
29 &Print("Returned code $rc");
30 &ErrorMsg("Stopping compile") if ($rc);
31
32
33 &Print("Finishing compile with command \"make vmunix\"");
34 &Print("in directory /usr/sys/$arch/$hostname");
35 &Print("New kernel will be /usr/sys/$arch/$hostname/vmunix");
36 &Print("and should be installed as /vmunix");
37
38 $rc = chdir("/usr/sys/$arch/$hostname");
39 &ErrorMsg("Could not change to dir", "/usr/sys/$arch/$hostname") if (!$rc);
40
41 $rc = system("make vmunix");
42 $rc = $rc >> 8;
43 &Print("Returned code $rc");
44 }