mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 05:57:43 +00:00
STABLE14-specfiles-20060821
"current" versions of spec files for rpm building (cherry picked from commit ffa71e5a917606bddfabc1005ad6ca14c3e28731)
This commit is contained in:
parent
0a2fd32c1d
commit
ae334834af
24
src/packaging/RedHat/afs-krb5-2.0-com_err.patch
Normal file
24
src/packaging/RedHat/afs-krb5-2.0-com_err.patch
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
diff -uNr afs-krb5.orig/src/configure.in afs-krb5/src/configure.in
|
||||||
|
--- afs-krb5.orig/src/configure.in 2005-04-14 16:06:15.597138000 -0400
|
||||||
|
+++ afs-krb5/src/configure.in 2005-04-14 16:06:44.201789856 -0400
|
||||||
|
@@ -143,7 +143,19 @@
|
||||||
|
LIBS="$ac_save_LIBS"])
|
||||||
|
if test "x$afs_cv_func_getDirPath" = "xyes"; then
|
||||||
|
AC_MSG_RESULT([Setting compilation parameters for AFS 3.5 and later])
|
||||||
|
- AKLOG_EXTRA_OBJ=adderrtable.o
|
||||||
|
+ AC_MSG_CHECKING([for add_to_error_table])
|
||||||
|
+dnl
|
||||||
|
+dnl We may be using libcom_err from Kerberos (shared libraries), and
|
||||||
|
+dnl already have add_to_error_table
|
||||||
|
+dnl
|
||||||
|
+ AC_TRY_LINK_FUNC(add_to_error_table, have_adderr=yes, have_adderr=no)
|
||||||
|
+ if test $have_adderr != yes; then
|
||||||
|
+ AC_MSG_RESULT([no, adding adderrtable.o])
|
||||||
|
+ AKLOG_EXTRA_OBJ=adderrtable.o
|
||||||
|
+ else
|
||||||
|
+ AC_MSG_RESULT([yes])
|
||||||
|
+ AKLOG_EXTRA_OBJ=
|
||||||
|
+ fi
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([Setting compilation parameters for pre-AFS 3.5])
|
||||||
|
AC_DEFINE(PRE_AFS35)
|
31
src/packaging/RedHat/afs-krb5-2.0-krb524.patch
Normal file
31
src/packaging/RedHat/afs-krb5-2.0-krb524.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
--- afs-krb5/src/configure.in-orig 2003-03-16 20:13:34.000000000 -0500
|
||||||
|
+++ afs-krb5/src/configure.in 2005-09-14 17:20:46.000000000 -0400
|
||||||
|
@@ -179,14 +197,20 @@
|
||||||
|
[ EXTRA_INC="$EXTRA_INC -I$with_krb5_obj/include -I$with_krb5_obj/include/krb5"
|
||||||
|
KADM_LIBS=`echo $KADM_LIBS | sed -e "s#-ldb#$with_krb5_obj/lib/libdb.a#"`])
|
||||||
|
dnl
|
||||||
|
-dnl Sigh, why is this so complicated? Right now, just assume that
|
||||||
|
-dnl the 524 library is always called krb524 and will be picked up by the
|
||||||
|
-dnl Kerberos link line
|
||||||
|
-dnl
|
||||||
|
-dnl AC_CHECK_LIB(krb524, krb524_convert_princs, [KRB524LIB="-lkrb524"], [
|
||||||
|
-dnl AC_MSG_ERROR([Cannot find 524 library, exiting])
|
||||||
|
-dnl ])
|
||||||
|
-KRB524LIB=-lkrb524
|
||||||
|
+dnl The krb524 functions may be included in libkrb5 itself, or else in a
|
||||||
|
+dnl separate library named libkrb524
|
||||||
|
+dnl
|
||||||
|
+ac_save_LIBS="$LIBS"
|
||||||
|
+KRB524LIB=
|
||||||
|
+AC_MSG_CHECKING([for krb524 library])
|
||||||
|
+AC_CHECK_FUNC(krb524_init_ets, have_krb524=yes, have_krb524=no)
|
||||||
|
+
|
||||||
|
+if test "$have_krb524" = no; then
|
||||||
|
+ LIBS="$LIBS -lkrb524"
|
||||||
|
+ AC_CHECK_LIB(krb524, krb524_init_ets, [KRB524LIB="-lkrb524"],
|
||||||
|
+ [AC_MSG_ERROR([Unable to find krb524 library])])
|
||||||
|
+fi
|
||||||
|
+LIBS="$ac_save_LIBS"
|
||||||
|
|
||||||
|
dnl AC_CHECK_LIB(kdb5, krb5_db_fetch_mkey, [KD_LIBS="-lkdb5"],[
|
||||||
|
dnl AC_MSG_WARN([Cannot find Kerberos 5 DB library, will not be able to build DB utilities])
|
39
src/packaging/RedHat/afs-krb5-2.0-libsocket.patch
Normal file
39
src/packaging/RedHat/afs-krb5-2.0-libsocket.patch
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
diff -uNr afs-krb5.orig/src/configure.in afs-krb5/src/configure.in
|
||||||
|
--- afs-krb5.orig/src/configure.in 2003-03-16 20:13:34.000000000 -0500
|
||||||
|
+++ afs-krb5/src/configure.in 2003-07-30 11:52:55.000000000 -0400
|
||||||
|
@@ -44,14 +44,6 @@
|
||||||
|
if test $retval -ne 0; then
|
||||||
|
AC_MSG_ERROR($krb5_config failed with error code of $retval)
|
||||||
|
fi
|
||||||
|
-AC_MSG_RESULT([Adding $krb5_cflags to CFLAGS])
|
||||||
|
-AC_MSG_RESULT([Adding $krb5_libs to LIBS])
|
||||||
|
-AC_MSG_RESULT([Setting KADM_CFLAGS to $krb5_cflags_kadm])
|
||||||
|
-AC_MSG_RESULT([Setting KADM_LIBS to $krb5_libs_kadm])
|
||||||
|
-CFLAGS="$CFLAGS $krb5_cflags"
|
||||||
|
-LIBS="$LIBS $krb5_libs"
|
||||||
|
-KADM_CFLAGS="$krb5_cflags_kadm"
|
||||||
|
-KADM_LIBS="$krb5_libs_kadm"
|
||||||
|
dnl
|
||||||
|
dnl Check for various network libraries
|
||||||
|
dnl
|
||||||
|
@@ -105,6 +97,20 @@
|
||||||
|
AC_MSG_ERROR([Unable to find res_search function])
|
||||||
|
fi
|
||||||
|
LIBS="$save_LIBS"
|
||||||
|
+
|
||||||
|
+dnl
|
||||||
|
+dnl Don't add these to LIBS until after we've already looked for
|
||||||
|
+dnl libsocket, etc. Otherwise ka-forwarder won't build properly
|
||||||
|
+dnl
|
||||||
|
+AC_MSG_RESULT([Adding $krb5_cflags to CFLAGS])
|
||||||
|
+AC_MSG_RESULT([Adding $krb5_libs to LIBS])
|
||||||
|
+AC_MSG_RESULT([Setting KADM_CFLAGS to $krb5_cflags_kadm])
|
||||||
|
+AC_MSG_RESULT([Setting KADM_LIBS to $krb5_libs_kadm])
|
||||||
|
+CFLAGS="$CFLAGS $krb5_cflags"
|
||||||
|
+LIBS="$LIBS $krb5_libs"
|
||||||
|
+KADM_CFLAGS="$krb5_cflags_kadm"
|
||||||
|
+KADM_LIBS="$krb5_libs_kadm"
|
||||||
|
+
|
||||||
|
dnl
|
||||||
|
dnl Optional support for AFS
|
||||||
|
dnl
|
12
src/packaging/RedHat/afs-krb5-2.0-openafs1.3.patch
Normal file
12
src/packaging/RedHat/afs-krb5-2.0-openafs1.3.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -uNr afs-krb5.orig/src/asetkey.c afs-krb5/src/asetkey.c
|
||||||
|
--- afs-krb5.orig/src/asetkey.c 2005-04-08 15:55:35.637620000 -0400
|
||||||
|
+++ afs-krb5/src/asetkey.c 2005-04-08 15:55:57.614279120 -0400
|
||||||
|
@@ -81,7 +81,7 @@
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
- code = afsconf_AddKey(tdir, kvno, key->contents);
|
||||||
|
+ code = afsconf_AddKey(tdir, kvno, key->contents, 1);
|
||||||
|
if (code) {
|
||||||
|
printf("setkey: failed to set key, code %ld.\n", code);
|
||||||
|
exit(1);
|
14
src/packaging/RedHat/afs-krb5-2.0-res_search.patch
Normal file
14
src/packaging/RedHat/afs-krb5-2.0-res_search.patch
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
--- afs-krb5/src/configure.in.res_search 2005-09-30 12:53:38.000000000 -0400
|
||||||
|
+++ afs-krb5/src/configure.in 2005-09-30 14:40:38.000000000 -0400
|
||||||
|
@@ -89,7 +89,10 @@
|
||||||
|
if test "$have_res_search" != yes; then
|
||||||
|
AC_CHECK_LIB(${lib}, res_search,
|
||||||
|
[have_res_search=yes
|
||||||
|
- NETLIBS="$NETLIBS -l${lib}"])
|
||||||
|
+ NETLIBS="$NETLIBS -l${lib}"],
|
||||||
|
+ [AC_CHECK_LIB(${lib}, __res_search,
|
||||||
|
+ [have_res_search=yes
|
||||||
|
+ NETLIBS="$NETLIBS -l${lib}"])])
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
@ -1,455 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
# afsmodname - return the name of the AFS module to load
|
|
||||||
# usage: afsmodname [path]
|
|
||||||
# THIS SCRIPT IS UNDER SOURCE CONTROL!
|
|
||||||
# The master copy is /afs/cs/misc/openafs/src/client-support/afsmodname
|
|
||||||
|
|
||||||
use Getopt::Std;
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use vars qw($modbase $VERSION @TrySyms @AddSyms $Prefix);
|
|
||||||
use vars qw($DEBUG $Mode $OutFile %SymCache);
|
|
||||||
|
|
||||||
$VERSION = '$Revision$';
|
|
||||||
$VERSION =~ s/^\$[a-z]*:?\s*(\S*)\s*\$$/$1/i;
|
|
||||||
$VERSION = 'testing' unless $VERSION;
|
|
||||||
$modbase = '/usr/vice/etc/modload';
|
|
||||||
@TrySyms = qw(__iget iget __iget4 iget4);
|
|
||||||
@AddSyms = qw(sock_create);
|
|
||||||
$Prefix = 'libafs';
|
|
||||||
|
|
||||||
|
|
||||||
sub vcmp {
|
|
||||||
my (@a, @b, @aa, @bb);
|
|
||||||
my ($i, $ii);
|
|
||||||
|
|
||||||
@a = split /-/, $a;
|
|
||||||
@b = split /-/, $b;
|
|
||||||
foreach $i (0 .. ((@a > @b) ? $#b : $#a)) {
|
|
||||||
@aa = split /\./, $a[$i];
|
|
||||||
@bb = split /\./, $b[$i];
|
|
||||||
foreach $ii (0 .. ((@aa > @bb) ? $#bb : $#aa)) {
|
|
||||||
return $aa[$ii] <=> $bb[$ii] if $aa[$ii] <=> $bb[$ii]
|
|
||||||
&& $aa[$ii] =~ /^\d+$/
|
|
||||||
&& $bb[$ii] =~ /^\d+$/;
|
|
||||||
return $aa[$ii] cmp $bb[$ii] if $aa[$ii] cmp $bb[$ii];
|
|
||||||
}
|
|
||||||
return @aa <=> @bb if @aa <=> @bb;
|
|
||||||
}
|
|
||||||
return @a <=> @b;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub parse_symbol ($) {
|
|
||||||
my($symbol) = @_;
|
|
||||||
|
|
||||||
if ($symbol =~ /^(.*)_R((?:smp)?(?:2gig)?_?[0-9a-f]{8})$/) {
|
|
||||||
($1, $2);
|
|
||||||
} else {
|
|
||||||
($symbol, '--none--');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub get_ksym ($) {
|
|
||||||
my($req_sym) = @_;
|
|
||||||
my($addr, $symbol, $module, $version, @answer);
|
|
||||||
|
|
||||||
|
|
||||||
if (exists($SymCache{$req_sym})) {
|
|
||||||
print STDERR "get_ksym($req_sym) [cached]\n" if $DEBUG > 1;
|
|
||||||
return $SymCache{$req_sym};
|
|
||||||
}
|
|
||||||
|
|
||||||
print STDERR "get_ksym($req_sym)" if $DEBUG;
|
|
||||||
$SymCache{$req_sym} = undef;
|
|
||||||
open(KSYMS, '/proc/ksyms') or die "open /proc/ksyms: $!\n";
|
|
||||||
while (<KSYMS>) {
|
|
||||||
if (/^(\w+)\s+(\w+)\s+\[(.*)\]/) {
|
|
||||||
($addr, $symbol, $module) = ($1, $2, $3)
|
|
||||||
} elsif (/^(\w+)\s+(\w+)/) {
|
|
||||||
($addr, $symbol, $module) = ($1, $2, 'KERNEL')
|
|
||||||
} else { next }
|
|
||||||
|
|
||||||
($symbol, $version) = parse_symbol($symbol);
|
|
||||||
|
|
||||||
if ($symbol eq $req_sym) {
|
|
||||||
$SymCache{$req_sym} = [$addr, $version, $module];
|
|
||||||
print STDERR " => [addr=$addr, vers=$version, mod=$module]\n" if $DEBUG;
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close(KSYMS);
|
|
||||||
|
|
||||||
print STDERR " => not found\n" if $DEBUG && !defined($SymCache{$req_sym});
|
|
||||||
$SymCache{$req_sym};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub get_modsyms ($) {
|
|
||||||
my($modpath) = @_;
|
|
||||||
my($symbol, $version, $V);
|
|
||||||
|
|
||||||
$V = {};
|
|
||||||
open(NM, "nm $modpath|") or die "nm $modpath: $!\n";
|
|
||||||
while (<NM>) {
|
|
||||||
chomp;
|
|
||||||
next unless /^\s+U\s+/;
|
|
||||||
($symbol, $version) = parse_symbol($');
|
|
||||||
$$V{$symbol} = $version unless $version eq '--none--';
|
|
||||||
}
|
|
||||||
close(NM);
|
|
||||||
$V;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub get_hdrsyms ($) {
|
|
||||||
my($srcpath) = @_;
|
|
||||||
my($moddir, @hdrs, $h);
|
|
||||||
my($symbol, $version, $V);
|
|
||||||
|
|
||||||
|
|
||||||
$moddir = "$srcpath/include/linux/modules";
|
|
||||||
opendir(HDRS, $moddir) or die "$moddir: $!\n";
|
|
||||||
@hdrs = readdir(HDRS);
|
|
||||||
closedir(HDRS);
|
|
||||||
|
|
||||||
$V = {};
|
|
||||||
foreach $h (@hdrs) {
|
|
||||||
next unless $h =~ /\.ver$/;
|
|
||||||
open(HDR, "$moddir/$h") or die "$moddir/$h: $!\n";
|
|
||||||
while (<HDR>) {
|
|
||||||
chomp;
|
|
||||||
next unless /#define __ver_(\S+)\s+(\S+)/;
|
|
||||||
$$V{$1} = $2;
|
|
||||||
}
|
|
||||||
close(HDR);
|
|
||||||
}
|
|
||||||
$V;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub get_cputype () {
|
|
||||||
my($cputype, $family, $vendor, $model);
|
|
||||||
|
|
||||||
open(CPUINFO, '/proc/cpuinfo') or die "open /proc/cpuinfo: $!\n";
|
|
||||||
while (<CPUINFO>) {
|
|
||||||
if (/^cpu\s*\:\s*(\S+)/) { $cputype = $1 }
|
|
||||||
elsif (/^cpu family\s*:\s*(\S+)/) { $family = $1 }
|
|
||||||
elsif (/^vendor_id\s*:\s*(\S+)/) { $vendor = $1 }
|
|
||||||
elsif (/^model\s*:\s*(\S+)/) { $model = $1 }
|
|
||||||
}
|
|
||||||
close(CPUINFO);
|
|
||||||
if ($vendor eq 'GenuineIntel') { $vendor = 'intel' }
|
|
||||||
elsif ($vendor eq 'AuthenticAMD') { $vendor = 'amd' }
|
|
||||||
$cputype = "${family}86" if !defined($cputype);
|
|
||||||
[$cputype, $vendor, $model];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub table_lookup ($@) {
|
|
||||||
my($cpu, @paths) = @_;
|
|
||||||
my($path, $symbol, $version, $mincpu, @mincpu, $module, $info, @supp);
|
|
||||||
my($prev_module); # last module line we saw
|
|
||||||
my($match_module); # last matching module
|
|
||||||
my($prev_match); # true if last module matches so far
|
|
||||||
|
|
||||||
foreach $path (@paths) {
|
|
||||||
next unless -f $path;
|
|
||||||
$prev_match = 0;
|
|
||||||
open(TABLE, $path) or die "open $path: $!\n";
|
|
||||||
while (<TABLE>) {
|
|
||||||
# Skip comments
|
|
||||||
next if (/^\#/ || /^\s*$/);
|
|
||||||
|
|
||||||
# Check supplemental requirements
|
|
||||||
if (/^\s*\>/) {
|
|
||||||
@supp = split;
|
|
||||||
foreach (@supp) {
|
|
||||||
if (/([^=]*)=([^=]*)/) {
|
|
||||||
($symbol, $version) = ($1, $2);
|
|
||||||
$info = get_ksym($symbol);
|
|
||||||
$prev_match = 0 if !$info || $version ne $$info[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
|
|
||||||
# This is a new module, so all supplemental requirements for the
|
|
||||||
# previous module have been processed. If they all passed, then
|
|
||||||
# the previous module is a matching module.
|
|
||||||
$match_module = $prev_module if $prev_match;
|
|
||||||
|
|
||||||
# Parse the line and remember the module name
|
|
||||||
($symbol, $version, $mincpu, $module) = split;
|
|
||||||
$prev_module = $module;
|
|
||||||
$prev_match = 0;
|
|
||||||
if ($DEBUG) {
|
|
||||||
print STDERR "Try $module ($symbol=$version)",
|
|
||||||
($mincpu ne '-') ? " mincpu = $mincpu" : "",
|
|
||||||
"\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check mincpu requirement
|
|
||||||
if ($mincpu ne '-') {
|
|
||||||
@mincpu = split(/\./, $mincpu);
|
|
||||||
if ($mincpu[0] ne '' && $mincpu[0] > $$cpu[0]) { # min family
|
|
||||||
print STDERR " mincpu failed: $mincpu[0] > $$cpu[0]\n" if $DEBUG;
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
if ($mincpu[1] ne '' && $mincpu[1] ne $$cpu[1]) { # exact vendor
|
|
||||||
print STDERR " mincpu failed: $mincpu[1] != $$cpu[1]\n" if $DEBUG;
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
if ($mincpu[2] ne '' && $mincpu[2] > $$cpu[2]) { # min model
|
|
||||||
print STDERR " mincpu failed: $mincpu[2] > $$cpu[2]\n" if $DEBUG;
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check primary symbol requirement
|
|
||||||
$info = get_ksym($symbol);
|
|
||||||
next unless $info;
|
|
||||||
next unless $version eq $$info[1];
|
|
||||||
|
|
||||||
# OK; it's a match so far. There may still be some supplemental
|
|
||||||
# requirements that we need to check.
|
|
||||||
$prev_match = 1;
|
|
||||||
}
|
|
||||||
close(TABLE);
|
|
||||||
$match_module = $prev_module if $prev_match;
|
|
||||||
}
|
|
||||||
$match_module;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub dump_versions ($) {
|
|
||||||
my($cpu) = @_;
|
|
||||||
my($version);
|
|
||||||
|
|
||||||
print STDERR "CPU Type: ", join('.', @$cpu), "\n";
|
|
||||||
|
|
||||||
chomp($version = `uname -rv`);
|
|
||||||
print STDERR "Linux version: $version\n";
|
|
||||||
|
|
||||||
if (open(RHR, "/etc/redhat-release")) {
|
|
||||||
chomp($version = <RHR>);
|
|
||||||
print STDERR "RedHat release: $version\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub dump_syms (@) {
|
|
||||||
my(@syms) = @_;
|
|
||||||
my($sym, $info);
|
|
||||||
|
|
||||||
print STDERR "Symbol versions:\n";
|
|
||||||
foreach $sym (@syms) {
|
|
||||||
$info = get_ksym($sym);
|
|
||||||
printf STDERR " %-10s %s\n", $sym, $$info[1] if $info;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub gen_table (@) {
|
|
||||||
my(@modules) = @_;
|
|
||||||
my($module, $modname, $V, $sym, $count, @add);
|
|
||||||
|
|
||||||
print <<'EOF';
|
|
||||||
# This file describes the available AFS kernel modules and what kernel
|
|
||||||
# versions they work with. Each line matches against some kernel symbol
|
|
||||||
# version, and specifies a module which may be used with kernels containing
|
|
||||||
# that version of the specified symbol. Only lines which match the
|
|
||||||
# currently-running kernel are considered.
|
|
||||||
#
|
|
||||||
# In addition, each line may specify a minimum CPU model on which the module
|
|
||||||
# will work. If this value is present, the actual CPU model must be greater
|
|
||||||
# than or equal to the version specified; otherwise, the module is assumed
|
|
||||||
# to work on any CPU.
|
|
||||||
#
|
|
||||||
# The last match found will be used.
|
|
||||||
#
|
|
||||||
# Symbol Version MinCPU Module
|
|
||||||
#======= ============ ====== ====================
|
|
||||||
EOF
|
|
||||||
foreach $module (sort vcmp @modules) {
|
|
||||||
($modname = $module) =~ s/.*\///;
|
|
||||||
$modname =~ s/^$Prefix[-.](.*)\.o$/$1/;
|
|
||||||
$V = get_modsyms($module);
|
|
||||||
$count = 0;
|
|
||||||
foreach $sym (@TrySyms) {
|
|
||||||
next unless exists $$V{$sym};
|
|
||||||
$count++;
|
|
||||||
printf "%-8s %-12s %-6s %s\n", $sym, $$V{$sym}, '-', $modname;
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
if (!$count) {
|
|
||||||
print STDERR "Unable to find a suitable symbol reference in $modname!\n";
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
@add = ();
|
|
||||||
foreach $sym (@AddSyms) {
|
|
||||||
next unless exists $$V{$sym};
|
|
||||||
push(@add, "$sym=$$V{$sym}");
|
|
||||||
}
|
|
||||||
print "> ", join(' ', @add), "\n" if @add;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub scan_kernels (@) {
|
|
||||||
my(@kernels) = @_;
|
|
||||||
my($kernel, $kpath, $kname, $V);
|
|
||||||
|
|
||||||
eval <<"EOF";
|
|
||||||
format =
|
|
||||||
@<<<<<<<<<<<<<<<<<<<<<<<< @{[' @<<<<<<<<<<<' x scalar(@TrySyms)]}
|
|
||||||
\$kname, @{[join(',', map(q/$$V{'/ . $_ . q/'}/, @TrySyms))]}
|
|
||||||
.
|
|
||||||
EOF
|
|
||||||
|
|
||||||
$kname = 'Kernel';
|
|
||||||
$V = { map(($_ => $_), @TrySyms) };
|
|
||||||
write;
|
|
||||||
|
|
||||||
$kname = '=========================';
|
|
||||||
$V = { map(($_ => '============'), @TrySyms) };
|
|
||||||
write;
|
|
||||||
|
|
||||||
foreach $kernel (@kernels) {
|
|
||||||
if (-d "$kernel/src/include/linux/modules") { $kpath = "$kernel/src" }
|
|
||||||
elsif (-d "$kernel/include/linux/modules") { $kpath = $kernel }
|
|
||||||
else { next }
|
|
||||||
($kname = $kpath) =~ s#/src$##;
|
|
||||||
$kname =~ s/.*\///;
|
|
||||||
|
|
||||||
$V = get_hdrsyms($kpath);
|
|
||||||
write;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub symcompare ($$) {
|
|
||||||
my($module, $kernel) = @_;
|
|
||||||
my($ksyms, $msyms, $sym, $kvers, $mvers, $info);
|
|
||||||
|
|
||||||
eval <<'EOF';
|
|
||||||
format =
|
|
||||||
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<< @<<<<<<<<<<<
|
|
||||||
$sym, $kvers, $mvers
|
|
||||||
.
|
|
||||||
EOF
|
|
||||||
|
|
||||||
if (defined($kernel)) { $ksyms = get_hdrsyms($kernel) }
|
|
||||||
$msyms = get_modsyms($module);
|
|
||||||
|
|
||||||
print "Symbol Kernel Module\n";
|
|
||||||
print "============================== ============ ============\n";
|
|
||||||
foreach (keys %$msyms) {
|
|
||||||
$sym = $_;
|
|
||||||
$mvers = $$msyms{$sym};
|
|
||||||
if (defined($kernel)) {
|
|
||||||
$kvers = $$ksyms{$sym};
|
|
||||||
} else {
|
|
||||||
$info = get_ksym($sym);
|
|
||||||
$kvers = $$info[1];
|
|
||||||
}
|
|
||||||
next if $kvers eq $mvers;
|
|
||||||
write;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub usage (;@) {
|
|
||||||
|
|
||||||
print STDERR "$00: ", @_, "\n" if @_;
|
|
||||||
print STDERR <<"EOF";
|
|
||||||
usage: $00 [opts] [modbase] (find module)
|
|
||||||
$00 [opts] -g modules ... (make table)
|
|
||||||
$00 [opts] -k kernels ... (scan kernels)
|
|
||||||
$00 [opts] -c module [kernel] (check module)
|
|
||||||
$00 -h (print help)
|
|
||||||
$00 -v (print version)
|
|
||||||
|
|
||||||
options:
|
|
||||||
-d enable debugging output
|
|
||||||
-f outfile set output file (default stdout)
|
|
||||||
-P prefix set module name prefix (default $Prefix)
|
|
||||||
-S syms... symbols to try for -x, -k (default @TrySyms)
|
|
||||||
-A syms... additional symbols to check for -x (default @AddSyms)
|
|
||||||
|
|
||||||
Module lists for -S and -A may be space- or comma-separated.
|
|
||||||
For backward-compatibility, -g is a synonym for -x.
|
|
||||||
EOF
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub parse_opts () {
|
|
||||||
my(%opts);
|
|
||||||
|
|
||||||
($00 = $0) =~ s/.*\///;
|
|
||||||
getopts('dckgxf:hvP:S:A:', \%opts) or usage('invalid option(s)');
|
|
||||||
usage() if $opts{'h'};
|
|
||||||
|
|
||||||
if ($opts{'v'}) {
|
|
||||||
print "afsmodname $VERSION\n";
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
$opts{'g'} = 1 if $opts{'x'};
|
|
||||||
if ($opts{'g'} + $opts{'k'} + $opts{'c'} > 1) {
|
|
||||||
usage("At most one of -g, -k, -c can be used\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
$DEBUG++ if exists $opts{'d'};
|
|
||||||
$Mode = 'g' if exists $opts{'g'};
|
|
||||||
$Mode = 'k' if exists $opts{'k'};
|
|
||||||
$Mode = 'c' if exists $opts{'c'};
|
|
||||||
|
|
||||||
usage("Too many arguments") if !$Mode && @ARGV > 1;
|
|
||||||
usage("Too many arguments") if $Mode eq 'c' && @ARGV > 2;
|
|
||||||
usage("Module name required") if $Mode eq 'c' && !@ARGV;
|
|
||||||
|
|
||||||
$OutFile = $opts{'f'} if exists $opts{'f'};
|
|
||||||
$Prefix = $opts{'p'} if exists $opts{'P'};
|
|
||||||
@TrySyms = split(/[, ]+/, $opts{'S'}) if exists $opts{'S'};
|
|
||||||
@AddSyms = split(/[, ]+/, $opts{'A'}) if exists $opts{'A'};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
## MAIN PROGRAM
|
|
||||||
|
|
||||||
my($cpu, $module);
|
|
||||||
|
|
||||||
parse_opts();
|
|
||||||
if ($Mode) {
|
|
||||||
if ($OutFile) {
|
|
||||||
open(STDOUT, ">$OutFile") or die "$OutFile: $!\n";
|
|
||||||
}
|
|
||||||
if ($Mode eq 'g') { gen_table(@ARGV) }
|
|
||||||
if ($Mode eq 'k') { scan_kernels(@ARGV) }
|
|
||||||
if ($Mode eq 'c') { symcompare($ARGV[0], $ARGV[1]) }
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
$modbase = $ARGV[0] if @ARGV;
|
|
||||||
|
|
||||||
$cpu = get_cputype();
|
|
||||||
|
|
||||||
$module = table_lookup($cpu, "$modbase/SymTable", "$modbase/SymTable.local");
|
|
||||||
|
|
||||||
if ($module) {
|
|
||||||
print "$Prefix-$module.o";
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
print STDERR <<'EOF';
|
|
||||||
Hmm... I can't seem to find an AFS kernel module suitable for your Linux
|
|
||||||
kernel. That means you will need to build or obtain a suitable module.
|
|
||||||
The following information may be of some use in obtaining assistance:
|
|
||||||
EOF
|
|
||||||
|
|
||||||
dump_versions($cpu);
|
|
||||||
dump_syms(sort (@TrySyms, keys %SymCache));
|
|
||||||
|
|
||||||
exit(1);
|
|
@ -1,27 +0,0 @@
|
|||||||
Index: src/afsd/afs.rc.linux
|
|
||||||
===================================================================
|
|
||||||
RCS file: /cvs/openafs/src/afsd/afs.rc.linux,v
|
|
||||||
retrieving revision 1.4
|
|
||||||
diff -u -r1.4 afs.rc.linux
|
|
||||||
--- src/afsd/afs.rc.linux 2001/10/10 03:16:54 1.4
|
|
||||||
+++ src/afsd/afs.rc.linux 2001/10/13 14:42:31
|
|
||||||
@@ -92,6 +92,19 @@
|
|
||||||
# LIBAFS manually.
|
|
||||||
choose_client() {
|
|
||||||
|
|
||||||
+ # Use the associated script to determine the module name
|
|
||||||
+ if test -f /usr/vice/etc/afsmodname && \
|
|
||||||
+ test -f /usr/vice/etc/modload/SymTable ; then
|
|
||||||
+
|
|
||||||
+ LIBAFS=`/usr/vice/etc/afsmodname`
|
|
||||||
+ if test "x$LIBAFS" = "x" ; then
|
|
||||||
+ echo Did not find matching module in SymTable
|
|
||||||
+ else
|
|
||||||
+ echo Found $LIBAFS from SymTable... Loading...
|
|
||||||
+ return 0
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
# Use the second field of the uname -v output instead of just
|
|
||||||
# doing a match on the whole thing to protect against matching
|
|
||||||
# a timezone named SMP -- I don't know of one, but let's be
|
|
@ -1,762 +0,0 @@
|
|||||||
%define afsvers 1.2.6
|
|
||||||
%define pkgrel 1
|
|
||||||
|
|
||||||
# Define your particular Red Hat and kernel versions:
|
|
||||||
# For Linux 2.2: 22
|
|
||||||
# For Linux 2.4: 24
|
|
||||||
#
|
|
||||||
%define osvers rh7.1
|
|
||||||
%define kernvers 24
|
|
||||||
|
|
||||||
# This is where to look for kernel-build includes files.
|
|
||||||
# Most likely you don't want to change this, but
|
|
||||||
# depending on your situation you may want:
|
|
||||||
# Linux 2.2:
|
|
||||||
# kbase = /usr/src/linux-
|
|
||||||
# kend = ""
|
|
||||||
# Linux 2.4:
|
|
||||||
# kbase = /lib/modules/
|
|
||||||
# kend = /build
|
|
||||||
#
|
|
||||||
%define kbase /usr/src/linux-
|
|
||||||
%define kend ""
|
|
||||||
|
|
||||||
# Set 'debugspec' to 1 if you want to debug the spec file. This will
|
|
||||||
# not remove the installed tree as part of the %clean operation
|
|
||||||
%define debugspec 0
|
|
||||||
|
|
||||||
# Set 'enterprisekernelsupport' to 1 if you want to build the
|
|
||||||
# kernel module for the enterprise kernel
|
|
||||||
# Note: This will only work for kernvers == 24 on i686
|
|
||||||
%define enterprisekernelsupport 1
|
|
||||||
|
|
||||||
# Set 'bigmemkernelsupport' to 1 if you want to build the
|
|
||||||
# kernel module for the bigmem kernel
|
|
||||||
# Note: This will only work for kernvers == 24 on i686
|
|
||||||
%define bigmemkernelsupport 1
|
|
||||||
|
|
||||||
# Set 'krb5support' to 1 if you want to build the openafs-krb5 package
|
|
||||||
# to distribute aklog and asetkey
|
|
||||||
%define krb5support 1
|
|
||||||
|
|
||||||
# OpenAFS configuration options
|
|
||||||
%define enable_bitmap_later 0
|
|
||||||
%define enable_bos_restricted_mode 0
|
|
||||||
%define enable_fast_restart 0
|
|
||||||
|
|
||||||
#######################################################################
|
|
||||||
# You probably don't need to change anything beyond this line
|
|
||||||
# NOTE: If you do, please email me!!!
|
|
||||||
|
|
||||||
Summary: OpenAFS distributed filesystem
|
|
||||||
Name: openafs
|
|
||||||
Version: %{afsvers}
|
|
||||||
Release: %{osvers}.%{pkgrel}
|
|
||||||
Copyright: IPL
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
||||||
Packager: Derek Atkins <warlord@MIT.EDU>
|
|
||||||
Group: Networking/Filesystems
|
|
||||||
BuildRequires: kernel-source
|
|
||||||
%if "%{osvers}" != "rh6.2"
|
|
||||||
# Newer versions of Red Hat require pam-devel in order to build
|
|
||||||
BuildRequires: pam-devel
|
|
||||||
%endif
|
|
||||||
|
|
||||||
Source0: http://www.openafs.org/dl/openafs/${afsvers}/openafs-%{afsvers}-src.tar.gz
|
|
||||||
Source1: http://www.openafs.org/dl/openafs/${afsvers}/openafs-%{afsvers}-doc.tar.gz
|
|
||||||
Source2: openafs-ThisCell
|
|
||||||
# http://grand.central.org/dl/cellservdb/CellServDB
|
|
||||||
Source3: openafs-CellServDB
|
|
||||||
Source4: openafs-SuidCells
|
|
||||||
Source5: openafs-cacheinfo
|
|
||||||
Source6: openafs-afsmodname
|
|
||||||
Source7: openafs-LICENSE.Sun
|
|
||||||
Source8: openafs-README
|
|
||||||
Source10: http://www.openafs.org/dl/openafs/${afsvers}/RELNOTES-%{afsvers}
|
|
||||||
Source11: http://www.openafs.org/dl/openafs/${afsvers}/ChangeLog
|
|
||||||
|
|
||||||
Source20: openafs-krb5-1.3.tar.gz
|
|
||||||
|
|
||||||
Patch0: openafs-%{afsvers}-rc.patch
|
|
||||||
|
|
||||||
Patch20: openafs-krb5-1.3-1.2.1.diff.gz
|
|
||||||
Patch21: openafs-krb5-1.3-configure.patch
|
|
||||||
|
|
||||||
%description
|
|
||||||
The AFS distributed filesystem. AFS is a distributed filesystem
|
|
||||||
allowing cross-platform sharing of files among multiple computers.
|
|
||||||
Facilities are provided for access control, authentication, backup and
|
|
||||||
administrative management.
|
|
||||||
|
|
||||||
This package provides common files shared across all the various
|
|
||||||
OpenAFS packages but are not necessarily tied to a client or server.
|
|
||||||
|
|
||||||
%package client
|
|
||||||
Requires: binutils, openafs-kernel, openafs = %{PACKAGE_VERSION}
|
|
||||||
Summary: OpenAFS Filesystem Client
|
|
||||||
Group: Networking/Filesystem
|
|
||||||
|
|
||||||
%description client
|
|
||||||
The AFS distributed filesystem. AFS is a distributed filesystem
|
|
||||||
allowing cross-platform sharing of files among multiple computers.
|
|
||||||
Facilities are provided for access control, authentication, backup and
|
|
||||||
administrative management.
|
|
||||||
|
|
||||||
This package provides basic client support to mount and manipulate
|
|
||||||
AFS.
|
|
||||||
|
|
||||||
%package server
|
|
||||||
Requires: openafs-kernel, openafs = %{PACKAGE_VERSION}
|
|
||||||
Summary: OpenAFS Filesystem Server
|
|
||||||
Group: Networking/Filesystems
|
|
||||||
|
|
||||||
%description server
|
|
||||||
The AFS distributed filesystem. AFS is a distributed filesystem
|
|
||||||
allowing cross-platform sharing of files among multiple computers.
|
|
||||||
Facilities are provided for access control, authentication, backup and
|
|
||||||
administrative management.
|
|
||||||
|
|
||||||
This package provides basic server support to host files in an AFS
|
|
||||||
Cell.
|
|
||||||
|
|
||||||
%package devel
|
|
||||||
Summary: OpenAFS Development Libraries and Headers
|
|
||||||
Group: Development/Filesystems
|
|
||||||
|
|
||||||
%description devel
|
|
||||||
The AFS distributed filesystem. AFS is a distributed filesystem
|
|
||||||
allowing cross-platform sharing of files among multiple computers.
|
|
||||||
Facilities are provided for access control, authentication, backup and
|
|
||||||
administrative management.
|
|
||||||
|
|
||||||
This package provides static development libraries and headers needed
|
|
||||||
to compile AFS applications. Note: AFS currently does not provide
|
|
||||||
shared libraries.
|
|
||||||
|
|
||||||
%package kernel
|
|
||||||
Summary: OpenAFS Kernel Module(s)
|
|
||||||
Requires: openafs = %{PACKAGE_VERSION}
|
|
||||||
Group: Networking/Filesystems
|
|
||||||
|
|
||||||
%description kernel
|
|
||||||
The AFS distributed filesystem. AFS is a distributed filesystem
|
|
||||||
allowing cross-platform sharing of files among multiple computers.
|
|
||||||
Facilities are provided for access control, authentication, backup and
|
|
||||||
administrative management.
|
|
||||||
|
|
||||||
This package provides precompiled AFS kernel modules for various
|
|
||||||
kernels.
|
|
||||||
|
|
||||||
%package kernel-source
|
|
||||||
Summary: OpenAFS Kernel Module source tree
|
|
||||||
Group: Networking/Filesystems
|
|
||||||
|
|
||||||
%description kernel-source
|
|
||||||
The AFS distributed filesystem. AFS is a distributed filesystem
|
|
||||||
allowing cross-platform sharing of files among multiple computers.
|
|
||||||
Facilities are provided for access control, authentication, backup and
|
|
||||||
administrative management.
|
|
||||||
|
|
||||||
This package provides the source code to build your own AFS kernel
|
|
||||||
module.
|
|
||||||
|
|
||||||
%package compat
|
|
||||||
Summary: OpenAFS client compatibility symlinks
|
|
||||||
Requires: openafs = %{PACKAGE_VERSION}, openafs-client = %{PACKAGE_VERSION}
|
|
||||||
Group: Networking/Filesystems
|
|
||||||
Obsoletes: openafs-client-compat
|
|
||||||
|
|
||||||
%description compat
|
|
||||||
The AFS distributed filesystem. AFS is a distributed filesystem
|
|
||||||
allowing cross-platform sharing of files among multiple computers.
|
|
||||||
Facilities are provided for access control, authentication, backup and
|
|
||||||
administrative management.
|
|
||||||
|
|
||||||
This package provides compatibility symlinks in /usr/afsws. It is
|
|
||||||
completely optional, and is only necessary to support legacy
|
|
||||||
applications and scripts that hard-code the location of AFS client
|
|
||||||
programs.
|
|
||||||
|
|
||||||
%package kpasswd
|
|
||||||
Summary: OpenAFS KA kpasswd support
|
|
||||||
Requires: openafs
|
|
||||||
Group: Networking/Filesystems
|
|
||||||
|
|
||||||
%description kpasswd
|
|
||||||
The AFS distributed filesystem. AFS is a distributed filesystem
|
|
||||||
allowing cross-platform sharing of files among multiple computers.
|
|
||||||
Facilities are provided for access control, authentication, backup and
|
|
||||||
administrative management.
|
|
||||||
|
|
||||||
This package provides the compatibility symlink for kpasswd, in case
|
|
||||||
you are using KAserver instead of Krb5.
|
|
||||||
|
|
||||||
%if %{krb5support}
|
|
||||||
%package krb5
|
|
||||||
Summary: OpenAFS programs to use with krb5
|
|
||||||
Requires: openafs = %{PACKAGE_VERSION}
|
|
||||||
Group: Networking/Filesystems
|
|
||||||
BuildRequires: krb5-devel
|
|
||||||
|
|
||||||
%description krb5
|
|
||||||
The AFS distributed filesystem. AFS is a distributed filesystem
|
|
||||||
allowing cross-platform sharing of files among multiple computers.
|
|
||||||
Facilities are provided for access control, authentication, backup and
|
|
||||||
administrative management.
|
|
||||||
|
|
||||||
This package provides compatibility programs so you can use krb5
|
|
||||||
to authenticate to AFS services, instead of using AFS's homegrown
|
|
||||||
krb4 lookalike services.
|
|
||||||
%endif
|
|
||||||
|
|
||||||
#
|
|
||||||
# PREP
|
|
||||||
#
|
|
||||||
|
|
||||||
%prep
|
|
||||||
%setup -q -b 1
|
|
||||||
%setup -q -T -D -a 20
|
|
||||||
|
|
||||||
%patch0 -p0
|
|
||||||
%patch20 -p0
|
|
||||||
%patch21 -p0
|
|
||||||
|
|
||||||
###
|
|
||||||
### build
|
|
||||||
###
|
|
||||||
%build
|
|
||||||
|
|
||||||
%ifarch i386 i486 i586 i686 athlon
|
|
||||||
sysbase=i386
|
|
||||||
sysname=${sysbase}_linux%{kernvers}
|
|
||||||
%else
|
|
||||||
sysbase=%{_arch}
|
|
||||||
sysname=${sysbase}_linux%{kernvers}
|
|
||||||
%endif
|
|
||||||
|
|
||||||
if [ %{kernvers} = 22 ]; then
|
|
||||||
kv='2\.2\.'
|
|
||||||
elif [ %{kernvers} = 24 ]; then
|
|
||||||
kv='2\.4\.'
|
|
||||||
else
|
|
||||||
echo "I don't know how to build $sysname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
%ifarch i386 i486 i586 i686 athlon
|
|
||||||
archlist="i386 i586 i686 athlon"
|
|
||||||
%else
|
|
||||||
archlist=${sysbase}
|
|
||||||
%endif
|
|
||||||
|
|
||||||
#
|
|
||||||
# PrintDefine var value statements file
|
|
||||||
#
|
|
||||||
PrintDefine() {
|
|
||||||
case $3 in
|
|
||||||
*ifn*)
|
|
||||||
echo "#ifndef $1" >> $4
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
case $3 in
|
|
||||||
*und*)
|
|
||||||
echo "#undef $1" >> $4
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
case $3 in
|
|
||||||
*def*)
|
|
||||||
echo "#define $1 $2" >> $4
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
case $3 in
|
|
||||||
*end*)
|
|
||||||
echo "#endif" >> $4
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
case $3 in
|
|
||||||
*inc*)
|
|
||||||
echo "#include $1" >> $4
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
case $3 in
|
|
||||||
*nl*)
|
|
||||||
echo "" >> $4
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# PrintRedhatKernelFix arch mp file
|
|
||||||
PrintRedhatKernelFix() {
|
|
||||||
arch="$1"
|
|
||||||
up=0
|
|
||||||
smp=0
|
|
||||||
ent=0
|
|
||||||
bm=0
|
|
||||||
if [ "$2" = "MP" ]; then
|
|
||||||
smp=1
|
|
||||||
elif [ "$2" = "EP" ]; then
|
|
||||||
ent=1
|
|
||||||
elif [ "$2" = "BM" ]; then
|
|
||||||
bm=1
|
|
||||||
else
|
|
||||||
up=1
|
|
||||||
fi
|
|
||||||
file="$3"
|
|
||||||
|
|
||||||
# deal with the various boot kernels
|
|
||||||
boot=0
|
|
||||||
bootsmp=0
|
|
||||||
|
|
||||||
# arch of 'BOOT' == 386
|
|
||||||
if [ "$arch" = "BOOT" ]; then
|
|
||||||
if [ "$up" = 1 ]; then
|
|
||||||
boot=1
|
|
||||||
up=0
|
|
||||||
elif [ "$smp" = 1 ]; then
|
|
||||||
bootsmp=1
|
|
||||||
smp=0
|
|
||||||
fi
|
|
||||||
arch=i386
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f $file
|
|
||||||
touch $file
|
|
||||||
|
|
||||||
PrintDefine "REDHAT_FIX_H" "" ifn,def,nl $file
|
|
||||||
|
|
||||||
PrintDefine "__BOOT_KERNEL_ENTERPRISE" $ent und,def,nl $file
|
|
||||||
PrintDefine "__BOOT_KERNEL_BIGMEM" $bm und,def,nl $file
|
|
||||||
PrintDefine "__BOOT_KERNEL_SMP" $smp und,def,nl $file
|
|
||||||
PrintDefine "__BOOT_KERNEL_UP" $up und,def,nl $file
|
|
||||||
PrintDefine "__BOOT_KERNEL_BOOT" $boot und,def,nl $file
|
|
||||||
PrintDefine "__BOOT_KERNEL_BOOTSMP" $bootsmp und,def,nl $file
|
|
||||||
|
|
||||||
PrintDefine \"/boot/kernel.h\" "" inc,nl $file # include file
|
|
||||||
|
|
||||||
for ar in $archlist ; do
|
|
||||||
if [ "$ar" = "$arch" ]; then
|
|
||||||
PrintDefine "__MODULE_KERNEL_$ar" "1" ifn,def,end $file
|
|
||||||
else
|
|
||||||
PrintDefine "__MODULE_KERNEL_$ar" "" und $file # undef
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
echo "" >> $file
|
|
||||||
|
|
||||||
PrintDefine "" "" end $file
|
|
||||||
|
|
||||||
if [ %{debugspec} = 1 ] ; then
|
|
||||||
echo "Kernel Configuration File for Red Hat kernels:"
|
|
||||||
cat $file
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Pick up all the 'appropriate' kernels
|
|
||||||
kvers=`ls -d %{kbase}* | sed 's^%{kbase}^^g' | grep $kv`
|
|
||||||
|
|
||||||
# Choose the last one for now.. It doesn't really matter, really.
|
|
||||||
hdrdir=`ls -d %{kbase}*%{kend} | grep $kv | tail -1`
|
|
||||||
|
|
||||||
config_opts="--enable-redhat-buildsys \
|
|
||||||
%if %{enable_bitmap_later}
|
|
||||||
--enable-bitmap-later \
|
|
||||||
%endif
|
|
||||||
%if %{enable_bos_restricted_mode}
|
|
||||||
--enable-bos-restricted-mode \
|
|
||||||
%endif
|
|
||||||
%if %{enable_fast_restart}
|
|
||||||
--enable-fast-restart \
|
|
||||||
%endif
|
|
||||||
--enable-transarc-paths"
|
|
||||||
|
|
||||||
# Configure AFS
|
|
||||||
./configure --with-afs-sysname=${sysname} \
|
|
||||||
--with-linux-kernel-headers=$hdrdir $config_opts
|
|
||||||
|
|
||||||
# Build the user-space AFS stuff
|
|
||||||
make dest_nolibafs
|
|
||||||
|
|
||||||
# Build the libafs tree
|
|
||||||
make only_libafs_tree
|
|
||||||
|
|
||||||
# Now build all the kernel modules
|
|
||||||
for vers in $kvers ; do
|
|
||||||
|
|
||||||
# Reconfigure sources for this kernel version, to catch various
|
|
||||||
# kernel params in the configure script. Yes. this takes more time,
|
|
||||||
# but it's worth it in the long run.. But first remove config.cache
|
|
||||||
# to be sure we get a clean configuration.
|
|
||||||
rm -f config.cache
|
|
||||||
./configure --with-afs-sysname=${sysname} \
|
|
||||||
--with-linux-kernel-headers=%{kbase}$vers%{kend} \
|
|
||||||
$config_opts
|
|
||||||
|
|
||||||
KTL="SP MP"
|
|
||||||
%if %{enterprisekernelsupport}
|
|
||||||
# See if we should build EP support
|
|
||||||
if grep -q -r __BOOT_KERNEL_ENTERPRISE %{kbase}$vers%{kend}/include
|
|
||||||
then
|
|
||||||
KTL="${KTL} EP"
|
|
||||||
fi
|
|
||||||
%endif
|
|
||||||
%if %{bigmemkernelsupport}
|
|
||||||
# See if we should build BM support
|
|
||||||
if grep -q -r __BOOT_KERNEL_BIGMEM %{kbase}$vers%{kend}/include
|
|
||||||
then
|
|
||||||
KTL="${KTL} BM"
|
|
||||||
fi
|
|
||||||
%endif
|
|
||||||
|
|
||||||
for mp in $KTL; do
|
|
||||||
# ... for all appropriate 'architectures'...
|
|
||||||
if [ %{kernvers} = 22 ]; then
|
|
||||||
# For 2.2 kernels, just do MP and SP kernels; force EP into i686
|
|
||||||
|
|
||||||
arch=${sysbase}
|
|
||||||
if [ $mp = EP -a ${sysbase} = i386 ]; then
|
|
||||||
arch=i686
|
|
||||||
fi
|
|
||||||
|
|
||||||
PrintRedhatKernelFix $arch $mp src/config/redhat-fix.h
|
|
||||||
make dest_only_libafs LOCAL_SMP_DEF=-DREDHAT_FIX MPS=$mp
|
|
||||||
|
|
||||||
elif [ %{kernvers} = 24 ]; then
|
|
||||||
# For 2.4 kernels, need to build modules for each architecture!
|
|
||||||
|
|
||||||
for arch in $archlist ; do
|
|
||||||
|
|
||||||
# build SP and MP on all architectures.
|
|
||||||
# build EP and BM only on i686
|
|
||||||
if [ $mp = SP -o $mp = MP -o \
|
|
||||||
\( $mp = EP -a $arch = i686 \) -o \
|
|
||||||
\( $mp = BM -a $arch = i686 \) ]; then
|
|
||||||
PrintRedhatKernelFix $arch $mp src/config/redhat-fix.h
|
|
||||||
make dest_only_libafs LOCAL_SMP_DEF=-DREDHAT_FIX \
|
|
||||||
LINUX_MODULE_NAME="-$arch" MPS=$mp
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "I don't know how to build $sysname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -f src/config/redhat-fix.h
|
|
||||||
|
|
||||||
%if %{krb5support}
|
|
||||||
# Now build aklog/asetkey
|
|
||||||
(cd openafs-krb5-1.3/src &&
|
|
||||||
autoconf &&
|
|
||||||
./configure --prefix=/usr --with-krb5=/usr/kerberos \
|
|
||||||
--with-afs=`pwd`/../../${sysname}/dest/ && \
|
|
||||||
make all && \
|
|
||||||
make install DESTDIR=`pwd`/../../${sysname}/dest/ INSTALL_BIN=/bin \
|
|
||||||
INSTALL_SBIN=/etc)
|
|
||||||
%endif
|
|
||||||
|
|
||||||
###
|
|
||||||
### install
|
|
||||||
###
|
|
||||||
%install
|
|
||||||
[ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%ifarch i386 i486 i586 i686 athlon
|
|
||||||
sysbase=i386
|
|
||||||
sysname=${sysbase}_linux%{kernvers}
|
|
||||||
%else
|
|
||||||
sysbase=%{_arch}
|
|
||||||
sysname=${sysbase}_linux%{kernvers}
|
|
||||||
%endif
|
|
||||||
|
|
||||||
# Build install tree
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/sbin
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/openafs
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/lib/security
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/afs/logs
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/vice/etc
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/vice/cache
|
|
||||||
chmod 700 $RPM_BUILD_ROOT/usr/vice/cache
|
|
||||||
|
|
||||||
# Copy files from dest to the appropriate places in BuildRoot
|
|
||||||
tar cf - -C ${sysname}/dest bin include lib | tar xf - -C $RPM_BUILD_ROOT/usr
|
|
||||||
tar cf - -C ${sysname}/dest/etc . | tar xf - -C $RPM_BUILD_ROOT/usr/sbin
|
|
||||||
tar cf - -C ${sysname}/dest/root.server/usr/afs bin | tar xf - -C $RPM_BUILD_ROOT/usr/afs
|
|
||||||
tar cf - -C ${sysname}/dest/root.client/usr/vice/etc afsd modload | tar xf - -C $RPM_BUILD_ROOT/usr/vice/etc
|
|
||||||
|
|
||||||
# Link kpasswd to kapasswd
|
|
||||||
ln -f $RPM_BUILD_ROOT/usr/bin/kpasswd $RPM_BUILD_ROOT/usr/bin/kapasswd
|
|
||||||
|
|
||||||
# Copy root.client config files
|
|
||||||
install -m 755 ${sysname}/dest/root.client/usr/vice/etc/afs.conf $RPM_BUILD_ROOT/etc/sysconfig/afs
|
|
||||||
install -m 755 ${sysname}/dest/root.client/usr/vice/etc/afs.rc $RPM_BUILD_ROOT/etc/rc.d/init.d/afs
|
|
||||||
|
|
||||||
# Copy PAM modules
|
|
||||||
install -m 755 ${sysname}/dest/lib/pam* $RPM_BUILD_ROOT/lib/security
|
|
||||||
|
|
||||||
# PAM symlinks
|
|
||||||
ln -sf pam_afs.so.1 $RPM_BUILD_ROOT/lib/security/pam_afs.so
|
|
||||||
ln -sf pam_afs.krb.so.1 $RPM_BUILD_ROOT/lib/security/pam_afs.krb.so
|
|
||||||
|
|
||||||
# Populate /usr/vice/etc
|
|
||||||
uve=$RPM_BUILD_ROOT/usr/vice/etc
|
|
||||||
install -p -m 644 $RPM_SOURCE_DIR/openafs-CellServDB $uve/CellServDB
|
|
||||||
install -p -m 644 $RPM_SOURCE_DIR/openafs-SuidCells $uve/SuidCells
|
|
||||||
install -p -m 644 $RPM_SOURCE_DIR/openafs-ThisCell $uve/ThisCell
|
|
||||||
install -p -m 644 $RPM_SOURCE_DIR/openafs-cacheinfo $uve/cacheinfo
|
|
||||||
install -p -m 755 $RPM_SOURCE_DIR/openafs-afsmodname $uve/afsmodname
|
|
||||||
|
|
||||||
#
|
|
||||||
# Build the SymTable
|
|
||||||
symtable=$RPM_BUILD_ROOT/usr/vice/etc/modload/SymTable
|
|
||||||
rm -f $symtable
|
|
||||||
echo "# SymTable, automatically generated" > $symtable
|
|
||||||
echo "# symbol version cpu module" >> $symtable
|
|
||||||
echo "" >> $symtable
|
|
||||||
|
|
||||||
$RPM_BUILD_ROOT/usr/vice/etc/afsmodname -x -f $symtable \
|
|
||||||
$RPM_BUILD_ROOT/usr/vice/etc/modload/libafs*.o
|
|
||||||
|
|
||||||
#
|
|
||||||
# install kernel-source
|
|
||||||
#
|
|
||||||
|
|
||||||
# Install the kernel module source tree
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/src/openafs-kernel-%{afsvers}/src
|
|
||||||
tar cf - -C libafs_tree . | \
|
|
||||||
tar xf - -C $RPM_BUILD_ROOT/usr/src/openafs-kernel-%{afsvers}/src
|
|
||||||
|
|
||||||
# Next, copy the LICENSE Files, README
|
|
||||||
install -m 644 src/LICENSE $RPM_BUILD_ROOT/usr/src/openafs-kernel-%{afsvers}/LICENSE.IBM
|
|
||||||
install -m 644 $RPM_SOURCE_DIR/openafs-LICENSE.Sun $RPM_BUILD_ROOT/usr/src/openafs-kernel-%{afsvers}/LICENSE.Sun
|
|
||||||
install -m 644 $RPM_SOURCE_DIR/openafs-README $RPM_BUILD_ROOT/usr/src/openafs-kernel-%{afsvers}/README
|
|
||||||
|
|
||||||
#
|
|
||||||
# Install DOCUMENTATION
|
|
||||||
#
|
|
||||||
|
|
||||||
# Build the DOC directory
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
|
|
||||||
tar cf - -C doc LICENSE html pdf | \
|
|
||||||
tar xf - -C $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
|
|
||||||
install -m 644 $RPM_SOURCE_DIR/RELNOTES-%{afsvers} $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
|
|
||||||
install -m 644 $RPM_SOURCE_DIR/ChangeLog $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
|
|
||||||
|
|
||||||
#
|
|
||||||
# create filelist
|
|
||||||
#
|
|
||||||
grep -v "^#" >openafs-file-list <<EOF-openafs-file-list
|
|
||||||
/usr/bin/afsmonitor
|
|
||||||
/usr/bin/bos
|
|
||||||
/usr/bin/fs
|
|
||||||
/usr/bin/kapasswd
|
|
||||||
/usr/bin/kpasswd
|
|
||||||
/usr/bin/klog
|
|
||||||
/usr/bin/klog.krb
|
|
||||||
/usr/bin/pagsh
|
|
||||||
/usr/bin/pagsh.krb
|
|
||||||
/usr/bin/pts
|
|
||||||
/usr/bin/scout
|
|
||||||
/usr/bin/sys
|
|
||||||
/usr/bin/tokens
|
|
||||||
/usr/bin/tokens.krb
|
|
||||||
/usr/bin/translate_et
|
|
||||||
/usr/bin/udebug
|
|
||||||
/usr/bin/unlog
|
|
||||||
/usr/sbin/backup
|
|
||||||
/usr/sbin/butc
|
|
||||||
/usr/sbin/fms
|
|
||||||
/usr/sbin/fstrace
|
|
||||||
/usr/sbin/kas
|
|
||||||
/usr/sbin/read_tape
|
|
||||||
/usr/sbin/restorevol
|
|
||||||
/usr/sbin/rxdebug
|
|
||||||
/usr/sbin/uss
|
|
||||||
/usr/sbin/vos
|
|
||||||
EOF-openafs-file-list
|
|
||||||
|
|
||||||
#
|
|
||||||
# Install compatiblity links
|
|
||||||
#
|
|
||||||
for d in bin:bin etc:sbin; do
|
|
||||||
olddir=`echo $d | sed 's/:.*$//'`
|
|
||||||
newdir=`echo $d | sed 's/^.*://'`
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/afsws/$olddir
|
|
||||||
for f in `cat openafs-file-list`; do
|
|
||||||
if echo $f | grep -q /$newdir/; then
|
|
||||||
fb=`basename $f`
|
|
||||||
ln -sf /usr/$newdir/$fb $RPM_BUILD_ROOT/usr/afsws/$olddir/$fb
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### clean
|
|
||||||
###
|
|
||||||
%clean
|
|
||||||
rm -f openafs-file-list
|
|
||||||
[ "$RPM_BUILD_ROOT" != "/" -a "x%{debugspec}" != "x1" ] && \
|
|
||||||
rm -fr $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### scripts
|
|
||||||
###
|
|
||||||
%pre compat
|
|
||||||
if [ -e /usr/afsws ]; then
|
|
||||||
/bin/rm -fr /usr/afsws
|
|
||||||
fi
|
|
||||||
|
|
||||||
%post
|
|
||||||
chkconfig --add afs
|
|
||||||
|
|
||||||
%post client
|
|
||||||
if [ ! -d /afs ]; then
|
|
||||||
mkdir /afs
|
|
||||||
chown root.root /afs
|
|
||||||
chmod 0755 /afs
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo The AFS cache is configured for 100 MB. Edit the
|
|
||||||
echo /usr/vice/etc/cacheinfo file to change this before
|
|
||||||
echo running AFS for the first time. You should also
|
|
||||||
echo set your home cell in /usr/vice/etc/ThisCell.
|
|
||||||
echo
|
|
||||||
echo Also, you may want to edit /etc/pam.d/login and
|
|
||||||
echo possibly others there to get an AFS token on login.
|
|
||||||
echo Put the line:
|
|
||||||
echo
|
|
||||||
echo auth sufficient /lib/security/pam_afs.so try_first_pass ignore_root
|
|
||||||
echo
|
|
||||||
echo before the one for pwdb.
|
|
||||||
echo
|
|
||||||
|
|
||||||
%post server
|
|
||||||
if [ -f /etc/sysconfig/afs ] ; then
|
|
||||||
srv=`grep ^AFS_SERVER /etc/sysconfig/afs | sed 's/^AFS_SERVER[\s]*=[\s]*//'`
|
|
||||||
if [ "x$srv" = "xon" ] ; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo Be sure to edit /etc/sysconfig/afs and turn AFS_SERVER on
|
|
||||||
echo
|
|
||||||
|
|
||||||
%preun
|
|
||||||
if [ $1 = 0 ] ; then
|
|
||||||
/etc/rc.d/init.d/afs stop
|
|
||||||
chkconfig --del afs
|
|
||||||
[ -d /afs ] && rmdir /afs
|
|
||||||
fi
|
|
||||||
|
|
||||||
###
|
|
||||||
### file lists
|
|
||||||
###
|
|
||||||
%files -f openafs-file-list
|
|
||||||
%defattr(-,root,root)
|
|
||||||
%config /etc/sysconfig/afs
|
|
||||||
%doc %{_docdir}/openafs-%{afsvers}
|
|
||||||
/etc/rc.d/init.d/afs
|
|
||||||
|
|
||||||
%files client
|
|
||||||
%defattr(-,root,root)
|
|
||||||
%dir /usr/vice
|
|
||||||
%dir /usr/vice/cache
|
|
||||||
%dir /usr/vice/etc
|
|
||||||
%dir /usr/vice/etc/modload
|
|
||||||
%config /usr/vice/etc/CellServDB
|
|
||||||
%config /usr/vice/etc/SuidCells
|
|
||||||
%config /usr/vice/etc/ThisCell
|
|
||||||
%config /usr/vice/etc/cacheinfo
|
|
||||||
/usr/bin/cmdebug
|
|
||||||
/usr/bin/up
|
|
||||||
/usr/vice/etc/afsd
|
|
||||||
/usr/vice/etc/afsmodname
|
|
||||||
/lib/security/pam_afs.krb.so.1
|
|
||||||
/lib/security/pam_afs.krb.so
|
|
||||||
/lib/security/pam_afs.so.1
|
|
||||||
/lib/security/pam_afs.so
|
|
||||||
|
|
||||||
%files server
|
|
||||||
%defattr(-,root,root)
|
|
||||||
%dir /usr/afs
|
|
||||||
%dir /usr/afs/bin
|
|
||||||
%dir /usr/afs/logs
|
|
||||||
/usr/afs/bin/bosserver
|
|
||||||
/usr/afs/bin/buserver
|
|
||||||
/usr/afs/bin/fileserver
|
|
||||||
# Should we support KAServer?
|
|
||||||
/usr/afs/bin/kaserver
|
|
||||||
/usr/afs/bin/kpwvalid
|
|
||||||
/usr/afs/bin/pt_util
|
|
||||||
/usr/afs/bin/ptserver
|
|
||||||
/usr/afs/bin/salvager
|
|
||||||
/usr/afs/bin/upclient
|
|
||||||
/usr/afs/bin/upserver
|
|
||||||
/usr/afs/bin/vlserver
|
|
||||||
/usr/afs/bin/volinfo
|
|
||||||
/usr/afs/bin/volserver
|
|
||||||
/usr/sbin/prdb_check
|
|
||||||
/usr/sbin/vldb_check
|
|
||||||
/usr/sbin/vldb_convert
|
|
||||||
|
|
||||||
%files devel
|
|
||||||
%defattr(-,root,root)
|
|
||||||
/usr/bin/rxgen
|
|
||||||
/usr/include/afs
|
|
||||||
/usr/include/des.h
|
|
||||||
/usr/include/des_conf.h
|
|
||||||
/usr/include/des_odd.h
|
|
||||||
/usr/include/lock.h
|
|
||||||
/usr/include/lwp.h
|
|
||||||
/usr/include/mit-cpyright.h
|
|
||||||
/usr/include/potpourri.h
|
|
||||||
/usr/include/preempt.h
|
|
||||||
/usr/include/rx
|
|
||||||
/usr/include/timer.h
|
|
||||||
/usr/include/ubik.h
|
|
||||||
/usr/include/ubik_int.h
|
|
||||||
/usr/lib/afs
|
|
||||||
/usr/lib/libafsauthent.a
|
|
||||||
/usr/lib/libafsrpc.a
|
|
||||||
/usr/lib/libdes.a
|
|
||||||
/usr/lib/liblwp.a
|
|
||||||
/usr/lib/librx.a
|
|
||||||
/usr/lib/librxkad.a
|
|
||||||
/usr/lib/librxstat.a
|
|
||||||
/usr/lib/libubik.a
|
|
||||||
|
|
||||||
%files kernel
|
|
||||||
%defattr(-,root,root)
|
|
||||||
/usr/vice/etc/modload/libafs*.o
|
|
||||||
/usr/vice/etc/modload/SymTable
|
|
||||||
|
|
||||||
%files kernel-source
|
|
||||||
%defattr(-,root,root)
|
|
||||||
/usr/src/openafs-kernel-%{afsvers}/LICENSE.IBM
|
|
||||||
/usr/src/openafs-kernel-%{afsvers}/LICENSE.Sun
|
|
||||||
/usr/src/openafs-kernel-%{afsvers}/README
|
|
||||||
/usr/src/openafs-kernel-%{afsvers}/src
|
|
||||||
|
|
||||||
%files compat
|
|
||||||
%defattr(-,root,root)
|
|
||||||
/usr/afsws
|
|
||||||
|
|
||||||
%files kpasswd
|
|
||||||
%defattr(-,root,root)
|
|
||||||
/usr/bin/kpasswd
|
|
||||||
/usr/bin/kpwvalid
|
|
||||||
|
|
||||||
%if %{krb5support}
|
|
||||||
%files krb5
|
|
||||||
%defattr(-,root,root)
|
|
||||||
/usr/bin/aklog
|
|
||||||
/usr/sbin/asetkey
|
|
||||||
%endif
|
|
9
src/packaging/RedHat/openafs-LICENSE.Sun
Normal file
9
src/packaging/RedHat/openafs-LICENSE.Sun
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
Sun Microsystems' ONC RPC license
|
||||||
|
|
||||||
|
Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||||
|
unrestricted use provided that this legend is included on all tape
|
||||||
|
media and as a part of the software program in whole or part. Users
|
||||||
|
may copy or modify Sun RPC without charge, but are not authorized to
|
||||||
|
license or distribute it to anyone else except as part of a product or
|
||||||
|
program developed by the user.
|
||||||
|
|
95
src/packaging/RedHat/openafs-buildall.sh
Executable file
95
src/packaging/RedHat/openafs-buildall.sh
Executable file
@ -0,0 +1,95 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# build all of openafs for all the various kernels installed on this system.
|
||||||
|
#
|
||||||
|
# Written by: Derek Atkins <warlord@MIT.EDU>
|
||||||
|
#
|
||||||
|
# $Revision$
|
||||||
|
#
|
||||||
|
|
||||||
|
# Define where the Specfile is located.
|
||||||
|
specdir=/usr/src/redhat/SPECS
|
||||||
|
|
||||||
|
# Define the rpmbuild options you want to supply.
|
||||||
|
buildopts=
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
# Figure out the release version
|
||||||
|
rhrel=`cat /etc/redhat-release`
|
||||||
|
if [ `echo $rhrel | grep -c 'Fedora Core'` = 1 ] ; then
|
||||||
|
ostype='fc'
|
||||||
|
elif [ `echo $rhrel | grep -c 'Red Hat Enterprise Linux'` = 1 ] ; then
|
||||||
|
ostype='rhel'
|
||||||
|
excludearch=i586
|
||||||
|
elif [ `echo $rhrel | grep -c 'Red Hat Linux'` = 1 ] ; then
|
||||||
|
ostype='rh'
|
||||||
|
else
|
||||||
|
echo "Unknown Linux Release: $rhrel"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
osrel=`echo $rhrel | sed -e 's/^.*release \([^ ]*\).*$/\1/' -e 's/\.//g'`
|
||||||
|
osvers="$ostype$osrel"
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
# Now figure out the kernel version. We assume that the running
|
||||||
|
# kernel version is "close enough" to tell us whether it's a
|
||||||
|
# 2.4 or 2.6 kernel.
|
||||||
|
kvers=`uname -r`
|
||||||
|
case $kvers in
|
||||||
|
2.4.*)
|
||||||
|
kbase=/usr/src/linux-
|
||||||
|
kv=2.4.
|
||||||
|
;;
|
||||||
|
2.6.*)
|
||||||
|
kbase=/usr/src/kernels/
|
||||||
|
kv=2.6.
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "I don't know how to build for kernel $kvers"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
# Now build the packages and all the kernel modules
|
||||||
|
|
||||||
|
echo "Building OpenAFS for $osvers"
|
||||||
|
rpmbuild -ba $buildopts --define "osvers $osvers" $specdir/openafs.spec || \
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
kernels=`ls -d ${kbase}${kv}*`
|
||||||
|
|
||||||
|
for kerndir in $kernels ; do
|
||||||
|
# Ignore symlinks
|
||||||
|
if [ ! -h $kerndir ] ; then
|
||||||
|
vers=`echo $kerndir | sed -e "s^${kbase}^^g" -e 's/-smp/smp/g' \
|
||||||
|
-e 's/-hugemem/hugemem/g' -e 's/-largesmp/largesmp/g'`
|
||||||
|
if [ $kv = "2.4." ] ; then
|
||||||
|
kvers=$vers
|
||||||
|
case `uname -m` in
|
||||||
|
i386|i486|i586|i686|athlon) archlist="i586 i686 athlon" ;;
|
||||||
|
*) archlist=`uname -m` ;;
|
||||||
|
esac
|
||||||
|
for a in $excludearch ; do
|
||||||
|
archlist=`echo $archlist | sed -e s/$a//`
|
||||||
|
done
|
||||||
|
kend="''"
|
||||||
|
else
|
||||||
|
karch=`echo $vers | sed 's/.*-//'`
|
||||||
|
kvers=`echo $vers | sed s/-$karch//`
|
||||||
|
archlist=$karch
|
||||||
|
kend=-$karch
|
||||||
|
fi
|
||||||
|
|
||||||
|
for arch in $archlist ; do
|
||||||
|
echo "Building for $kerndir, $kvers, $arch"
|
||||||
|
rpmbuild -bb $buildopts \
|
||||||
|
--define "osvers $osvers" \
|
||||||
|
--define "kernvers $kvers" \
|
||||||
|
--define "ksrcdir $kerndir" \
|
||||||
|
--define "build_modules 1" \
|
||||||
|
--target=$arch \
|
||||||
|
$specdir/openafs.spec || exit 1
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
83
src/packaging/RedHat/openafs-client.init
Normal file
83
src/packaging/RedHat/openafs-client.init
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# openafs-client Start/Stop the OpenAFS Client
|
||||||
|
#
|
||||||
|
# chkconfig: 2345 50 50
|
||||||
|
# description: OpenAFS is a distributed filesystem.
|
||||||
|
#
|
||||||
|
# $Revision$
|
||||||
|
|
||||||
|
. /etc/init.d/functions
|
||||||
|
[ -f /etc/sysconfig/openafs ] && . /etc/sysconfig/openafs
|
||||||
|
|
||||||
|
|
||||||
|
start() {
|
||||||
|
echo -n $"Starting openafs-client: "
|
||||||
|
if [ -e /var/lock/subsys/openafs-client ] ; then
|
||||||
|
echo -n $"cannot start openafs-client: already running"
|
||||||
|
failure $"cannot start openafs-client: already running"
|
||||||
|
echo
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
modprobe openafs
|
||||||
|
RETVAL=$?
|
||||||
|
if [ $RETVAL -ne 0 ] ; then
|
||||||
|
echo -n $"failed to load openafs kernel module."
|
||||||
|
failure $"failed to load openafs kernel module."
|
||||||
|
echo
|
||||||
|
return $RETVAL
|
||||||
|
fi
|
||||||
|
/usr/vice/etc/afsd $AFSD_ARGS
|
||||||
|
RETVAL=$?
|
||||||
|
echo
|
||||||
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/openafs-client
|
||||||
|
return $RETVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
echo -n $"Stopping openafs-client: "
|
||||||
|
if [ ! -e /var/lock/subsys/openafs-client ] ; then
|
||||||
|
echo -n $"cannot stop openafs-client: not running"
|
||||||
|
failure $"cannot stop openafs-client: not running"
|
||||||
|
echo
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
umount /afs
|
||||||
|
RETVAL=$?
|
||||||
|
echo
|
||||||
|
if [ $RETVAL -eq 0 ] ; then
|
||||||
|
rm -f /var/lock/subsys/openafs-client
|
||||||
|
rmmod openafs
|
||||||
|
fi
|
||||||
|
return $RETVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
rhstatus() {
|
||||||
|
status afsd
|
||||||
|
}
|
||||||
|
|
||||||
|
restart() {
|
||||||
|
stop || exit
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stop
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
restart
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
rhstatus
|
||||||
|
;;
|
||||||
|
condrestart)
|
||||||
|
[ -f /var/lock/subsys/openafs-client ] && restart || :
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
|
||||||
|
exit 1
|
||||||
|
esac
|
49
src/packaging/RedHat/openafs-kernel-version.sh
Executable file
49
src/packaging/RedHat/openafs-kernel-version.sh
Executable file
@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# investigate the name of the kernel
|
||||||
|
#
|
||||||
|
# $Revision$
|
||||||
|
|
||||||
|
if [ "x$1" = "x" ] ; then
|
||||||
|
kernvers=`uname -r`
|
||||||
|
if [ ! -d /lib/modules/$kernvers/build/include ] ; then
|
||||||
|
kernvers=`/bin/ls /lib/modules/*/build/include/linux/version.h | \
|
||||||
|
cut -d/ -f4 | \
|
||||||
|
sort -u | \
|
||||||
|
tail -1`
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
kernvers=$1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$kernvers" ]; then echo "unable to determine kernel version" >&2; exit 1; fi
|
||||||
|
|
||||||
|
# strip "kernel-" off of the front
|
||||||
|
if expr "$kernvers" : "kernel-" >&/dev/null
|
||||||
|
then
|
||||||
|
kernvers=`expr "$kernvers" : 'kernel-\(.*\)'`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Strip kernel config mnemonic off 2.4 kernels.
|
||||||
|
case $kernvers in
|
||||||
|
2.4.*)
|
||||||
|
# strip kernel config mnemonic off of the tail
|
||||||
|
case "$kernvers" in
|
||||||
|
*smp)
|
||||||
|
kernvers=`expr "$kernvers" : '\(.*\)smp'`
|
||||||
|
;;
|
||||||
|
*bigmem)
|
||||||
|
kernvers=`expr "$kernvers" : '\(.*\)bigmem'`
|
||||||
|
;;
|
||||||
|
*hugemem)
|
||||||
|
kernvers=`expr "$kernvers" : '\(.*\)hugemem'`
|
||||||
|
;;
|
||||||
|
*enterprise)
|
||||||
|
kernvers=`expr "$kernvers" : '\(.*\)enterprise'`
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo $kernvers
|
||||||
|
exit 0
|
BIN
src/packaging/RedHat/openafs-krb5-2.0.tar.gz
Normal file
BIN
src/packaging/RedHat/openafs-krb5-2.0.tar.gz
Normal file
Binary file not shown.
43
src/packaging/RedHat/openafs-kvers-is.sh
Executable file
43
src/packaging/RedHat/openafs-kvers-is.sh
Executable file
@ -0,0 +1,43 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Small helper script for parsing kernel versions and types
|
||||||
|
# $Revision$
|
||||||
|
|
||||||
|
if [ "$1" = "parsev" ] ; then
|
||||||
|
#logger "parsing version from $2"
|
||||||
|
echo "$2" | /bin/sed -e 's/^\([0-9]*\.[0-9]*\)\..*/\1/'
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "parset" ] ; then
|
||||||
|
#logger "parsing type from $2"
|
||||||
|
echo "$2" | /bin/sed -e 's/^.*[0-9L]\([^0-9L]*\)/\1/'
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "kvers" ] ; then
|
||||||
|
#logger "parsing type from $2"
|
||||||
|
echo "$2" | /bin/sed -e 's/^\(.*[0-9L]\)[^0-9L]*$/\1/'
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "find" ] ; then
|
||||||
|
f=`find "$2"/configs -name \*-"$3"-"$4".config`
|
||||||
|
if [ -n "$f" ] ; then
|
||||||
|
echo 1
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo 0
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
#logger "comparing $1 to $2"
|
||||||
|
if [ "$1" = "$2" ] ; then
|
||||||
|
#logger "yes"
|
||||||
|
echo 1
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
#logger "no"
|
||||||
|
echo 0
|
||||||
|
exit 0
|
||||||
|
fi
|
34
src/packaging/RedHat/openafs-makesrc.sh
Executable file
34
src/packaging/RedHat/openafs-makesrc.sh
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# openafs-makesrc -- convert a 2.6 'kernel' package into something
|
||||||
|
# you can install into /usr/src/kernels
|
||||||
|
#
|
||||||
|
# Written by: Derek Atkins <warlord@MIT.EDU>
|
||||||
|
#
|
||||||
|
# $Revision$
|
||||||
|
|
||||||
|
kerndir=/usr/src/kernels
|
||||||
|
|
||||||
|
[ -d $kerndir ] || mkdir -p -m 0755 $kerndir
|
||||||
|
umask 022
|
||||||
|
while [ -n "$1" ] ; do
|
||||||
|
rpm=$1
|
||||||
|
name=`rpm -qp $rpm`
|
||||||
|
vers=`echo $name | sed -e 's/kernel-[^0-9]*\([0-9].*\)$/\1/'`
|
||||||
|
smp=`echo $name | sed -e 's/kernel-\([^0-9]*\)[0-9].*$/\1/' -e s/-//`
|
||||||
|
arch=`echo $rpm | sed 's/.*\.\([^\.]*\)\.rpm$/\1/'`
|
||||||
|
|
||||||
|
kd=$kerndir/$vers$smp-$arch
|
||||||
|
if [ ! -d $kd ] ; then
|
||||||
|
echo "converting `basename $rpm` to $kd"
|
||||||
|
rpm2cpio $rpm | ( cd $kerndir ; cpio --quiet -imd \*lib/modules/\*/build/\* )
|
||||||
|
mv $kerndir/lib/modules/*/build $kd
|
||||||
|
chmod 755 $kd
|
||||||
|
rmdir $kerndir/lib/modules/*
|
||||||
|
rmdir $kerndir/lib/modules
|
||||||
|
rmdir $kerndir/lib
|
||||||
|
else
|
||||||
|
echo "$kd already exists. Ignoring."
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
done
|
80
src/packaging/RedHat/openafs-server.init
Normal file
80
src/packaging/RedHat/openafs-server.init
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# openafs-server Start/Stop the OpenAFS Server
|
||||||
|
#
|
||||||
|
# chkconfig: 2345 49 51
|
||||||
|
# description: OpenAFS is a distributed filesystem.
|
||||||
|
#
|
||||||
|
# $Revision$
|
||||||
|
|
||||||
|
. /etc/init.d/functions
|
||||||
|
[ -f /etc/sysconfig/openafs ] && . /etc/sysconfig/openafs
|
||||||
|
|
||||||
|
|
||||||
|
start() {
|
||||||
|
echo -n $"Starting openafs-server: "
|
||||||
|
if [ -e /var/lock/subsys/openafs-server ] ; then
|
||||||
|
echo -n $"cannot start openafs-server: already running"
|
||||||
|
failure $"cannot start openafs-server: already running"
|
||||||
|
echo
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
/usr/afs/bin/bosserver $BOSSERVER_ARGS
|
||||||
|
RETVAL=$?
|
||||||
|
echo
|
||||||
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/openafs-server
|
||||||
|
return $RETVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
echo -n $"Stopping openafs-server: "
|
||||||
|
if [ ! -e /var/lock/subsys/openafs-server ] ; then
|
||||||
|
echo -n $"cannot stop openafs-server: not running"
|
||||||
|
failure $"cannot stop openafs-server: not running"
|
||||||
|
echo
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
/usr/bin/bos shutdown localhost -wait -localauth
|
||||||
|
RETVAL=$?
|
||||||
|
if [ $RETVAL -ne 0 ] ; then
|
||||||
|
echo -n $"failed to shutdown OpenAFS"
|
||||||
|
failure $"failed to shutdown OpenAFS"
|
||||||
|
echo
|
||||||
|
return $RETVAL
|
||||||
|
fi
|
||||||
|
killproc bosserver
|
||||||
|
RETVAL=$?
|
||||||
|
echo
|
||||||
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/openafs-server
|
||||||
|
return $RETVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
rhstatus() {
|
||||||
|
status bosserver
|
||||||
|
}
|
||||||
|
|
||||||
|
restart() {
|
||||||
|
stop || exit
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stop
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
restart
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
rhstatus
|
||||||
|
;;
|
||||||
|
condrestart)
|
||||||
|
[ -f /var/lock/subsys/openafs-server ] && restart || :
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
|
||||||
|
exit 1
|
||||||
|
esac
|
1491
src/packaging/RedHat/openafs.spec.in
Normal file
1491
src/packaging/RedHat/openafs.spec.in
Normal file
File diff suppressed because it is too large
Load Diff
5
src/packaging/RedHat/openafs.sysconfig
Normal file
5
src/packaging/RedHat/openafs.sysconfig
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# OpenAFS Client Configuration
|
||||||
|
AFSD_ARGS="-dynroot -fakestat"
|
||||||
|
|
||||||
|
# OpenAFS Server Configuration
|
||||||
|
BOSSERVER_ARGS=
|
Loading…
x
Reference in New Issue
Block a user